S3Nn4oXx Posted September 4, 2015 Posted September 4, 2015 Guys how to do getPlayerPing in server.lua? addEventHandler("onPlayerChat", root, function (msg) if msg == 'my ping' then local ping = getPlayerPing(getLocalPlayer(source)) outputChatBox("Your Ping is:"..getPlayerPing, root) cancelEvent() end end ) EDIT:
Markeloff Posted September 4, 2015 Posted September 4, 2015 function myping (msg,t) if msg == "my ping" then cancelEvent() outputChatBox("Your ping is : "..getPlayerPing(source),source,255,0,0) end end addEventHandler("onPlayerChat", root,myping)
S3Nn4oXx Posted September 4, 2015 Author Posted September 4, 2015 function myping (msg,t) if msg == "my ping" then cancelEvent() outputChatBox("Your ping is : "..getPlayerPing(source),source,255,0,0) end end addEventHandler("onPlayerChat", root,myping) Works fine but how do i make getPlayerName too ? outputChatBox(getPlayerName(source), source).."#FF4923Ping Is: "..getPlayerPing(source),source,255,0,0) ?
Markeloff Posted September 4, 2015 Posted September 4, 2015 function myping (msg,t) if msg == "my ping" then cancelEvent() outputChatBox(getPlayerName(source).."'s ping is : "..getPlayerPing(source),root,255,0,0) end end addEventHandler("onPlayerChat", root,myping)
S3Nn4oXx Posted September 4, 2015 Author Posted September 4, 2015 Oh right i forgot ) Thanks function myping (msg,t) if msg == "my ping" then cancelEvent() outputChatBox(getPlayerName(source).."'s #FF4923ping is : "..getPlayerPing(source),root,255 ,0, 0, true ) end end addEventHandler("onPlayerChat", root,myping) Dat works fine now
S3Nn4oXx Posted September 4, 2015 Author Posted September 4, 2015 Btw how to do that when i write "What's my ping?" elso ? function myping (msg,t) if msg == "my ping" then cancelEvent() outputChatBox(getPlayerName(source).."'s #FF4923ping is : "..getPlayerPing(source),root,255 ,0, 0, true ) end end addEventHandler("onPlayerChat", root,myping)
Markeloff Posted September 4, 2015 Posted September 4, 2015 local mywords = {["my ping"]=true,["What's my ping?"]=true,["What is my ping?"]=true} function myping (msg,t) if mywords[msg] then cancelEvent() outputChatBox(getPlayerName(source).."'s #FF4923ping is : "..getPlayerPing(source),root,255 ,0, 0, true ) end end addEventHandler("onPlayerChat", root,myping)
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