Scripting/Squirrel/Functions/IsIPBanned: 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 check if an IP is banned from the server. == Syntax == <pre>IsIPBanned( ip )</pre> == Arguments == * ''string'' '''ip''' - The IP to be checked == Retu...")
 
No edit summary
Line 14: Line 14:


== Example ==
== Example ==
<source lang="squirrel">
function onPlayerCommand( player, command, arguments )
{
if (cmd == "unbanip")
{
if(!IsIPBanned(text) == true)
{
ClientMessage("Provided IP '" + text + "' was not banned previously",player,255,255,255);
}
else
{
ClientMessage("Provided IP '" + text + "' is banned.",player,255,255,255);
}
}
return 1;
}
</source>


{{Scripting/Needs_Example}}
== Notes ==
 
* Callbacks [[onPlayerCommand]] were used in this example. More info about in the corresponding page.
=== Notes ===
 


== Related Functions ==
== Related Functions ==
{{Scripting/Squirrel/Functions/Administrative_Functions}}
{{Scripting/Squirrel/Functions/Administrative_Functions}}

Revision as of 18:07, 23 April 2016

This function will check if an IP is banned from the server.

Syntax

IsIPBanned( ip )

Arguments

  • string ip - The IP to be checked

Return value

  • bool isbanned - true or false

Example

function onPlayerCommand( player, command, arguments )
{
	if (cmd == "unbanip")
	{
		if(!IsIPBanned(text) == true) 
		{
			ClientMessage("Provided IP '" + text + "' was not banned previously",player,255,255,255);
		}
		else
		{
			ClientMessage("Provided IP '" + text + "' is banned.",player,255,255,255);
		}
	}
	return 1;
}

Notes

  • Callbacks onPlayerCommand were used in this example. More info about in the corresponding page.

Related Functions