Damage Record System
小鸡要塞吧
全部回复
仅看楼主
level 12
hzqst 楼主
Array:g_DmgRecorder【33】
Array:g_DmgRecorder_Attacker【33】
public fw_TakeDamage_Player(…)
{
ArrayPushCell(g_DmgRecord【victim】, damage)
ArrayPushCell(g_DmgRecord_Attacker【victim】, attacker)
}
2012年09月13日 11点09分 1
level 11

虽不知 但觉历
2012年09月13日 11点09分 2
level 12
[瞌睡]
2012年09月13日 11点09分 3
level 12
hzqst 楼主
public Get_DmgRecorder(id,attacker)
{
new dmg
for(new i=0;i<ArraySize(g_DmgRecord【id】;i++)
{
if(ArrayGetCell(g_DmgRecorder_Attacker【id】, i)==attacker)
dmg+=ArrayGetCell(g_DmgRecorder【id】, i)
}
}
}
2012年09月13日 11点09分 4
记录来干什么……除了伤害显示的确是没什么用途了
2012年09月13日 14点09分
level 12
hzqst 楼主
上面少了一句 return dmg
2012年09月13日 11点09分 5
level 12
hzqst 楼主
public Clean_DmgRecorder(id)
{
ArrayClear(g_DmgRecorder【id】)
ArrayClear(g_DmgRecorder_attacker【id】)
}
2012年09月13日 11点09分 6
level 11

这是什么 可以吃么
2012年09月13日 11点09分 7
level 10
伤害记录么
2012年09月13日 13点09分 9
level 11
hzqst ,can you tell me why you writed that to tell other?
you thinks here a lot of people can understand the AMX MOD X's things?
2012年09月13日 13点09分 10
我想说……你知道我想说什么的[汗]
2012年09月13日 15点09分
level 12
Array是哪位
2012年09月13日 13点09分 11
哪个都不是
2012年09月13日 13点09分
level 10

学历不够。不会看
2012年09月13日 14点09分 12
这是代码又不是要学英语才懂
2012年09月13日 14点09分
level 12
hzqst 楼主
这个弱爆了,发个正常版的
//DamageRecorder System
public DmgRecorder_Count(const id, const attacker, const Float:before){static Array:aa = MGetEntData(id, mPlayer_aDmgRecorder)static Array:atmatm = MGetEntData(id, mPlayer_aDmgRecorderTimer)static nn = ArraySize(a)
static istatic k[2], atk, dmg, Float:tmstatic dmgt; dmgt = 0static Float:now; now = get_gametime()for(i = 0; i < n; i++){ArrayGetArray(a, i, k)tm = ArrayGetCell(atm, i)atk = k[0]dmg = k[1]if(attacker == atk && now < tm + before){dmgt += dmg}}return dmgt}
public DmgRecorder_Add(const id, const attacker, const damage, const Float:time){if (damage == 0) returnretry:static Array:aa = MGetEntData(id, mPlayer_aDmgRecorder)if(a == Invalid_Array){DmgRecorder_Create(id)goto retry}static Array:atmatm = MGetEntData(id, mPlayer_aDmgRecorderTimer)static k[2]key[0] = attackerkey[1] = damageArrayPushArray(a, k)ArrayPushCell(atm, time)}
public DmgRecorder_Remove(const id, const attacker, const Float:before){retry:static Array:aa = MGetEntData(id, mPlayer_aDmgRecorder)static Array:atmatm = MGetEntData(id, mPlayer_aDmgRecorderTimer)if(a == Invalid_Array || atm == Invalid_Array){DmgRecorder_Create(id)goto retry}static nn = ArraySize(a)
static istatic k[2], atk, dmg, Float:tmstatic Float:now; now = get_gametime()for(i = 0; i < n; i++){ArrayGetArray(a, i, k)tm = ArrayGetCell(atm, i)atk = k[0]dmg = k[1]if(attacker == atk && now < tm + before){ArrayDeleteItem(a, i)ArrayDeleteItem(atm, i)}}}
public DmgRecorder_Clear(const id){static Array:aa = MGetEntData(id, mPlayer_aDmgRecorder)static Array:atmatm = MGetEntData(id, mPlayer_aDmgRecorderTimer)ArrayClear(a)ArrayClear(atm)}
public DmgRecorder_Create(const id){static Array:aa = ArrayCreate(2)
static Array:atmatm = ArrayCreate()MSetEntData(id, mPlayer_aDmgRecorder, a)
MSetEntData(id, mPlayer_aDmgRecorder, atm)}
2012年09月13日 15点09分 13
肯定炸
2012年09月13日 23点09分
换行扯淡
2012年09月14日 04点09分
1