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

HELP! Block the MC only from a Client

adrianootavares

New Member
Joined
Jul 23, 2012
Messages
112
Reaction score
4
Location
Salvador - Bahia - Brasil
Lua:
local AccPorIp = 1

function onLogin(player)
    if player:getClient().version == 1000 then
        local mc = 0
        for _, verificar in ipairs(Game.getPlayers()) do
            if player:getIp() == verificar:getIp() then
                mc = mc + 1
                if mc > AccPorIp then return false end
            end
        end
    end
 
    return true
end


I wanted to block the MC only from CLIENT 10
I already have a script that blocks the MC but it blocks everyone I just wanted from the client 10

- Evil Puncker

sorry, I tried it today and it is not working
 
Solution
Use:
if player:getClient().os <= 3 then
Because this is the correct client os enums:
Code:
enum OperatingSystem_t : uint8_t {
    CLIENTOS_NONE = 0,

    CLIENTOS_LINUX = 1,
    CLIENTOS_WINDOWS = 2,
    CLIENTOS_FLASH = 3,

    CLIENTOS_NEW_LINUX = 4,
    CLIENTOS_NEW_WINDOWS = 5,
    CLIENTOS_NEW_MACOS = 6,

    CLIENTOS_OTCLIENT_LINUX = 10,
    CLIENTOS_OTCLIENT_WINDOWS = 11,
    CLIENTOS_OTCLIENT_MAC = 12,
}
1-3 means old client, 4-6 means new qt client

Also I have a question, why people say client 10 when they mean the client 11.00?
Client 10 were released in 2013 and client 11 in 2016, that's the reason why your script don't work simply because it is 1100 not 1000.
Lua:
local AccPorIp = 1

function onLogin(player)
    if player:getClient().version == 1000 then
        local mc = 0
        for _, verificar in ipairs(Game.getPlayers()) do
            if player:getIp() == verificar:getIp() then
                mc = mc + 1
                if mc > AccPorIp then return false end
            end
        end
    end

    return true
end


I wanted to block the MC only from CLIENT 10
I already have a script that blocks the MC but it blocks everyone I just wanted from the client 10

- Evil Puncker

sorry, I tried it today and it is not working


Try to change Line 4, player:getClient().version == 1000 to player:getClient().os < 10
Anything lower than 10 is not OTC.

C++:
enum OperatingSystem_t : uint8_t {
    CLIENTOS_NONE = 0,

    CLIENTOS_LINUX = 1,
    CLIENTOS_WINDOWS = 2,
    CLIENTOS_FLASH = 3,

    CLIENTOS_OTCLIENT_LINUX = 10,
    CLIENTOS_OTCLIENT_WINDOWS = 11,
    CLIENTOS_OTCLIENT_MAC = 12,
};
 
Then I’m not sure what you mean.
You use tibia12 and tibia10 clients?
Then player:getClient().version == 1000 should work.
Or you need to block client 10.00 to 10.99?
 
Add print(player:getClient().version) and try login with tibia12 and tibia10, what result you get in console?
 
Use:
if player:getClient().os <= 3 then
Because this is the correct client os enums:
Code:
enum OperatingSystem_t : uint8_t {
    CLIENTOS_NONE = 0,

    CLIENTOS_LINUX = 1,
    CLIENTOS_WINDOWS = 2,
    CLIENTOS_FLASH = 3,

    CLIENTOS_NEW_LINUX = 4,
    CLIENTOS_NEW_WINDOWS = 5,
    CLIENTOS_NEW_MACOS = 6,

    CLIENTOS_OTCLIENT_LINUX = 10,
    CLIENTOS_OTCLIENT_WINDOWS = 11,
    CLIENTOS_OTCLIENT_MAC = 12,
}
1-3 means old client, 4-6 means new qt client

Also I have a question, why people say client 10 when they mean the client 11.00?
Client 10 were released in 2013 and client 11 in 2016, that's the reason why your script don't work simply because it is 1100 not 1000.
 
Solution
Lua:
local AccPorIp = 1
function onLogin(player)
   if player:getClient().os <= 3 then
        local mc = 0
        for _, verificar in ipairs(Game.getPlayers()) do
            if player:getIp() == verificar:getIp() then
                mc = mc + 1
                if mc > AccPorIp then return false end
            end
        end
    end

    return true
end

Complete Script!
 
Back
Top