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

upgrade Skill bar

darckx2010

New Member
Joined
Mar 22, 2010
Messages
6
Reaction score
0
Hallo


I am making a skill bar but I'm having a SMALL setback, the skill will be normal when I put it upo not updated , so update when I relogo Any suggestion???

Cliente Lua

Code:
function skillsn(protocol, opcode, buffer)
    local balanceLabel = tutorialWindow:getChildById('MiningSkill'):getChildById('skillatual')
    balanceLabel:setText(formatNumbers(buffer))
end

Server creaturescript
Code:
function onExtendedOpcode(player, opcode, buffer)
    local skillsn = getPlayerStorageValue(player, 15000)
    player:sendExtendedOpcode(54, skillsn)
    return true
end
 
dude, what the heck did you try to say ?
the value is just updating when you log in, is it ?
if yes, its because the extendedopcode creaturescript only call when you log in, or if the client sends a opcode.
Every time you change the value of the skill you need send the opcode, or you can just make it in sources, like an skill
 
I should make a loop to be sending the OPCODE and checking the Storage ? how would I do if that
 
unless you make an source code, yes !
every time the values change( skill or skilltry ) you need send a opcode. You can upgrade your libs to make the things easier. Like this (part of the code).
Code:
function addMiningSkill(cid, count)
if(getPlayerStorageValue(cid, Miningconfig.storage[1]) >= Miningconfig.maxLevel) then
setPlayerStorageValue(cid, Miningconfig.storage[2], 0)
doSendPlayerExtendedOpcode(cid, 70, CUSTOMSKILL_MINING .. ', ' .. getMiningSkill(cid) .. ', ' .. getMiningSkillTry(cid))
return true
end

then in your clinent skills.lua you register the opcode and throw the values in the function that update skills .
 
Back
Top