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

How to make a Door/Tile available only for Premium Players

Tyson12302

New Member
Joined
Aug 6, 2014
Messages
264
Reaction score
4
I've made a VIP area which can only be accessible if you are premium. I've put a Wooden tile or a Door. Whenever i go there it says its against intruders. I would love to know how to make that door/tile available if you are Premium. Can i do this in Map Editor. Or do i need a script if so what script?
 
You have to assign an ActionID or UniqueID in map editor, then write a proper script. Usually it's something like:
Code:
if player:getPremiumDays() < 1 then //here we check how many premDays player has
     return false; //return false means not opening the door
else
     return true; //we pass the door
end
About wooden tile you also have to assing an ID, then simply write a script teleporting the player to position x-1 or x+1. Function onStepIn.

@Lordfire: Good point.
 
Last edited:
You have to assign an ActionID or UniqueID in map editor, then write a proper script. Usually it's something like:
Code:
if player:getPremiumDays() < 1 then //here we check how many premDays player has
     return false; //return false means not opening the door
else
     return true; //we pass the door
end
About wooden tile you also have to assing an ID, then simply write a script teleporting the player to position x-1 or x+1. Function onStepIn.

In this case you can also use
Code:
return player:isPremium()
 
hello this is my first post and i hope it helps you, i use this script for my premium door and it works perfectly.
PHP:
function onUse(cid, item, frompos, item2, topos)
if isPremium(cid) then
pos = getPlayerPosition(cid)
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22, " Please, stand in front of the door.")
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22, "You need to have a premium account to access this area.")
end
end
and you also have to add this in actions in order for it to work
PHP:
  <action itemid="doorid" event="script" value="premiumdoor.lua"/>
in the door id part of the code, you put the door id hehe just get it from RME and put it here and you only have to put it once, the good thing about this is that you wont have to waste 4 seconds putting the action ids in the door you could just put it and it will work.!
 
WHY ON EARTH YOU GUYS LIKE TO MAKE THINGS SO COMPLICATED? SINCE YEARS ALREADY THERE IS A BUILT IN CODE IN DOORS SCRIPT THAT THE ONLY THING NEEDED IN ORDER TO MAKE A DOOR PREMIUM ONLY IS TO SET ITS ACTIONID TO 189 (if you are using tfs 0.3.x/0.4 that is it)
 
WHY ON EARTH YOU GUYS LIKE TO MAKE THINGS SO COMPLICATED? SINCE YEARS ALREADY THERE IS A BUILT IN CODE IN DOORS SCRIPT THAT THE ONLY THING NEEDED IN ORDER TO MAKE A DOOR PREMIUM ONLY IS TO SET ITS ACTIONID TO 189 (if you are using tfs 0.3.x/0.4 that is it)
so you still believe that people read
 
Back
Top