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

'end' expected to close 'function' -Really Urgent

wizzar

New Member
Joined
Aug 21, 2009
Messages
90
Reaction score
0
Code:
function onSay(cid, words, param)

     if(words == "/vip")then
        accountName = getPlayerAccount(cid)
        if(isSilverVip(accountName))then
            time1 = getSilverVipTime(accountName)
            if(time1 > 0)then
                doPlayerSendTextMessage(cid, 19, "Sua conta tem "..timeString(time1).." de Silver VIP.")
            else
                doPlayerSendTextMessage(cid, 19, "Sua conta tem Vip Gratis.")
            end
        else
            doPlayerSendTextMessage(cid, 19, "Voce nao tem dias VIP.")
        end
        elseif(isGoldVip(accountName))then
	        time2 = getGoldVipTime(accountName)
                if(time2 > 0)then
                doPlayerSendTextMessage(cid, 19, "Sua conta tem "..timeString(time2).." of Gold VIP.")
		end
            else
                doPlayerSendTextMessage(cid, 19, "Sua conta tem VIP Gratis.")
            end
        else
            doPlayerSendTextMessage(cid, 19, "Voce nao tem dias VIP.")
        end
end
return true
end

data/talkactions/scripts/vip.lua:23: 'end' expected (to close 'function' at line 1) near 'else'
Cannot load script (data/talkactions/scripts/vip.lua)
data/talkactions/scripts/vip.lua:23: 'end' expected (to close 'function' at line 1) near 'else'

I tryed to put ends everywhere, nothing works! I cant understand >.< Help Please!
 
xDDDD
Lua:
function onSay(cid, words, param)

     if(words == "/vip")then
        accountName = getPlayerAccount(cid)
        if(isSilverVip(accountName))then
            time1 = getSilverVipTime(accountName)
            if(time1 > 0)then
                doPlayerSendTextMessage(cid, 19, "Sua conta tem "..timeString(time1).." de Silver VIP.")
            else
                doPlayerSendTextMessage(cid, 19, "Sua conta tem Vip Gratis.")
            end
        else
            doPlayerSendTextMessage(cid, 19, "Voce nao tem dias VIP.")
        end
        elseif(isGoldVip(accountName))then
              time2 = getGoldVipTime(accountName)
              if(time2 > 0)then
                 doPlayerSendTextMessage(cid, 19, "Sua conta tem "..timeString(time2).." of Gold VIP.")
              else
                  doPlayerSendTextMessage(cid, 19, "Sua conta tem VIP Gratis.")
              end
        else
              doPlayerSendTextMessage(cid, 19, "Voce nao tem dias VIP.")
        end
        return true
        end
 
Last edited:
But it is running 2 functions look:

03:24 Sua conta tem 23 hours, 4 minutes and 30 seconds de Silver VIP.
03:24 Sua conta tem VIP Gratis.
 
you didnt change anything :s
03:33 Sua conta tem 22 hours, 54 minutes and 58 seconds de Silver VIP.
03:33 Sua conta tem VIP Gratis.
maybe it happens bcause i have silver and gold, but when i finish it wont be possible to have them both
 
you didnt change anything :s
03:33 Sua conta tem 22 hours, 54 minutes and 58 seconds de Silver VIP.
03:33 Sua conta tem VIP Gratis.
maybe it happens bcause i have silver and gold, but when i finish it wont be possible to have them both
Try again i edited my main post
 
[06/03/2010 03:36:52] data/actions/scripts/vipdoor.lua:9: attempt to call global 'doPlayerSetExtraExpRate' (a nil value)
-doPlayerSetExtraExpRate(cid, 2)
this lua function is included in doc, so why it does not work?
 
[06/03/2010 03:36:52] data/actions/scripts/vipdoor.lua:9: attempt to call global 'doPlayerSetExtraExpRate' (a nil value)
-doPlayerSetExtraExpRate(cid, 2)
this lua function is included in doc, so why it does not work?
WTF, you didn't post a script contains "doPlayerSetExtraExpRate" post it please so i can try and fix it
 
i need to multiply the player exp rate for 1.5, do you know how to do that by script? This mssut happer when the player become vip
 
03:40 Sua conta tem 22 hours, 48 minutes and 15 seconds de Silver VIP.
03:40 Sua conta tem 23 hours, 59 minutes and 56 seconds of Gold VIP.
 
When silver > 0 and gold == 0
03:41 Sua conta tem 22 hours, 47 minutes and 6 seconds de Silver VIP.
03:41 Sua conta tem VIP Gratis.
 
When you have days of Silver Vip and ou ahve 0 Days/Dont have Gold Vip, and you use /vip to check your days, you get both messages instead of only one, saying "you have xxx silver vips"
 
it wont be possible for player to have both silver and gold at the same time, so it is a problem because it will always be gold > 0 days and silver = 0 days, vice-versa
 

Similar threads

Back
Top