WhoAmI Posted April 1, 2015 Posted April 1, 2015 Well, yea. You just added unnecessary condition ('if'). In both cases it draws same thing.
#RooTs Posted April 1, 2015 Posted April 1, 2015 Well, yea. You just added unnecessary condition ('if'). In both cases it draws same thing. if you no know the mta has health 100% and 200%, and that you no added, look in line ( getPedStat )
Castillo 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) Do you even check what you post? don't you see that both dxDrawCircle have the same arguments? and that "stat" is not being used anywhere but in that useless "if" statement?
#RooTs Posted April 1, 2015 Posted April 1, 2015 Do you even check what you post? don't you see that both dxDrawCircle have the same arguments? and that "stat" is not being used anywhere but in that useless "if" statement? he just use his calculations, I forever using this. and always I had success local stat = getPedStat ( getLocalPlayer(), 24 ) if stat < 1000 then dx.... else dx.... end
JR10 Posted April 1, 2015 Posted April 1, 2015 Not to mention, your "all resolutions" logic is not correct. EDIT: Wow...
Castillo Posted April 1, 2015 Posted April 1, 2015 Do you even check what you post? don't you see that both dxDrawCircle have the same arguments? and that "stat" is not being used anywhere but in that useless "if" statement? he just use his calculations, I forever using this. and always I had success local stat = getPedStat ( getLocalPlayer(), 24 ) if stat < 1000 then dx.... else dx.... end So, your solution is to make a useless check, to draw the same thing no matter what "stat" is returning? You really should avoid posting if you don't know how to help, since you're only confusing the person who asked for help.
#RooTs Posted April 1, 2015 Posted April 1, 2015 Not to mention, your "all resolutions" logic is not correct.EDIT: Wow... how would your calculation for this? I want to learn to do
Emilio_M Posted April 1, 2015 Author Posted April 1, 2015 I dont care about all resolution, it's not my question I know what i have to do for all resolution. Beacause we see that difference. what? Look that RED BAR : http://gyazo.com/3a7523cc2fd75726452f068c87e39dec ( at 10HP ) http://gyazo.com/809e2c7f1281361de1063d1b224c37e4 ( at 1HP ) You see a big difference ?
Emilio_M Posted April 1, 2015 Author Posted April 1, 2015 local hpMin = 176 local hpMax = 135 local hpRate = hpMin-hpMax local hp = hpMin-((getElementHealth(getLocalPlayer())*hpRate)/100) dxDrawCircle( 220,796,113, 16,1,134,226,tocolor(0,0,0,255)) -- black bar background dxDrawCircle( 220,796,110, 15,1,hp,hpMin,tocolor(255,0,0,255)) -- red bar ( HP )
Castillo Posted April 1, 2015 Posted April 1, 2015 Have you tried to use WhoAmI's 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 ); If you want it to be a full circle, change this variable: local maxAngle = 180; to 360 instead of 180.
Emilio_M Posted April 1, 2015 Author Posted April 1, 2015 No I doesnt want a full circle. The current is good.
Castillo Posted April 1, 2015 Posted April 1, 2015 local hpMin = 225 local hpMax = 135 local hpRate = ( ( hpMin - hpMax ) / 100 ) addEventHandler ( "onClientRender", root, function ( ) local hp = ( hpMin - ( getElementHealth ( localPlayer ) * hpRate ) ) dxDrawCircle ( 220, 796, 113, 16, 1, 134, 226, tocolor ( 0, 0, 0, 255 ) ) -- black bar background dxDrawCircle ( 220, 796, 112, 12, 1, hp, hpMin, tocolor ( 255, 0, 0, 255 ) ) -- red bar ( HP ) end ) Is that what you want?
Castillo Posted April 1, 2015 Posted April 1, 2015 Yes, I did change something. This line: local hpMin = 176 I changed it to: local hpMin = 225 I tested it and it fills the whole bar when my health is 100%.
Emilio_M Posted April 1, 2015 Author Posted April 1, 2015 No, i have two bar on 134° to 225. Not one. The problems is under 1 and 10HP.
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