• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Door+Item to add VIP Compatible with Azi's VIP Sytem for Account

Vikarious

New Member
Joined
Dec 16, 2008
Messages
93
Reaction score
2
FIXED 2 SMALL BUGS:

1 - Door now say when you're not VIP

2 - Item dislay correctly the days of VIP you're receiving.
(Not more automatic, so you'll need to change it from 30 to days you'll use)

Okay, to all people using this system ( http://otland.net/f163/best-vip-system-functions-vip-account-30286/ )

Remembering: It will work only for the topic mentioned ABOVE. You need to complete install and make things work first (can use commands /addvip and /vip to check it out)

-------------

(It work only for the mentioned VIP system, you can find this topic useful if you wish to use storage value VIP system http://otland.net/f81/release-vip-system-44986/ )

-------------

After a little of work last night, I could finish it.

Door and Item that adds VIP Days.

Working 100% on The Forgotten Server, version 0.3.6 (Crying Damson) (GUI tested only).

Door:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)



accountName = getPlayerAccount(cid) 
        if(isVip(accountName))then 
            time = getAccountVipTime(accountName) 
            if(time > 0) == 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)
end
        else 
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here. Buy VIP on the WEB.") 

end
return TRUE
end

Item:

Lua:
local days = 30*3600*24
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 30 days! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
                end
               doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED) 
                doAccountAddVipTime(getPlayerAccount(cid), days)
                doRemoveItem(item.uid, 1)
                doSendAnimatedText(getCreaturePosition(cid), "+ 30 days", MESSAGE_INFO_DESCR)
        else
                doPlayerSendCancel(cid, "You need level "..levelToBeVIP.." to be a VIP player.")
        end     
        return TRUE
end

This way, item will add 30 days.

To change days, just change the formula here:

local days = 30*3600*24

30 = number of days.

It's working 100%

If someone finds a bug please post it and I'll try to help.

Credits:

Shawak for originally write scripts and me for the adaptation.

Hope it help!!

And if it helped you, rep++ me and Shawak.
 
Last edited:
Back
Top