Squirrel/Server/Functions/Misc/BanPlayer
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This function bans a player from the server == Syntax == <code>bool BanPlayer( int id )</code> == Arguments == * '''id''' - ID of the player to kick == Example == This will...) |
m |
||
Line 4: | Line 4: | ||
== Syntax == | == Syntax == | ||
− | <code>bool BanPlayer( | + | <code>bool BanPlayer( player plr )</code> |
== Arguments == | == Arguments == | ||
− | * ''' | + | * '''plr''' - Pointer of the player to kick |
== Example == | == Example == | ||
Line 15: | Line 15: | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function OnPlayerJoin( | + | function OnPlayerJoin( player ) |
{ | { | ||
− | if ( | + | if ( player.Name == "Bob" ) |
{ | { | ||
− | MessagePlayer( "NO BOBS ALLOWED!", | + | MessagePlayer( "NO BOBS ALLOWED!", player ); |
− | BanPlayer( | + | BanPlayer( player ); |
} | } | ||
} | } |
Revision as of 20:35, 31 March 2009
This function bans a player from the server
Syntax
bool BanPlayer( player plr )
Arguments
- plr - Pointer of the player to kick
Example
This will ban anybody called 'Bob'
function OnPlayerJoin( player ) { if ( player.Name == "Bob" ) { MessagePlayer( "NO BOBS ALLOWED!", player ); BanPlayer( player ); } }
Notes
The calls OnPlayerJoin and MessagePlayer were used in in this example. More info about there in the corresponding pages.