Jump to content

gate script


orcun99

Recommended Posts

   gate = createObject( 971, 2334.8000488281, 2444.1000976563, 8.3000001907349, 0, 0, 58 ) --Object ID (Airport Gate=978) & Co-Ordinates of your gates start of position. 
   gatecol = createColCircle ( 2334.8000488281, 2444.1000976563, 15 ) --Co-Ordinates "X" and "Y" and the radius, I use 15 as default. 
  
function openagates(thePlayer) 
        if getElementModel( thePlayer ) == 267 then --Will open only if the player is in the male staff skin 
        moveObject ( gate, 3000, 2334.8000488281, 2444.1000976563, 0 ) --The speed in which 7000 is slow and 2000 is fast to open, Co-Ordinates for the gate to move to. 
        end 
end 
addEventHandler( "onColShapeHit", gatecol, openagates ) --Event Handler to trigger the function 
  
function closegates (thePlayer) 
    moveObject ( gate, 971, 2334.8000488281, 2444.1000976563, 8.3000001907349, 0, 0, 58) 
end 
addEventHandler ( "onMarkerLeave", root, closegates ) 

 

 

 

closegates is not work help pls

Edited by orcun99
Link to comment

 

 gate = createObject( 971, 2334.8000488281, 2444.1000976563, 8.3000001907349, 0, 0, 58 ) --Object ID (Airport Gate=978) & Co-Ordinates of your gates start of position. 
   gatecol = createColCircle ( 2334.8000488281, 2444.1000976563, 15 ) --Co-Ordinates "X" and "Y" and the radius, I use 15 as default. 
  
function openagates(thePlayer) 
        if getElementModel( thePlayer ) == 267 then --Will open only if the player is in the male staff skin 
        moveObject ( gate, 3000, 2334.8000488281, 2444.1000976563, 0 ) --The speed in which 7000 is slow and 2000 is fast to open, Co-Ordinates for the gate to move to. 
        end 
end 
addEventHandler( "onColShapeHit", gatecol, openagates ) --Event Handler to trigger the function 
  
function closegates (thePlayer) 
    moveObject ( gate, 971, 2334.8000488281, 2444.1000976563, 8.3000001907349, 0, 0, 58) 
end 
addEventHandler ( "onColShapeLeave", root, closegates ) 

 

I would recommend to do it with "Client", but maybe it will work

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...