Squirrel/Server/Functions/Misc/BanPlayer
From Liberty Unleashed Wiki
(Difference between revisions)
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
This function bans a player from the server.
[edit] Syntax
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'
function onPlayerJoin( player ) { if ( player.Name == "Bob" ) { MessagePlayer( "NO BOBS ALLOWED!", player ); BanPlayer( player ); } }
[edit] Notes
The functions Player.Name, MessagePlayer and call onPlayerJoin were used in in this example. More info about there in the corresponding pages.