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

Windows problem with a vip system ( door )

Cris2387

Member
Joined
Dec 30, 2013
Messages
177
Reaction score
9
door is not teleporting players to the right position :(
my doorvip.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   local cidPosition = getCreaturePosition(cid)
     if (item.actionid == 5788 and getPlayerStorageValue(cid,13500) >= 1) then
       if cidPosition.x < toPosition.x then
         doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
                 doCreatureSay(cid, "Bem-vindo a area VIP!", TALKTYPE_ORANGE_1)
       else
         doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
                 doCreatureSay(cid, "Bem-vindo a area VIP", TALKTYPE_ORANGE_1)
       end
       return TRUE
     else
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao possui Vip Access.")
       return TRUE
   end
   return FALSE
end
this is what happens if i try to go from bottom to top
Before i use it:
upload_2015-1-24_13-33-16.png
After i use it:
upload_2015-1-24_13-33-35.png
This is what happens if i try to go from top to bottom:
Before i use it:
upload_2015-1-24_13-34-17.png
After i use it:
upload_2015-1-24_13-34-40.png
i dont get any errors in the distro :l please help me
 
Last edited:
Try this?
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   local cidPosition = getCreaturePosition(cid)
     if (item.actionid == 5788 and getPlayerStorageValue(cid,13500) >= 1) then
       if cidPosition.x < toPosition.x then
         doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
                 doCreatureSay(cid, "Bem-vindo a area VIP!", TALKTYPE_ORANGE_1)
       else
         doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
                 doCreatureSay(cid, "Bem-vindo a area VIP", TALKTYPE_ORANGE_1)
       end
       return TRUE
     else
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao possui Vip Access.")
       return TRUE
   end
   return FALSE
end
 
This script is made for vertical doors, so change the x parts for the y.
Comparing the x positions is not useful for a horizontal door since they will be the same.

You can do it like the vip door in this vip system (change the vip function for storage then).
http://otland.net/threads/the-best-vip-system-ever-action-movevent-globalevent.71638/
Or you can just do it like in doors.lua, transform the door to an open door and teleport the player to toPosition.
 
This script is made for vertical doors, so change the x parts for the y.
Comparing the x positions is not useful for a horizontal door since they will be the same.

You can do it like the vip door in this vip system (change the vip function for storage then).
http://otland.net/threads/the-best-vip-system-ever-action-movevent-globalevent.71638/
Or you can just do it like in doors.lua, tranform the door to an open door and teleport the player to toPosition.
hey i ended up using this script
Code:
function onUse(cid, item, frompos, item2, topos)
if (item.actionid == 5788 and getPlayerStorageValue(cid,13500) >= 1) 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
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Bem-vindo a area VIP!')
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,"Stand in front of the door.")
return true
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao possui Vip Access.")
end
return true
end
works perfect :) thank you
 
Back
Top