DjSt3rios Posted September 22, 2011 Share Posted September 22, 2011 Hello guys. I wanna make a command to get all the handlings of the car, the acceleration, mass etc. I tried to use this function, but still It's not working: function carhandlings(thePlayer, command) local handlings = getVehicleHandling(getPedOccupiedVehicle(thePlayer)) for i,v in ipairs(handlings) do outputChatBox(i,v) end end addCommandHandler("handlings", carhandlings) I don't get any errors, I just don't see any message. Any help? Link to comment
Deltanic Posted September 22, 2011 Share Posted September 22, 2011 You cannot output i,v as you can with print(). Also, handling properties are strings, so you cannot iterate them with ipairs(). Use ipairs for dictionared tables. function carhandlings(thePlayer, command) local handlings = getVehicleHandling(getPedOccupiedVehicle(thePlayer)) for property,value in pairs(handlings) do outputChatBox( property.." = "..tostring(value) ) end end addCommandHandler("handlings", carhandlings) Link to comment
DjSt3rios Posted September 22, 2011 Author Share Posted September 22, 2011 Works, thanks a lot! 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