Jump to content

Entire value?


Araa

Recommended Posts

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 ;)

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...