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

ExtendedOpcode error (nil value)

subyth

New Member
Joined
May 1, 2009
Messages
56
Reaction score
4
I have a problem with the Op Code.
My Server is OTX 0.4 - from github version 8.6
My Otclient is V8

CreatureScript - OpCode 52:
Code:
OPCODE_LANGUAGE = 1

function onExtendedOpcode(cid, opcode, buffer)
    if(opcode == OPCODE_LANGUAGE) then
        -- otclient language
        if(buffer == 'de' or buffer == 'en' or buffer == 'es' or buffer == 'pl' or buffer == 'pt' or buffer == 'sv') then
            -- example, setting player language, because otclient is multi-language...
            --doCreatureSetStorage(cid, CREATURE_STORAGE_LANGUAGE, buffer)
        end

    elseif(opcode == 52) then
        if getPlayerStorageValue(cid, 19010) >= 0 then
            doSendPlayerExtendedOpcode(cid, 52, getPlayerStorageValue(cid, 19010))
        end

    else
        print("[ERROR] Received invalid opcode of header `" .. (opcode or '?') .. "` from (`" .. (getPlayerName(cid) or '?') .. "`)")
        table.debug({buffer}, "opcode `" .. (opcode or '?') .. "`")
    end
end

ERROR:
Sem título.png

If I change the Op code to 201:
Sem título2.png


My Code in MODULE OTC:
Code:
  ProtocolGame.registerExtendedOpcode(52, function (protocol, opcode, buffer)
        print("TEST")     
--        ticks = tonumber(buffer) or 0     
    end)
 
Moved your thread to support.

Nil = does not exist.
So in this case your server doesn't have that function, I have no clue if OTX even supports OTC.
If they don't you most likely are trying to run a TFS datapack with an OTX server, so try to remove the script (you won't notice anything if the code you are running is what you posted)

If you need / want to use that function upgrade to TFS. or edit the source code and recompile to support OTC.
 
Back
Top