WhoAmI Posted April 1, 2015 Share Posted April 1, 2015 You changed nothing in my code. Link to comment
#RooTs Posted April 1, 2015 Share Posted April 1, 2015 You changed nothing in my code. sure? Link to comment
WhoAmI Posted April 1, 2015 Share Posted April 1, 2015 Well, yea. You just added unnecessary condition ('if'). In both cases it draws same thing. Link to comment
#RooTs Posted April 1, 2015 Share 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 ) Link to comment
Castillo Posted April 1, 2015 Share 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? Link to comment
#RooTs Posted April 1, 2015 Share 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 Link to comment
JR10 Posted April 1, 2015 Share Posted April 1, 2015 Not to mention, your "all resolutions" logic is not correct. EDIT: Wow... Link to comment
Castillo Posted April 1, 2015 Share 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. Link to comment
#RooTs Posted April 1, 2015 Share 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 Link to comment
Emilio_M Posted April 1, 2015 Author Share 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 ? Link to comment
Castillo Posted April 1, 2015 Share Posted April 1, 2015 May I see the code that you are currently using? Link to comment
Emilio_M Posted April 1, 2015 Author Share 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 ) Link to comment
Castillo Posted April 1, 2015 Share 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. Link to comment
Emilio_M Posted April 1, 2015 Author Share Posted April 1, 2015 No I doesnt want a full circle. The current is good. Link to comment
Castillo Posted April 1, 2015 Share 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? Link to comment
Emilio_M Posted April 1, 2015 Author Share Posted April 1, 2015 Yes and ? You change nothing. Link to comment
Castillo Posted April 1, 2015 Share 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%. Link to comment
Emilio_M Posted April 1, 2015 Author Share Posted April 1, 2015 No, i have two bar on 134° to 225. Not one. The problems is under 1 and 10HP. Link to comment
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