SA-MP Forums Archive
string help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: string help (/showthread.php?tid=311896)



string help - rinori - 18.01.2012

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?

pawn Код:
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;
}