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
No edit summary |
|||
Line 34: | Line 34: | ||
== Related Functions == | == Related Functions == | ||
{{Scripting/Squirrel/Functions/Administrative_Functions}} | {{Scripting/Squirrel/Functions/Administrative_Functions}} | ||
[[Category:Scripting/Squirrel/Functions/Administrative_Functions]] |
Revision as of 17:58, 30 January 2017
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 == "ban" )
{
if ( !text )
{
MessagePlayer( "[Syntax] - /ban <Nick/ID> <Reason>", player );
}
else
{
local params = split( text, " " ), plr = FindPlayer( params[0] ), reason = params[1];
Message( "[#EE82EE]** Admin " + player.Name + " Banned " + plr.Name + " Reason: " + reason );
MessagePlayer( " You have been banned. Reason: " + reason + " by: " + player.Name , plr );
BanPlayer( plr );
}
}
return 1;
}
Notes
Call onPlayerCommand were used in this example. More info about them in the corresponding pages.