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

Teleport vip only

George00

propro
Joined
Jan 11, 2014
Messages
163
Solutions
1
Reaction score
10
Location
propro
Hey ive got a teleport in temple and id like to make so that only vip members can pass trough. The vip medal is id 5785 and it works already with a vip door i have created but i just dont know how to make it with the vip teleport? should i change the action id of teleport to 5785? and uinique id to 111152 because ive got a script but it doesnt work


Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPlayer(cid)) then
return true
end
if (item.actionid == 5785 and getPlayerStorageValue(cid,11552) >= 1) then
doTeleportThing(cid, fromPosition, true)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need VIP to go through here.")
else
local destination = {x = 247, y = 659, z = 13}
doTeleportThing(cid, destination, true)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Enjoy vip.")
end
return true
end


I dont know what this line is for?
Code:
local destination = {x = 247, y = 659, z = 13}
 
Code:
-- Credits StreamSide, Empty and Kaorus
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getCreatureName(cid)
    -- if getPlayerStorageValue(cid,11551) < 1 then
        if getPlayerLevel(cid) > 1 then
            getPlayerStorageValue(cid, 11551)
            doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED)
            doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for 15 days! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
            doBroadcastMessage("CONGRATULATIONS " ..  name .. "! Now you are VIP for 15 days! Now you can enter the VIP-area and use unique features!")
            setPlayerStorageValue(cid, 11551, (getPlayerStorageValue(cid,11551) + 15))
            doRemoveItem(item.uid, 1)
        else
            doPlayerSendCancel(cid,"You need to be at least level 2 to use this.")
            doRemoveItem(item.uid, 1)
        end
    -- else
    --    doPlayerSendCancel(cid,"You are already a donator.")
    -- end   
return TRUE
end

Its working fine even with another script ive got that only vips can use the gate of experience so may wonder why teleport unique id is 11552 and not 11551 and thats because i used unique id 11552 in vip teleport idk if i can use 11551 because its already being used and so i thought it wouldnt be an unique id if i put it to 11551 too?


Code:
<action itemid="5785" script="other/vip.lua"/>
    <action uniqueid="11552" script="other/vip teleport.lua" />
    <action uniqueid="11551" script="other/vip door.lua" />
 
local destination = {x = 247, y = 659, z = 13}
this must be vip temple player who have vip tp to here

Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPlayer(cid)) then
return true
end
if (item.actionid == 5785 and getCreatureStorage(cid, 11552) < 1 then
doTeleportThing(cid, fromPosition, true)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need VIP to go through here.")
else
local destination = {x = 247, y = 659, z = 13}  --- here vip temple 
doTeleportThing(cid, destination, true) 
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Enjoy vip.")
end
return true
end
 
You can use @heba's code.
Sorry I was cooking dinner.
Basically you were just checking the storage value incorrectly.
(tabbed heba's code. (Fixed the extra bracket on line 5 as well))
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
     if not isPlayer(cid) then
         return true
     end
     if item.actionid == 5785 and getCreatureStorage(cid, 11552) < 1 then
         doTeleportThing(cid, fromPosition, true)
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need VIP to go through here.")
     else
         local destination = {x = 247, y = 659, z = 13}  --- here vip temple
         doTeleportThing(cid, destination, true)
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Enjoy vip.")
     end
     return true
end
 
Code:
[20/08/2016 15:14:40] [Warning - Event::loadScript] Event onUse not found (data/actions/scripts/other/vip teleport.lua)
It's a StepIn event for your teleport.. it's not a replacement for your VIP medal.
data/movements/scripts/script_name.lua

pm me
 
Back
Top