MTA FANAT Posted August 21, 2009 Share Posted August 21, 2009 Hello everybody! please help me to make a script who move gates if you write in chat /gates. picture:[attachment=0]gates.PNG[/attachment] Link to comment
Slothman Posted August 22, 2009 Share Posted August 22, 2009 honestly, use a colshape! commands are lame! Link to comment
Vercetti1010 Posted August 22, 2009 Share Posted August 22, 2009 Yeah, definitely use colshapes. Its a pain in the ass to use commands. Make sure the colshape only triggers for what element you want it to trigger on. For instance, if you don't add this check, if someone drives in it, it will trigger for both the vehicle AND the player. do something like this: function openGate(theElement,matchingDimension) if (source == theColShape and getElementType(theElement) == "player") then moveObject(.......) end end Also make sure you add an event handler and function for when they exit the col shape so the gate will automatically close. As for the actual movement of the object, go to the wiki (development.mtasa.com) and search for moveObject. What you are going to have to do is create the object in the closed position, get the coordinates (and rotation too!) and then move the object to the open position, then do the same. Once you do that, for the function that opens the gate, tell it to move the gate to the open position. For when you exit, trigger a function that moves the gate to the closed position. You can even put restrictions to who or what opens it too, such as teams or what kind of element. That's another subject though. Try out what I said and I'm sure you will find success. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now