/report command help
#1

I'm having a slight issue with my /report command. sometimes when people do /report it reports their ID and not the id they wanted to report.

EX:
Jake /report Bob Hacking!
[INFO]: Jake (0) Has Reported Jake (0) for: Hacking!

Here is the command code:
pawn Код:
if(strcmp(cmd, "/report", true) == 0 || strcmp(cmd, "/re", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(JustReported[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "** Wait 1 minute after sending another report! ");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/re)port [playerid/PartOfName] [text]");
                return 1;
            }
            giveplayerid = strval(tmp);
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    new length = strlen(cmdtext);
                    while ((idx < length) && (cmdtext[idx] <= ' '))
                    {
                        idx++;
                    }
                    new offset = idx;
                    new result[128];
                    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                    {
                        result[idx - offset] = cmdtext[idx];
                        idx++;
                    }
                    result[idx - offset] = EOS;
                    if(!strlen(result))
                    {
                        SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/re)port [playerid] [text]");
                        return 1;
                    }
                    if(PlayerInfo[playerid][pRegularRank] == 0)
                    {
                        format(string, sizeof(string), "[INFO]: %s (%d) Has Reported %s (%d) for: %s",sendername, playerid, giveplayer, giveplayerid, (result));
                    }
                    else
                    {
                        format(string, sizeof(string), "[INFO]: High-Ranking Player %s (%d) Has Reported %s (%d) for: %s",sendername, playerid, giveplayer, giveplayerid, (result));
                    }
                    SendAdminMessage(COLOR_GREEN,string);
                    SendAdminMessage(COLOR_LIGHTRED, "----------------------------------------------------------------------------------------------");
                    SendAdminMessage(COLOR_GREEN,"Type '/acceptreport (/ar) [reporter id]' or '/trashreport (/tr) [reporter id]'");
                    SendClientMessage(playerid, COLOR_LIGHTRED, "* Your report was sent and reviewed by the Server Admins that are online.");
                    JustReported[playerid] = 1;
                    PlayerNeedsHelp[playerid] = 1;
                    SetTimerEx("ReportReset", 60000, false, "i", playerid);
                    new y, m, d;
                    new h,mi,s;
                    getdate(y,m,d);
                    gettime(h,mi,s);
                    format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Reported %s for: %s",d,m,y,h,mi,s,sendername, giveplayer, (result));
                    ReportLog(string);
                    Reports[MAX_REPORTS-1] = string;
                }
            }
        }
        return 1;
 }
Please & thanks for help with this issue
Reply


Messages In This Thread
/report command help - by jakejohnsonusa - 24.04.2013, 21:44
Re: /report command help - by Skyrise - 24.04.2013, 23:40
Re: /report command help - by jakejohnsonusa - 25.04.2013, 00:20
Re: /report command help - by arakuta - 25.04.2013, 00:22
Re: /report command help - by Skyrise - 25.04.2013, 00:25
Re: /report command help - by jakejohnsonusa - 25.04.2013, 00:26
Re: /report command help - by Onfroi - 25.04.2013, 01:02
Re: /report command help - by jakejohnsonusa - 25.04.2013, 01:05
Re: /report command help - by Tom Kingston - 25.04.2013, 05:47
Re: /report command help - by yaron0600 - 25.04.2013, 05:57
Re: /report command help - by jakejohnsonusa - 25.04.2013, 11:14

Forum Jump:


Users browsing this thread: 4 Guest(s)