Report system
#1

Hello, I have tried to make a new report system of my old one.

But the RID(report id) isn't working..

Here is my code.

pawn Код:
CMD:report(playerid, params[])
{
new id;
    new reason[128];
    if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [playerid] [reporttext]");
    if(!IsPlayerConnected(id)) return SendClientMessageEx(playerid, COLOR_GREY, "That player is not connected! Use /ask if you have a general admin request.");
    if(playerid == id) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot report yourself! Use /ask if you have a general admin request.");
    if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 1338)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You can't submit reports as an administrator.");
        return 1;
    }
    if(PlayerInfo[playerid][pRMuted] != 0)
    {
        ShowPlayerDialog(playerid,7955,DIALOG_STYLE_MSGBOX,"Report blocked","You are blocked from submitting any reports!\n\nTips when reporting:\n- Report what you need, not who you need.\n- Be specific, report exactly what you need.\n- Do not make false reports.\n- Do not flame admins.\n- Report only for in-game items.\n- For shop orders use the /shoporder command","Close", "");
        return 1;
    }
    if(JustReported[playerid] > 0)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "Wait 30 seconds before sending another report!");
        return 1;
    }
   
   
    new bool:breakingloop = false, newid = INVALID_REPORT_ID;

    for(new i=0;i<MAX_REPORTS;i++)
    {
        if(!breakingloop)
        {
            if(Reports[i][HasBeenUsed] == 0)
            {
                breakingloop = true;
                newid = i;
            }
        }
    }
    if(newid != INVALID_REPORT_ID)
    {
        Reports[newid][TimeToExpire] = 5;
        Reports[newid][HasBeenUsed] = 1;
        Reports[newid][BeingUsed] = 1;
        Reports[newid][ReportExpireTimer] = SetTimerEx("ReportTimer", 60000, 0, "d", newid);
    }
    else
    {
        ClearReports();
    }
   
    new string[150], sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sender, sizeof(sender));
    GetPlayerName(id, receiver, sizeof(receiver));

    format(string, sizeof(string), "[RID: %d] - %s(%d) has reported %s(%d) for: %s ", newid, sender, playerid, receiver, id, reason);
    ABroadCast(COLOR_REPORT,string,1);
   
    JustReported[playerid]=30;
    SendClientMessageEx(playerid, COLOR_WHITE, "Your report has been sent to the admins. Please be patient and wait until an admin can help you.");
    return 1;
}
Thanks for all help I can get.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)