Don't like ads? PRO users don't see any ads ;-)
Guest

Anti-MC

By: a guest on Jan 20th, 2012  |  syntax: Lua  |  size: 0.52 KB  |  hits: 127  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. local config = {
  2.         max = 1, -- How many should be allowed? [1 = default]
  3.         allowedIP = {"127.0.0.1", "another IP"} -- People with this IP will be able to MC.
  4. }
  5.  
  6. local function antiMC(p)
  7.         if(#getPlayersByIp(getPlayerIp(p.pid)) >= p.max) then
  8.                 doRemoveCreature(p.pid)
  9.         end
  10. end
  11. -- Script by J.Dre --
  12. function onLogin(cid)
  13.         if(getPlayerGroupId(cid) < 2) then
  14.                 if(not isInArray(allowedIP, doConvertIntegerToIp(getPlayerIp(cid)))) then
  15.                         addEvent(antiMC, 150, {pid = cid, max = config.max + 1})
  16.                 end
  17.         end
  18.  
  19.         return true
  20. end