Jump to content

[Ayuda] Actualizar label


DuFraN

Recommended Posts

Posted

Hola, cree un label para que me especifique cuanto ping tengo, como hago para que se actualice el ping que tengo?, que debo usar.

function F_Ping() 
    local miping = getPlayerPing(getLocalPlayer()) 
        L_Ping = guiCreateLabel(0.80, 0.29, 0.18, 0.07, "Ping:"..miping, true) 
        guiSetFont(L_Ping, "sa-gothic") 
        guiLabelSetColor(L_Ping, 30, 135, 224)     
    end 
addEventHandler("onClientResourceStart",resourceRoot,F_Ping) 
  

Posted

Podrías usar esto también:

miping = getPlayerPing(getLocalPlayer()) 
        L_Ping = guiCreateLabel(0.80, 0.29, 0.18, 0.07, "Ping:"..miping, true) 
        guiSetFont(L_Ping, "sa-gothic") 
        guiLabelSetColor(L_Ping, 30, 135, 224)     
  
        setTimer( guiSetText, 100, 0, L_Ping, miping ) 
  

Posted
Podrías usar esto también:
miping = getPlayerPing(getLocalPlayer()) 
        L_Ping = guiCreateLabel(0.80, 0.29, 0.18, 0.07, "Ping:"..miping, true) 
        guiSetFont(L_Ping, "sa-gothic") 
        guiLabelSetColor(L_Ping, 30, 135, 224)     
  
        setTimer( guiSetText, 100, 0, L_Ping, miping ) 
  

Defines 'miping' una vez y luego no varia, es decir, el Label siempre tendrá el mismo texto.

Posted

Solo agrega esto:

addEventHandler("onClientRender", root, 
 function() 
    guiSetText(L_Ping, "Ping: "..tostring(getPlayerPing(getLocalPlayer()))) 
 end) 

Posted
Solo agrega esto:
addEventHandler("onClientRender", root, 
 function() 
    guiSetText(L_Ping, "Ping: "..tostring(getPlayerPing(getLocalPlayer()))) 
 end) 

Eso sobre consume, insisto en que seria mas rápido usar 'dxDrawText'.

  • Recently Browsing   0 members

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