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

Help with door bug

Rab

Member
Joined
Feb 23, 2009
Messages
468
Reaction score
9
Location
ARGENTINA!
I'm using this:

Code:
   <!-- VIP -->
        <action actionid="5786" script="vipdoor.lua"/>
        <action itemid="5785" script="vip.lua"/>

and

Code:
   function onUse(cid, item, fromPosition, itemEx, toPosition)
        if isPlayerVip(cid) == TRUE then
                if getCreaturePosition(cid).y < toPosition.y then
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
                else
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z}, TRUE)
                end
                doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
                doSendMagicEffect(getCreaturePosition(cid), 10)
        else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here! Buy VIP on the WEB.")
        end
        return TRUE
end

and

Code:
local days = 30
local levelToBeVIP = 1

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerLevel(cid) >= levelToBeVIP then
                if isPlayerVip(cid) == FALSE then
                        doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for "..days.." days! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
                end
                doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED)
                doPlayerAddVipDays(cid, days)
                doRemoveItem(item.uid, 1)
                doSendAnimatedText(getCreaturePosition(cid), "+"..days.." days", 30)
        else
                doPlayerSendCancel(cid, "You need level "..levelToBeVIP.." to be a VIP player.")
        end    
        return TRUE
end

When i create a door, add action id 5786 it says "only the worthy may pass" or something like that. What am i doing wrong?
 
where i aadd this? setPlayerVipDays(cid, days) -- set player XXX Vip days // return days
getPlayerVipDays(cid) -- get player current Vip days left // return days
isPlayerVip(cid) -- check if player is vip // return TRUE (if player is Vip) or FALSE (if player isn't Vip)
doPlayerAddVipDays(cid, days) -- add player vip days // return days
doPlayerRemoveVip(cid) -- remove player Vip and set Vip days to 0 // return TRUE
 

Similar threads

Back
Top