下面是引用 [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");