01.01.2013, 13:58
Hello.
The problem is that it will always show me "The player id you typed... "
How do I fix this?
pawn Код:
CMD:ban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 5) return
SendClientMessage(playerid, COLOR_ERROR, "[ERROR]{FFFFFF} Only level 5 admins can use this command");
new id,
reason[64];
if(sscanf(params, "us[64]", id, reason)) return
SendClientMessage(playerid, COLOR_ORANGE, "[USAGE]{FFFFFF} ban <id/name> <reason>");
if(id == INVALID_PLAYER_ID) return
SendClientMessage(playerid, COLOR_ERROR, "[ERROR]{FFFFFF} The player id you typed doesn't exist.");
if(PlayerInfo[id][pBanned] = 1) return
SendClientMessage(playerid, COLOR_ERROR, "[ERROR]{FFFFFF} The player id you typed is already banned.");
new pName[MAX_PLAYER_NAME],
pName2[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(id, pName2, sizeof(pName2));
format(string, sizeof(string), "[BAN] Admin '%s' permanently banned '%s' for: %s", pName, id, reason);
SendClientMessageToAll(COLOR_LIGHTGREEN, string);
PlayerInfo[id][pBanned] = 1;
Ban(id);
return 1;
}
How do I fix this?