-.Paradox.- Posted October 10, 2013 Posted October 10, 2013 Hello im asking for some useful functions to attach a text to marker thanks for helping If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
myonlake Posted October 10, 2013 Posted October 10, 2013 getScreenFromWorldPosition dxDrawText getElementPosition getElementInterior getElementDimension getDistanceBetweenPoints3D If I helped you, please click the like button on the right Thanks!
-.Paradox.- Posted October 10, 2013 Author Posted October 10, 2013 Thanks I made it and it work perfectly. If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
myonlake Posted October 10, 2013 Posted October 10, 2013 You're welcome. If I helped you, please click the like button on the right Thanks!
-.Paradox.- Posted October 10, 2013 Author Posted October 10, 2013 (edited) I tried to do same thing with ped but i can't see the text here is the code local rootElement = getRootElement() local PED = createPed( 179, -1621.07922, 666.60632, -4.90625 ) local screenWidth, screenHeight = guiGetScreenSize() local maxrange = 45 function PEDnametag() local pedX,pedY,pedZ = getElementPosition(PED) local sx,sy = getScreenFromWorldPosition (pedX,pedY,pedZ) local cameraX,cameraY,cameraZ = getCameraMatrix() if sx then if getDistanceBetweenPoints3D(cameraX,cameraY,cameraZ,pedX,pedY,pedZ) <= maxrange then dxDrawText("Bob",sx,sy,screenWidth, screenHeight,tocolor ( 255, 255, 0, 255 ), 2,"sans") end end end function HandleTheRendering() addEventHandler("onClientRender",rootElement, PEDnametag) end addEventHandler("onClientResourceStart",rootElement, HandleTheRendering) Edited October 11, 2013 by Guest If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
.:HyPeX:. Posted October 10, 2013 Posted October 10, 2013 adding to what prestege said, where are you defining from whom you are getting the camera matrix? local cameraX,cameraY,cameraZ = getCameraMatrix() if sx then if getDistanceBetweenPoints3D(cameraX,cameraY,cameraZ,pedX,pedY,pedZ) <= maxrange then My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
myonlake Posted October 11, 2013 Posted October 11, 2013 adding to what prestege said, where are you defining from whom you are getting the camera matrix? local cameraX,cameraY,cameraZ = getCameraMatrix() if sx then if getDistanceBetweenPoints3D(cameraX,cameraY,cameraZ,pedX,pedY,pedZ) <= maxrange then It's used client-side so it checks it from the player that wants to see the text over his friend. If I helped you, please click the like button on the right Thanks!
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