|
我用了击中对方声音这个插件
但在LOGs里老是出现这样的错误信息
请求大家帮忙指点,谢谢!!L 05/29/2008 - 00:53:18: Invalid player id 107
L 05/29/2008 - 00:53:18: [AMXX] Displaying debug trace (plugin "hitnotify.amxx")
L 05/29/2008 - 00:53:18: [AMXX] Run time error 10: native error (native "client_cmd")
L 05/29/2008 - 00:53:18: [AMXX] [0] hitnotify.sma::got_hit (line 44) #include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
public plugin_init()
{
register_plugin("Hit notifications","0.1","DahVid")
register_event("Damage", "got_hit", "b")
register_cvar("hn_redflash","1")
register_cvar("hn_shake","1")
register_cvar("hn_beep","1")
}
public plugin_precache()
{
precache_sound("q3/myshot2.wav")
}
public got_hit(id)
{
if(is_user_alive(id) && is_user_connected(id)) {
if(get_cvar_num("hn_redflash")) {
message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id)
write_short(25)
write_short(25)
write_short(9)
write_byte(255)
write_byte(0)
write_byte(0)
write_byte(100)
message_end()
}
if(get_cvar_num("hn_shake")) {
message_begin(MSG_ONE,get_user_msgid("ScreenShake"),{0,0,0},id)
write_short(10000)
write_short(500)
write_short(500)
message_end()
}
if(get_cvar_num("hn_beep")) {
new attacker=get_user_attacker(id)
if(attacker>0) {
client_cmd(attacker,"spk q3/myshot2.wav")
}
}
}
return PLUGIN_HANDLED
} |
|