24.03.2015, 06:21
Try this :
Код:
CMD:ban(playerid, params[]) { if(!IsLoggedEx(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login before using any commands."); if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid)) { new giveplayerid, reason[250], log[250]; if(!sscanf(params, "us[250]", giveplayerid, reason)) { if(!IsPlayerConnected(giveplayerid)) { SendClientMessage(playerid, COLOR_WHITE, "That player is not connected."); } else { if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you."); new string[256]; format(string, sizeof(string), "System: %s has been banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason); SendClientMessageToAll(COLOR_ORANGE, string); format(log, sizeof(log), "BAN: %s was banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason); Log("Logs/Ban.log", log); PlayerInfo[giveplayerid][pBanned] = 1; AddBan(GetPlayerIpEx(giveplayerid)); } } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Ban [Player ID] [Reason]"); } } return 1; }