Advertisement
Guest User

muteip

a guest
Jul 17th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. ipmute = {}
  2. function hc.moderation.muteip_say_command(p, arg)
  3.     local array = explode(" ", arg)
  4.     if array[1]~=nil and array[2]~=nil and player(array[1],"exists") then
  5.         msg2(p,array[1]..array[2])
  6.         if tonumber(array[2]) > 5 or tonumber(array[2]) < 1 then array[2] = 5 end
  7.         table.insert(ipmute, player(tonumber(array[1]),"ip"))
  8.         timer(tonumber(array[2])*1000*60,"remove_ip",player(tonumber(array[1]),"ip"))
  9.     end
  10. end
  11.  
  12. function hc.moderation.check_ipmuted(id,msg)
  13.     local ip = player(id,"ip")
  14.     for key,value in pairs(ipmute) do
  15.         if ip == value then return 1 end
  16.     end
  17. end
  18.  
  19. function remove_ip(ip)
  20.     for key,value in pairs(ipmute) do
  21.         if value == ip then table.remove(ipmute, key) end
  22.     end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement