Report problem
#10

pawn Код:
CMD:ar(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        print("Creating Variables");
        new string[128], reportid;
        print("Executing SSCANF");
        if(sscanf(params, "d", reportid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ar [reportid]");
        print("Checking Report ID");
        if(reportid < 0 || reportid > 999) { SendClientMessageEx(playerid, COLOR_GREY, "   Report ID not below 0 or above 999!"); return 1; }
        print("Checking report id for usage");
        if(Reports[reportid][BeingUsed] == 0)
        {
            print("Sending report unused message");
            SendClientMessageEx(playerid, COLOR_GREY, "   That report ID is not being used!");
            return 1;
        }
        print("Checking if player is connected");
        if(!IsPlayerConnected(Reports[reportid][ReportFrom]))
        {
            print("Sending player not connected message");
            SendClientMessageEx(playerid, COLOR_GREY, "   The reporter has disconnected !");
            print("Setting reportfrom to 999");
            Reports[reportid][ReportFrom] = 999;
            print("Setting BeingUsed to 0');
            Reports[reportid][BeingUsed] = 0;
            return 1;
        }
        print("
formatting admin accepted message");
        format(string, sizeof(string), "
AdmCmd: %s has accepted the report from %s (ID: %i, RID: %i).", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]),Reports[reportid][ReportFrom],reportid);
        print("
Sending Admin Accepted Message to ABroadCast");
        ABroadCast(COLOR_ORANGE, string, 2);
        print("
adding report token");
        AddReportToken(playerid); // Report Tokens
        print("
formatting accepted messsage for player");
        format(string, sizeof(string), "
%s has accepted your report and is reviewing it, you can /reply to send messages to the admin reviewing your report.", GetPlayerNameEx(playerid));
        print("
Sending The accepted message to the player");
        SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
        print("
Setting pAcceptReport ++");
        PlayerInfo[playerid][pAcceptReport]++;
        print("
Setting Reply Timer");
        Reports[reportid][ReplyTimerr] = SetTimerEx("
ReplyTimer", 30000, 0, "d", reportid);
        print("
Setting CheckingReport to the admins id");
        Reports[reportid][CheckingReport] = playerid;
        print("
Setting BeingUsed to 0");
        Reports[reportid][BeingUsed] = 0;
        print("
Setting time to expire to 0");
        Reports[reportid][TimeToExpire] = 0;
        print("
Executing strmid");
        strmid(Reports[reportid][Report], "
None", 0, 4, 4);
    }
    return 1;
}
replace the /ar with that and then post the log after the server crashes
Reply


Messages In This Thread
Report problem - by WG Chinn - 17.08.2011, 00:10
Re: Report problem - by mprofitt - 17.08.2011, 00:12
Re: Report problem - by dowster - 17.08.2011, 00:16
Re: Report problem - by WG Chinn - 17.08.2011, 00:20
Re: Report problem - by farris - 17.08.2011, 00:37
Re: Report problem - by WG Chinn - 17.08.2011, 00:44
Re: Report problem - by farris - 17.08.2011, 00:55
Re: Report problem - by WG Chinn - 17.08.2011, 00:56
Re: Report problem - by ElieJabbour - 17.08.2011, 02:15
Re: Report problem - by dowster - 17.08.2011, 02:28
Re: Report problem - by WG Chinn - 17.08.2011, 15:29
Re: Report problem - by WG Chinn - 17.08.2011, 17:42
Re: Report problem - by dowster - 17.08.2011, 17:52
Re: Report problem - by WG Chinn - 17.08.2011, 17:59
Re: Report problem - by WG Chinn - 17.08.2011, 20:40
Re: Report problem - by dowster - 17.08.2011, 22:28

Forum Jump:


Users browsing this thread: 2 Guest(s)