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

Windows Looking for script against Asta Magebomb, help!

grand128

New Member
Joined
Jun 8, 2009
Messages
33
Reaction score
0
Hello

People crashing my TFS 3.5.0.
I think they are using Asta Magebomb, anyone can help me and post any script against it?
 
@up lol?
@grand


create a AntiMC.lua in
data/creaturescripts/scripts/

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

local config = {
        max = 1,     -- max chars with the same ip
        text = "Multi-Client is not allowed.",  -- 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})
                        doPlayerPopupFYI(cid, config.text)
                end
        end
        return TRUE
end

EDIT:

data/creaturescripts/creaturescripts.xml

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


Rep++ If i helped :) (This is tested on my own ot and working ^^)


Credits: Shawak
 
I tried that

Code:
local function gtfoMC(p)
    if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
        doRemoveCreature(p.pid)
    end
        return TRUE
end
function onLogin(cid)
    addEvent(gtfoMC, 1000, {pid = cid, max = 2})
    return TRUE
end

and

Code:
  local config = {
        seconds = 15,            -- in seconds
        onlyWithSameIP = "yes"  -- will work for all players ("no"), or only check player with same IP? ("yes")
}

--DONT MODIFY
config.onlyWithSameIP = getBooleanFromString(config.onlyWithSameIP)

local m_lastLogin, m_lastIP = 0, 0

function onLogin(cid)
        local timeNow, playerIP = os.time(), getPlayerIp(cid)
        if(m_lastLogin + config.seconds >= timeNow and
                (config.onlyWithSameIP == FALSE or m_lastIP == playerIP)) then
                return FALSE
        end

        m_lastIP = playerIP
        m_lastLogin = timeNow
        return TRUE
end


but I will try your script, then I edit post

@EDIT1
When 2. character try log in on the same IP, he log in and get kicked with your message from script, but on console I can see error:

Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/antiMc.lua:eek:nLogin

internalGetPlayerInfo(). Player not found
 
Back
Top