Squirrel/Server/Functions/Misc/BanIP
From Liberty Unleashed Wiki
(Difference between revisions)
(→Example) |
|||
Line 13: | Line 13: | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function onPlayerCommand( | + | function onPlayerCommand ( pPlayer, szCommand, szArguments ) |
{ | { | ||
− | if ( | + | if ( szCommand == "banip" ) |
+ | { | ||
+ | BanIP ( szArguments ); | ||
+ | MessagePlayer ( "The IP: " + szArguments + " has been banned.", pPlayer, 255, 255, 255 ); | ||
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> |
Revision as of 11:41, 22 August 2013
This function bans the given IP address from joining the server.
Syntax
bool BanIP( string IP )
Arguments
- IP - The IP address to be banned
Example
function onPlayerCommand ( pPlayer, szCommand, szArguments ) { if ( szCommand == "banip" ) { BanIP ( szArguments ); MessagePlayer ( "The IP: " + szArguments + " has been banned.", pPlayer, 255, 255, 255 ); return 1; }
Notes
This function is used to ban the IP specified.