引用 | 编辑
s091140
2014-04-15 23:44 |
楼主
▼ |
||
x0
插件是DSHGFHDS十字弓插件maxdamage乃伤害数值 而ptd是被击中的人 下面有四种写法 1) fm_fakedamage(ptd, "arrowdamge", maxdamage, DMG_BLAST) 作者原版写法 <-----运作正常无误 2) ExecuteHamB(Ham_TakeDamage, ptd, 0, pev(ent, pev_owner), maxdamage, 0) 写法1 <-----运作正常无误 但我想让弓箭对npc/人质也有伤害 3) ExecuteHamB(Ham_TakeDamage, -1, 0, pev(ent, pev_owner), maxdamage, 0) 写法2<-----出现error log 4) ExecuteHamB( Ham_TakeDamage, FM_NULLENT ,0 ,pev(ent, pev_owner), maxdamage, DMG_BLAST ) 写法3<---出现error log fw_Touch 是弓箭实体打中目标后给予目标伤害 写法2,3出现的error log L 04/15/2014 - 23:18:22: [HAMSANDWICH] Entity out of range (-1) L 04/15/2014 - 23:18:22: [AMXX] Run time error 10: native error (native "ExecuteHamB") L 04/15/2014 - 23:18:22: [AMXX] [0] crossbow.sma::fw_Touch (line 479) 请问如何修正? x0
|
引用 | 编辑
op47
2014-04-15 23:58 |
1楼
▲ ▼ |
FM_NULLENT 是 -1 , -1 不是有效的物件 (> -1), 所以会出现Entity out of range (-1).
正确应该是用 由 fw_Touch 侦测到的 touched 的 id 而不是用 FM_NULLENT x0 |
引用 | 编辑
弑血
2014-04-15 23:59 |
2楼
▲ ▼ |
下面是引用 s091140 于 2014-04-15 23:44 发表的 对ExecuteHamB的疑问: 我记得 ptd的位置是受害者.. ExecuteHamB(Ham_TakeDamage, -1, 0, pev(ent, pev_owner), maxdamage, 0) //受害者是-1? 怎么不用个判断.. if (!is_user_alive(ptd)) //给不是活着的玩家..进行 ExecuteHamB(Ham_TakeDamage, ptd, 0, pev(ent, pev_owner), maxdamage, 0) //让不是活着的执行 有问题..再发问吧 x0 |