Squirrel/Server/Functions/Misc/BanIP

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
Line 13: Line 13:
  
 
<code lang="squirrel">
 
<code lang="squirrel">
function onPlayerCommand( player, command, text )
+
function onPlayerCommand ( pPlayer, szCommand, szArguments )
 
{
 
{
if ( command == "banip" ) BanIP( text );
+
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

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function bans the given IP address from joining the server.

Syntax

  1. bool BanIP( string IP )

Arguments

  • IP - The IP address to be banned

Example

  1.  
  2. function onPlayerCommand ( pPlayer, szCommand, szArguments )
  3. {
  4. if ( szCommand == "banip" )
  5. {
  6. BanIP ( szArguments );
  7. MessagePlayer ( "The IP: " + szArguments + " has been banned.", pPlayer, 255, 255, 255 );
  8.  
  9. return 1;
  10. }
  11.  

Notes

This function is used to ban the IP specified.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox