Jump to content

Marker gates problem..


Tonnzza

Recommended Posts

Marker1 and marker2 doesn't move gates. What could be wrong?

-- Ovet- 
gate1 = createObject(1965, 1899.8000488281, -1702.5, 27, 0,0,90) 
gate2 = createObject(1965, 1898.3000488281, -1702.4897460938, 27, 0,0,90) 
gate3 = createObject(1965, 1896.8000488281, -1702.4809570313, 27, 0,0,90, doublesided) 
-- Markerit -- 
hitMarker1 = createMarker ( 1897.9, -1701.3000488281, 25.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
hitMarker2 = createMarker ( 1897.6999511719, -1704, 25.5, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
function moveGateUpA( hitElement, matchingDimension ) 
    moveObject(gate1, 5000, 1901.3, -1702.5, 27, 0,0,0) 
    moveObject(gate2, 5000, 1901.3, -1702.4897460938, 27, 0,0,0) 
    moveObject(gate3, 5000, 1901.3, -1702.4809570313, 27, 0,0,0) 
end 
addEventHandler( "onMarkerHit", hitMarker1, moveGateUpA ) 
  
function moveGateDownA( leaveElement, matchingDimension ) 
    setTimer ( timerReady, 10000, 1 ) 
end 
addEventHandler( "onMarkerLeave", hitMarker1, moveGateDownA ) 
  
function timerReady() 
    moveObject(gate1, 5000, 1899.8000488281, -1702.5, 27, 0,0,0) 
    moveObject(gate2, 5000, 1898.3000488281, -1702.4897460938, 27, 0,0,0) 
    moveObject(gate3, 5000, 1896.8000488281, -1702.4809570313, 27, 0,0,0) 
end 
addEventHandler( "onMarkerLeave", hitMarker1) 
  
function moveGateUpB( hitElement, matchingDimension ) 
    moveObject(gate1, 5000, 1901.3, -1702.5, 27, 0,0,0) 
    moveObject(gate2, 5000, 1901.3, -1702.4897460938, 27, 0,0,0) 
    moveObject(gate3, 5000, 1901.3, -1702.4809570313, 27, 0,0,0) 
end 
addEventHandler( "onMarkerHit", hitMarker2, moveGateUpB ) 
  
function moveGateDownB( leaveElement, matchingDimension ) 
    setTimer ( timerReady, 10000, 1 ) 
end 
addEventHandler( "onMarkerLeave", hitMarker2, moveGateDownB ) 
  
function timerReady() 
    moveObject(gate1, 5000, 1899.8000488281, -1702.5, 27, 0,0,0) 
    moveObject(gate2, 5000, 1898.3000488281, -1702.4897460938, 27, 0,0,0) 
    moveObject(gate3, 5000, 1896.8000488281, -1702.4809570313, 27, 0,0,0) 
end 
addEventHandler( "onMarkerLeave", hitMarker2) 

Link to comment

You have to identify the hitElement , see this example below

    Marker = createMarker(x,y,z,"cylinder",1.5,255,255,255) 
    gate = createObject(id,x,y,z,nil,nil,nil) 
     
        function moveGate (hitElement)  
            if (getElementType(hitElement) == "player")  then  
                moveObject(gate,time,x,y,z,) 
            end 
        end 
addEventHandler("onMarkerHit",Marker,moveGate) 

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