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

Solved Problem with doRemoveItem

arti1194

New Member
Joined
Jun 6, 2009
Messages
96
Reaction score
3
Hello everyone, I have problem with pacc rune. Everything works fine, but when I have two or more pacc rune and I will use it immediately removes two. Please help. TFS 0.4 revision 3777

Here is my code:

Code:
function onUse(cid, item, frompos, item2, topos)
    local storage = getPlayerStorageValue(cid, 12570)

    if storage == -1 then
        setPlayerStorageValue(cid, 12570, 1)
    elseif storage ~= -1 then
        setPlayerStorageValue(cid, 12570, storage+1)
    end

    doPlayerAddPremiumDays(cid, 7)
    doSendMagicEffect(topos , 14)
    doCreatureSay(cid, "7 Days Premium Account Added", TALKTYPE_ORANGE_1)
    doRemoveItem(item.uid , 1)
end
 
I have no idea.. but try adding return true before the last end.
I don't see anything wrong with your remove item function.
 
you have to check if there's more then 1 charge on the rune, if yes you have to remove the charge instead of the entire rune
 
you have to check if there's more then 1 charge on the rune, if yes you have to remove the charge instead of the entire rune
I thought 'charges' was simply multiple of the same item, like gold coins or arrows, et cetera?
I don't think I've ever seen 'charges' in any function except npc's when buying items from them.
 
I thought 'charges' was simply multiple of the same item, like gold coins or arrows, et cetera?
I don't think I've ever seen 'charges' in any function except npc's when buying items from them.
No runes cannot be stacked they consist out of charges which can be accessed by item.type
 
No runes cannot be stacked they consist out of charges which can be accessed by item.type
It's just weird.. because they definitely 'stack' on our server, and have never had charges.
Maybe 0.4 and 0.3.7 defer in this way.
Interesting to know.
 
Back
Top