Jump to content

Fuel condition and the condition of the vehicle.


Guest Guest26901

Recommended Posts

Ehh, now if i create new car, vehicle condition is 90%. Now it burning <14-13%.

I would like to at the entrance to the newly created vehicle, vehicle status was equal to 100%, and that the vehicle was on fire when the state was equal to 0%.

Link to comment

Car health ranges from a little above 1000 to 250, between 250 and 0 the car is burning. To ignore the under 250 part you can use math.max(). So to get it in a percentage:

carHealth = ( math.max(getElementHealth(vehicle) - 250, 0) ) / 7.5 

Slap some rounding function on that and you should be good to go.

Link to comment

It's almost a good, but not totality. When the condition of the vehicle is 13%, the bar is no longer visible.

  
            dxDrawRectangle(x-30,(y/2)+44,16,21,colour); 
            local HealthHeight = ((136/100)*carHealth); 
            local stan = ( math.max(getElementHealth(vehicle) - 360, 1) ) / 7.5 * 1.6 
            local yOffset = stan-136 
            dxDrawRectangle(x-50,(y/2)-71-yOffset,16,stan,0x99990000); 
  
        dxDrawText(tostring(HealthHeight-36)..'%',x-105,y-65); 
        dxDrawText(tostring(fuel)..'%',x-105,y-50); 
  

Link to comment

I can not explain this too you because i do not know the fine with English, and even then I use google translator. In addition, it is not my code.

Just when the state of the vehicle is equal to 13%, you can not see the belt.

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...