• 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

Stewie

Family Guy # ;3
Joined
May 3, 2010
Messages
786
Reaction score
12
Location
TV
i would like a !bless only VIP can buy:

Code:
if vip.hasVip(cid) == TRUE then


without vip : you arent a player VIP

here the script:

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

	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_MAGIC_RED)
				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
 
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

        for i = 1, 5 do
                if getPlayerBlessing(cid, i) then
                        fail = fail + 1
                else
					if vip.hasVip(cid) == TRUE then
                        if doPlayerRemoveMoney(cid, cost) == TRUE then
                                doPlayerAddBlessing(cid, i)
                                if i == 5 and not(fail == 5) then
                                        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
                                end
                        else
                                doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
                                break
                        end
					else
					doPlayerSendCancel(cid, "You aren't a player VIP!")
                end
        end
        if fail == 5 then
                doPlayerSendCancel(cid, "You already have all the blessings!")
        end
return TRUE
end
 
ok,, im go test


EDIT///

Code:
[Error - LuaScriptInterface::loadFile] data/talkactions/scripts/bless.lua:36: 'end' expected (to close 'function' at line 1) near '<eof>'
[30/06/2010 12:19:46] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/bless.lua)
[30/06/2010 12:19:46] data/talkactions/scripts/bless.lua:36: 'end' expected (to close 'function' at line 1) near '<eof>'
 
wesloy missed an end

try this

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 vip.hasVip(cid) then
                        if doPlayerRemoveMoney(cid, cost) == TRUE then
                                doPlayerAddBlessing(cid, i)
                                if i == 5 and not(fail == 5) then
                                        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
                                end
                        else
                                doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
                                break
                        end
                                        else
                                        doPlayerSendCancel(cid, "You aren't a player VIP!")
                end
        end
        if fail == 5 then
                doPlayerSendCancel(cid, "You already have all the blessings!")
        end
  end
  return true
end
 
Code:
[Error - LuaScriptInterface::loadFile] data/talkactions/scripts/bless.lua:36: 'end' expected (to close 'function' at line 1) near '<eof>'
[30/06/2010 12:19:46] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/bless.lua)
[30/06/2010 12:19:46] data/talkactions/scripts/bless.lua:36: 'end' expected (to close 'function' at line 1) near '<eof>'

error
 
ok,, im go test


EDIT///

Code:
[Error - LuaScriptInterface::loadFile] data/talkactions/scripts/bless.lua:36: 'end' expected (to close 'function' at line 1) near '<eof>'
[30/06/2010 12:19:46] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/bless.lua)
[30/06/2010 12:19:46] data/talkactions/scripts/bless.lua:36: 'end' expected (to close 'function' at line 1) near '<eof>'
OMG
Can't you read? How old are you? 7..?
 
Back
Top Bottom