DuFraN Posted September 12, 2013 Posted September 12, 2013 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)
Alexs Posted September 12, 2013 Posted September 12, 2013 Deberías usar Dibujado DirectX ya que el Ping varia muy seguido.
Atouk Posted September 12, 2013 Posted September 12, 2013 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 )
Alexs Posted September 12, 2013 Posted September 12, 2013 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.
Sasu Posted September 12, 2013 Posted September 12, 2013 Solo agrega esto: addEventHandler("onClientRender", root, function() guiSetText(L_Ping, "Ping: "..tostring(getPlayerPing(getLocalPlayer()))) end)
Alexs Posted September 12, 2013 Posted September 12, 2013 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'.
DuFraN Posted September 13, 2013 Author Posted September 13, 2013 Gracias , la verdad con un dxDrawText era mucho mas fácil
Recommended Posts