Jump to content

Healt Progress


#Paper

Recommended Posts

Posted

There is already default resource: "race" and in there file called: "fancyprogress.lua" - there you can find it.

Also the nametags.lua has it too.

Posted (edited)
addEventHandler("onClientRender",getRootElement(), 
function () 
if ( somebar ) then 
    local veh = getPedOccupiedVehicle(getLocalPlayer()) 
    if veh then 
    health = getElementHealth(veh)/100*10 
    guiProgressBarSetProgress(somebar, health) 
      end 
   end 
end) 

It should work.

Edited by Guest
Posted
addEventHandler("onClientRender",getRootElement(), 
function () 
if ( somebar ) then 
    local veh = getPedOccupiedVehicle(getLocalPlayer() 
    if veh then 
    health = math.floor(getElementHealth(veh)) 
    guiProgressBarSetProgress(somebar, health) 
      end 
   end 
end) 

It should work.

No, it doesn't work, and doesn't show any error...

P.S: You forgot a ')' to close getPedOccupiedVehicle, i added it :D

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