Jump to content

dxDrawText


Recommended Posts

Here you go e.g:

local x = -- x coordination 
local y = -- y coordination 
local z = -- z coordination 
  
addEventHandler("onClientRender",getRootElement(), 
function() 
    local px,py,pz = getElementPosition(getLocalPlayer()) 
    local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) 
    if distance <= 150 then 
        local sx,sy = getScreenFromWorldPosition ( x, y, z+0.95, 0.06 ) 
        if not sx then return end 
        local scale = 1/(0.3 * (distance / 150)) 
        dxDrawText ( "XeroxMTA", sx, sy - 30, sx, sy - 30, tocolor(255,255,255,255), math.min ( 0.4*(150/distance)*1.4,4), "bankgothic", "center", "bottom", false, false, false ) 
    end 
end 
) 

Link to comment

Fixed, now i got a error on this , whats wrong?

local Leaders =  
                { 
                [1] = { 0, 2934.3000488281, -2052.1000976563, 3.5, 179.252929 }, 
                [2] = { 0, 2935.6999511719, -2052.1000976563, 3.5, 179.252929 }, 
                [3] = { 0, 2937.1000976563, -2052.1000976563, 3.5, 179.252929 }, 
                } 
m1, x1, y1, z1, r1 = unpack ( Leaders[1] )   
m2, x2, y2, z2, r2 = unpack ( Leaders[2] )   
m3, x3, y3, z3, r3 = unpack ( Leaders[3] )               
                 
                 
function CreateThePeds() 
ped1 = createPed ( m1, x1, y1, z1, r1 ) 
ped2 = createPed ( m2, x2, y2, z2, r2 ) 
ped3 = createPed ( m3, x3, y3, z3, r3 ) 
end 

Link to comment
local Leaders = 
    { 
                { 0, 2934.3000488281, -2052.1000976563, 3.5, 179.252929 }, 
                { 0, 2935.6999511719, -2052.1000976563, 3.5, 179.252929 }, 
                { 0, 2937.1000976563, -2052.1000976563, 3.5, 179.252929 } 
              } 
m1, x1, y1, z1, r1 = unpack ( Leaders[1] )  
m2, x2, y2, z2, r2 = unpack ( Leaders[2] )  
m3, x3, y3, z3, r3 = unpack ( Leaders[3] )              
                
                
function CreateThePeds() 
ped1 = createPed ( m1, x1, y1, z1, r1 ) 
ped2 = createPed ( m2, x2, y2, z2, r2 ) 
ped3 = createPed ( m3, x3, y3, z3, r3 ) 
end 

Link to comment

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