• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Blessing script

Freezer

New Member
Joined
Mar 14, 2013
Messages
54
Reaction score
0
Location
Germany
Hiho!
I have a small Issue with the blessings. When I cast "!bless" it takes money from my char and the "doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)" works also.
When I cast the !bless again it says also: You have already got one or more blessings! Seems to look fine!
BUT!
The problem is actually, the Bless is not working :/...
I die and loose stuff etc. Also when I relog and say !bless the script takes money again, and blesses me... <_<
I checked then the MySQL database, and when I say !bless (+refresh database) the database under players -> blessings -> is still "0" dafuck?

Here is my bless.lua

PHP:
function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 5000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need 5k to get blessed!")
        end
    end    
    return 1
end


I also added:

PHP:
<talkaction words="!buybless;/buybless;!bless;/bless" script="bless.lua" />

in talkactions.xml




Anyone got a clue? :o


Edit:

My Distribution is:
The Forgotten Server, version 0.3.7_SVN (Crying Damson)
 
Last edited:
Try this one. Change the price since mine only costs 50 gold.

function onSay(cid, words, param)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 50) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), 28)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 50 gold coins to get blessed!")
end
end
return TRUE
end
 
Your script works also with taking money and magic effect etc.

But still the same problem :/
There must be something wrong with the MySQL database I think. Becuz it is not changing the variable in the table -> player -> "blessings". It's still zero.
But the SQL database works fine I can see accounts/players change values there and it works, but it seems that the script bless.lua is not editing the variable.
 
Warning.jpg



Could this be relevant?
But the SQL database works....


Like I said in the main post:
My Distribution is:
The Forgotten Server, version 0.3.7_SVN (Crying Damson)
 
on your config at the bottom I think you want optimize database at startup or whatever it is on true or yes. if that doesnt work then im sorry i use mystic spirit.
 
I fixed it... I just changed the Distribution from 32 to 64 bit... Don't think this was the "Bug" but maybe I messed up something in any config files from the old distribution.
Thank you anyway Powtreeman :)
 
Back
Top