SA-MP Forums Archive
How to make /report cmd? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make /report cmd? (/showthread.php?tid=274259)



How to make /report cmd? - ServerRestart - 05.08.2011

How can i make a /report cmd? i use zcmd.


Re: How to make /report cmd? - ServerRestart - 05.08.2011

Anyone can help?


Re: How to make /report cmd? - Toreno - 05.08.2011

pawn Код:
CMD:report(playerid, params[]) {
    new id, s_text[128], s_string[128];
    if(sscanf(params, "us[128]", id, stext)) return SendClientMessage(playerid, -1, "Syntax: /report [playerid] [text]");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Invalid Player ID!");
    format(s_string, sizeof(s_string), "[%d]%s reports [%d]%s, %s", playerid, GetPlayerNameEx(playerid), id, GetPlayerNameEx(otherid), s_text);
    SendAdminReport(-1, s_string);
    SendClientMessage(playerid, -1, "Your report has been sent.");
    return 1;
}
pawn Код:
stock SendAdminReport(color, const len[]) {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerAdmin(i)) SendClientMessage(i, color, len);
    }
    return 1;
}
pawn Код:
stock GetPlayerNameEx(playerid) {
    new sPlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sPlayerName, sizeof(sPlayerName));
    return sPlayerName;
}
EDIT: Fixed a mistake.


AW: How to make /report cmd? - samtey - 05.08.2011

Where do those reports go


Re: How to make /report cmd? - Toreno - 05.08.2011

Whenever player reports, if there is a player which is logged in as admin RCON. He'll get the message, look at the stock I created.


Re: How to make /report cmd? - ServerRestart - 05.08.2011

I dont want the rcon admin to get the report i want anyone who a mod or admin to get the report, Like level 1 admin level 2 admin level 3 admins ect.. :/


Re: How to make /report cmd? - kingchandio - 05.08.2011

please tell how to make /accept report
/invalid report
/reports
and expire report in 5 mint


Re: How to make /report cmd? - emokidx - 05.08.2011

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
pawn Код:
new id, s_text[128], s_string[128];
    if(sscanf(params, "us[128]", id, stext))
you defined "s_text" but wrote 'stext'.. minor prob
Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
pawn Код:
otherid, GetPlayerNameEx(otherid), stext);
now i wanna know where did you define the other id? and "stext" here too..

EDIT

Quote:
Originally Posted by ServerRestart
Посмотреть сообщение
I dont want the rcon admin to get the report i want anyone who a mod or admin to get the report, Like level 1 admin level 2 admin level 3 admins ect.. :/
use the varieble you use for the admin levels and put that instead of "IsPlayerAdmin" in the stock..
if you want the reports for every level admin use this as an e.g.
pawn Код:
stock SendAdminReport(color, const len[]) {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(PlayerInfo[i][AdminLevel] >= 1) SendClientMessage(i, color, len);
    }
    return 1;
}



Re: How to make /report cmd? - Toreno - 05.08.2011

Woah... I had a mistake, otherid means id, stext means s_text... not hard to understand, you know.


Re: How to make /report cmd? - ServerRestart - 05.08.2011

C'mon someone.. All i want to know is how to make a /report cmd.. the player types /report they get the message USAGE: /REPORT [ID] [REASON] Then who ever they reported gets sent to all admins/mods.. :/