Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[LINUX ONLY] Ban the ip from the Server by Iptables
#1
Bug 
This is just a sample and only works on Linux,keep that in mind. If you get the idea, you can improve it.

Code:
addhook("say","_gban")
function _gban(id,txt)
if txt:sub(1,5)=="!gban" then
        if player(id,"usgn") == 32376 then --Change 32376 with your USGN Id
            t = tonumber(txt:sub(7,8))
            if tonumber(t) == nil then return 1 end --if id is not stated then stop
            if not player(t,"exists") then return 1 end --if stated id does not exist in game
os.execute("iptables -A INPUT -s "..player(t,"ip").." -j DROP") --drop that ip from the server, won't be able to see or join the sv
            return 1
        end
    end    
end
[Image: bcy.jpg]

- United we stand, divided we fall. -
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Bug Blocking Radio Menus by Server-side BcY 2 671 16-08-2018, 07:53 PM
Last Post: BcY

Forum Jump:


Users browsing this thread: 1 Guest(s)