下面是引用 [NiGhT]-妖 于 2014-10-09 10:07 发表的 请问大大们怎取得玩家对丧尸造成500伤害?:
请问大大们怎取得玩家对丧尸造成500伤害?
#include <hamsandwich>
new Float:count_damage[33];
public plugin_init()
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if(!is_user_connected(attacker) || zp_get_user_zombie(attacker) || !zp_get_user_zombie(victim))
return return HAM_IGNORED;
//把伤害回传给count_damage做记录
count_damage[attacker] += damage;
//显示伤害
client_print(attacker, print_center, "show damage [%f]", count_damage[attacker]);
return HAM_IGNORED;
}
//支援bot
public client_putinserver(id)
{
static classname[32], bool:Debug;
pev(id, pev_classname, classname, charsmax(classname));
if(!equal(classname,"player") && !Debug)
{
Debug = true;
set_task(1.0,"_Debug", id);
}
}
public _Debug(id)
RegisterHamFromEntity(Ham_TakeDamage, id, "fw_TakeDamage");