06.08.2014, 19:32
Hi, I am have a bit of trouble with my report command. When someone reports a player, the message duplicates to other players who are admin, if you do have ID 0, it does not duplicate for you. If you have an ID over 0 and you are admin, it duplicates the message.
Picture.

Code for the report command.
All suggestions are appreciated, thanks
Picture.

Code for the report command.
pawn Код:
CMD:report(playerid, params[])
{
new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME], str[128], reason, iD;
if(PlayerInfo[playerid][pReport] > 0) return SendClientMessage(playerid, -1, "You have already reported someone!");
if(sscanf(params, "us[128]", iD, reason)) return SendClientMessage(playerid, -1, "Usage: /report [id] [reason]");
if(iD == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "That player is not connected!");
PlayerInfo[playerid][pReport] +=1;
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];
GetPlayerName(i, zName, sizeof(zName));
if(PlayerInfo[i][pAdmin] > 0)
{
new str35[128];
format(str, sizeof(str), "(( [REPORT] %s(%d) has reported %s(%d). [Reason]:%s ))", pName,playerid, aName,iD, reason);
format(str35, sizeof(str35),"Type /acceptreport %d to accept the Report",playerid);
SendClientMessage(i,ORANGE, str);
SendClientMessage(i,ORANGE, str35);
}
}
}
return 1;
}
