Jump to content

Attach a text to a marker


-.Paradox.-

Recommended Posts

Posted

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.

Posted
getScreenFromWorldPosition 
dxDrawText 
getElementPosition 
getElementInterior 
getElementDimension 
getDistanceBetweenPoints3D 

If I helped you, please click the like button on the right ;) Thanks!

Posted

Thanks I made it and it work perfectly. :D

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.

Posted (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 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.

Posted

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

gKhdyRJ.png

Posted
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!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...