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

anti multiclient MC

Converted to TFS 1.x
Tested on TFS 1.2

Lua:
local config = {
    max = 4,
    text = "Only 4 characters allowed per IP.",
    group_id = 1,  -- it apply the limit to players with a group less than or equal to the id
    milliseconds_before_kick_to_read_popup = 3000 -- 3000 = 3 seconds
}
local accepted_ip_list = {"127.0.0.1", "255.255.255.255"}  -- here put the Ip you whant to be allowed to use Mc/Magebomb..
function delayedKickPlayerMCLimit(cid)
    doRemoveCreature(cid)
end

function onLogin(player)
    if player:getGroup():getId() <= config.group_id then
        if isInArray(accepted_ip_list, Game.convertIpToString(player:getIp())) == false then
            if #getPlayersByIPAddress(player:getIp()) > config.max then
                addEvent(delayedKickPlayerMCLimit, config.milliseconds_before_kick_to_read_popup, player:getId())
                player:popupFYI(config.text)
            end
        end
    end
    return true
end
 
Last edited:
Back
Top