#Paper Posted April 2, 2011 Posted April 2, 2011 How i can set the progress of a progressbar proportional the vehicle's healt? My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
proracer Posted April 2, 2011 Posted April 2, 2011 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.
#Paper Posted April 2, 2011 Author Posted April 2, 2011 In the nametags.lua i saw the code for the healt, is it the same thing? But i didn't see the fancyprogress.lua My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Castillo Posted April 2, 2011 Posted April 2, 2011 (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 April 3, 2011 by Guest San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
#Paper Posted April 3, 2011 Author Posted April 3, 2011 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 My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Castillo Posted April 3, 2011 Posted April 3, 2011 Do you have the progress bar someBar? And btw, i know i had a missing ')' but i wanted you to fix it, i was a bit hurry. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
#Paper Posted April 3, 2011 Author Posted April 3, 2011 Yes, i modified somebar whit my bar, but nothing... T_T My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Castillo Posted April 3, 2011 Posted April 3, 2011 I will try it later, right now i'am busy. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
#Paper Posted April 3, 2011 Author Posted April 3, 2011 Ok, np My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Castillo Posted April 3, 2011 Posted April 3, 2011 Ok, i have changed the code, try it now. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
#Paper Posted April 3, 2011 Author Posted April 3, 2011 Ty, it works My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
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