/ban help
#2

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;
}
Reply


Messages In This Thread
/ban help - by nicholasramdhan - 24.03.2015, 06:16
Re: /ban help - by X337 - 24.03.2015, 06:21
Re: /ban help - by JeaSon - 24.03.2015, 06:25
Re: /ban help - by nicholasramdhan - 24.03.2015, 06:30
Re: /ban help - by JeaSon - 24.03.2015, 06:34
Re: /ban help - by Sew_Sumi - 24.03.2015, 06:49

Forum Jump:


Users browsing this thread: 3 Guest(s)