29.05.2013, 17:50
I just made this command to reset the warnings to an offline player but seems don't work.
The warnings are still there (in /stats and in player file):
the "Users" folder is in scriptfiles, obv.
The warnings are still there (in /stats and in player file):
pawn Код:
CMD:rwarns(playerid,params[])
{
if(pInfo[playerid][Logged] == 0) return SCM(playerid,0x0080C0FF,"Please login before using this command.");
if(pInfo[playerid][Admin] >= 5)
{
new id;
new name[128];
new aName[MAX_PLAYER_NAME];
GetPlayerName(playerid, aName, sizeof(aName));
if(sscanf(params, "s[128]",name)) return SCM(playerid,-1,"{F70505}Usage: {FFFFFF}/rwarns <account name>");
if(GetPVarInt(id,"CmdTime")>GetTickCount())return SCM(playerid,0xFF0000FF,"Please wait before using this command again.");
new string[250];
new echos[250];
new Year, Month, Day, Hour, Minute, Second;
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
new stringo[90];
new filestring[128];
format(filestring, sizeof(filestring), "/Users/%s.ini", name);
if(!fexist(filestring)) return SCM(playerid,red, "Player account not found.");
else
{
dini_IntSet(filestring, "Warn", 0);
format(stringo, sizeof(stringo),"Success! You have resetted %s's warnings.", name);
SCM(playerid, red,stringo);
}
format(string, sizeof(string), "** Admin %s (%d) resetted %s's warnings - %02d/%02d/%02d - %02d:%02d:%02d", aName,id,name,Day,Month,Year,Hour,Minute,Second);
format(echos, sizeof(echos), "1,4** Admin %s (%d) resetted %s's warnings - %02d/%02d/%02d - %02d:%02d:%02d", aName,id,name,Day,Month,Year,Hour,Minute,Second);
SendMessageToAdmins(red,string);
IRC_Say(gGroupID, IRC_CHANNEL, echos);
IRC_Say(gGroupID, IRC_ACHANNEL, echos);
SetPVarInt(id,"CmdTime",GetTickCount()+2000);
RWarnsLog(string);
}
return 1;
}