Scripting/Squirrel/Functions/Misc/BanPlayer

From VC-MP Wiki

Jump to: navigation, search

This function kicks a player from the server and bans their IP address.

Syntax

bool BanPlayer( player plr )

Arguments

  • plr - This is the pointer of the player to be banned

Example

This will ban a player on join if his name is not 'Bob'

function onPlayerJoin( player )
{
     if ( player.name != "Bob" )
     {
          MessagePlayer( "Your name still isn't Bob! Be bant", player );
          BanPlayer( player );
     }
}

Notes

The functions player.Name, MessagePlayer and call onPlayerJoin were used in in this example. More info about there in the corresponding pages.

Related Functions

Personal tools
squirrel scripting