franku Posted July 23, 2015 Share Posted July 23, 2015 guys how i make this when i closer to ped this text show when i go far it disappear http://i.imgur.com/mSV3FfT.png Link to comment
TheSmart Posted July 23, 2015 Share Posted July 23, 2015 try this local maxDistance = 12 -- the distance showing 3dtext local ped = createPed (ID,x,y,z) addEventHandler ( "onClientRender", root, function ( ) local pX, pY, pZ = getElementPosition ( localPlayer ) local pedX, pedY, pedZ = getElementPosition ( ped ) local distance = getDistanceBetweenPoints3D ( pX, pY, pZ, pedX, pedY, pedZ ) if ( distance <= 12 ) then local x, y = getScreenFromWorldPosition ( pedX, pedY, pedZ ) if ( x and y ) then dxDrawText( "Text here", x, y+1.5, _, _, tocolor( 255, 0, 0, 255 ), 1, myFont, "center", "center" ) end end end ) 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