Lachuks Posted July 20, 2018 Share 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 Link to comment
xMKHx Posted July 20, 2018 Share 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 Link to comment
Lachuks Posted July 20, 2018 Author Share 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 Link to comment
Moderators IIYAMA Posted July 20, 2018 Moderators Share Posted July 20, 2018 math.max(vehHealth - 250, 0) / 750 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