Snakegold Posted July 24, 2018 Share Posted July 24, 2018 Guys i wan't this dxDrawText appears for 3 secs when someone type the command /ping function checkPing() local ping = getPlayerPing(getLocalPlayer()) setTimer(function() dxDrawText("#ff0000Your ping is: #00ff00"..ping.."", 805, 303, 1175, 338, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, true, false) end, 1000, 1) end addCommandHandler("ping", checkPing) Link to comment
Leo Messi Posted July 24, 2018 Share Posted July 24, 2018 (edited) function checkPing() addEventHandler("onClientRender", root, drawPing) setTimer(function() removeEventHandler("onClientRender", root, drawPing) end, 3000, 1) end addCommandHandler("ping", checkPing) function drawPing() local ping = getPlayerPing(getLocalPlayer()) dxDrawText("#ff0000Your ping is: #00ff00"..ping.."", 805, 303, 1175, 338, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, true, false) end Edited July 24, 2018 by Leo Messi 1 Link to comment
Snakegold Posted July 24, 2018 Author Share Posted July 24, 2018 (edited) Thanks but local ping = getPlayerPing(getLocalPlayer()) must be under function drawPing() thanks anyway Edited July 24, 2018 by Snakegold Link to comment
Leo Messi Posted July 24, 2018 Share Posted July 24, 2018 On 7/24/2018 at 10:07, Snakegold said: Thanks but local ping = getPlayerPing(getLocalPlayer()) must be under function drawPing() thanks anyway I know, I didn't notice You're welcome. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now