Weigh Posted January 11, 2017 Share Posted January 11, 2017 (edited) Good evening I would add to my door system a function that forces the player to be close enough to the door to use the command to open the door. I would understand if you did not give me the whole code but at least tell me the necessary functions I'm french sorry for my english. Bye Edited January 11, 2017 by Weigh Link to comment
koragg Posted January 12, 2017 Share Posted January 12, 2017 (edited) You can use https://wiki.multitheftauto.com/wiki/GetElementPosition to get current player's position every frame with onClientRender and compare that to the door's position (again use same way to get door positron). For the comparing you'll need a function called getDistanceBetweenPoints3D. Good luck There are examples in wiki to help you. And if the player is in the specified interval, allow the player to use the command which opens the door. Edited January 12, 2017 by koragg Link to comment
^iiEcoo'x_) Posted January 12, 2017 Share Posted January 12, 2017 createMarker createMarkerAttachedTo isElementWithinMarker setVehicleDoorState 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