Scripting/Squirrel/Functions/Misc/KickPlayer

From VC-MP Wiki

Jump to: navigation, search

This function kicks a player from the server.

Syntax

bool KickPlayer( player playerObject )

Arguments

  • playerObject - This is an object representing the player to kick

Example

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

function onPlayerJoin( player )
{
     if ( player.Name() != "Bob" )
     {
          MessagePlayer( "Your name isn't Bob! Only Bob is allowed on this server!.", player );
          KickPlayer( player );
     }
}

Notes

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

Related Functions

Personal tools
squirrel scripting