07.07.2017, 05:27
Hello,
I'm having a problem with this command, I know it's simple enough to understand but i can't find the problem here
It keeps spamming the 'USAGE' text.
I'm having a problem with this command, I know it's simple enough to understand but i can't find the problem here
It keeps spamming the 'USAGE' text.
PHP код:
CMD:report(playerid, params[])
{
new id;
new reason[50];
/*keeps spamming this ==>*/if(sscanf(params, "us[50]", id, reason)) return SendClientMessage(playerid, -1, "Usage: /report [id] [reason]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!");
new sender[MAX_PLAYER_NAME], reported[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, sender, sizeof(sender));
GetPlayerName(id, reported, sizeof(reported));
format(string, sizeof(string), "ADMIN CONSOLE - Player %s(%d) has reported player %s(%d)", sender, playerid, reported, id);
SendMessageToAdmins(string);
format(string, sizeof(string), "ADMIN CONSOLE - Reason: %s", reason);
SendMessageToAdmins(string);
format(string, sizeof(string), "ADMIN CONSOLE - Use '/approve %d' to approve this player's report", playerid);
SendMessageToAdmins(string);
SendClientMessage(playerid, COLOR_RED, "Your report has been recieved, Wait for it's approval");
reportid[playerid]=1;
return 1;
}