Scripting/Squirrel/Functions/BanIP: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
BrYaN FuRy (talk | contribs) No edit summary |
ProsuWANTED (talk | contribs) No edit summary |
||
Line 3: | Line 3: | ||
== Syntax == | == Syntax == | ||
<pre>BanIP( | <pre>BanIP( ip )</pre> | ||
== Arguments == | == Arguments == | ||
Line 16: | Line 16: | ||
if ( cmd == "banip" ) | if ( cmd == "banip" ) | ||
{ | { | ||
BanIP( text ); | |||
MessagePlayer( "You have banned IP: " + text, player ); | MessagePlayer( "You have banned IP: " + text, player ); | ||
} | } | ||
} | } | ||
Line 24: | Line 24: | ||
=== Notes === | === Notes === | ||
Call [[Scripting/Squirrel/Events/Player/onPlayerCommand|onPlayerCommand]] and [[Scripting/Squirrel/Functions/MessagePlayer|MessagePlayer]] | Call [[Scripting/Squirrel/Events/Player/onPlayerCommand|onPlayerCommand]] and function [[Scripting/Squirrel/Functions/MessagePlayer|MessagePlayer]] were used in this example. More info about them in the corresponding pages. | ||
Revision as of 13:45, 1 August 2015
This function will ban an IP from the server.
Syntax
BanIP( ip )
Arguments
- string ip - This is the IP address to be banned
Example
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "banip" )
{
BanIP( text );
MessagePlayer( "You have banned IP: " + text, player );
}
}
Notes
Call onPlayerCommand and function MessagePlayer were used in this example. More info about them in the corresponding pages.