• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Auto-Check Multi Clients (MC)

Gilahof

RepzorMe
Joined
Dec 11, 2007
Messages
87
Reaction score
1
Location
Brazil
The script will not affect players with access > 3 !

PHP:
<event type="login" name="check" script="check.lua"/>

Script:
PHP:
function getValuePos(array, value)
    for i = 1, #array do
        if array[i] == value then
          Ret = i
          break
        end  
    end
  return Ret or FALSE
end

function onLogin(cid)
  Online = getPlayersOnline()
  MCPlayers = {}
  PlayerIP = getPlayerIp(cid)
    for rem = 1, #Online do
        if Online[rem] == cid then
          table.remove(Online, getValuePos(Online, Online[rem]))
        end
    end
    for psid = 1, #Online do
      sid = Online[psid]
      SecundaryIP = getPlayerIp(sid)
        if getPlayerAccess(cid) >= 5 or getPlayerAccess(sid) >= 5 then
          return TRUE
        end
        if PlayerIP == SecundaryIP then
          table.insert(MCPlayers, 1, sid)          
        end    
    end
    if #MCPlayers > 0 then
        for pmcp = 1, #MCPlayers do
          mcp = MCPlayers[pmcp]
          Log = io.open(getDataDir().."logs/MC Players.txt", "a+")
          Log:write("Nome: "..getCreatureName(mcp).."\n")
          doPlayerPopupFYI(mcp, "You have been kicked because you are using Multi-Client.")
          doRemoveCreature(mcp)
          table.remove(MCPlayers, 1)
        end
      Log:write("Nome: "..getCreatureName(cid).."\n")
      doPlayerPopupFYI(cid, "You have been kicked because you are using Multi-Client.")
      doRemoveCreature(cid)
      table.remove(MCPlayers, 1)
      Log:write("Date: "..os.date("%d/%m/%y").."\n")
      Log:write("Hour: "..os.date("%d/%m/%y").."\n")
      Log:write("IP: "..PlayerIP.."\n\n\n")
      Log:close()
    end
  return TRUE
end

Credit to Skyen Hasus
 
Why you using a so long function for a simple anti mc script ? :confused:

Regards,
Shawak
 
In most servers you can simply do /mc to check.. But thanks for the release I guess.

What the script does is Removes any player that tries to MC.

But if you try and MC while lets say your Main is PZ itll kick both of you so its very buggy.
 
Back
Top