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

Working bless?

BugaS

Donżuan
Joined
Mar 12, 2009
Messages
1,219
Reaction score
9
Location
NYC
When someone buy !bless and die he downgrade to 1 lvl. How to fix?
 
I've got:

Code:
function onSay(cid, words, param)
local fail = 0

	if getPlayerLevel(cid) < 31 then
		cost = 2000
	else
		cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
	end
	
	if cost > 20000 then
		cost = 20000
	end

	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if doPlayerRemoveMoney(cid, cost) == TRUE then
				doPlayerAddBlessing(cid, i)
				if i == 5 and not(fail == 5) then
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				end
			else
				doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already have all the blessings!")
	end
return TRUE
end
 
you have to execute this query in phpmyadmin
SQL:
UPDATE players SET loss_experience = 100, loss_mana = 100, loss_skills = 100, loss_containers = 100
 
I made this query when server was offline, I'm using this action:

function onUse(cid, item, fromPosition, itemEx, toPosition)

local exhaustionInSeconds = 10
local storage = 35321
if(exhaustion.check(cid, storage) == true) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Nie tak szybko, musisz poczekac " .. exhaustion.get(cid, storage) .. " sekund, aby uzyc ksiazki.")
return 0
end
exhaustion.set(cid, storage, exhaustionInSeconds)

local bless = {1, 2, 3, 4, 5}

for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless)) then
doPlayerSendCancel(cid, "Masz juz kupione blessy.")
doSendMagicEffect(getPlayerPosition(cid),2)
return TRUE
end
end
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless)
end
doPlayerSendTextMessage(cid,24, "Kupiles all blessy.")
doSendMagicEffect(getPlayerPosition(cid), 10)
return true
end


Not working, 1 lvl
 
Last edited:
Back
Top