PHP Code:
L 05/06/2017 - 13:50:29: Start of error session.
L 05/06/2017 - 13:50:29: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20170506.log")
L 05/06/2017 - 13:50:29: String formatted incorrectly - parameter 4 (total 3)
L 05/06/2017 - 13:50:29: [AMXX] Displaying debug trace (plugin "resetscore.amxx")
L 05/06/2017 - 13:50:29: [AMXX] Run time error 25: parameter error
L 05/06/2017 - 13:50:29: [AMXX] [0] resetscore.sma::ClientCommand_ResetScore (line 48)
SMA
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < fun >
#define PLUGIN_NAME "Reset Score"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Chilimax"
new const g_szClientCommands[][] =
{
"say /retry", "say_team /retry",
"say /resetscore", "say_team /resetscore",
"say /restartscore", "say_team /restartscore"
}
new g_MsgScoreInfo;
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
register_cvar("reset_score_version", PLUGIN_VERSION, FCVAR_SERVER | FCVAR_SPONLY);
set_cvar_string("reset_score_version", PLUGIN_VERSION);
new Index, iMaxLoops = sizeof(g_szClientCommands);
for(Index = 0; Index < iMaxLoops; Index++)
register_clcmd(g_szClientCommands[Index], "ClientCommand_ResetScore");
g_MsgScoreInfo = get_user_msgid("ScoreInfo");
}
public ClientCommand_ResetScore(Index)
{
if( !get_user_frags(Index) && !cs_get_user_deaths(Index) )
{
client_print(Index, print_chat, "Your score is already reset");
return PLUGIN_HANDLED;
}
set_user_frags(Index, 0);
cs_set_user_deaths(Index, 0);
UpdateClientScore(Index, 0, 0);
new szName[32];
get_user_name(Index, szName, charsmax(szName));
client_print(0, print_chat, "%s has just reset his/her score");
return PLUGIN_HANDLED;
}
UpdateClientScore(Index, iFrags, iDeaths)
{
message_begin(MSG_ALL, g_MsgScoreInfo);
write_byte(Index);
write_short(iFrags);
write_short(iDeaths);
write_short(0);
write_short(get_user_team(Index));
message_end();
}
please help, tahnks in advance