How to ban an IP from your server? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to ban an IP from your server? (
/showthread.php?tid=399677)
How to ban an IP from your server? -
Elysian` - 15.12.2012
Title says it..
And when you send the Rcon command to reload bans, does it get rid of all the bans or just the IP you chose to unban?
Re: How to ban an IP from your server? -
Djole1337 - 15.12.2012
Just IP that you unbanned/banned. Example: /rcon banip 127.0.0.1 /rcon reloadbans.
Re: How to ban an IP from your server? -
Elysian` - 15.12.2012
So would you send the RconCommand BanIP?
Re: How to ban an IP from your server? -
Djole1337 - 15.12.2012
Here's an example:
pawn Код:
CMD:banip(playerid, params[])
{
new
iStr[32],
IP[16]
;
if(sscanf(params, "s[24]", IP)) return SendClientMessage(playerid, -1, "Usage: /banip [IP]");
format(iStr, sizeof(iStr),"banip %s", IP);
SendRconCommand(iStr);
SendRconCommand("reloadbans");
return 1;
}
Re: How to ban an IP from your server? -
Elysian` - 15.12.2012
Ah okay.. And then if you was to unban an IP it'd be:
pawn Код:
CMD:unbanip(playerid, params[])
{
new
iStr[32],
IP[16]
;
if(sscanf(params, "s[24]", IP)) return SendClientMessage(playerid, -1, "Usage: /unbanip [IP]");
format(iStr, sizeof(iStr),"unbanip %s", IP);
SendRconCommand(iStr);
SendRconCommand("reloadbans");
return 1;
}
Re: How to ban an IP from your server? -
Djole1337 - 15.12.2012
Yes, that's it.
Re: How to ban an IP from your server? -
Elysian` - 15.12.2012
Thanks;
Another question..
If you done /ban playerid
how would you do it so it'd automatically ban the players IP?
Re: How to ban an IP from your server? -
Djole1337 - 15.12.2012
Ban(playerid); = Bans players IP.
Re: How to ban an IP from your server? -
Tanush123 - 15.12.2012
well you do know that all servers has /rcon banip and /rcon unbanip, right..?
Re: How to ban an IP from your server? -
Elysian` - 15.12.2012
Yes.. But I wouldn't give my administrative team my RCON password...