22.06.2011, 21:40
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_GREY, "SYNTAX:/report [ID] [Reason]");
if (iD == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This Player is not online.");
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))
{
new zName[MAX_PLAYER_NAME], pFile[256];
GetPlayerName(i, zName, sizeof(zName));
format(pFile, sizeof(pFile), "Users\%s.ini", zName); //not needed but leave it there to avoid errors
if (IsPlayerAdmin(i) || dini_Int(pFile, "AdminLevel") >= 1)
{
format(str, sizeof(str), "%s(%d) has reported %s(%d) for: %s", pName, playerid, aName, iD, reason);
SendClientMessage(i, COLOR_LEMON, str);
}
}
}
return 1;
}