05.08.2011, 10:06
How can i make a /report cmd? i use zcmd.
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;
}
stock SendAdminReport(color, const len[]) {
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerAdmin(i)) SendClientMessage(i, color, len);
}
return 1;
}
stock GetPlayerNameEx(playerid) {
new sPlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, sPlayerName, sizeof(sPlayerName));
return sPlayerName;
}
pawn Код:
|
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.. :/
|
stock SendAdminReport(color, const len[]) {
for(new i = 0; i < MAX_PLAYERS; i++) {
if(PlayerInfo[i][AdminLevel] >= 1) SendClientMessage(i, color, len);
}
return 1;
}