• 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
 
darkhaos , gave error in your script executable.

Colandus, i need perferct script of bless+aol, look this script below:

Code:
-- [(  Script edited by: DoidinMapper )] --
function onSay(cid, words, param)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 100000) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), 28)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 100.000 gold coins to get blessed!")
end
end
return TRUE
end

he is bless+aol,
more...
is not equal to the global price level

understand me ?

thx ( i rep you for end my life :D)
 
I don't see any AoL being given in that script. And what you mean about the price? You mean you want a static price and not one based on a formula ?
 
yes guy, lose no items like backpack, items e aol !

even not using AOL, I do not lose items !


on the price, equal global:

lvl 31 - is 2k

more 1 lvl = more 200gps

lvl 32 = 2,2k
lvl 33 = 2,4k
...
lvl 120+= 100k
...

same global rl !

thx
 
ok look , This is talkaction script :
Lua:
function onSay(cid, words, param)
local price = 2000
        if getPlayerLevel(cid) >= 31 and getPlayerLevel(cid) < 120 then
              price = ((getPlayerLevel(cid) - 31 )*200  ) + 2000
        elseif getPlayerLevel(cid) >= 120 then
              price = 100000
        end
        
		if getPlayerBlessing(cid,5) and getPlayerBlessing(cid,4) and getPlayerBlessing(cid,3) and getPlayerBlessing(cid,2) and getPlayerBlessing(cid,1) then
              doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already been blessed.")
              doSendMagicEffect(getPlayerPosition(cid), 2)
         return true
		 end
		if getPlayerMoney(cid) < price then
               doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You dont have enough money, you need "..price.." gold.")
           return true
        end
        
		if doPlayerRemoveMoney(cid, price) == TRUE then
              
			  for i = 1,5 do
                      doPlayerAddBlessing(cid,i)
               end
                     
					 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received blessings for 100k!")
					  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
        else
                      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 100,000 gp in backpack for blessings.")
					 doSendMagicEffect(getPlayerPosition(cid), 2)
        end


return TRUE
end

Now lets make when you have bless you lose no item.
Go to creaturescripts--> scripts--> creatre new loss.lua
[paste]
Lua:
function onLogin(cid)
 if getPlayerLossPercent(cid, 3) ~= 100 or getPlayerLossPercent(cid, 4) ~= 100 then
      doPlayerSetLossPercent(cid, 3, 100)
      doPlayerSetLossPercent(cid, 4, 100)
 end
registerCreatureEvent(cid, "log")
return true
end
function onPrepareDeath(cid, deathList)
 if getPlayerBlessing(cid,1) and getPlayerBlessing(cid,2) and getPlayerBlessing(cid,3) and getPlayerBlessing(cid,4) and getPlayerBlessing(cid,5) then
   doPlayerSetLossPercent(cid, 3, 0)
   doPlayerSetLossPercent(cid, 4, 0)
  end
return true
end

Now go to creaturescript --> creaturescript.xml
[paste these lines in it]
Code:
<event type="preparedeath" name="log" event="script" value="loss.lua"/>
<event type="login" name="tab" event="script" value="loss.lua"/>
 
Last edited:
if I die without bless, I lose ALL items :S

other bug:
test price (lvl 51)

player: !bless
14:56 You dont have enough money, you need 29000 gold.
I put 29k in backpack
player: !bless (again)
14:57 You need 100,000 gp in backpack for blessings.
 
change the talk action for that
Lua:
function onSay(cid, words, param)
local price = 10000
        if getPlayerLevel(cid) >= 31 and getPlayerLevel(cid) < 120 then
              price = ( getPlayerLevel(cid) - 20) * 1000
        elseif getPlayerLevel(cid) >= 120 then
              price = 100000
        end
 
		if getPlayerBlessing(cid,5) and getPlayerBlessing(cid,4) and getPlayerBlessing(cid,3) and getPlayerBlessing(cid,2) and getPlayerBlessing(cid,1) then
              doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already been blessed.")
              doSendMagicEffect(getPlayerPosition(cid), 2)
         return true
		 end
		if getPlayerMoney(cid) < price then
               doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You dont have enough money, you need "..price.." gold.")
           return true
        end
 
		if doPlayerRemoveMoney(cid, price) == TRUE then
 
			  for i = 1,5 do
                      doPlayerAddBlessing(cid,i)
               end
 
					 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received blessings for 100k!")
					  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
        else
                      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 100,000 gp in backpack for blessings.")
					 doSendMagicEffect(getPlayerPosition(cid), 2)
        end
 
 
return TRUE
end
 
Last edited:
Back
Top