Araa Posted April 17, 2012 Posted April 17, 2012 Well, this might sound noob but.. I would like to know how to show ONLY the entire value in this script. function vehiclestatus ( ) local car = getPedOccupiedVehicle (localPlayer) local sx, sy, sz = getElementVelocity (car) local speed = (sx^2 + sy^2 + sz^2)^(0.5) local kmh = speed*180 local health = getElementHealth (car) local currenthealth = health/10 dxDrawText ( "Speed: "..tostring(kmh).."Kph", 1000, screenHeight - 37, screenWidth, screenHeight, tocolor ( 220, 220, 220, 200 ), 1.5, "default" ) dxDrawText ( "Health: "..tostring(currenthealth).."%", 1000, screenHeight - 55, screenWidth, screenHeight, tocolor ( 220, 220, 220, 200 ), 1.5, "default" ) end function HandleTheRender ( ) addEventHandler ( "onClientRender", root, vehiclestatus ) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRender ) E.g: If the health is in 86.11585335685 % I would like to make it show ONLY 86% Thanks since now
Araa Posted April 17, 2012 Author Posted April 17, 2012 https://wiki.multitheftauto.com/wiki/Math.round Woah, got it, thanks. /lock please
Michael# Posted April 17, 2012 Posted April 17, 2012 Someone can have the same problem or are having the same problem but don't know how to use "math.round" functions. This must not be closed now, at least I think.
Castillo Posted April 17, 2012 Posted April 17, 2012 https://wiki.multitheftauto.com/wiki/Math.round Woah, got it, thanks. /lock please Someone may have the same problem, there's no point on closing it .
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