#RooTs Posted March 31, 2015 Posted March 31, 2015 It reduce the width of the circle. sorry, I tried to help
Emilio_M Posted March 31, 2015 Author Posted March 31, 2015 So, i thinks dxDrawCircle is not a good solution. I look some script like this : viewtopic.php?f=108&t=33342 It draw a progress bar with but i dont understand that...
-.Paradox.- Posted March 31, 2015 Posted March 31, 2015 https://community.multitheftauto.com/in ... ls&id=8550 Take a look on how the author did it by checking functions he used and parameters etc
Emilio_M Posted April 1, 2015 Author Posted April 1, 2015 https://community.multitheftauto.com/index.php?p=resources&s=details&id=8550Take a look on how the author did it by checking functions he used and parameters etc Thanks but it's always DxDrawCircle.
GTX Posted April 1, 2015 Posted April 1, 2015 There is an awesome way to do circular progress bars without any frame drops. Try shaders.
Emilio_M Posted April 1, 2015 Author Posted April 1, 2015 Do you have some exemples ? I never used shaders.
JR10 Posted April 1, 2015 Posted April 1, 2015 The community has a lot of examples of shaders. https://wiki.multitheftauto.com/wiki/Shader_examples
WhoAmI Posted April 1, 2015 Posted April 1, 2015 100hp: 50hp: 1hp: Here is the code local screenX, screenY = guiGetScreenSize ( ); local maxAngle = 180; addEventHandler ( "onClientRender", root, function ( ) local hp = getElementHealth ( localPlayer ) * ( maxAngle / 100 ); dxDrawCircle ( ( screenX - 50 ) / 2, ( screenY - 50 ) / 2, 50, 5, 1, 0, hp, tocolor ( 255, 0, 0, 255 ), false ); end );
Emilio_M Posted April 1, 2015 Author Posted April 1, 2015 Or you could use dxDrawImageSection. Yeah i thinks it's the solution but i dont have idee how to do that...
Emilio_M Posted April 1, 2015 Author Posted April 1, 2015 100hp: 50hp: 1hp: Here is the code local screenX, screenY = guiGetScreenSize ( ); local maxAngle = 180; addEventHandler ( "onClientRender", root, function ( ) local hp = getElementHealth ( localPlayer ) * ( maxAngle / 100 ); dxDrawCircle ( ( screenX - 50 ) / 2, ( screenY - 50 ) / 2, 50, 5, 1, 0, hp, tocolor ( 255, 0, 0, 255 ), false ); end ); Thanks but I doesnt want a half-circle. Test with 0-41° for 100 HP ans see the result.
WhoAmI Posted April 1, 2015 Posted April 1, 2015 It should work normally. 100 * 41 / 100 = 41° Just change maxAngle to your value.
Emilio_M Posted April 1, 2015 Author Posted April 1, 2015 No it not work. The proportionality for 1 to 10 HP isnt correct. Change your HP step to step 1-10 an see the bar.
Castillo Posted April 1, 2015 Posted April 1, 2015 If you want it to be a full circle, then it has to be max angle 360, not 180 ( half circle ).
#RooTs Posted April 1, 2015 Posted April 1, 2015 local screenX, screenY = guiGetScreenSize ( ); local maxAngle = 180; addEventHandler ( "onClientRender", root, function ( ) local hp = getElementHealth ( localPlayer ) * ( maxAngle / 100 ); dxDrawCircle ( ( screenX - 50 ) / 2, ( screenY - 50 ) / 2, 50, 5, 1, 0, hp, tocolor ( 255, 0, 0, 255 ), false ); end ); where is the getPedStat, 24; to health in 200% ????
Emilio_M Posted April 1, 2015 Author Posted April 1, 2015 It's correct but it's just too small. Not too small, on the contrary, it's to big. Under 10HP the progress bar doesnt move.
WhoAmI Posted April 1, 2015 Posted April 1, 2015 It's changing. It's different on 1hp and 10hp. But those changes are small, that's why you can't see them that much.
#RooTs Posted April 1, 2015 Posted April 1, 2015 added, all resolutions, and added getPedStat to health in 200% local screenW,screenH = guiGetScreenSize() local resW, resH = 1280, 720 local x, y = (screenW/resW), (screenH/resH) local maxAngle = 180 addEventHandler ( "onClientRender", root, function ( ) local stat = getPedStat ( getLocalPlayer(), 24 ) local hp = getElementHealth ( localPlayer ) * ( maxAngle / 100 ) if stat < 1000 then dxDrawCircle ( ( x - 50 ) / 2, ( y - 50 ) / 2, 50, 5, 1, 0, hp, tocolor ( 255, 0, 0, 255 ), false ) else dxDrawCircle ( ( x - 50 ) / 2, ( y - 50 ) / 2, 50, 5, 1, 0, hp, tocolor ( 255, 0, 0, 255 ), false ) end end)
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