Trust aka Tiffergan Posted June 8, 2020 Posted June 8, 2020 I have a question, how can I make a script in which I create a vehicle for a command, and if someone takes it from me, then I type this command and he returns to my cords x / y / z, I hope you understand, I just have one vehicle someone will take it from me then I will enter the command and the vehicle is taken from them and he comes back to me i hope you understand sorry for bad english R
Sisqo0 Posted June 8, 2020 Posted June 8, 2020 (edited) getElementPosition setElementPosition createVehicle addCommandHandler You can give the vehicle you spawned a special id so you can get it back. setElementData(vehicle, "ID", num) getElementData(vehicle, "ID") Edited June 8, 2020 by Sisqo0 1
Moderators IIYAMA Posted June 8, 2020 Moderators Posted June 8, 2020 @Sisqo0 Did you know that there are id functions available? Which are very similar to those that are used in html/css/js. https://wiki.multitheftauto.com/wiki/SetElementID https://wiki.multitheftauto.com/wiki/GetElementByID 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Sisqo0 Posted June 8, 2020 Posted June 8, 2020 @IIYAMA Oh! you are right and those id functions is better in this case but i forgot since i used to use setElementData to save more data to one element. 1
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