im making my very first plugin, its quite a simple plugin.. it will play a sound when a user dies... but if you die ALOT it can get VERY annoying, so im trying to make a command that will stop the plugin from working for that client.. I dont know how to do this though
heres my source, can someone help me?
PHP Code:
/* Script generated by Pawn Studio */
#include <amxmodx>
#include <amxmisc>
#include <HamSandwich>
#define PLUGIN "Death Noise"
#define AUTHOR "HLM A.K.A Master"
#define VERSION "1.0"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Killed, "player" , "ham_player_killed", 1)
register_clcmd("amx_deathmsg","blocksounds",_,"Enables/Disables the death sound")
}
public plugin_precache()
{
precache_sound("misc/Terminated.wav")
}
public blocksounds(id)
{
new arg[5]
read_argv(1,arg,4)
new name[33]
get_user_name(id,name,32)
if( equal(arg, "off"))
{
client_print(id,print_chat, "[AMXX] %s, you will no longer hear the sound on death. ", name)
return PLUGIN_HANDLED
}
else if( equal(arg, "on"))
{
client_print(id,print_chat, "[AMXX] %s, you will hear the sound on death. ",name)
return PLUGIN_CONTINUE
}
}
public ham_player_killed(id)
{
new name[33]
get_user_name(id,name,32)
client_cmd(id, "speak misc/Terminated.wav")
return HAM_HANDLED
}
__________________