Script Name: pingWarning
Script Description: script showing if you getting ping warnings and how many more to get kicked
Original Author: cooz
Core Version: 2.5.2
var
pingwarnings: array[1..32] of integer;
i: integer;
function IDtoPing(PlayerID: integer):integer;
begin
case PlayerID of
1: Result:= Player_Ping_1;
2: Result:= Player_Ping_2;
3: Result:= Player_Ping_3;
4: Result:= Player_Ping_4;
5: Result:= Player_Ping_5;
6: Result:= Player_Ping_6;
7: Result:= Player_Ping_7;
8: Result:= Player_Ping_8;
9: Result:= Player_Ping_9;
10: Result:= Player_Ping_10;
11: Result:= Player_Ping_11;
12: Result:= Player_Ping_12;
13: Result:= Player_Ping_13;
14: Result:= Player_Ping_14;
15: Result:= Player_Ping_15;
16: Result:= Player_Ping_16;
17: Result:= Player_Ping_17;
18: Result:= Player_Ping_18;
19: Result:= Player_Ping_19;
20: Result:= Player_Ping_20;
21: Result:= Player_Ping_21;
22: Result:= Player_Ping_22;
23: Result:= Player_Ping_23;
24: Result:= Player_Ping_24;
25: Result:= Player_Ping_25;
26: Result:= Player_Ping_26;
27: Result:= Player_Ping_27;
28: Result:= Player_Ping_28;
29: Result:= Player_Ping_29;
30: Result:= Player_Ping_30;
31: Result:= Player_Ping_31;
32: Result:= Player_Ping_32;
end;
end;
procedure AppOnIdle(Ticks: integer);
begin
if Ticks mod 420 = 0 then begin
for i:= 1 to 32 do begin
if(IDtoPing(i)>strtoint(ReadINI('soldat.ini','NETWORK','Max_Ping','10000'))) then begin
pingwarnings[i]:=pingwarnings[i]+1;
SaytoPlayer(i,'you just got ping warning');
SaytoPlayer(i,inttostr(strtoint(ReadINI('soldat.ini','NETWORK','Max_Ping_Warnings','10000'))-pingwarnings[i])+' more and you''ll be kicked');
if (pingwarnings[i]=strtoint(ReadINI('soldat.ini','NETWORK','Max_Ping_Warnings','10000'))) then pingwarnings[i]:=0;
end;
end;
end;
end;
nots:
based on Ensce code demo,
made on Leo request,
i broke msg into 2 lines cause it was showing with this nasty small font...