• 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 Blessings TFS 0.3.6 bugg from lvl 100 to 1

Clorens

New Member
Joined
Oct 5, 2011
Messages
89
Reaction score
0
PHP:
	blessingOnlyPremium = true
	blessingReductionBase = 15
	blessingReductionDecreament = 5
	eachBlessReduction = 10


PHP:
function onSay(cid, words, param, channel)
        if getPlayerBlessing(cid, 5) == FALSE then
                if getPlayerMoney(cid) >= 100000 then
                        for i = 1,5 do
                                doPlayerAddBlessing(cid, i)
                        end
                        doSendMagicEffect(getCreaturePosition(cid), 39)
                        doPlayerRemoveMoney(cid, 100000)
                        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
                        doPlayerSendTextMessage(cid, 22, "You have been blessed by the gods!")
                else
                        doPlayerSendCancel(cid, "Sorry, but you dont have 10cc")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
                end
        else
                doPlayerSendCancel(cid, "You have already been blessed.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        end
return true
end


So these are the scripts I'm using and when I'm trying to fix it so the players doesn't lose any levels at all it doesn't work...
So could you please help me and correct the script?
 
use this script ,works fine..
LUA:
local bless = {1, 2, 3, 4, 5}
local cost = 100000
local maxlevel = 50000
function onSay(cid, words, param)
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)


        for i = 1, table.maxn(bless) do
                if(getPlayerBlessing(cid, bless[i])) then
                        doPlayerSendCancel(cid, "You have already have been blessed.")
                        return TRUE
                end
        end
        
        if (getPlayerLevel(cid) >= maxlevel)  then
                if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
                        for i = 1, table.maxn(bless) do
                        doPlayerAddBlessing(cid, bless[i])
                        doPlayerSendTextMessage(cid,22,"You have been successfully blessed.!")
                end
                else
                doPlayerPopupFYI(cid, "You need "..new_cost.." to buy blessings.")
                end
        
        elseif(getPlayerLevel(cid) < maxlevel) then
                if(doPlayerRemoveMoney(cid, cost) == TRUE) then
                        for i = 1, table.maxn(bless) do
                        doPlayerAddBlessing(cid, bless[i])
                        end
                        doPlayerPopupFYI(cid, "You have successfully been blessed.")
                else
                        doPlayerPopupFYI(cid, "You need to have "..cost.."gp to buy blessings.")
                end
        end
        return FALSE
end

note: are you sure have in phpmyadmin
loss_experience = 100?
SQL:
update players set loss_experience = 100;
 
While using that code you sent me the command !blessings stoped working lol..

- - - Updated - - -

Nvm managed to fix my old script now ty anyway!

- - - Updated - - -

How do I change this thread to solved?
 
Back
Top