How to make a /reports command
#1

I have tried so many times to get this to work. I need to make a /reports command and I havnt got a clue on why it isnt working. Ill post the enum and Command I already have. So if you guys can help. That would be great!

pawn Код:
enum reportinfo
{
    HasBeenUsed,
    Report[128],
    ReportFrom,
    CheckingReport,
    TimeToExpire,
    BeingUsed,
    ReportExpireTimer,
    ReplyTimerr,
    ReportPriority,
    ReportLevel
};

new Reports[MAX_REPORTS][reportinfo];

//Commnd

CMD:reports(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, NOTADMIN);
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        new string[128];
        SendClientMessage(playerid, COLOR_GREEN, "____________________ REPORTS _____________________");
        for(new i = 999; i >= 0; i--)
        {
            if(Reports[i][BeingUsed] == 1 && Reports[i][ReportPriority] == 5)
            {
                if(Reports[i][ReportLevel] == 2 || PlayerInfo[playerid][pAdmin] >= 2)
                {
                    format(string, sizeof(string), "%s (ID: %i) | RID: %i | Report: %s | Pending: %d minutes | Priority: %i", GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, (Reports[i][Report]), Reports[i][TimeToExpire], Reports[i][ReportPriority]);
                    SendClientMessage(playerid, COLOR_REPORT, string);
                }
            }
        }
        for(new i = 999; i >= 0; i--)
        {
            if(Reports[i][BeingUsed] == 1 && Reports[i][ReportPriority] == 4)
            {
                if(Reports[i][ReportLevel] == 2 || PlayerInfo[playerid][pAdmin] >= 2)
                {
                    format(string, sizeof(string), "%s (ID: %i) | RID: %i | Report: %s | Pending: %d minutes | Priority: %i", GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, (Reports[i][Report]), Reports[i][TimeToExpire], Reports[i][ReportPriority]);
                    SendClientMessage(playerid, COLOR_REPORT, string);
                }
            }
        }
        for(new i = 999; i >= 0; i--)
        {
            if(Reports[i][BeingUsed] == 1 && Reports[i][ReportPriority] == 3)
            {
                if(Reports[i][ReportLevel] == 2 || PlayerInfo[playerid][pAdmin] >= 2)
                {
                    format(string, sizeof(string), "%s (ID: %i) | RID: %i | Report: %s | Pending: %d minutes | Priority: %i", GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, (Reports[i][Report]), Reports[i][TimeToExpire], Reports[i][ReportPriority]);
                    SendClientMessage(playerid, COLOR_REPORT, string);
                }
            }
        }
        for(new i = 999; i >= 0; i--)
        {
            if(Reports[i][BeingUsed] == 1 && Reports[i][ReportPriority] == 2)
            {
                if(Reports[i][ReportLevel] == 2 || PlayerInfo[playerid][pAdmin] >= 2)
                {
                    format(string, sizeof(string), "%s (ID: %i) | RID: %i | Report: %s | Pending: %d minutes | Priority: %i", GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, (Reports[i][Report]), Reports[i][TimeToExpire], Reports[i][ReportPriority]);
                    SendClientMessage(playerid, COLOR_REPORT, string);
                }
            }
        }
        for(new i = 999; i >= 0; i--)
        {
            if(Reports[i][BeingUsed] == 1 && Reports[i][ReportPriority] == 1)
            {
                if(Reports[i][ReportLevel] == 2 || PlayerInfo[playerid][pAdmin] >= 2)
                {
                    format(string, sizeof(string), "%s (ID: %i) | RID: %i | Report: %s | Pending: %d minutes | Priority: %i", GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, (Reports[i][Report]), Reports[i][TimeToExpire], Reports[i][ReportPriority]);
                    SendClientMessage(playerid, COLOR_REPORT, string);
                }
            }
        }
        SendClientMessage(playerid, COLOR_GREEN, "___________________________________________________");
    }
    return 1;
}
Rep to anyone who can fix this
Reply


Messages In This Thread
How to make a /reports command - by TranquiliZed - 06.07.2013, 04:44
Re: How to make a /reports command - by SwisherSweet - 06.07.2013, 06:00
Re: How to make a /reports command - by TranquiliZed - 06.07.2013, 06:21
Re: How to make a /reports command - by SwisherSweet - 06.07.2013, 06:34

Forum Jump:


Users browsing this thread: 2 Guest(s)