Jump to content

Help


S3Nn4oXx

Recommended Posts

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:

C0PplX3.jpg?

Link to comment
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) 
  

?

Link to comment

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

Link to comment

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) 
  

Link to comment
  
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) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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