Scripting/Squirrel/Functions/BanIP: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
No edit summary
No edit summary
Line 3: Line 3:
== Syntax ==
== Syntax ==


<pre>BanIP( ip )</pre>
<pre>void BanIP( string ip )</pre>


== Arguments ==
== Arguments ==


* ''string'' '''ip''' - The IP to be banned
* ''string'' '''ip''' - This is the IP address to be banned


== Example ==
== Example ==


{{Scripting/Needs_Example}}
<source lang=squirrel>
function onPlayerCommand( player, cmd, text )
{
    if ( cmd == "banip" )
    {
        MessagePlayer( "You have banned IP: " + text, player );
        BanIP( text );
    }
}
</source>


=== Notes ===
=== Notes ===
Call [[Scripting/Squirrel/Events/Player/onPlayerCommand|onPlayerCommand]] and [[Scripting/Squirrel/Functions/MessagePlayer|MessagePlayer]] function were used in this example. More info about them in the corresponding pages.





Revision as of 15:23, 25 July 2014

This function will ban an IP from the server.

Syntax

void BanIP( string ip )

Arguments

  • string ip - This is the IP address to be banned

Example

function onPlayerCommand( player, cmd, text )
{
    if ( cmd == "banip" )
    {
        MessagePlayer( "You have banned IP: " + text, player );
        BanIP( text );
    }
}

Notes

Call onPlayerCommand and MessagePlayer function were used in this example. More info about them in the corresponding pages.


Related Functions