Official Soldat Forums
Server Talk => Scripting Releases => Topic started by: cooz on November 11, 2006, 12:47:41 pm
-
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...
-
Thanks cooz, you are the best :)
-
Nice one. Good work cooz.
-
thanks, but it doesn't work as i wish to,
i hope i'll be able to update it after next soldat/server version release...
-
I tested it before, the problem I got with it was that it
counted down to 0 and then began on 10 again and
when it was like 8 for the second time the person
were kicked by the server. It could have been my fault
though, maybe there was something in the script I
should have changed..
What's the problem with it that you are referring to?
-
i'm referring exactly to problem you're writing about, i need more accurate way to determine if person is getting ping warning, and it's rather hard in current server version
-
Ah all right.
-
I figured that linking this would be appropriate: http://forums.soldat.pl/index.php?topic=8064.0
Just a bug that is afflicting this script in one of Leo's servers.
-
yes, i know about this bug from Leo,
cause time checking method is not precise enough to determine if someone got ping warning
and i can't think up any other one for now,
script has [unstable] status - please wait for any updates of it,
oh and also i think Leo did turn of scripts in his server cause of some memory leaks...
so probably 4X4 didn't have this bug recently