Sound has been added: client_cmd(id, "spk \"cleanup(t20) progress(t20)\"")
Dictionary file has been removed.
You can add more commands like in: new const resetScoreCommands[][]
Replace yoursound with Your own sound.
Code: Select all
#include <amxmodx>
#include <reapi>
#define MIN_FRAGS 5 // Player who has more than minimum frags will be able to reset his score but not lower
#define MIN_DEATHS 5 // Player who has more than minimum deaths will be able to reset his score but not lower
new const resetScoreCommands[][] =
{
"/rs", "/resetscore", "/rscore", "/resets"
}
new sayCmd[64], sayTeamCmd[64], x
public plugin_init()
{
register_plugin("Reset Score", "1.1", "Raheem")
// Commands
for (x = 0; x <= charsmax(resetScoreCommands); x++)
{
formatex(sayCmd, charsmax(sayCmd), "say %s", resetScoreCommands[x])
formatex(sayTeamCmd, charsmax(sayTeamCmd), "say_team %s", resetScoreCommands[x])
register_clcmd(sayCmd, "CmdSay")
register_clcmd(sayTeamCmd, "CmdSay")
}
}
public CmdSay(id)
{
if (get_entvar(id, var_frags) > MIN_FRAGS || get_member(id, m_iDeaths) > MIN_DEATHS)
{
set_entvar(id, var_frags, 0.0)
set_member(id, m_iDeaths, 0)
message_begin(MSG_BROADCAST, get_user_msgid("ScoreInfo"))
write_byte(id) // id
write_short(0) // Frags
write_short(0) // Deaths
write_short(0) // Class
write_short(get_member(id, m_iTeam)) // Team
message_end()
client_print_color(id, print_team_default, "^3Your score has been reset successfully^1.")
client_cmd(id, "spk yoursound")
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}