OMG 发表于 2008-5-29 12:48:49

请大家都进来看看

我用了击中对方声音这个插件
但在LOGs里老是出现这样的错误信息
请求大家帮忙指点,谢谢!!
L 05/29/2008 - 00:53:18: Invalid player id 107
L 05/29/2008 - 00:53:18: Displaying debug trace (plugin "hitnotify.amxx")
L 05/29/2008 - 00:53:18: Run time error 10: native error (native "client_cmd")
L 05/29/2008 - 00:53:18: 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
}

Rulzy 发表于 2008-5-30 01:47:01

回复: 请大家都进来看看

把这一行:
if(is_user_alive(id) && is_user_connected(id)) {

改成

if(is_user_connected(id) && is_user_alive(id)) {

OMG 发表于 2008-5-30 10:06:27

回复: 请大家都进来看看

谢谢!rulzy 我去试试看

OMG 发表于 2008-5-30 12:46:18

回复: 请大家都进来看看

还是会出以下错误信息

Displaying debug trace (plugin "hitnotify.amxx")
L 05/30/2008 - 12:37:18: Run time error 10: native error (native "client_cmd")
L 05/30/2008 - 12:37:18:     hitnotify.sma::got_hit (line 44)/QUOTE]
页: [1]
查看完整版本: 请大家都进来看看