|
L 05/12/2008 - 23:54:18: Start of error session.
L 05/12/2008 - 23:54:18: Info (map "de_inferno") (logfile "error_051208.log")
L 05/12/2008 - 23:54:18: [ENGINE] Invalid player 20
L 05/12/2008 - 23:54:18: [AMXX] Displaying debug trace (plugin "Voice_Comm_Control.amxx")
L 05/12/2008 - 23:54:18: [AMXX] Run time error 10: native error (native "set_speak")
L 05/12/2008 - 23:54:18: [AMXX] [0] Voice_Comm_Control.sma::eventResetHud (line 58)
==================以下是代码请帮忙修改=========================
/*new g_teamsNames[2][] = {"TERRORIST","CT"}*/
/*Voice Comm Control
Control dead player can voice comm each other, but alive player can not hear them.
*/
public plugin_init(){
register_plugin("Voice Comm Control","0.0.1","Zhao")
register_event("ResetHUD", "eventResetHud", "be")
register_event("DeathMsg","eDeathMsg","a")
register_concmd("amx_mute","amx_mute_player",ADMIN_VOTE,"playername --Mute players Microphone")
register_concmd("amx_unmute","amx_mute_player",ADMIN_VOTE,"playername --Unmute player's Microphone")
set_task(15.0,"alltalkoff")
}
public alltalkoff(){
set_cvar_num("sv_alltalk",0)
}
public amx_mute_player(id,level,cid){
new playername[33]
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
//new argc = read_argc()
new cmdname[33]
read_argv(0,cmdname,32)
read_argv(1,playername,32)
new player = cmd_target(id,playername,1)
if (!player) return PLUGIN_HANDLED
new imname[32],name2[32]
get_user_name(player,imname,31)
get_user_name(id,name2,31)
if(equal(cmdname,"amx_mute")){
set_speak(player,SPEAK_MUTED)
console_print(id,"%s is Muted",imname)
log_amx("Mute:%s Muted %s microphone",name2,imname)
}else{
set_speak(player,SPEAK_NORMAL)
console_print(id,"%s is Unmuted",imname)
log_amx("Mute:%s unmuted %s microphone",name2,imname)
}
return PLUGIN_HANDLED
}
public client_putinserver(id){
set_speak(id,SPEAK_LISTENALL)
}
public eventResetHud(id){
new clmsg[513]
set_speak(id,SPEAK_NORMAL)
format(clmsg,512,"^x04[amxx]^x03现在语音通话被限制在队友之间")
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
write_byte(id)
write_string(clmsg)
message_end()
}
public eDeathMsg(){
new victim=read_data(2)
new clmsg[513]
set_speak(victim,SPEAK_LISTENALL)
remove_voice_from_alive(victim)
format(clmsg,512,"^x04[amxx]^x01牺牲了,可以听所有玩家语音通话,但活的队友听不到你的声音")
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, victim)
write_byte(victim)
write_string(clmsg)
message_end()
} |
|