11.04.2011, 14:52
hi,
i use this /report cmd in my server but sometimes its buged and i returns smth. like:
PlayerName has reported PlayerName has reported PlayerName has reported BadPlayerName Reason PlayerName has reported.
Shit like this
Would be nice if someone could show me where there could be the error in this code
regards...
i use this /report cmd in my server but sometimes its buged and i returns smth. like:
PlayerName has reported PlayerName has reported PlayerName has reported BadPlayerName Reason PlayerName has reported.
Shit like this

Would be nice if someone could show me where there could be the error in this code

regards...
pawn Код:
dcmd_report(playerid, params[])
{
new name[30], aName[MAX_PLAYER_NAME], str[128], reason, iD;
GetPlayerName(playerid,name,30);
if (sscanf(params, "dz", iD, reason)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /report [ID] [Reason]");
if (iD == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "Invalid PlayerID!");
if (playerid == iD) return SendClientMessage(playerid, 0xFF0000FF, "You can't report yourself!");
GetPlayerName(iD, aName, sizeof(aName));
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(Spieler[i][AdminLevel] > 0)
{
format(str, sizeof(str), "%s(%d) has reported %s(%d) for: %s", name, playerid, aName, iD, reason);
SendClientMessage(i, 0xFF66FFAA, str);
}
}
}
return 1;
}