08.04.2013, 17:51
This /report command, when someone does a long report like /report 1 using cheats like hh and infinite ammo bla bla, makes crash the server and i dont know why..
The admins get reports ingame and an irc, whats the problem then?
pawn Код:
CMD:report(playerid,params[])
{
if(pInfo[playerid][Logged] == 0) return SCM(playerid,0x0080C0FF,"Please login before using this command.");
if(GetPVarInt(playerid,"RepTime")>GetTickCount())return SCM(playerid,0xFF0000FF,"Please wait 10 seconds before reporting a player again.");
new Target;
new Reason[128];
new string2[250];
if(!sscanf(params, "u[24]s[250]",Target, Reason))
{
if(Target == playerid) return SCM(playerid, COLOR_RED, "You can't report yourself.");
if(strlen(params) > 128) return SCM(playerid, COLOR_RED, "Your report can't be more than 128 characters long.");
if(!IsPlayerConnected(Target))
return SCM(playerid, COLOR_RED, "Player is not connected!");
new tname[MAX_PLAYER_NAME];
new pname[MAX_PLAYER_NAME];
GetPlayerName(Target,tname,sizeof(tname));
GetPlayerName(playerid,pname,sizeof(pname));
new astring[250];
new Year, Month, Day, Hour, Minute, Second;
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
SCM(playerid, COLOR_RED, "> Player reported to online admins.");
new rstring[200];
format(rstring,sizeof(rstring),"** %s (%d) reported %s (%d) - (%s) - %02d/%02d/%02d - %02d:%02d:%02d -", pname,playerid,tname,Target,Reason,Day,Month,Year,Hour,Minute,Second);
format(astring,sizeof(astring),"[REPORT] %s (%d) reported %s (%d) - (%s)", pname,playerid,tname,Target,Reason);
SendMessageToAdmins(0x33AA33FF,astring);
ReportLog(rstring);
format(string2, sizeof(string2), "04,2[REPORT]: %s (%d) reported %s (%d) - (Reason: %s) - %02d/%02d/%02d - %02d:%02d:%02d -", pname,playerid,tname,Target,Reason,Day,Month,Year,Hour,Minute,Second);
IRC_GroupSay(gGroupID, IRC_ACHANNEL, string2);
IRC_GroupSay(gGroupID, IRC_CHANNEL, string2);
SetPVarInt(playerid,"RepTime",GetTickCount()+10000);
}
else return SCM(playerid, -1, "{F70505}Usage: {FFFFFF}/report <playerid> <reason>");
return 1;
}