public NewLife(playerid)
{
KillTimer(NewLifeTimerr[playerid]);
SendClientMessage(playerid, 0xFF0000FF, "** New life loaded without errors, your account stats have been resetted.");
GameTextForPlayer(playerid, "~w~New life ~r~loaded!", 5000, 3);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, 24);
new filestring[128];
format(filestring, sizeof(filestring), "/Users/%s.ini", pname);
{
new INI:File = INI_Open(filestring);
INI_SetTag(File, "Player's Data");
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Nopm",0);
INI_WriteInt(File,"Mute",0);
INI_WriteInt(File,"Vip",0);
INI_WriteInt(File,"Banned",0);
INI_WriteInt(File,"Cookies",0);
INI_WriteInt(File,"Warn",0);
INI_WriteInt(File,"Jailed", 0);
INI_WriteInt(File,"Logged", 1);
INI_WriteInt(File,"AdminActions",0);
INI_WriteInt(File,"Rank", 0);
INI_WriteInt(File,"Taxes",0);
INI_WriteInt(File,"Skill",0);
INI_WriteInt(File,"Condoms",0);
INI_WriteInt(File,"Infected",0);
INI_WriteInt(File,"TempBan",0);
INI_WriteInt(File,"PlayersRobbed",0);
INI_WriteInt(File,"PlayersRaped",0);
INI_WriteInt(File,"SoldVehicles",0);
INI_WriteInt(File,"TotalRobbedMoney",0);
INI_WriteInt(File,"PlayersInfected",0);
INI_WriteInt(File,"CarjackerProfit",0);
INI_WriteInt(File,"PingExceeds",0);
INI_WriteInt(File,"Bombs",0);
INI_WriteInt(File,"BombsPlanted",0);
INI_WriteInt(File,"Drugs",0);
INI_WriteInt(File,"DrugsSold",0);
INI_WriteInt(File,"DrugsProfit",0);
INI_WriteInt(File,"DDClientsServed",0);
INI_WriteInt(File,"Reputation",0);
INI_WriteInt(File,"DrugSeeds",0);
INI_Close(File);
}
new echos[128];
new am[128];
format(echos,sizeof(echos),"0,** %s (%d) started a new life. (/newlife)",pname,playerid);
format(am,sizeof(am),"0,2** %s (%d) started a new life. (/newlife)",pname,playerid);
IRC_GroupSay(gGroupID, IRC_CHANNEL, echos);
SCMTA(COLOR_CON_GREEN,am);
return 1;
}
Everything seems fine dude :/ Try restarting whole server by closing the command window, not with gmx or reloadfs.
|
Why you create a callback instead of creating a simple zcmd command? And what does that timer, NewLifeTimerr[playerid] which you kill, do?
|
NewLifeTimerr[playerid] = SetTimerEx("NewLife",10000,0,"i",playerid);
It'll write to the files but it's not actually setting the player's INFO variables to 0...
|
Just for test, try to run the cmd as CMD:.... and lets see if it works. If it does, then you do something wrong with the timer, did you forward it?
EDIT: non-repeating timers do not need to be killed/cannot be killed, do they/can they? |