Scripting/Squirrel/Functions/UnbanIP: 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
(Created page with "This function will unban an IP from the server. == Syntax == <pre>UnbanIP( ip )</pre> == Arguments == * ''string'' '''ip''' - The IP to be unbanned == Example == {{Scrip...")
 
Line 11: Line 11:
== Example ==
== Example ==


{{Scripting/Needs_Example}}
<source lang=squirrel>
function onPlayerCommand( player, cmd, text )
{
    if ( cmd == "unbanip" )
    {
        if ( !IsIPBanned( text ) == true )  MessagePlayer( "Provided IP '" + text + "' was not banned previously", player );
        else
        UnbanIP( text );
        MessagePlayer( "IP: " + text + " has been unbanned", player );
    }
}
</source>


=== Notes ===
=== Notes ===
 
Checks if [[Scripting/Squirrel/Functions/IsIPBanned|IsIPBanned]]( ..provided ip.. ), if returns true then triggers [[Scripting/Squirrel/Functions/UnbanIP|UnbanIP]]( ..provided ip.. ) when on event [[Scripting/Squirrel/Events/Player/onPlayerCommand|onPlayerCommand]].


== Related Functions ==
== Related Functions ==


{{Scripting/Squirrel/Functions/Administrative_Functions}}
{{Scripting/Squirrel/Functions/Administrative_Functions}}

Revision as of 17:52, 6 December 2015

This function will unban an IP from the server.

Syntax

UnbanIP( ip )

Arguments

  • string ip - The IP to be unbanned

Example

function onPlayerCommand( player, cmd, text )
{
    if ( cmd == "unbanip" )
    {
        if ( !IsIPBanned( text ) == true )  MessagePlayer( "Provided IP '" + text + "' was not banned previously", player );
        else
        UnbanIP( text );
        MessagePlayer( "IP: " + text + " has been unbanned", player );
    }
}

Notes

Checks if IsIPBanned( ..provided ip.. ), if returns true then triggers UnbanIP( ..provided ip.. ) when on event onPlayerCommand.

Related Functions