Report
#1

pawn Код:
CMD:report(playerid, params[])
{
    new string[280], pName[MAX_PLAYER_NAME];
    if(sscanf(params, "s[280]", string)) return SendClientMessage(playerid, COLOR_RED, "Syntax error: /report [Message]");
    {
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), DIALOG_GREEN"%s's report: %s", pName, string);
        SendMessageToAdmins(COLOR_RED, string);
        SendClientMessage(playerid, COLOR_RED, DIALOG_YELLOW"Your report has been submitted to the admins");
    }
    return 1;
}
How can I makw it so admins type /acceptreport amd it lets that player know and he can /reply to a admin?
Reply
#2

pawn Код:
new Reported[ MAX_PLAYERS ]; // Top


Reported[ playerid ] = 0; // OnPlayerConnect

CMD:report(playerid, params[])
{
    new string[280], pName[MAX_PLAYER_NAME];
    if(sscanf(params, "s[280]", string)) return SendClientMessage(playerid, COLOR_RED, "Syntax error: /report [Message]");
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    format(string, sizeof(string), DIALOG_GREEN"(%d) %s's report: %s", playerid, pName, string);
    SendMessageToAdmins(COLOR_RED, string);
    SendClientMessage(playerid, COLOR_RED, DIALOG_YELLOW"Your report has been submitted to the admins");
    Reported[ playerid ] = 1;
    return true;
}

CMD:acceptreport(playerid, params[])
{
    new pID, string[ 128 ], pName[ MAX_PLAYER_NAME ], tName[ MAX_PLAYER_NAME ];
    if(sscanf(params,"u", pID)) return SendClientMessage(playerid, -1,"Syntax: /acceptreport [PlayerName/ID]");
    if(!IsPlayerAdmin( playerid )) return SendClientMessage(playerid, -1,"You are not RCON Admin"); // Change it to your admin var
    if(Reported[ id ] == 0) return SendClientMessage(playerid, -1,"This player hasn't reported anything!");
    if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1,"This player is offline");
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    GetPlayerName(pID, tName, MAX_PLAYER_NAME);
    format(string, sizeof(string),"Administrator %s has accepted %s report", pName, tName);
    SendClientMessageToAll(-1, string);
    Reported[ id ] = 0;
    return true;
}
Hope you get the idea.
Reply
#3

Yeah I made one like that I just wanted to know how people do it without entering the id?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)