Jump to content

¿dxDrawText 3D en user visible para todos los jugadores?


lLinux

Recommended Posts

Hola a todos, mi problema es que quiero hacer que cuando los usuarios pongan en el comando "/mp" le cree un texto encima del que lo puso... Pero que los otros puedan ver el texto que el otro usuario tiene encima.

Asi como esta aqui, se le creea al usuario pero los otros no la pueden ver.

local modo = false 
local text = "PASIVO" 
  
function md() 
    if (modo == false) then 
        addEventHandler("onClientRender", getRootElement(), texto) 
    elseif (modo == true) then 
        removeEventHandler("onClientRender", getRootElement(), texto) 
    end 
end 
addCommandHandler("mp", md) 
  
function texto() 
    local px, py, pz = getPedBonePosition(localPlayer, 6) 
    local sx, sy = getScreenFromWorldPosition(px, py, pz + 0.3) 
    local cx, cy, cz = getCameraMatrix() 
  
    if sx then 
        if getDistanceBetweenPoints3D(cx, cy, cz, px, py, pz) <= maxdistancia then 
            dxDrawText("PASIVO",sx,sy,pantalla_x, pantalla_y,tocolor ( 255, 255, 255, 255 ), 1.5,"default-bold") 
        end 
    end 
end 

Link to comment
  
local modo = false 
local text = "PASIVO" 
local estapasivo = false 
function md() 
    if (modo == false) then 
  --      addEventHandler("onClientRender", getRootElement(), texto) 
estapasivo = true 
    elseif (modo == true) then 
        removeEventHandler("onClientRender", getRootElement(), texto) 
estapasivo = false 
    end 
end 
addCommandHandler("mp", md) 
  
function texto() 
    local px, py, pz = getPedBonePosition(localPlayer, 6) 
    local sx, sy = getScreenFromWorldPosition(px, py, pz + 0.3) 
    local cx, cy, cz = getCameraMatrix() 
    if sx then 
        if getDistanceBetweenPoints3D(cx, cy, cz, px, py, pz) <= maxdistancia then 
if estapasivo then 
            dxDrawText("PASIVO",sx,sy,pantalla_x, pantalla_y,tocolor ( 255, 255, 255, 255 ), 1.5,"default-bold") 
        end 
end 
    end 
end 
 addEventHandler("onClientRender", getRootElement(), texto) 
  

Link to comment
  
local modo = false 
local text = "PASIVO" 
local estapasivo = false 
function md() 
    if (modo == false) then 
  --      addEventHandler("onClientRender", getRootElement(), texto) 
estapasivo = true 
    elseif (modo == true) then 
        removeEventHandler("onClientRender", getRootElement(), texto) 
estapasivo = false 
    end 
end 
addCommandHandler("mp", md) 
  
function texto() 
    local px, py, pz = getPedBonePosition(localPlayer, 6) 
    local sx, sy = getScreenFromWorldPosition(px, py, pz + 0.3) 
    local cx, cy, cz = getCameraMatrix() 
    if sx then 
        if getDistanceBetweenPoints3D(cx, cy, cz, px, py, pz) <= maxdistancia then 
if estapasivo then 
            dxDrawText("PASIVO",sx,sy,pantalla_x, pantalla_y,tocolor ( 255, 255, 255, 255 ), 1.5,"default-bold") 
        end 
end 
    end 
end 
 addEventHandler("onClientRender", getRootElement(), texto) 
  

Eso de igual manera no funcionara para que sea visible para los otros usuarios... creo que no haz entendido lo que he querido decir:

necesito que cuando el user1 ponga /mp le ponga el dxDrawText encima... pero que lo puedan ver el user2, user3, y todos los usuarios.

Link to comment
  • Recently Browsing   0 members

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