Ivo1313 Posted January 14, 2020 Share Posted January 14, 2020 I need some help in my script, im using onClientRender and getScreenFomWorld position but the dxDrawText wont work! heres my program: marker = createMarker(-662.33703613281,2365.9025878906,178.9553527832, "cylinder", 1.5, 0, 100, 100, 200) function Texto() if(getDistanceBetweenPoints3D(0, 0, 4+.5, getElementPosition(getLocalPlayer()))) < 20 then local coords = {getScreenFromWorldPosition(-662.33703613281,2365.9025878906,178.9553527832)} if coords[1] and coords[2] then dxDrawText("CJ", coords[1], coords[2], coords[1], coords[2], tocolor(255,0,0,255), 10, "sans", "center", "center", false, false, false, false) end end end addEventHandler("onClientRender", root, Texto) Link to comment
Bilal135 Posted January 14, 2020 Share Posted January 14, 2020 Perhaps, what you're looking for is dxDrawImageOnElement. Link to comment
justn Posted January 14, 2020 Share Posted January 14, 2020 (edited) I believe this is what you're trying to do. marker = createMarker(-662.33703613281,2365.9025878906,178.9553527832, "cylinder", 1.5, 0, 100, 100, 200) function Texto() local x,y,z = getElementPosition(localPlayer) local distance = getDistanceBetweenPoints3D(-662.33703613281,2365.9025878906,178.9553527832,x,y,z) if distance < 20 then local sx,sy = getScreenFromWorldPosition(-662.33703613281,2365.9025878906,178.9553527832) if sx and sy then local coords = {sx,sy} if coords[1] and coords[2] then dxDrawText("CJ", coords[1], coords[2], coords[1], coords[2], tocolor(255,0,0,255), 10, "sans", "center", "center", false, false, false, false) end end end end addEventHandler("onClientRender", root, Texto) Edited January 14, 2020 by Shux Link to comment
Ivo1313 Posted January 14, 2020 Author Share Posted January 14, 2020 Oh, thanks for your reply, the program worked now, analysing your file i can see what i did wrong, thank you! 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