• 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 Tibia Client Crash when use /commands

1268995

Member
Joined
Sep 9, 2010
Messages
422
Reaction score
13
My tibia close when i use /commands.

commands.lua:

Code:
local config = {
    guildTalksEnabled = getBooleanFromString(getConfigValue('ingameGuildManagement'))
}

function onSay(cid, words, param, channel)
    local playerAccess, t = getPlayerAccess(cid), {}
    for i, talk in ipairs(getTalkActionList()) do
        if(not talk.hide and playerAccess >= talk.access) then
            local tmp = talk.words:sub(1, 1):trim()
            if((guildTalksEnabled or (talk.words ~= "!joinguild" and talk.words ~= "!createguild")) and (tmp == "!" or tmp == "/")) then
                table.insert(t, talk)
            end
        end
    end

    table.sort(t, function(a, b) return a.access > b.access end)
    local lastAccess, str = -1, ""
    for i, talk in ipairs(t) do
        local line = ""
        if(lastAccess ~= talk.access) then
            if(i ~= 1) then
                line = "\n"
            end
            lastAccess = talk.access
        end
        str = str .. line .. talk.words .. "\n"
    end

    doShowTextDialog(cid, 2160, str)
    return true
end
 
If you have too much text it will cause a debug. You will have to split it into multiple windows if you have that many commands.
 
post your debug log from the client

Debug Log:

2eq4f4k.jpg

If you have too much text it will cause a debug. You will have to split it into multiple windows if you have that many commands.

Really? Because in windows it not give debug... debug is only when i putted my server on linux.. it make senses?
 
Instead of using
doShowTextDialog(cid, 2160, str)

Can you change it to
print(str)

Then paste what it prints out on here.

But yes... too much text in those windows can debug. Not sure why it would be any different in linux than windows though so maybe it is a different problem.
 
Instead of using
doShowTextDialog(cid, 2160, str)

Can you change it to
print(str)

Then paste what it prints out on here.

But yes... too much text in those windows can debug. Not sure why it would be any different in linux than windows though so maybe it is a different problem.

Appeared on console all comands player can use.

Edit: about linux, i compiled with a strange source.. maybe can be it!
 
Appeared on console all comands player can use.
Yea obviously... I wanted you to paste it here so I could see how much text there was.

Edit: about linux, i compiled with a strange source.. maybe can be it!
Really? Did you actually just tell me "worked fine on windows" but you are using a completely different source on linux...................

Anyway, if I am not mistaken and it really is due to the text limit then it is very possible that the source you have for windows detects if it is too much text and prevents all of it from being sent (thus no debug) while the one for linux has no such feature. It is similar to how bots used to be able to send more text than possible in default chat thus causing players to debug but nowadays the server just blocks messages that are too large.
 
Back
Top