Lachuks Posted July 20, 2018 Posted July 20, 2018 (edited) Hello, there! I'm up to make a speedometer but found some kind of problem. When vehicle is on ~25% it starts flaming and blowing up. How to make veh flaming when it's on 0%? Code local car = getPedOccupiedVehicle ( getLocalPlayer() ) local carhp = math.floor(getElementHealth(car)/10) dxDrawRectangle(screenW * 0.7760, screenH * 0.8796, screenW * 0.1083/100*carhp, screenH * 0.0278, tocolor(171, 100, 17, 207), false) Image Edited July 20, 2018 by Emix
xMKHx Posted July 20, 2018 Posted July 20, 2018 try this i'm using my phone i didn't test it local car = getPedOccupiedVehicle ( getLocalPlayer() ) local carfullhp = math.floor(getElementHealth(car)/10) local carhp = carfullhp - 25 dxDrawRectangle(screenW * 0.7760, screenH * 0.8796, screenW * 0.1083/100*carhp, screenH * 0.0278, tocolor(171, 100, 17, 207), false) 1 UDC:RPG Owner 13 Years Experience ______________________________________ Spoiler - ATM Robbery Script. - Police Shield Script - Army Animations Script - Criminal Skills Script - Drop Weapons Script
Lachuks Posted July 20, 2018 Author Posted July 20, 2018 (edited) 100% replaced with 75%. Can't fix veh to 100% Fixed ( Had also to replace /100*carhp with /75*carhp ) Edited July 20, 2018 by Emix 1
Moderators IIYAMA Posted July 20, 2018 Moderators Posted July 20, 2018 math.max(vehHealth - 250, 0) / 750 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