• 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!

Lua Help with crash

Bondy

New Member
Joined
Mar 28, 2009
Messages
282
Reaction score
1
There's a guy in my ot that keeps logging in with 10+ chars and dance and spam. The ot crashes with this. Can someone post me a solution in simple steps, what to do and how to do it? thanks
 
make AntiMC.lua in data\creaturescripts\scripts:

Code:
--[[
     Anti MC
     by Shawak
]]--

local config = {
        max = 2,     -- max chars with the same ip
        text = "Multi-Client is not allowed. You use it at your own risk.",  -- text on kick
        group_id = 1  -- only kick player with group id 1 (normal players)
}

local accepted_ip_list = {}    -- list of ip's then can use MC

local function antiMC(p)
        if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
                doRemoveCreature(p.pid)
        end
        return TRUE
end

function onLogin(cid)
        if getPlayerGroupId(cid) <= config.group_id then
                if isInArray(accepted_ip_list,getPlayerIp(cid)) == FALSE then 
                        addEvent(antiMC, 1000, {pid = cid, max = config.max+1})
                       
                end
        end
        return TRUE
end

and add to creaturescript.xml

Code:
      <event type="login" name="AntiMC" event="script" value="antiMc.lua"/>
 
Back
Top