PDA

View Full Version : string help


rinori
18/01/2012, 08:54 PM
I made a report command and right when I use the command with a many characters it restarts the server.
Here is the code, any one know where is the problem?


dcmd_report(playerid, params[])
{
new result[60],string[128];
if(PlayerInfo[playerid][pReportMuted] == 1) return SendClientMessage(playerid, COLOR_GRAD1, " You are muted from report!");
if(JustReported[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, " Wait 25 seconds after sending another report!");
if(sscanf(params, "s",result)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /report [text]");
else
{
/*if(PlayerInfo[playerid][pAdm] >= 2)
{
SendClientMessage(playerid, COLOR_GREY, " Administrators cant send reports!");
return 1;
}*/
JustReported[playerid] = 1;
SetTimerEx("ReportReset", 25000, false, "i", playerid);
format(string, sizeof(string), "Report from [%d]%s: %s", playerid, GetName(playerid), result);
ABroadCast(COLOR_LIGHTYELLOW,string,1);
AModCast(COLOR_LIGHTYELLOW,string,1);
SendClientMessage(playerid, COLOR_YELLOW, "Your Report Message was sent to {FF6347}administrators{FFFF00}.");
Reported[playerid] = 1;
}
return 1;
}