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

Blessing 100k - VIP players 65k

Jaac

[PHP] *Linux*
Joined
Dec 15, 2010
Messages
180
Reaction score
9
Hello what I want to do is that my bless talkaction also works like tibia rl, and for vip players costs 65k. here is my script

Lua:
local bless = {1, 2, 3, 4, 5}
local cost = 100000 -- Cost in gp.
 
function onSay(cid, words, param)
	for i = 1, table.maxn(bless) do
		if(getPlayerBlessing(cid, bless[i])) then
			doPlayerSendCancel(cid, "You already have all blessings.")
			return TRUE
		end
	end
 
	if(doPlayerRemoveMoney(cid, cost) == TRUE) then
		for i = 1, table.maxn(bless) do
			doPlayerAddBlessing(cid, bless[i])
		end
		doPlayerSendTextMessage(cid,24, "You have bought all blessings.")
		doSendMagicEffect(getPlayerPosition(cid), 28)
	else
		doPlayerSendCancel(cid, "You don't have enough money.")
	end
	return TRUE
end
 
Lua:
local bless = {1, 2, 3, 4, 5}
local cost = 100000
 
function onSay(cid, words, param, channel)
	for i = 1, table.maxn(bless) do
		if(getPlayerBlessing(cid, bless[i])) then
			doPlayerSendCancel(cid, "You already have all blessings.")
			return TRUE
		end
	end
	if isPremium(cid) then
		if(doPlayerRemoveMoney(cid, cost) == TRUE) then
			for i = 1, table.maxn(bless) do
				doPlayerAddBlessing(cid, bless[i])
			end
			
			doPlayerSendTextMessage(cid,24, "You have bought all blessings.")
			doSendMagicEffect(getPlayerPosition(cid), 28)
		else
			doPlayerSendCancel(cid, "You don't have enough money.")
		end
	else
		doPlayerSendCancel(cid, "You are not a VIP member.")
	end
	return TRUE
end
 
Lua:
local bless = {1, 2, 3, 4, 5}
local cost = 100000
 
function onSay(cid, words, param, channel)
	for i = 1, table.maxn(bless) do
		if(getPlayerBlessing(cid, bless[i])) then
			doPlayerSendCancel(cid, "You already have all blessings.")
			return TRUE
		end
	end
	if isPremium(cid) then
		if(doPlayerRemoveMoney(cid, cost) == TRUE) then
			for i = 1, table.maxn(bless) do
				doPlayerAddBlessing(cid, bless[i])
			end
			
			doPlayerSendTextMessage(cid,24, "You have bought all blessings.")
			doSendMagicEffect(getPlayerPosition(cid), 28)
		else
			doPlayerSendCancel(cid, "You don't have enough money.")
		end
	else
		doPlayerSendCancel(cid, "You are not a VIP member.")
	end
	return TRUE
end

I think you don't understand that him want about, him want that Free Players bless cost 100k and premium players cost 65k.
 
Lua:
local cost = 100000

function onSay(cid, words, param)
	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			return doPlayerSendCancel(cid, "You already have all blessings.")
		end
	end

	if doPlayerRemoveMoney(cid, isPremium(cid) and 65000 or cost) then
		for i = 1, 5 do
			doPlayerAddBlessing(cid, i)
		end
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You have bought all blessings.")
		doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
	else
		doPlayerSendCancel(cid, "You don't have enough money.")
	end
	return true
end
 
I think you don't understand that him want about, him want that Free Players bless cost 100k and premium players cost 65k.

Lua:
local bless = {1, 2, 3, 4, 5}
local cost
 
function onSay(cid, words, param, channel)
	for i = 1, table.maxn(bless) do
		if(getPlayerBlessing(cid, bless[i])) then
			doPlayerSendCancel(cid, "You already have all blessings.")
			return true
		end
	end
	
	if isPremium(cid) then
		cost = 65000
	else
		cost = 100000
	end
	
	if doPlayerRemoveMoney(cid, cost) then
		for i = 1, table.maxn(bless) do
			doPlayerAddBlessing(cid, bless[i])
		end
 
		doPlayerSendTextMessage(cid,24, "You have bought all blessings.")
		doSendMagicEffect(getPlayerPosition(cid), 28)
	else
		doPlayerSendCancel(cid, "You don't have enough money.")
	end
	return true
end
 
@jdb...
Lua:
local bless = {1, 2, 3, 4, 5}
local cost = 100000
 
function onSay(cid, words, param, channel)
	for i = 1, table.maxn(bless) do
		if(getPlayerBlessing(cid, bless[i])) then
			doPlayerSendCancel(cid, "You already have all blessings.")
			return true
		end
	end 
	if isPremium(cid) then
		cost = 65000
	end
 
	if doPlayerRemoveMoney(cid, cost) then
		for i = 1, table.maxn(bless) do
			doPlayerAddBlessing(cid, bless[i])
		end
 
		doPlayerSendTextMessage(cid,24, "You have bought all blessings.")
		doSendMagicEffect(getPlayerPosition(cid), 28)
	else
		doPlayerSendCancel(cid, "You don't have enough money.")
	end
	return true
end

or i'm wrong?
 
Back
Top