I have error, when you buy the bless, When a player gives him more than of 1 click to the lever and has 1 kk it is taking the money from him little by little, it is supposed that if it has all the bless the are of stopping buying and saying that already it has them. You can repair this error? :/?
Code:
--fixed by Dark Rat
local cost = 20000
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPremiumDays(cid) == 0 then
doPlayerSendCancel(cid, "You need premium to do this.")
return 1
end
if(getPlayerMoney(cid) < cost*5) then
doPlayerSendCancel(cid, "You do not have enough money.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return 1
end
for i = 1, 5 do
if not(getPlayerBlessing(cid, i)) then
doPlayerAddBlessing(cid, i)
end
end
doPlayerRemoveMoney(cid, cost*5)
doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You received all of the blessings!")
if item.itemid == 1945 then
doTransformItem(item.uid, item.itemid )
else
doTransformItem(item.uid, item.itemid )
end
return true
end