Skip to content

Instantly share code, notes, and snippets.

Created June 15, 2017 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4fd9e8d99c0908e3178b54be397e6218 to your computer and use it in GitHub Desktop.
Save anonymous/4fd9e8d99c0908e3178b54be397e6218 to your computer and use it in GitHub Desktop.
Player Rate System
function Punkty(TempIndexID:int64): string;
var d, kd: double; cel, KD2, KD3: double; Temp:single;
begin
if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then begin
Temp:=strtoint(ReadPlayer(TempIndexID,'shoots')); cel := (single(strtoint(ReadPlayer(TempIndexID,'shoothits'))*100)/iif(Temp>0,Temp,1)); if (cel > 100) then cel := 100.00; if (cel <= 0) then cel := 1;
Temp:=strtoint(ReadPlayer(TempIndexID,'deaths')); KD2:=(single(strtoint(ReadPlayer(TempIndexID,'teamkills')))/iif(Temp>0,Temp,1)); KD2 := strtofloat(FormatFloat('0.00',KD2)); if (KD2 <= 0) then KD2 := 1;
Temp:=strtoint(ReadPlayer(TempIndexID,'lose')); KD3 := (strtoint(ReadPlayer(TempIndexID,'wins'))/iif(temp>0,temp,1)); if (KD3 <= 0) then KD3 := 1; if (KD3 < 0) then KD3 := 1;
KD := (cel * KD2 * KD3 * Multiplier) / 3.14; if (KD > 0) then d := KD+((cel/100)*KD) else d := KD+((cel/100)*(KD*-1));
if (TempRank.Count>PlayerRateRankCountMin) then d := (d*strtoint(ReadPlayer(TempIndexID,'points')))/TempRank.Count;
result := formatfloat('0.00',d);
end;
if (GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6) then begin
if (Game.FriendlyFire) then begin
Temp:=strtoint(ReadPlayer(TempIndexID,'shoots')); cel := (single(strtoint(ReadPlayer(TempIndexID,'shoothits'))*100)/iif(Temp>0,Temp,1)); if (cel > 100) then cel := 100.00; if (cel <= 0) then cel := 1;
Temp:=strtoint(ReadPlayer(TempIndexID,'deaths')); KD2 := (single(strtoint(ReadPlayer(TempIndexID,'kills'))-strtoint(ReadPlayer(TempIndexID,'teamkills')))/iif(Temp>0,Temp,1)); if (KD2 <= 0) then KD2 := 1;
Temp:=strtoint(ReadPlayer(TempIndexID,'lose')); KD3 := (strtoint(ReadPlayer(TempIndexID,'wins'))/iif(temp>0,temp,1)); if (KD3 <= 0) then KD3 := 1; if (KD3 <= 0) then KD3 := 1; if (KD3 <= 0) then KD3 := 1;
KD := (cel * KD2 * KD3 * Multiplier) / 3.14; if (KD > 0) then d := KD+((cel/100)*KD) else d := KD+((cel/100)*(KD*-1));
if (TempRank.Count>PlayerRateRankCountMin) then d := (d*strtoint(ReadPlayer(TempIndexID,'points')))/TempRank.Count;
result := formatfloat('0.00',d);
end else
begin
Temp:=strtoint(ReadPlayer(TempIndexID,'shoots')); cel := (single(strtoint(ReadPlayer(TempIndexID,'shoothits'))*100)/iif(Temp>0,Temp,1)); if (cel > 100) then cel := 100.00; if (cel <= 0) then cel := 1;
Temp:=strtoint(ReadPlayer(TempIndexID,'deaths')); KD2 := (single(strtoint(ReadPlayer(TempIndexID,'kills')))/iif(Temp>0,Temp,1)); KD2 := strtofloat(FormatFloat('0.00',KD2)); if (KD2 <= 0) then KD2 := 1;
Temp:=strtoint(ReadPlayer(TempIndexID,'lose')); KD3 := (strtoint(ReadPlayer(TempIndexID,'wins'))/iif(temp>0,temp,1)); if (KD3 <= 0) then KD3 := 1; if (KD3 <= 0) then KD3 := 1; if (KD3 <= 0) then KD3 := 1;
KD := (cel * KD2 * KD3 * Multiplier) / 3.14; if (KD > 0) then d := KD+((cel/100)*KD) else d := KD+((cel/100)*(KD*-1));
if (TempRank.Count>PlayerRateRankCountMin) then d := (d*strtoint(ReadPlayer(TempIndexID,'points')))/TempRank.Count;
result := formatfloat('0.00',d);
end;
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment