Squirrel/Server/Functions/Misc/KickPlayer
From Liberty Unleashed Wiki
(Difference between revisions)
m (Squirrel/Functions/Misc/KickPlayer moved to Squirrel/Server/Functions/Misc/KickPlayer: server-side scripting) |
(updated) |
||
Line 4: | Line 4: | ||
== Syntax == | == Syntax == | ||
− | <code>bool KickPlayer( | + | <code>bool KickPlayer( Player plr )</code> |
== Arguments == | == Arguments == | ||
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/Players/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:49, 27 November 2009
This function kicks a player from the server
Syntax
bool KickPlayer( Player plr )
Arguments
- plr - pointer of the player to kick
Example
This will kick a player on join if his name is not 'Bob'
function onPlayerJoin( player ) { if ( player.Name != "Bob" ) { MessagePlayer( "Your name isn't Bob! Only Bob is allowed on this server!.", player ); KickPlayer( player ); } }
Notes
The functions Player.Name, MessagePlayer and call onPlayerJoin were used in in this example. More info about there in the corresponding pages.