09.11.2014, 12:56
Hey guys i got this one Code for REPORT
how can i make /reports for only admins ..
pawn Код:
CMD:report(playerid, params[]) {
new id;
new reason[128];
if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid,COLOR_RED, "[SERVER] - USAGE: /report [ID] [REASON]");
new string[150], sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME];
GetPlayerName(playerid, sender, sizeof(sender));
GetPlayerName(id, receiver, sizeof(receiver));
format(string, sizeof(string), "[ADMIN] - %s(%d) has reported %s(%d)", sender, playerid, receiver, id);
SendMessageToAdmins(string);
format(string, sizeof(string), "[ADMIN] - Reason: %s", reason);
SendMessageToAdmins(string);
SendClientMessage(playerid, COLOR_RED, "Your report has been sent.");
return 1;
}
stock SendMessageToAdmins(text[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i, COLOR_RED, text);
}
}
}