cycektb / avesta74

Automatically exported from code.google.com/p/avesta74
0 stars 0 forks source link

getPlayerLearnedInstantSpell(cid, name) not working #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
example; getPlayerLearnedInstantSpell(cid, "Light")

It isn't working...
It actually learns the spell for the player, but he needs to relogin in order 
to update player_spells table.

Also it wont work when talking about conditions;

                if getPlayerLearnedInstantSpell(cid, "light") == false then
                    if getPlayerLevel(cid) >= _level then
                        if doPlayerRemoveMoney(cid, _price) == 1 then
                            _selfSay("Here you are. Look in your spellbook for the pronunciation of this spell.")
                            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
                            playerLearnInstantSpell(cid, _spellname)
                            _topic = 0
                            return true
                        else
                            _selfSay("Return when you have enough gold.")
                            _topic = 0
                            return true
                        end
                    else
                        _selfSay("You have to be level " .. _level .. " to learn this spell.")
                        _topic = 0
                        return true
                    end
                else
                    _selfSay("You already know how to cast this spell.")
                    _topic = 0
                    return true
                end

It will always call You already know how to cast this spell, when indeed, I 
haven't learned such spell.

Ignore them _var it's something in my loop, I can buy the spell when set to 
TRUE, but it wont tell me I have already purchased the spell.

Original issue reported on code.google.com by owntibia...@googlemail.com on 20 Jul 2012 at 9:40

GoogleCodeExporter commented 8 years ago
IGNORE.

Avesta needs to update Global Booleans, and I'm talking about "true and false", 
they wont work, have to use 1 and 0 to make it work.

Original comment by owntibia...@googlemail.com on 20 Jul 2012 at 9:47

GoogleCodeExporter commented 8 years ago
global.lua add
TRUE = 1
FALSE = 0

true = 1
false = 0

Original comment by otclient...@gmail.com on 20 Jul 2012 at 3:07

GoogleCodeExporter commented 8 years ago

Original comment by r...@ymail.com on 15 Sep 2012 at 1:21