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
No edit summary
Line 14: Line 14:
function onPlayerCommand( player, cmd, text )
function onPlayerCommand( player, cmd, text )
{
{
    if ( cmd == "unbanip" )
if (cmd == "unbanip")
    {
{
        if ( !IsIPBanned( text ) == true ) MessagePlayer( "Provided IP '" + text + "' was not banned previously", player );
if(!IsIPBanned(text) == true)  
        else
{
        UnbanIP( text );
ClientMessage("Provided IP '" + text + "' was not banned previously",player,255,255,255);
        MessagePlayer( "IP: " + text + " has been unbanned", player );
}
    }
else
{
UnbanIP(text);
ClientMessage("Unbanned IP: " + text,player,255,255,255);
}
}
}
}
</source>
</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]].
Call [[onPlayerCommand]] were used in this example. More info about them in the corresponding pages.


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


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

Revision as of 18:15, 23 April 2016

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) 
		{
			ClientMessage("Provided IP '" + text + "' was not banned previously",player,255,255,255);
		}
		else
		{
			UnbanIP(text);
			ClientMessage("Unbanned IP: " + text,player,255,255,255);
		}
	}
}

Notes

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

Related Functions