Squirrel/Server/Functions/Misc/BanPlayer

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(updated)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
This function bans a player from the server
+
This function bans a player from the server.
  
 
== Syntax ==
 
== Syntax ==
Line 8: Line 8:
 
== Arguments ==
 
== Arguments ==
  
* '''plr''' - Pointer of the player to kick
+
* '''plr''' - Pointer of the player to ban
  
 
== Example ==
 
== Example ==
Line 15: Line 15:
  
 
<code lang="squirrel">
 
<code lang="squirrel">
function OnPlayerJoin( player )
+
function onPlayerJoin( player )
 
{
 
{
 
     if ( player.Name == "Bob" )
 
     if ( player.Name == "Bob" )
Line 27: Line 27:
 
=== Notes ===
 
=== Notes ===
  
The calls [[Squirrel/Events/Player/OnPlayerJoin|OnPlayerJoin]] and [[Squirrel/Functions/Misc/MessagePlayer|MessagePlayer]] were used in in this example. More info about there in the corresponding pages.
+
The functions [[Squirrel/Server/Functions/Players/Name|Player.Name]], [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and call [[Squirrel/Server/Events/Player/onPlayerJoin|onPlayerJoin]] were used in in this example. More info about there in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
{{Squirrel/Functions/Misc}}
+
{{Squirrel/Server/Functions/Misc}}

Revision as of 01:45, 27 November 2009

This function bans a player from the server.

Syntax

  1. bool BanPlayer( player plr )

Arguments

  • plr - Pointer of the player to ban

Example

This will ban anybody called 'Bob'

  1.  
  2. function onPlayerJoin( player )
  3. {
  4. if ( player.Name == "Bob" )
  5. {
  6. MessagePlayer( "NO BOBS ALLOWED!", player );
  7. BanPlayer( player );
  8. }
  9. }
  10.  

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
Namespaces

Variants
Actions
Navigation
scripting
Toolbox