function serverCmdGetPing(%client){ %ping = %client.getPing(); %client.chatmessage("<color:ffffff>Your ping is " @ %ping); //Changed this to make more sense... Don't put quotes around %ping, it could be a problem}
function serverCmdGetPing(%client){ messageClient(%client, '', "\c6Your ping is: " @ %client.getPing());}
messageClient(%client,"<color:ffffff>Your ping is " @ %client.getPing());
Neither of those will work because you are forgetting to define the client in the messageClient functionCode: [Select]messageClient(%client,"<color:ffffff>Your ping is " @ %client.getPing());
function serverCmdGetPing(%client){%ping = %client.serverConnection.getPing();messageclient(%client,"<color:ffffff>Your ping is " @ %ping);}
So this should work on any server?Code: [Select]function serverCmdGetPing(%client){%ping = %client.serverConnection.getPing();messageclient(%client,"<color:ffffff>Your ping is " @ %ping);}
function getMyPing(){ echo("Your ping is " @ serverConnection.getPing());}
You all are wrong :). He said he wants this to work for any server he goes on, which means it must be client sided. @OP, you cannot get other player's ping from the client side but you can get yours against the server.serverConnection.getPing();
After all this, your all wrong and i figured it out :) I made a command, /getping, and it works on any server and it shows your ping in your chat box and only you can see it.
package ClientPing{ function NMH_Type::Send(%this) { if(%this.getValue() $= "/getping") { NewChatSO.addLine("<color:ffffff>Your ping is " @ "<color:00C800>" @ serverConnection.getPing()); } Parent::Send(%this); }};ActivatePackage(ClientPing);
Heres the script...Code: [Select]package ClientPing{ function NMH_Type::Send(%this) { if(%this.getValue() $= "/getping") { NewChatSO.addLine("<color:ffffff>Your ping is " @ "<color:00C800>" @ serverConnection.getPing()); } Parent::Send(%this); }};ActivatePackage(ClientPing);:)