13.05.2014, 20:11
You should really learn when to use braces (and whitespace, for that matter). For example, this ban command is completely unconditional:
If the player isn't an admin, it will format the string with an empty name, but it'll ban the player nonetheless.
pawn Код:
CMD:ban(playerid, params[])
{
new id, reason[50], string[128], banned[MAX_PLAYER_NAME];
if(pInfo[playerid][Adminlevel] >= 3)
if(sscanf(params, "us[50]", id, reason))return SendClientMessage(playerid, -1, "USAGE: /ban [playerid] [reason(optional)]");
GetPlayerName(id, banned, sizeof(banned));
format(string, sizeof(string), "AdmCmd: %s has been banned by %s. reason: %s", banned, GetName(playerid), reason);
SendClientMessageToAll(COLOR_RED, string);
BanEx(id, reason);
return 1;
}