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:
ERROR:
If I change the Op code to 201:
My Code in MODULE OTC:
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:
If I change the Op code to 201:
My Code in MODULE OTC:
Code:
ProtocolGame.registerExtendedOpcode(52, function (protocol, opcode, buffer)
print("TEST")
-- ticks = tonumber(buffer) or 0
end)