Jump to content

Open Gate scripting not working :(


DYNAMO

Recommended Posts

Posted
function createTheGate () 
  
  
   myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
  
  
end 
  
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
  
  
  
  
  
  
function openMyGate ( ) 
  
  
   moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947, 0, 0, 90 ) 
  
  
       setTimer ( movingMyGateBack, 5000, 1 ) 
  
  
end 
  
  
addCommandHandler("swat",openMyGate) 
  
  
  
  
  
function movingMyGateBack () 
  
  
   moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
  
  
end 

I tried this , but not working .

please help any admin , moderator , or any who know about it.

Posted

Mm try this.

function createTheGate30 () 
   myGate30 = createObject ( 971, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate30 ) 
  
  
function openMyGate30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
end 
addCommandHandler("swat1",openMyGate30) 
  
function movingMyGateBack30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 
addCommandHandler("swat2",movingMyGateBack30) 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
Mm try this.
function createTheGate30 () 
   myGate30 = createObject ( 971, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate30 ) 
  
  
function openMyGate30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
end 
addCommandHandler("swat1",openMyGate30) 
  
function movingMyGateBack30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 
addCommandHandler("swat2",movingMyGateBack30) 

He don't want to close the gate by command, he wants to close by timer

Try this

function createTheGate () 
myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
function openMyGate ( ) 
moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947, 0, 0, 90 ) 
setTimer ( moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ), 5000, 1 ) 
end 
addCommandHandler("swat",openMyGate) 

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

Posted
Mm try this.
function createTheGate30 () 
   myGate30 = createObject ( 971, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate30 ) 
  
  
function openMyGate30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
end 
addCommandHandler("swat1",openMyGate30) 
  
function movingMyGateBack30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 
addCommandHandler("swat2",movingMyGateBack30) 

He don't want to close the gate by command, he wants to close by timer

Try this

function createTheGate () 
myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
function openMyGate ( ) 
moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947, 0, 0, 90 ) 
setTimer ( moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ), 5000, 1 ) 
end 
addCommandHandler("swat",openMyGate) 

Open and close with one command? o.O

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted (edited)
Mm try this.
function createTheGate30 () 
   myGate30 = createObject ( 971, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate30 ) 
  
  
function openMyGate30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
end 
addCommandHandler("swat1",openMyGate30) 
  
function movingMyGateBack30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 
addCommandHandler("swat2",movingMyGateBack30) 

He don't want to close the gate by command, he wants to close by timer

Try this

function createTheGate () 
myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
function openMyGate ( ) 
moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947, 0, 0, 90 ) 
setTimer ( moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ), 5000, 1 ) 
end 
addCommandHandler("swat",openMyGate) 

Wrong timer.

@Just make sure you have it server side.

Edited by Guest
CiTLh.png
Posted
can anyone send me the correct script?

Your script is work, MAKE SURE IT SERVER SIDE NOT CLIENT SIDE.

CiTLh.png
Posted

Try if the first one is rotates try the second one

function createTheGate () 
   myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 9 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
function openMyGate ( ) 
moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
setTimer ( movingMyGateBack, 5000, 1 ) 
end 
addCommandHandler("swat",openMyGate) 
  
  
function movingMyGateBack () 
   moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 

the second one

function createTheGate () 
   myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
function openMyGate ( ) 
moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
setTimer ( movingMyGateBack, 5000, 1 ) 
end 
addCommandHandler("swat",openMyGate) 
  
  
function movingMyGateBack () 
   moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

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