Squirrel/Server/Functions/Misc/BanPlayer

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 4: Line 4:
 
== Syntax ==
 
== Syntax ==
  
<code>bool BanPlayer( Player plr )</code>
+
<code>bool BanPlayer( Player plr, [BanType type] )</code>
  
 
== Arguments ==
 
== Arguments ==
  
 
* '''plr''' - Pointer of the player to ban
 
* '''plr''' - Pointer of the player to ban
 +
* '''type''' - The type of ban to add. This can be any of the BANTYPE_ constants. Defaults to BANTYPE_IP
  
 
== Example ==
 
== Example ==

Latest revision as of 09:38, 7 August 2014

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

This function bans a player from the server.

[edit] Syntax

  1. bool BanPlayer( Player plr, [BanType type] )

[edit] Arguments

  • plr - Pointer of the player to ban
  • type - The type of ban to add. This can be any of the BANTYPE_ constants. Defaults to BANTYPE_IP

[edit] 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.  

[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