• 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 to fix opcode in otx2

tiag0_bn

Well-Known Member
Joined
Dec 8, 2011
Messages
181
Reaction score
50
hello, i need help to fix opcode in otx2

i pay 10usd or 50,00

Hello community, I'm having problems calling the opcode... could anyone help me?


Server Side


lua script
<event type="extendedopcode" name="ExtendedOpcode" event="script" value="opcodes.lua"/>```

local COINS_OPCODE = 70

function onExtendedOpcode(player, opcode, buffer)
if opcode == COINS_OPCODE then
local accountPoints = getAccountPoints(cid)
doSendPlayerExtendedOpcode(cid, COINS_OPCODE, tostring(accountPoints))
else
-- other opcodes can be ignored, and the server will just work fine...
end
end

function getAccountPoints(accountId)
local res = db.getResult("SELECT premium_points FROM accounts WHERE id = " .. accountId .. ";")

local points = 0
if res:getID() ~= -1 then
points = res:getDataInt("premium_points")
res:free()
end

return points
end


login
registerCreatureEvent(cid, "ExtendedOpcode")

otcv8
function coinsBalance(protocol, opcode, buffer)
local balanceLabel = storeWindow:getChildById('balanceInfo'):getChildById('coinBalance')
balanceLabel:setText(formatNumbers(buffer))
end

COINS_OPCODE = 70
 
if not solved yet msg me on discord probably needs to be turned on from the protocolgame.cpp 0x32 packet might be blocked from serverSide as i expect (this happens for many users using 1.2 tfs because it is disabled by default i believe)
 
Back
Top