Squirrel/Server/Functions/Misc/BanPlayer
From Liberty Unleashed Wiki
(Difference between revisions)
m (Squirrel/Functions/Misc/BanPlayer moved to Squirrel/Server/Functions/Misc/BanPlayer: server-side scripting) |
(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 | + | * '''plr''' - Pointer of the player to ban |
== Example == | == Example == | ||
Line 15: | Line 15: | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function | + | function onPlayerJoin( player ) |
{ | { | ||
if ( player.Name == "Bob" ) | if ( player.Name == "Bob" ) | ||
Line 27: | Line 27: | ||
=== Notes === | === Notes === | ||
− | The | + | 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
bool BanPlayer( player plr )
Arguments
- plr - Pointer of the player to ban
Example
This will ban anybody called 'Bob'
function onPlayerJoin( player ) { if ( player.Name == "Bob" ) { MessagePlayer( "NO BOBS ALLOWED!", player ); BanPlayer( player ); } }
Notes
The functions Player.Name, MessagePlayer and call onPlayerJoin were used in in this example. More info about there in the corresponding pages.