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

!buybless

Rhumor

Dutch & Proud
Joined
Jul 7, 2007
Messages
451
Reaction score
2
Ok I have a talkaction script and it should be that you need vip (storageID) and enough money before you can do !buybless.
Now I got it to work but the only problem is, when you don't have money but you do have vip it will work. But when you have money and also vip it will work but then it will take money.. So it's like when you HAVE money it takes money, when you DON'T have money it will also work.. Can someone help me with that?
Here is the script:

Code:
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 getPlayerStorageValue(cid,11551) == TRUE then
            doPlayerRemoveMoney(cid, 60000)
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need vip to get blessed!")
        end
    end    
    return 1
end
 
Code:
already = FALSE

function onSay(cid, words, param)
	for i = 1, 5 do
	if getPlayerBlessing(cid, i) == TRUE then
		already = TRUE
	end
    if already = TRUE then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if getPlayerStorageValue(cid,11551) == TRUE then
			if doPlayerRemoveMoney(cid, 60000) == TRUE then
				for i = 1, 5 do
				doPlayerAddBlessing(cid, i)
				end
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
			else
				doPlayerSendCancel(cid, "You don't have enough money!")
			end
        else
            doPlayerSendCancel(cid, "You need vip to get blessed!")
        end
    end    
    return 1
end
doPlayerRemoveMoney() return TRUE if player can pay.
 
Last edited:
Code:
already = FALSE

function onSay(cid, words, param)
	for i = 1, 5 do
	if getPlayerBlessing(cid, i) == TRUE then
		already = TRUE
	end
    if already = TRUE then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if getPlayerStorageValue(cid,11551) == TRUE then
			if doPlayerRemoveMoney(cid, 60000) == TRUE then
				for i = 1, 5 do
				doPlayerAddBlessing(cid, i)
				end
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
			else
				doPlayerSendCancel(cid, "You don't have enough money!")
			end
        else
            doPlayerSendCancel(cid, "You need vip to get blessed!")
        end
    end    
    return 1
end
doPlayerRemoveMoney() return TRUE if player can pay.


Thanks again but its still the same problem ,I just bought it without any cash in my BP.
 
Here you go...
I tested it a bit and work but if you have any error just tell me and ill fix it cuz i made it fast...
Code:
function onSay(cid, words, param)
blesscost = 12000  -- This is the cost of 1 bless Just 1
local num = 0
local add = {}
for i = 1,5 do
if getPlayerBlessing(cid, i) then
else
num = num +1
table.insert(add, i)
end
end
if getPlayerStorageValue(cid,11551) == -1 then
doPlayerSendTextMessage(cid,22,"Sorry, You need VIP to buy bless.")
elseif num == 0 then
 doPlayerSendTextMessage(cid,22,"Sorry, But you have all the bless already.")
elseif getPlayerMoney(cid) < num*blesscost then
  doPlayerSendTextMessage(cid,22,"Sorry but you don't enought money you need exactly ".. num*blesscost -getPlayerMoney(cid) ..".")
  elseif isPlayer(cid) == TRUE then
  for i = 1,#add do
  doPlayerRemoveMoney(cid, blesscost)
  doPlayerAddBlessing(cid, add[i])
  end
  doPlayerSendTextMessage(cid,22,"Added a total of ".. num .." bless for a exactly total of ".. num*blesscost .." GPS.")
  end
  end
 
Last edited:
Back
Top Bottom