Jump to content

DxDraw3DText server side


BucketBull

Recommended Posts

Hey guys.

Im making a second hand carshop. I need your help! My varriables are in server side. How shall i trigger it?

This is my client side function:

function dxDraw3D()
    dxDraw3DText( name.."\n Nyitvatartás: "..open_hour..":"..open_minute.." - "..close_hour..":"..close_minute, 1951.80859375, -1875.513671875, 13.646875 )
end
addEvent ( "dxDraw3D ", true ) 
addEventHandler ( "dxDraw3D ", getRootElement(), dxDraw3D ) 

 

Edited by BucketBull
Link to comment

are you talking about like this?

 

local x =  1951.80859375 
local y =  -1875.513671875
local z =  13.646875  
  
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 (name.."\n Nyitvatartás: "..open_hour..":"..open_minute.." - "..close_hour..":"..close_minute"", 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

Or

Example 

 

-- # Server Side

local "..open_hour.." = m

setElementData ( player , "ok", m )

-- # Client Side

dxDrawText ("[ "..getElementData(localPlayer,"ok").." ]", 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 ) 

 

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