• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Anti mc active by talkaction

_M4G0_

Intermediate OT User
Joined
Feb 6, 2016
Messages
550
Solutions
17
Reaction score
108
Hello i have this script for anti-mc, but i not active all time i need active on world boss

LUA:
local AccPerIp = 1
function onLogin(player)
    local mc = 0
    for _, verificar in ipairs(Game.getPlayers()) do
        if player:getIp() == verificar:getIp() then
            mc = mc + 1
            if mc > AccPerIp then
             player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only login one characters per IP.\nYou'll be disconnected in 3 seconds.")
        addEvent(function(playerId)
         local player = Player(playerId)
         if player then
           player:remove()
         end
       end, 3000, player:getId())
   end
    
        end
    end
    return true
end

and i have changed /mccheck for kick mc

LUA:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Multiclient Check List:")

    local ipList = {}
    local players = Game.getPlayers()
    for i = 1, #players do
        local tmpPlayer = players[i]
        local ip = tmpPlayer:getIp()
        if ip ~= 0 then
            local list = ipList[ip]
            if not list then
                ipList[ip] = {}
                list = ipList[ip]
            end
            list[#list + 1] = tmpPlayer
        end
    end

    for ip, list in pairs(ipList) do
        local listLength = #list
        if listLength > 1 then
            local tmpPlayer = list[1]
            local message = ("%s: %s [%d]"):format(Game.convertIpToString(ip), tmpPlayer:getName(), tmpPlayer:getLevel())
            for i = 2, listLength do
                tmpPlayer = list[i]
                message = ("%s, %s [%d]"):format(message, tmpPlayer:getName(), tmpPlayer:getLevel())
        addEvent(function(playerId)
         local tmpPlayer = Player(playerId)
         if tmpPlayer then
           tmpPlayer:remove()
         end
       end, 3000, tmpPlayer:getId())
            end
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, message .. ".")
        end
    end
    return false
end
is possible use /mccheck for activate anti mc script ?
TFS 1.2
 
Last edited:
he's implying that he cannot understand what you're asking help with
i do not understand either, try to clarify what you want
if i use /mccheck for disconnect all mc and then activate the second script for players dont enter using the same ip
 
Last edited:

Similar threads

Back
Top