SA-MP Forums Archive
Report - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Report (/showthread.php?tid=288338)



Report - Snowman12 - 07.10.2011

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?


Re: Report - Jafet_Macario - 07.10.2011

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.


Re: Report - Snowman12 - 07.10.2011

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