/ban :P
#2

Код:
if(strcmp(cmd, "/ban", true) == 0)
{
	if(PlayerInfo[playerid][Adminlevel] >= 3)
	{
		tmp = strtok(cmdtext,idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /ban [playerid] [reason]");
		new player1 = strval(tmp);
		new Reason[120];
		strmid(Reason,cmdtext,strlen(cmd)+strlen(tmp)+2,strlen(cmdtext));
		if(IsPlayerConnected(player1)) {
			GetPlayerName(player1, playername, sizeof(playername));  GetPlayerName(playerid, adminname, sizeof(adminname));
			format(string,sizeof(string),"You have banned %s from the server!(Reason: %s)", playername, Reason);
			SendClientMessage(playerid, COLOR_GREEN, string);
			format(string,sizeof(string),"Administrator %s has banned %s from the server!(Reason: %s)",adminname, playername, Reason);
			SendClientMessageToAll(COLOR_GREEN, string);
			printf("%s has banned %s from the server !(Reason: %s)",adminname, playername, Reason);
			Ban(player1);
		}else SendClientMessage(playerid, COLOR_RED, "This player is not connected");
	}else SendClientMessage(playerid, COLOR_RED, "Your admin level must be more than 2");
	return 1;
}
Reply


Messages In This Thread
/ban :P - by geerdinho8 - 06.05.2010, 13:01
Re: /ban :P - by Jefff - 06.05.2010, 13:07
Re: /ban :P - by geerdinho8 - 06.05.2010, 13:12
Re: /ban :P - by Jefff - 06.05.2010, 13:13
Re: /ban :P - by geerdinho8 - 06.05.2010, 13:36
Re: /ban :P - by [MWR]Blood - 06.05.2010, 14:22

Forum Jump:


Users browsing this thread: 1 Guest(s)