Twisted Posted July 8, 2011 Posted July 8, 2011 how to create a dx text at a GTA position like the x,y,z value could someone help me? never tried it before dont even know which functions to use
Castillo Posted July 8, 2011 Posted July 8, 2011 (edited) I Think with this function: getScreenFromWorldPosition you can get it to work. Edited July 8, 2011 by Guest
Twisted Posted July 8, 2011 Author Posted July 8, 2011 ok ill try that see how i get on with it thanks castillo, could i have a quick example?
Johnniey Posted July 9, 2011 Posted July 9, 2011 local x = 4985 local y = -3575 local z = 9 addEventHandler("onClientRender",getRootElement(), function() local px,py,pz = getElementPosition(getLocalPlayer()) local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if distance <= 150 then local sx,sy = getScreenFromWorldPosition ( x, y, z+0.95, 0.06 ) if not sx then return end local scale = 1/(0.3 * (distance / 150)) dxDrawText ( "HERE'S YOUR TEXT", sx, sy - 30, sx, sy - 30, tocolor(255,155,0,200), math.min ( 0.4*(150/distance)*1.4,4), "default", "center", "bottom", false, false, false ) end end )
Twisted Posted July 9, 2011 Author Posted July 9, 2011 Use 3dt resource by TheKid thanks Qais may use this in the future local x = 4985 local y = -3575 local z = 9 addEventHandler("onClientRender",getRootElement(), function() local px,py,pz = getElementPosition(getLocalPlayer()) local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if distance <= 150 then local sx,sy = getScreenFromWorldPosition ( x, y, z+0.95, 0.06 ) if not sx then return end local scale = 1/(0.3 * (distance / 150)) dxDrawText ( "HERE'S YOUR TEXT", sx, sy - 30, sx, sy - 30, tocolor(255,155,0,200), math.min ( 0.4*(150/distance)*1.4,4), "default", "center", "bottom", false, false, false ) end end ) thank you for the example
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