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

!bless steals money !

felipedorgas

New Member
Joined
Aug 10, 2010
Messages
34
Reaction score
1
hey guys, i need help in this script:

if the player does not have enough money, he takes a part, not bless them and says he does not have enough money

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


i need help in this script too:

vip ends when the script has to take the storage 5000.

I tried, it did not work more:

Code:
function onLogin(cid)
if isVip(cid) == FALSE then 
	doPlayerSetPromotionLevel(cid,1)
end 
        local vip = isVip(cid) 
        if getVipTime(cid) > 0 and vip == FALSE then
                doPlayerSetStorageValue(cid, 5000, 0) -- Termina a VIP   
                local townid = 2 
                doPlayerSetTown(cid, townid) 
                local templePos = getTownTemplePosition(getPlayerTown(cid)) 
                doTeleportThing(cid, templePos, false) 
                setVipTime(cid, 0)
                doTeleportPlayers(cid, templePos) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Vip acabou!") 
        elseif vip == TRUE then 
                local duration = getVipDate(cid) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você possui "..getVipDays(cid).." dia(s) de vip."..(duration and (" Ela irá durar até "..duration..".") or "")) 
        end 
        return TRUE 
end

i rep++++

thx
 
Lua:
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
       if getPlayerMoney(cid) < cost then
         doPlayerSendCancel(cid,"You dont have enough Money.")
      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
			
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already have all the blessings!")
	end
return TRUE
end
 
Code:
function onSay(cid, words, param)
local fail = 0
local cost = 2000
	if getPlayerMoney(cid) < (getPlayerLevel(cid) < 31 and cost or getPlayerLevel(cid) < 120 and ((getPlayerLevel(cid) - 30) * 200) + 2000 or getPlayerLevel(cid) >= 120 and 20000) then
                 doPlayerSendTextMessage(cid,25,"You dont have enough Money.You need "..(getPlayerLevel(cid) < 31 and cost or getPlayerLevel(cid) < 120 and ((getPlayerLevel(cid) - 30) * 200) + 2000 or getPlayerLevel(cid) >= 120 and 20000)..".")
                doSendMagicEffect(getThingPos(cid),2)
	   return true    
	 end
        
          if getPlayerBlessing(cid, 1)  and getPlayerBlessing(cid, 2) and getPlayerBlessing(cid, 3) and getPlayerBlessing(cid, 4) and getPlayerBlessing(cid, 5) then
		doPlayerSendCancel(cid, "You already have all the blessings!")
         else
			doPlayerRemoveMoney(cid, getPlayerLevel(cid) < 31 and cost or getPlayerLevel(cid) < 120 and ((getPlayerLevel(cid) - 30) * 200) + 2000 or getPlayerLevel(cid) >= 120 and 20000)
	        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
		doPlayerSendTextMessage(cid,29,"You have bough all blessings.")
				
                                for i = 1,5 do
				       doPlayerAddBlessing(cid, i)
				end
	  end
	return true
end
 
Last edited:
Code:
function onSay(cid, words, param, channel)
	local cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
	if cost > 100000 then
		cost = 100000
	end
	
	for i = 1, 5 do
		if not getPlayerBlessing(cid, i) then
			doPlayerAddBlessing(cid, i)
		else
			doPlayerSendCancel(cid, "You already have the blessings.")
			break
		end
	end
	
	if getPlayerMoney(cid) >= cost then
		doPlayerRemoveMoney(cid, cost)
	else
		doPlayerSendCancel(cid, "Sorry, you do not have enough money.")
	end
	
	return true
end

gz free bless
 
Free is the best way to go!

Code:
function onSay(cid, words, param, channel)
	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
			return doPlayerSendCancel(cid, "Sorry, you have the blessing's.")
		end
	
		if doPlayerRemoveMoney(cid, cost) then
			doPlayerAddBlessing(cid, i)
		else
			return doPlayerSendCancel(cid, "Sorry, you do not have enough money.")
		end
		
		doCreatureSay(cid, "You have been blessed!", TALKTYPE_ORANGE_1)
		break
	end
	
	return true
end
 
Last edited:
Lua:
if(getPlayerLevel(cid) <= 30) then
	price = 2000
elseif(getPlayerLevel(cid) > 30 and getPlayerLevel(cid) < 120) then
	price = 2000 + (getPlayerLevel(cid) - 30) * 1000
else
	price = 100000
end
 
FREE BLESS.

Code:
function onSay(cid, words, param, channel)
if(getPlayerLevel(cid) <= 30) then
	price = 2000
elseif(getPlayerLevel(cid) > 30 and getPlayerLevel(cid) < 120) then
	price = 2000 + (getPlayerLevel(cid) - 30) * 1000
else
	price = 100000
end
	
	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			return doPlayerSendCancel(cid, "Sorry, you have the blessing's.")
		end
	
		if doPlayerRemoveMoney(cid, cost) then
			doPlayerAddBlessing(cid, i)
		else
			return doPlayerSendCancel(cid, "Sorry, you do not have enough money.")
		end
		
		doCreatureSay(cid, "You have been blessed!", TALKTYPE_ORANGE_1)
		break
	end
	
	return true
end

+ AOL PLX
 
Lua:
function onSay(cid, words, param, channel)
    if(getPlayerLevel(cid) < 120) then
        price = 2000 + math.max(0, getPlayerLevel(cid) - 30) * 1000
    else
        price = 100000
    end
    
    if(getPlayerMoney(cid) < price) then
        return doPlayerSendCancel(cid, "Sorry, you do not have enough money.")
    end
    
    for i = 1, 5 do
        if getPlayerBlessing(cid, i) then
            return doPlayerSendCancel(cid, "Sorry, you have the blessings.")
        end
    end
    doPlayerRemoveMoney(cid, price)
    doCreatureSay(cid, "You have been blessed!", TALKTYPE_ORANGE_1)
    
    return true
end
 
Last edited:
Lua:
function onSay(cid, words, param, channel)
    if(getPlayerLevel(cid) < 120) then
        price = 2000 + math.max(0, getPlayerLevel(cid) - 30) * 1000
    else
        price = 100000
    end
    
    if(getPlayerMoney(cid) < cost) then
        return doPlayerSendCancel(cid, "Sorry, you do not have enough money.")
    end
    
    for i = 1, 5 do
        if getPlayerBlessing(cid, i) then
            return doPlayerSendCancel(cid, "Sorry, you have the blessings.")
        end
    end
    doPlayerRemoveMoney(cid, cost)
    doCreatureSay(cid, "You have been blessed!", TALKTYPE_ORANGE_1)
    
    return true
end

Where is cost declared? replace "cost" by "price"
 
Back
Top