TrickyTommy Posted August 28, 2017 Posted August 28, 2017 Hello, i want to get the original handling of all vehicles, and boost them a bit. But i can't get their speed, it returns nil! I did not understand the examples online. function realHandling() if isTimer (checkVehicles) then killTimer (checkVehicles) end local checkVehicles = setTimer (function() vehicles = getElementsByType("vehicle") for k, v in pairs(vehicles) do local originalHandling = getOriginalHandling(596) for k in pairs (originalHandling) do outputDebugString (tostring(k["maxVelocity"])) end if not getElementData (v, "realHandled") then end end end, 50, 0) end addEventHandler ("onResourceStart", getRootElement(), realHandling)
Moderators IIYAMA Posted August 28, 2017 Moderators Posted August 28, 2017 for _, vehicle in pairs(vehicles) do local originalHandling = getOriginalHandling(getElementModel(vehicle)) for _, k in pairs (originalHandling) do 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
TrickyTommy Posted August 28, 2017 Author Posted August 28, 2017 3 hours ago, IIYAMA said: for _, vehicle in pairs(vehicles) do local originalHandling = getOriginalHandling(getElementModel(vehicle)) for _, k in pairs (originalHandling) do okay, thanks, but how do i ask for example the car's maximum velocity?
Moderators IIYAMA Posted August 28, 2017 Moderators Posted August 28, 2017 (edited) You can ask it like this: "Can you please make an example that shows all the cars their maximum velocity?" But I am afraid this section isn't for English lessons my friend... Edited August 28, 2017 by IIYAMA 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
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