Squirrel/Server/Functions/Misc/KickPlayer

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(updated)
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|KickPlayer}}
 
This function kicks a player from the server
 
This function kicks a player from the server
  

Latest revision as of 10:34, 11 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function kicks a player from the server

[edit] Syntax

  1. bool KickPlayer( Player plr )

[edit] Arguments

  • plr - pointer of the player to kick

[edit] Example

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

  1.  
  2. function onPlayerJoin( player )
  3. {
  4. if ( player.Name != "Bob" )
  5. {
  6. MessagePlayer( "Your name isn't Bob! Only Bob is allowed on this server!.", player );
  7. KickPlayer( player );
  8. }
  9. }
  10.  

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox