Stumbled upon this today, Enjoy! Although a player.ping variable that would auto-update itself would be niftier but this can get us pretty close.
Scripthelp Docs: TServerPlayer.sendping() - returns object - pings the player, returns a request object which will get an onReceivePing(time) event (use catchevent() on the object)
PHP Code:
function onGPing(acct) {
temp.obj = findplayer(acct).sendping();
this.catchevent(obj, "onReceivePing", "onGPingReply");
}
function onGPingReply(obj, plyr, time) {
echo(plyr.account SPC int(time * 1000) @ "ms");
}