Jump to content

how to check where something is / Figured out sort of


Recommended Posts

i have made a backdoor / sidelift / and rearlift for the aircraft carrier by easterbay airport

i use collision spheres to move lifts and door when player approaches but i need to put a check to see where the lifts / door are when player hits collision sphere

my problem is that if player stands on the lift it moves down but when it moves back up player hits collision sphere again and lift moves back down

i need to deactivate the collision sphere or make it do a check to see where the lift is so it will go all the way up and player can get off on aircraft carrier deck

i was thinking of just using setElementPosition on the sphere and then moving it back again on a timer but just wondered if theres a better way of doing it

heres the code

backdooropen = createColSphere ( -1465, 501, 1, 5 ) 
backdoor = createObject ( 3113, -1465.0147705078, 501.51794433594, 1.900021314621, 0, 0, 0 ) 
  
sidepanelopen = createColSphere ( -1414, 516, 16, 5 ) 
sidepanel = createObject ( 3114, -1414.5109863281, 516.51159667969, 16.721645355225, 0, 0, 0 ) 
  
rearpanelopen = createColSphere ( -1456, 501, 20, 5 ) 
rearpanel = createObject ( 3115, -1456.6696777344, 501.32189941406, 17.009790420532, 0, 0, 0 ) 
  
  
function carrierbackdooropen () 
   outputChatBox ( "open sesame" ) 
   moveObject ( backdoor, 5000, -1463.3822021484, 499.57089233398, -9.5959815979004, 0, 0, 0 ) 
   setTimer ( moveObject, 10000, 1, backdoor, 5000, -1465.0147705078, 501.51794433594, 1.900021314621, 0, 0, 0 ) 
   setTimer ( outputChatBox, 9900, 1, "close sesame" ) 
end 
  
function carriersidepanelopen () 
   outputChatBox ( "Side Panel Lowering" ) 
   moveObject ( sidepanel, 10000, -1414.5109863281, 516.51159667969, 9, 0, 0, 0 ) 
   setTimer ( moveObject, 20000, 1, sidepanel, 10000, -1414.5109863281, 516.51159667969, 16.721645355225, 0, 0, 0 ) 
   setTimer ( outputChatBox, 19800, 1, "Side Panel Rising" ) 
end 
  
  
function carrierrearpanelopen () 
   outputChatBox ( "Rear Panel Lowering" ) 
   moveObject ( rearpanel, 10000, -1456.6696777344, 501.32189941406, 9.009790420532, 0, 0, 0 ) 
   setTimer ( moveObject, 20000, 1, rearpanel, 10000, -1456.6696777344, 501.32189941406, 17.009790420532, 0, 0, 0 ) 
   setTimer ( outputChatBox, 19800, 1, "Rear Panel Rising" ) 
end 
  
  
addEventHandler ( "onColShapeHit", backdooropen, carrierbackdooropen ) 
addEventHandler ( "onColShapeHit", sidepanelopen, carriersidepanelopen ) 
addEventHandler ( "onColShapeHit", rearpanelopen, carrierrearpanelopen ) 

any ideas greatly appreciated THANX :D

EDIT ::

i have sorted it with setelementposition thanx for lookin :D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...