papam77 Posted October 29, 2013 Share Posted October 29, 2013 Hello guys, Is possible to do distance around ped with no marker? I mean if is player 5m near to ped then he can press X or something to open Ped's menu? I need it with no marker. And why is the text floating on my screen randomly when I look to a ped function md () local get3D = getScreenFromWorldPosition ( 2184.70, -3279.12, 1684.65 ) dxDrawText ( "PED1", get3D,tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) end addEventHandler ("onClientRender", root, md ) Link to comment
myonlake Posted October 29, 2013 Share Posted October 29, 2013 getScreenFromWorldPosition returns two values; X and Y coordinate. You're currently only checking for one value. Also, you don't have the proper values set in dxDrawText. It goes like this: dxDrawText(string, float, float, float, float, color...). In order to do that ped thing, make a bind on X key and whenever they press the key the script will check the distance between the elements with getDistanceBetweenPoints3D. Link to comment
papam77 Posted October 29, 2013 Author Share Posted October 29, 2013 And how it should be correctly? Link to comment
denny199 Posted October 29, 2013 Share Posted October 29, 2013 function md () local x3D, y3D = getScreenFromWorldPosition ( 2184.70, -3279.12, 1684.65 ) if x3D and y3D then dxDrawText ( "PED1", x3D, y3D, 500,500,tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) end end addEventHandler ("onClientRender", root, md ) Link to comment
papam77 Posted October 29, 2013 Author Share Posted October 29, 2013 Oh now it works, but here is problem.... From every side i see it elsewhere and when is between ped and me cca 50m it's big, I need it with same size still. 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