Author Topic: Ping Track  (Read 5444 times)

0 Members and 1 Guest are viewing this topic.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Ping Track
« on: July 04, 2010, 04:59:02 am »
Name: Ping Track

Author: Mighty
Script version: 1.0.0
Server version: 2.6.5
Release Date: 4th of July 2010
Compile Test: Uploading disabled
Description:
The script checks player's ping every second, for 5 seconds. Then it returns the avarage and maximum ping measured. It's kinda better than single !ping, isn't it?
Commands:
 * !track ID  - starts tracking player's ping.
 * !track mig - starts tracking for (example) MyNameIsmig.

Requirements:
  * None

---

---
Code: {snippets}
Code: [Select]
(...)
procedure AppOnIdle(Ticks: integer);
begin

  if (TrackOrNot = TRUE) then
begin
for i:=1 to 12 do
begin

IF Track[i]=TRUE then
begin
if TrackCount[i] = 0 then
begin
TrackPing[i] := TrackPing[i] + GetPlayerStat(i,'ping');

WriteConsole(0,'Track result for ' + IDToName(i) + ':   Max Ping: ' + inttostr(TrackPingMax[i]) + '         Avarage: '+ inttostr(Round(TrackPing[i]/4)),Color);
// reset vars
TrackPingMax[i] := 0;
TrackPing[i] := 0;
Track[i] := FALSE;
end
else if TrackCount[i] > 0 then
begin
TrackPing[i] := TrackPing[i] + GetPlayerStat(i,'ping');
IF GetPlayerStat(i,'ping') > TrackPingMax[i] then TrackPingMax[i] := GetPlayerStat(i,'ping');
TrackCount[i] := TrackCount[i] - 1;
end;
end;

end;
end;

end;
(...)

Questions? Bugs? Report please --> macekmil@gmail.com
« Last Edit: February 08, 2012, 12:57:09 pm by Mighty »
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: Ping Track
« Reply #1 on: July 04, 2010, 05:40:55 pm »
Useful but I have other ping track script running on my servers:)

Im chill like that

Offline Spotix

  • Major
  • *
  • Posts: 63
  • Shut up! I just give my sentimental side!
    • http://steamcommunity.com/id/Spotix
Re: Ping Track
« Reply #2 on: February 08, 2012, 01:02:27 pm »
Good work.  ;D

Offline Hubiq

  • Soldier
  • **
  • Posts: 119
Re: Ping Track
« Reply #3 on: July 27, 2016, 01:32:23 am »
After release 1.7.1 function "!track [name other player]" doesn't work :/

Offline KoGAi

  • Major(1)
  • Posts: 32
  • The Light of the Universe
Re: Ping Track
« Reply #4 on: August 02, 2016, 11:22:55 pm »
Right, same goes for the readwhoiz/whoiz script commands. :)
=₳US7RAL|¹² is a growing Soldat Community making a difference by offering a wide variety of top-notch servers across North America- a new alternative to everyone.
Jump into our servers in NA with the new domain (austral12.com)! Check our Facebook Page.
_______
#austral12soldat @ QuakeNet ▲ facebook.com/AUS7RAL12 ▲ twitter.com/AUS7RAL12

Offline soldat-game

  • Camper
  • ***
  • Posts: 407
Re: Ping Track
« Reply #5 on: September 02, 2016, 01:59:12 pm »
How fix:
Go script dir open script.pas (Track.pas) find and go to function StrToID(s: string): byte;
and replace to this function:
Code: [Select]
function StrToID(s: string): byte;
var i,xx: byte;
begin
xx:=0;
Result:=254;
try
if GetPlayerStat(StrToInt(s),'active') then begin
Result := StrToInt(s);
xx:=1;
end;
except
end;
if (xx=0) then begin
s := LowerCase(s);
for i := 1 to 32 do if GetPlayerStat(i,'active') then begin
if ContainsString(LowerCase(IDToName(i)), s) then begin
Result := i;
break;
end;
end;
end;
end;

Offline KoGAi

  • Major(1)
  • Posts: 32
  • The Light of the Universe
Re: Ping Track
« Reply #6 on: September 18, 2016, 08:04:46 pm »
How fix:
Go script dir open script.pas (Track.pas) find and go to function StrToID(s: string): byte;
and replace to this function:
Code: [Select]
function StrToID(s: string): byte;
var i,xx: byte;
begin
xx:=0;
Result:=254;
try
if GetPlayerStat(StrToInt(s),'active') then begin
Result := StrToInt(s);
xx:=1;
end;
except
end;
if (xx=0) then begin
s := LowerCase(s);
for i := 1 to 32 do if GetPlayerStat(i,'active') then begin
if ContainsString(LowerCase(IDToName(i)), s) then begin
Result := i;
break;
end;
end;
end;
end;

Thank you so much for this! :3
=₳US7RAL|¹² is a growing Soldat Community making a difference by offering a wide variety of top-notch servers across North America- a new alternative to everyone.
Jump into our servers in NA with the new domain (austral12.com)! Check our Facebook Page.
_______
#austral12soldat @ QuakeNet ▲ facebook.com/AUS7RAL12 ▲ twitter.com/AUS7RAL12