27.05.2012, 08:33
try this:
I think you don't need to give the playerid, in this case I because it is already defined in the function sendclientmessagetoadmins or something
Try it, and tell it if it worked
So it will be:
pawn Код:
SendClientMessageToAdmins(COLOR_RED, str);
Try it, and tell it if it worked

So it will be:
pawn Код:
CMD:report(playerid, params[])
{
new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME], str[128], reason, iD;
if (sscanf(params, "dz", iD, reason)) return SendClientMessage(playerid, COLOR_RED, "Usage: /report [id] [reason]");
if (iD == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid ID.");
if (playerid == iD) return SendClientMessage(playerid, COLOR_RED, "You can't report yourself.");
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(iD, aName, sizeof(aName));
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
format(str, sizeof(str), "[%d]%s has reported [%d]%s for: %s", playerid, pName, iD, aName, reason);
SendClientMessageToAdmins(COLOR_RED, str);
}
}
return 1;
}

