/report Bug
#1

On This Code:
pawn Код:
dcmd_report(playerid,params[])
{
    new reported;
    new tmp[256];
    new tmp2[256];
    new Index;
    tmp = strtok(params,Index);
    tmp2 = strtok(params,Index);
    if(!strlen(params)) return
    SendClientMessage(playerid, LIGHTBLUE2, "Usage: /report [PlayerID] [Reason]") &&
    SendClientMessage(playerid, orange, "Attention: Not report anyone without Reason!");
    reported = strval(tmp);

    if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID)
     {
        if(AccInfo[reported][Level] == ServerInfo[MaxAdminLevel])
        return SendClientMessage(playerid,red,"ERROR: You cannot report this Administrator");
        if(playerid == reported)
        return SendClientMessage(playerid,red,"ERROR: You Cannot report Yourself");
        if(strlen(params) > 7)
        {
            new reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], str[128];
            new hour,minute,second;
            gettime(hour,minute,second);
            GetPlayerName(reported, reportedname, sizeof(reportedname));
            GetPlayerName(playerid, reporter, sizeof(reporter));
            format(str, sizeof(str), "REPORT: %s(Id:%d) Reported %s(Id:%d) Reason: %s |Time: %d:%d:%d|", reporter,playerid, reportedname, reported, params[strlen(tmp)+1], hour,minute,second);
            MessageToAdmins(COLOR_WHITE,str);
            SaveIn("ReportLog",str);
            format(str, sizeof(str), "(%d:%d:%d): %s(Id:%d) Reported %s(Id:%d) Reason: %s", hour,minute,second, reporter,playerid, reportedname, reported, params[strlen(tmp)+1]);
            for(new i = 1; i < MAX_REPORTS-1; i++) Reports[i] = Reports[i+1];
            Reports[MAX_REPORTS-1] = str;
            return SendClientMessage(playerid,yellow, "|- Your report has been sent to Online Administrators and saved in File! -|");
        }
        else return SendClientMessage(playerid,red,"ERROR: Invalid Reason!");
    }
    else return ErrorMessages(playerid, 2);
}
The Problem Is When Typing /report Without ID It Shows That The Player Reported The Player Whose ID Is 0,Please Fix For Me This Problem.
Reply


Messages In This Thread
/report Bug - by Youssef214 - 05.05.2014, 19:37
Re: /report Bug - by Smileys - 05.05.2014, 19:45
Re: /report Bug - by Youssef214 - 05.05.2014, 19:54
Re: /report Bug - by Smileys - 05.05.2014, 19:57
Re: /report Bug - by Youssef214 - 05.05.2014, 19:58
Re: /report Bug - by Youssef214 - 05.05.2014, 20:11
Re: /report Bug - by Jefff - 05.05.2014, 22:18
Re: /report Bug - by Youssef214 - 06.05.2014, 09:58

Forum Jump:


Users browsing this thread: 1 Guest(s)