MAB Posted July 18, 2015 Share Posted July 18, 2015 hi i am trying to draw a text that displays the vehicle health and make it fits all screens with that but it didn't work. local sx,sy = guiGetScreenSize() local px,py = 1600,900 local x,y = (sx/px), (sy/py) local car = getPedOccupiedVehicle ( localPlayer ) local health = getElementHealth ( car ) local currenthealth = math.floor( health/10 ) dxDrawText(tostring(currenthealth).." % ", x*1090, y*635, x*1226, y*549, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) Link to comment
Rataj Posted July 18, 2015 Share Posted July 18, 2015 Consider make that using addition (or subtraction) instead of multiplication. Example: -- Left top corner local car = getPedOccupiedVehicle ( localPlayer ) local health = getElementHealth ( car ) local currenthealth = math.floor( health/10 ) dxDrawText(tostring(currenthealth).." % ", 100, 50, 200, 50, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) -- Right bottom corner local sx,sy = guiGetScreenSize() local car = getPedOccupiedVehicle ( localPlayer ) local health = getElementHealth ( car ) local currenthealth = math.floor( health/10 ) dxDrawText(tostring(currenthealth).." % ", sx-100, sy-50, x, y, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) Link to comment
GTX Posted July 18, 2015 Share Posted July 18, 2015 https://wiki.multitheftauto.com/wiki/Gu ... esolutions 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