How to make /report cmd?
#1

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

Anyone can help?
Reply
#3

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.
Reply
#4

Where do those reports go
Reply
#5

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.
Reply
#6

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.. :/
Reply
#7

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

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;
}
Reply
#9

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

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.. :/
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)