NoxDies Posted November 17, 2018 Share Posted November 17, 2018 (edited) function highPing() local ping = getPlayerPing(getLocalPlayer()) if (ping > 100) then outputChatBox('#990033 ' .. getPlayerName(source) .. ' #ffffffhas high ping.', GetRootElement(), 250, 255, 250, true) end end addCommandHandler("ping", highPing) Whats wrong? When ping higher than 100 I want it written on chat. Edited November 17, 2018 by NoxDies Link to comment
Geteco Posted November 17, 2018 Share Posted November 17, 2018 The code works perfectly. Are you sure is your ping over 100? and the code are in client-side? Link to comment
LilDawage Posted November 17, 2018 Share Posted November 17, 2018 function highPing() local ping = getPlayerPing(getLocalPlayer()) if (ping > 100) then outputChatBox('#990033 ' .. getPlayerName(source) .. ' #ffffffhas high ping.', getRootElement(), 250, 255, 250, true) end end addCommandHandler("ping", highPing) Link to comment
NoxDies Posted November 17, 2018 Author Share Posted November 17, 2018 2 minutes ago, Geteco said: The code works perfectly. Are you sure is your ping over 100? and the code are in client-side? yes it is in client-side. but I'm trying on home server this script so i have 2 ping that's why i did it "ping > 1" but it should be 100 5 minutes ago, LilDawage said: Previous Page Next Page function highPing() local ping = getPlayerPing(getLocalPlayer()) if (ping > 100) then outputChatBox('#990033 ' .. getPlayerName(source) .. ' #ffffffhas high ping.', getRootElement(), 250, 255, 250, true) end end addCommandHandler("ping", highPing) Previous Page Next Page still not working. Link to comment
LyricalMM Posted November 17, 2018 Share Posted November 17, 2018 you want a check? or you want to write in chat whenever you type /ping? Link to comment
Gordon_G Posted November 17, 2018 Share Posted November 17, 2018 That's because you do not have to specify what player you want to outputChatBox off when you use it client side function highPing() local ping = getPlayerPing(getLocalPlayer()) if (ping > 100) then outputChatBox('#990033 ' .. getPlayerName(source) .. ' #ffffffhas high ping.', 250, 255, 250, true) end end addCommandHandler("ping", highPing) Link to comment
NoxDies Posted November 18, 2018 Author Share Posted November 18, 2018 11 hours ago, LyricalMM said: you want a check? or you want to write in chat whenever you type /ping? i want to write in chat but not with command. when ping higher than 100 Link to comment
LyricalMM Posted November 18, 2018 Share Posted November 18, 2018 setTimer(function highPing() local ping = getPlayerPing(getLocalPlayer()) if (ping > 100) then outputChatBox('#990033 ' .. getPlayerName(source) .. ' #ffffffhas high ping.', 250, 255, 250, true) end end, 1000,0) 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