Ban/Kick Commands With Name..
#6

Quote:
Originally Posted by [AC
Etch ]
Quote:
Originally Posted by NPTechStudios
Do you want a command that can Ban and or Kick a Player?

If so, use this,

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/ban (playerid)", cmdtext, true, 10) == 0)
	{
		if(IsPlayerAdmin(playerid)) // This makes only RCON admins allowed to use this command.
		{
		Ban(playerid); //Bans the player.
		}
		else // If the person using command is not RCON
		{
		SendClientMessage(playerid, /*Your Color Here*/ , "The command entered is for RCON admins only!"); // Message sent if not RCON
		return 1;
		}
	}
	return 0;
 }
 if (strcmp("/kick (playerid)", cmdtext, true, 10) == 0)
	{
		if(IsPlayerAdmin(playerid)) // This makes only RCON admins allowed to use this command.
		{
		Kick(playerid); //Bans the player.
		}
		else // If the person using command is not RCON
		{
		SendClientMessage(playerid, /*Your Color Here*/ , "The command entered is for RCON admins only!"); // Message sent if not RCON
		return 1;
		}
	}
	return 0;
 }
Hope this helps... I think there is 1 error in the code, but its an easy fix.
that will ban/kick the player who write the command
Ahh. Okay. Wow, I guess I wasn't thinking clearly.
Reply


Messages In This Thread
Ban/Kick Commands With Name.. - by SpanishMan - 02.03.2010, 18:31
Re: Ban/Kick Commands With Name.. - by Scenario - 02.03.2010, 18:40
Re: Ban/Kick Commands With Name.. - by Jefff - 02.03.2010, 18:45
Re: Ban/Kick Commands With Name.. - by Miguel - 02.03.2010, 18:51
Re: Ban/Kick Commands With Name.. - by aircombat - 02.03.2010, 18:52
Re: Ban/Kick Commands With Name.. - by Scenario - 02.03.2010, 18:59
Re: Ban/Kick Commands With Name.. - by SpanishMan - 02.03.2010, 20:17
Re: Ban/Kick Commands With Name.. - by Jefff - 02.03.2010, 20:31

Forum Jump:


Users browsing this thread: 1 Guest(s)