Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- DEATHMATCH = 0; // Compatible ✔
- POINTMATCH = 1; // Compatible ✔
- TEAMMATCH = 2; // Compatible ✔
- CTF = 3; // Compatible ✔
- RAMBO = 4; // Compatible ✔
- INF = 5; // Compatible ✔
- HTF = 6; // Compatible ✔
- ZitroVersion = 'v1.0.0 - Heavy'; //Code: 1807`974 end = 2257 Build=1.7.0.94
- CRLF = #13#10;
- rank_store = 10;
- AssistMinimumDamagePercent = 65; // Damage minimum to get assist
- CooldownTimer = 0; // Time from injury after which you can not already get assist
- TimeCon = 30; // Time from injury after which you can not get savior
- precision = 6; // Precision calculation powers for point ELO-Point system
- type
- TRank = record // ___ ___ ___ ___ ___ ___ ___
- Points: integer; // /\ \ ___ /\ \ /\ \ /\ \ /\ \ /\__\ /\__\
- Name: string; // \:\ \ /\ \ \:\ \ /::\ \ /::\ \ /::\ \ /:/ / /::| |
- end; // \:\ \ \:\ \ \:\ \ /:/\:\ \ /:/\:\ \ /:/\:\ \ /:/ / /:|:| |
- type // \:\ \ /::\__\ /::\ \ /::\~\:\ \ /:/ \:\ \ /::\~\:\ \ /:/ / ___ /:/|:| |__
- TMapRanks = record // _______\:\__\ __/:/\/__/ /:/\:\__\ /:/\:\ \:\__\ /:/__/ \:\__\ /:/\:\ \:\__\ /:/__/ /\__\ /:/ |:| /\__\
- Played: integer; // \::::::::/__/ /\/:/ / /:/ \/__/ \/_|::\/:/ / \:\ \ /:/ / \/__\:\ \/__/ \:\ \ /:/ / \/__|:|/:/ /
- Name: string; // \:\~~\~~ \::/__/ /:/ / |:|::/ / \:\ /:/ / \:\__\ \:\ /:/ / |:/:/ /
- end; // \:\ \ \:\__\ \/__/ |:|\/__/ \:\/:/ / \/__/ \:\/:/ / |::/ /
- type // \:\__\ \/__/ |:| | \::/ / \::/ / /:/ /
- TPlayerInfo = record // \/__/ \|__| \/__/ \/__/ \/__/
- nickStatus: boolean;
- Name, Password: string;
- IP, HWID, auto, DelAcc: string;
- LoginMes: string;
- kickTimer, startKickTimer: integer;
- end;
- type
- TStats = record
- Kills, TeamKills, Deaths, DeathsByTeam, SelfKills, PosKill, KillFlager: string;
- FlagGrab, FlagReturn, FlagScore, FlagDrop, Shoot, ShootHit, ShootFriendly, Wybawiciel, Zemsta, Asysta: string;
- AlphaCaps, BravoCaps, INF_Red, INF_Blue, HTF_Red, HTF_Blue, Points: string;
- Win, Lose, Remis, AlphaWins, AlphaLose, BravoWins, BravoLose, CharlieWin, CharlieLose, DeltaWin, DeltaLose: string;
- end;
- type
- PlayerAssist = record
- DamageRecievedByID: array[1..33] of double;
- DamageRecievedByCooldown: array[1..33] of integer;
- KilledBy: integer;
- end;
- var
- PlayerInfo: array [1..32] of TPlayerInfo;
- PlayerStats: array [1..32] of TStats;
- PlayersInfoArr: array[1..32] of PlayerAssist;
- ranks: array of TRank;
- TopMap: array of TMapRanks;
- Ammo, Weap, atc, flager: array[1..32] of byte;
- timer, Ttimer: array [1..32] of integer;
- Revenge: array [1..32] of string;
- Visit, AlphaV, BlueV, CharlieV, DeltaV, SpecV, SKill, STeamKill, SSelfkils, SKick: string;
- MapKills, MapSelfkills, MapTeamkills, MapFlagCaps, MapFlagGrabs, MapFlagReturns, MapFlagDrop, MapPlayerJoins, MapPlayerLeaves, MapPlayerKicks, MapPlays, YouInfo: string;
- GOOD, BAD: longint;
- Mnoznik, Procent, InitTime, AddTime, KickTime, TopLines, TimeMes, MaxPointGive, MinimalKills: integer;
- LimitKills, WriteLnSpam, AutoRegister, KickTimeON, TimeMesON, RealTimeUpdate, AntyMajor, TopMapsON, MapStatsON, OtherStatsON, WinStatsON, PointsForStart: String;
- DisStats, DisStatsOther, DisTop, DisFlagStats, DisFlagStatsOther, DisServerStats, DisMapStats, DisTopMaps, DisLastPlayed, DisOtherStats, DisOtherOther, DisWinStats, DisWinStatsOther, DisRank, DisRankOther, DisRankID, PrevMap: string;
- EnableStats, EnableTop, EnableFlagStats, EnableServerStats, EnableLastPlayed, EnableResetStats, EnableVoteUpdate, DefaultAutoLogin, AntyMulti, EnableSearch, EnableRank, EnableRankID: string;
- Go: boolean; VFor, Time: byte; Voted: array[1..32] of boolean;
- FriendlyFire, Survival: boolean; MaxHealth, INF_BravoNewScore, HTF_BravoNewScore, HTF_AlphaNewScore, Liczba, Tysieczna: integer;
- function Explode(Source: string; const Delimiter: string): array of string;
- var Position, DelLength, ResLength: integer;
- begin
- DelLength := Length(Delimiter);
- Source := Source + Delimiter;
- repeat
- Position := Pos(Delimiter, Source);
- SetArrayLength(Result, ResLength + 1);
- Result[ResLength] := Copy(Source, 1, Position - 1);
- ResLength := (ResLength + 1);
- Delete(Source, 1, Position + DelLength - 1);
- until (Position = 0);
- SetArrayLength(Result, ResLength - 1);
- end;
- function LoadSettings(File: string): boolean;
- begin
- try
- GOOD := StrtoInt(ReadINI(File,'Colors','ColorGOOD','$EE00FF00')); BAD := StrtoInt(ReadINI(File,'Colors','ColorBAD','$ff0033'));
- Procent := StrtoInt(ReadINI(File,'Vote','Vote','75')); InitTime := StrtoInt(ReadINI(File,'Vote','VoteTime','30')); AddTime := StrtoInt(ReadINI(File,'Vote','VoteTimeAdd','7'));
- DefaultAutoLogin := ReadINI(File,'Default','DefaultAutoLogin','HWID'); PointsForStart := ReadINI(File,'Default','PointsForStart','1000'); MaxPointGive := StrtoInt(ReadINI(File,'Default','MaxPointGive','50'));
- Mnoznik := StrtoInt(ReadINI(File,'Stats','Multiplier','100')); LimitKills := ReadINI(File,'Stats','LimitKills','25'); TopLines := StrtoInt(ReadINI(File,'Stats','TopLines','10')); MinimalKills := StrtoInt(ReadINI(File,'Stats','MinimalKills','0')); RealTimeUpdate := ReadINI(File,'Stats','UpdateRanksRealTime','ON');
- AutoRegister := ReadINI(File,'Accounts','AutoRegister','ON'); AntyMulti := ReadINI(File,'Accounts','AntyMulti','ON'); KickTime := StrtoInt(ReadINI(File,'Accounts','KickTime','15')); KickTimeON := ReadINI(File,'Accounts','KickTimeON','ON'); AntyMajor := ReadINI(File,'Accounts','AntyMajorStats','ON');
- WriteLnSpam := ReadINI(File,'Messages','WriteLnSpam','OFF'); TimeMesON := ReadINI(File,'Messages','TimeMesON','ON'); TimeMes := StrtoInt(ReadINI(File,'Messages','TimeMes','1')); YouInfo := ReadINI(File,'Messages','YouInfoHere','Bad here - Edit in Setting.ini (YouInfoHere=)');
- TopMapsON := ReadINI(File,'MapStats','TopMapsON','ON'); MapStatsON := ReadINI(File,'MapStats','MapStatsON','ON');
- OtherStatsON := ReadINI(File,'EnableStats','OtherStats','ON'); EnableStats := ReadINI(File,'EnableStats','Stats','ON'); EnableTop := ReadINI(File,'EnableStats','Top','ON'); EnableFlagStats := ReadINI(File,'EnableStats','FlagStats','ON'); WinStatsON := ReadINI(File,'EnableStats','WinStats','ON'); EnableServerStats := ReadINI(File,'EnableStats','ServerStats','ON');
- DisStats := ReadINI(File,'PublicDisplayStats','Stats','ON'); DisStatsOther := ReadINI(File,'PublicDisplayStats','StatsOther','OFF'); DisTop := ReadINI(File,'PublicDisplayStats','Top','ON'); DisFlagStats := ReadINI(File,'PublicDisplayStats','FlagStats','ON'); DisFlagStatsOther := ReadINI(File,'PublicDisplayStats','FlagStatsOther','OFF'); DisServerStats := ReadINI(File,'PublicDisplayStats','ServerStats','ON'); DisMapStats := ReadINI(File,'PublicDisplayStats','MapStats','ON'); DisTopMaps := ReadINI(File,'PublicDisplayStats','TopMaps','ON'); DisLastPlayed := ReadINI(File,'PublicDisplayStats','LastPlayed','ON'); DisOtherStats := ReadINI(File,'PublicDisplayStats','OtherStats','ON'); DisOtherOther := ReadINI(File,'PublicDisplayStats','OtherStatsOther','OFF'); DisRank := ReadINI(File,'PublicDisplayStats','Rank','ON'); DisRankOther := ReadINI(File,'PublicDisplayStats','RankOther','OFF'); DisRankID := ReadINI(File,'PublicDisplayStats','RankID','OFF'); DisWinStats := ReadINI(File,'PublicDisplayStats','WinStats','ON'); DisWinStatsOther := ReadINI(File,'PublicDisplayStats','WinStatsOther','OFF');
- EnableLastPlayed := ReadINI(File,'EnableCommands','LastPlayed','ON'); EnableResetStats := ReadINI(File,'EnableCommands','ResetStats','ON'); EnableVoteUpdate := ReadINI(File,'EnableCommands','VoteUpdate','OFF'); EnableSearch := ReadINI(File,'EnableCommands','Search','ON'); EnableRank := ReadINI(File,'EnableCommands','Rank','ON'); EnableRankID := ReadINI(File,'EnableCommands','RankID','ON');
- except
- Result := true;
- exit;
- end;
- end;
- function filterFilename(filename: string):string;
- var i,len: byte; c: string;
- begin
- len := length(filename);
- result := '';
- for i := 1 to len do begin
- c := copy(filename,i,1);
- if (c=chr(92)) or (c='/') or (c='\') or (c=':') or (c='*') or (c='?') or (c='"') or (c='<') or (c='>') or (c='|') or (c='.') then result := result + '_' else result := result + c;
- end;
- end;
- procedure LoadNickname(ID: byte);
- var temparray: TStringArray;
- begin
- if (FileExists('nickreg/'+FilterFilename(GetPlayerStat(ID,'name'))+'.txt') = true) then begin
- temparray := Explode(ReadFile('nickreg/'+FilterFilename(GetPlayerStat(ID,'name'))+'.txt'),CRLF);
- PlayerInfo[ID].Name := temparray[0]; PlayerInfo[ID].Password := temparray[1]; PlayerInfo[ID].IP := temparray[2]; PlayerInfo[ID].HWID := temparray[3]; PlayerInfo[ID].Auto := temparray[4]; PlayerStats[ID].PosKill := temparray[5]; PlayerInfo[ID].LoginMes := temparray[6];
- PlayerStats[ID].Kills := temparray[7]; PlayerStats[ID].TeamKills := temparray[8]; PlayerStats[ID].Deaths := temparray[9]; PlayerStats[ID].DeathsByTeam:= temparray[10]; PlayerStats[ID].SelfKills := temparray[11]; PlayerStats[ID].FlagGrab := temparray[12];
- PlayerStats[ID].FlagReturn := temparray[13]; PlayerStats[ID].FlagScore := temparray[14]; PlayerStats[ID].FlagDrop := temparray[15]; PlayerStats[ID].AlphaCaps := temparray[16]; PlayerStats[ID].BravoCaps := temparray[17]; PlayerStats[ID].INF_Red := temparray[18];
- PlayerStats[ID].INF_Blue := temparray[19]; PlayerStats[ID].HTF_Red := temparray[20]; PlayerStats[ID].HTF_Blue := temparray[21]; PlayerStats[ID].Shoot := temparray[22]; PlayerStats[ID].ShootHit := temparray[23]; PlayerStats[ID].ShootFriendly := temparray[24];
- PlayerStats[ID].Wybawiciel:= temparray[25]; PlayerStats[ID].Zemsta := temparray[26]; PlayerStats[ID].Asysta := temparray[27]; PlayerStats[ID].Win := temparray[28]; PlayerStats[ID].Lose := temparray[29]; PlayerStats[ID].Remis := temparray[30];
- PlayerStats[ID].AlphaWins := temparray[31]; PlayerStats[ID].AlphaLose := temparray[32]; PlayerStats[ID].BravoWins := temparray[33]; PlayerStats[ID].BravoLose := temparray[34]; PlayerStats[ID].CharlieWin := temparray[35]; PlayerStats[ID].CharlieLose := temparray[36];
- PlayerStats[ID].DeltaWin := temparray[37]; PlayerStats[ID].DeltaLose := temparray[38]; PlayerStats[ID].Points := temparray[39]; PlayerStats[ID].KillFlager := temparray[40]; PlayerInfo[ID].DelAcc := temparray[41];
- end else
- begin
- PlayerInfo[ID].LoginMes := 'OFF';
- PlayerInfo[ID].NickStatus := false; PlayerInfo[ID].Name := ''; PlayerInfo[ID].Password := ''; PlayerInfo[ID].IP := ''; PlayerInfo[ID].HWID := ''; PlayerInfo[ID].Auto := ''; PlayerInfo[ID].DelAcc := 'NO';
- end;
- end;
- procedure ResetVar(b: byte);
- begin
- PlayerInfo[b].nickStatus := false; PlayerInfo[b].kickTimer := 0; PlayerInfo[b].startKickTimer := 0; PlayerInfo[b].Name := ''; PlayerInfo[b].Password := ''; PlayerInfo[b].IP := '';
- PlayerInfo[b].HWID := ''; PlayerInfo[b].Auto := ''; PlayerStats[b].PosKill := '0'; PlayerInfo[b].LoginMes := ''; PlayerInfo[b].DelAcc := 'NO';
- PlayerStats[b].Kills := '0'; PlayerStats[b].TeamKills := '0'; PlayerStats[b].Deaths := '0'; PlayerStats[b].DeathsByTeam := '0'; PlayerStats[b].SelfKills := '0'; PlayerStats[b].FlagGrab := '0';
- PlayerStats[b].FlagReturn := '0'; PlayerStats[b].FlagScore := '0'; PlayerStats[b].FlagDrop := '0'; PlayerStats[b].AlphaCaps := '0'; PlayerStats[b].BravoCaps := '0';
- PlayerStats[b].INF_Red := '0'; PlayerStats[b].INF_Blue := '0'; PlayerStats[b].HTF_Red := '0'; PlayerStats[b].HTF_Blue := '0'; PlayerStats[b].Shoot := '0'; PlayerStats[b].ShootHit := '0';
- PlayerStats[b].ShootFriendly := '0'; PlayerStats[b].Wybawiciel := '0'; PlayerStats[b].Zemsta := '0'; PlayerStats[b].Asysta := '0'; PlayerStats[b].KillFlager := '0';
- PlayerStats[b].Win := '0'; PlayerStats[b].Lose := '0'; PlayerStats[b].Remis := '0'; PlayerStats[b].AlphaWins := '0'; PlayerStats[b].AlphaLose := '0'; PlayerStats[b].BravoWins := '0';
- PlayerStats[b].BravoLose := '0'; PlayerStats[b].CharlieWin := '0'; PlayerStats[b].CharlieLose := '0'; PlayerStats[b].DeltaWin := '0'; PlayerStats[b].DeltaLose := '0'; PlayerStats[b].Points := PointsForStart;
- flager[b] := 0; Revenge[b] := '';
- end;
- function MD5Issue(const S: string): string;
- begin
- while (not(RegExpMatch('^[0-9a-f]{32}$', Result))) do begin
- Result:= MD5String(S);
- end;
- end;
- function StrToID(s: string): byte;
- var i: byte;
- begin
- Result := 254;
- try
- if GetPlayerStat(StrToInt(s), 'active') then Result := StrToInt(s);
- except
- s := LowerCase(s);
- for i := 1 to 32 do if GetPlayerStat(i, 'active') then if ContainsString(LowerCase(IDToName(i)), s) then begin
- Result := i;
- break;
- end;
- end;
- end;
- function WowSuchASpeed(a: double; b: integer): double;
- var c: double;
- begin
- if (b = 0) then result := 1 else if b mod 2 = 1 then result := (WowSuchASpeed(a, b-1) * a) else begin
- c := WowSuchASpeed(a, b div 2);
- result := (c * c);
- end;
- end;
- function WowItsEvenFaster(a: double; b: longint): double;
- var l, r, s, p: int64; AlgorithmsAreSoEZ: double;
- begin
- p := round(WowSuchASpeed(10, precision));
- l := 0;
- r := p;
- while(l<r) do begin
- s := (l+r) div 2;
- AlgorithmsAreSoEZ := s;
- if (WowSuchASpeed(AlgorithmsAreSoEZ, b) > a) then r := s else l := (s + 1);
- end;
- result := (l-1);
- l := 0;
- r := (p-1);
- while(l<r) do begin
- s := (l+r) div 2;
- AlgorithmsAreSoEZ := s;
- AlgorithmsAreSoEZ := (AlgorithmsAreSoEZ / p);
- AlgorithmsAreSoEZ := (AlgorithmsAreSoEZ + result);
- if (WowSuchASpeed(AlgorithmsAreSoEZ, b) > a) then r := s else l := (s + 1);
- end;
- AlgorithmsAreSoEZ := (l - 1);
- AlgorithmsAreSoEZ := (AlgorithmsAreSoEZ / p);
- result := (result + AlgorithmsAreSoEZ);
- end;
- procedure ABP(c: double);
- var c1, c2: string; i, b: byte;
- begin
- if (c<>0) then begin
- c1 := FloatToStr(c);
- c1 := GetPiece(c1, '.', 1);
- for i := 1 to Length(c1) do if (strtoint(c1[i]) <> 0) then begin
- Liczba := strtoint(c1[i]);
- c2 := '1';
- for b := 1 to i do c2 := c2 + '0';
- Tysieczna := strtoint(c2);
- break;
- end;
- end else
- begin
- Liczba := 0;
- Tysieczna := 0;
- end;
- end;
- function Punkty2(Killer, Victim: byte): integer;
- var c: double; c1: string; c4: integer; x, x2, x3: double;
- begin
- c := (single(strtoint(PlayerStats[Killer].Points)-strtoint(PlayerStats[Victim].Points))/1000);
- if (c >= 1) or (c <= -1) then begin
- c1 := FloatToStr(c);
- if (c > 0) then x := WowSuchASpeed(10,strtoint(Copy(c1,1,1))) else x := WowSuchASpeed(10,strtoint(Copy(c1,1,2)));
- ABP(c);
- if (Liczba >= 1) or (Liczba <= -1) then x2 := Round(WowItsEvenFaster(WowSuchASpeed(10, Liczba), Tysieczna)) else x2 := 0;
- x3 := (single(x)*single(x2));
- c4 := Round(MaxPointGive/single(1+x3));
- Result := c4;
- end else
- begin
- ABP(c);
- if (Liczba >= 1) or (Liczba <= -1) then c4 := Round(WowItsEvenFaster(WowSuchASpeed(10, Liczba), Tysieczna)) else c4 := 0;
- c4 := Round(MaxPointGive/single(1+c4));
- Result := c4;
- end;
- end;
- function Punkty(ID: byte): integer;
- var d, kd: integer; cel, KD2, KD3: double;
- begin
- if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then begin
- cel := (single(strtoint(PlayerStats[ID].ShootHit))*100/Single(strtoint(PlayerStats[ID].Shoot)));
- if (cel > 100) then cel := 100.00;
- KD2 := (single(strtoint(PlayerStats[ID].TeamKills))/single(strtoint(PlayerStats[ID].Deaths)));
- KD2 := strtofloat(FormatFloat('0.00',KD2));
- if (strtoint(PlayerStats[ID].Lose) > 0) then KD3 := (strtoint(PlayerStats[ID].Win)/strtoint(PlayerStats[ID].Lose));
- if (KD3 <= 0) then KD3 := 1;
- KD := round((cel * KD2 * KD3 * Mnoznik) / 3.14);
- if (KD > 0) then d := KD+round((cel/100)*KD) else d := KD+round((cel/100)*(KD*-1));
- result := d;
- end;
- if (GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6) then begin
- if (FriendlyFire) then begin
- cel := (single(strtoint(PlayerStats[ID].ShootHit))*100/Single(strtoint(PlayerStats[ID].Shoot)));
- if (cel > 100) then cel := 100.00;
- KD2 := (single(strtoint(PlayerStats[ID].Kills)-strtoint(PlayerStats[ID].TeamKills))/single(strtoint(PlayerStats[ID].Deaths)));
- KD2 := strtofloat(FormatFloat('0.00',KD2));
- if (strtoint(PlayerStats[ID].Lose) > 0) then KD3 := (strtoint(PlayerStats[ID].Win)/strtoint(PlayerStats[ID].Lose));
- if (KD3 <= 0) then KD3 := 1;
- KD := round((cel * KD2 * KD3 * Mnoznik) / 3.14);
- if (KD > 0) then d := KD+round((cel/100)*KD) else d := KD+round((cel/100)*(KD*-1));
- result := d;
- end else
- begin
- cel := (single(strtoint(PlayerStats[ID].ShootHit))*100/Single(strtoint(PlayerStats[ID].Shoot)));
- if (cel > 100) then cel := 100.00;
- KD2 := (single(strtoint(PlayerStats[ID].Kills))/single(strtoint(PlayerStats[ID].Deaths)));
- KD2 := strtofloat(FormatFloat('0.00',KD2));
- if (strtoint(PlayerStats[ID].Lose) > 0) then KD3 := (strtoint(PlayerStats[ID].Win)/strtoint(PlayerStats[ID].Lose));
- if (KD3 <= 0) then KD3 := 1;
- KD := round((cel * KD2 * KD3 * Mnoznik) / 3.14);
- if (KD > 0) then d := KD+round((cel/100)*KD) else d := KD+round((cel/100)*(KD*-1));
- result := d;
- end;
- end;
- end;
- procedure UpdateNickname(ID: byte);
- var outdata: string;
- begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- outdata := PlayerInfo[ID].Name+CRLF+PlayerInfo[ID].Password+CRLF+GetPlayerStat(ID,'IP')+CRLF+GetPlayerStat(ID,'HWID')+CRLF+PlayerInfo[ID].Auto+CRLF+PlayerStats[ID].PosKill+CRLF+PlayerInfo[ID].LoginMes+CRLF+PlayerStats[ID].Kills+CRLF+
- PlayerStats[ID].TeamKills+CRLF+PlayerStats[ID].Deaths+CRLF+PlayerStats[ID].DeathsByTeam+CRLF+PlayerStats[ID].SelfKills+CRLF+PlayerStats[ID].FlagGrab+CRLF+PlayerStats[ID].FlagReturn+CRLF+PlayerStats[ID].FlagScore+CRLF+
- PlayerStats[ID].FlagDrop+CRLF+PlayerStats[ID].AlphaCaps+CRLF+PlayerStats[ID].BravoCaps+CRLF+PlayerStats[ID].INF_Red+CRLF+PlayerStats[ID].INF_Blue+CRLF+PlayerStats[ID].HTF_Red+CRLF+PlayerStats[ID].HTF_Blue+CRLF+PlayerStats[ID].Shoot+CRLF+
- PlayerStats[ID].ShootHit+CRLF+PlayerStats[ID].ShootFriendly+CRLF+PlayerStats[ID].Wybawiciel+CRLF+PlayerStats[ID].Zemsta+CRLF+PlayerStats[ID].Asysta+CRLF+PlayerStats[ID].Win+CRLF+PlayerStats[ID].Lose+CRLF+PlayerStats[ID].Remis+CRLF+
- PlayerStats[ID].AlphaWins+CRLF+PlayerStats[ID].AlphaLose+CRLF+PlayerStats[ID].BravoWins+CRLF+PlayerStats[ID].BravoLose+CRLF+PlayerStats[ID].CharlieWin+CRLF+PlayerStats[ID].CharlieLose+CRLF+PlayerStats[ID].DeltaWin+CRLF+
- PlayerStats[ID].DeltaLose+CRLF+PlayerStats[ID].Points+CRLF+PlayerStats[ID].KillFlager+CRLF+PlayerInfo[ID].DelAcc+CRLF+FormatDate('dd mmmm yyyy')+' at: '+ FormatDate('hh:nn:ss');
- WriteFile('nickreg/'+FilterFileName(PlayerInfo[ID].Name)+'.txt',outdata);
- LoadNickname(ID);
- end else if (lowercase(WriteLnSpam) = lowercase('ON')) then WriteLn('Player is not logged for statistics!');
- end;
- procedure OnPlayerShoot(ID, Weapon: byte);
- begin
- if (lowercase(OtherStatsON) = lowercase('ON')) and (PlayerInfo[ID].NickStatus = true) and (Weapon <> 255) and (Weapon <> 14) then begin
- if (Weapon <> 1) and (Weapon <> 5) then PlayerStats[ID].Shoot := inttostr(strtoint(PlayerStats[ID].Shoot) + 1);
- if (Weapon = 1) then PlayerStats[ID].Shoot := inttostr(strtoint(PlayerStats[ID].Shoot) + 2);
- if (Weapon = 5) then PlayerStats[ID].Shoot := inttostr(strtoint(PlayerStats[ID].Shoot) + 6);
- if (lowercase(RealTimeUpdate) = lowercase('ON')) then UpdateNickname(ID);
- end;
- end;
- procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);
- begin
- if (GetPlayerStat(ID,'Primary') = 14) then if (PrimaryNum = 255) then PlayerStats[ID].Shoot := inttostr(strtoint(PlayerStats[ID].Shoot) + 1);
- end;
- procedure ShootKeyCheck();
- var i: byte;
- begin
- for i := 1 to 32 do if (GetPlayerStat(i,'Active') = true) and (GetPlayerStat(i,'Ammo') <> Ammo[i]) then begin
- if (GetKeyPress(i, 'Shoot') = true) and (GetPlayerStat(i,'Primary') = Weap[i]) and (GetPlayerStat(i,'Ammo') >= 0) and (GetPlayerStat(i,'Ammo') < Ammo[i]) then OnPlayerShoot(i,GetPlayerStat(i,'Primary'));
- Weap[i] := GetPlayerStat(i,'Primary');
- Ammo[i] := GetPlayerStat(i,'Ammo');
- end;
- end;
- procedure CreateServerStats();
- var outdata: string;
- begin
- if (FileExists('nickreg/server/stats.txt') = false) and (lowercase(EnableServerStats) = lowercase('ON')) then begin
- outdata := '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0';
- WriteFile('nickreg/server/stats.txt',outdata);
- WriteLn(' [*] '+ ScriptName + ' (AutoRepair) Stats.txt -> None detected file, I create a new');
- end;
- if (FileExists('nickreg/server/rankpoint.db') = false) and (lowercase(EnableTop) = lowercase('ON')) then begin
- WriteFile('nickreg/server/rankpoint.db','');
- WriteLn(' [*] '+ ScriptName + ' (AutoRepair) RankPoint.db -> None detected file, I create a new');
- end;
- end;
- Procedure MapStatsCreate(Map: String);
- var outdata: string;
- begin
- if not (Map = '') then if (FileExists('nickreg/maps/'+Map+'.txt') = false) and (lowercase(MapStatsON) = lowercase('ON')) then begin
- outdata := '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0';
- WriteFile('nickreg/maps/'+Map+'.txt',outdata);
- WriteLnFile('nickreg/maps/maps.db', Map);
- WriteLn(' [*] '+ ScriptName + ' (MapStats) -> Create File MapStats for '+Map);
- end;
- if (FileExists('nickreg/server/MapPlayed.db') = false) and (lowercase(TopMapsON) = lowercase('ON')) then begin
- WriteFile('nickreg/server/MapPlayed.db','');
- WriteLn(' [*] '+ ScriptName + ' (AutoRepair) MapPlayed.db -> None detected file, I create a new');
- end;
- end;
- Procedure MapStatsLoad(Map: string);
- var temparray: TStringArray;
- begin
- if (FileExists('nickreg/maps/'+Map+'.txt') = true) then begin
- temparray := Explode(ReadFile('nickreg/maps/'+Map+'.txt'),CRLF);
- MapKills := temparray[0]; MapSelfkills := temparray[1]; MapTeamkills := temparray[2]; MapFlagCaps := temparray[3]; MapFlagGrabs := temparray[4];
- MapFlagReturns := temparray[5]; MapFlagDrop := temparray[6]; MapPlays := temparray[7]; MapPlayerJoins := temparray[8]; MapPlayerLeaves := temparray[9]; MapPlayerKicks := temparray[10];
- end else
- begin
- MapStatsCreate(Map);
- if (FileExists('nickreg/maps/'+Map+'.txt') = true) then MapStatsLoad(Map);
- end;
- end;
- Procedure UpdateMapStats(Map: String);
- var outdata: string;
- begin
- if (lowercase(MapStatsON) = lowercase('ON')) then begin
- if (FileExists('nickreg/maps/'+Map+'.txt') = true) then begin
- outdata := MapKills+CRLF+MapSelfkills+CRLF+MapTeamkills+CRLF+MapFlagCaps+CRLF+MapFlagGrabs+CRLF+MapFlagReturns+CRLF+MapFlagDrop+CRLF+MapPlays+CRLF+MapPlayerJoins+CRLF+MapPlayerLeaves+CRLF+MapPlayerKicks;
- WriteFile('nickreg/maps/'+Map+'.txt',outdata);
- MapStatsLoad(currentmap);
- end;
- end;
- end;
- procedure AutoSaveNickname(auto: string; ID: byte);
- var outdata: string;
- begin
- if (FileExists('nickreg/'+FilterFilename(GetPlayerStat(ID,'name'))+'.txt') = false) or (PlayerInfo[ID].DelAcc = 'YES') then begin
- outdata := GetPlayerStat(ID,'name')+CRLF+''+CRLF+GetPlayerStat(ID,'ip')+CRLF+GetPlayerStat(ID,'HWID')+CRLF+auto+CRLF+'0'+CRLF+'OFF'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+
- '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+
- '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+PointsForStart+CRLF+'0'+CRLF+'NO'+CRLF+FormatDate('dd mmmm yyyy')+' at: '+ FormatDate('hh:nn:ss');
- WriteFile('nickreg/'+FilterFilename(GetPlayerStat(ID,'name'))+'.txt',outdata);
- if (PlayerInfo[ID].DelAcc = 'NO') then WriteLnFile('nickreg/server/players.db',GetPlayerStat(ID,'name'));
- end else WriteConsole(ID,'Nickname already exists!',BAD);
- end;
- procedure SaveNickname(password,auto: string; ID: byte);
- var outdata: string;
- begin
- if (FileExists('nickreg/'+FilterFilename(GetPlayerStat(ID,'name'))+'.txt') = false) or (PlayerInfo[ID].DelAcc = 'YES') then begin
- outdata := GetPlayerStat(ID,'name')+CRLF+password+CRLF+GetPlayerStat(ID,'ip')+CRLF+GetPlayerStat(ID,'HWID')+CRLF+auto+CRLF+'0'+CRLF+'OFF'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+
- '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+
- '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+PointsForStart+CRLF+'0'+CRLF+'NO'+CRLF+FormatDate('dd mmmm yyyy')+' at: '+ FormatDate('hh:nn:ss');
- WriteFile('nickreg/'+FilterFilename(GetPlayerStat(ID,'name'))+'.txt',outdata);
- if (PlayerInfo[ID].DelAcc = 'NO') then WriteLnFile('nickreg/server/players.db',GetPlayerStat(ID,'name'));
- end else WriteConsole(ID,'Nickname already exists!',BAD);
- end;
- procedure ServerLoad();
- var temparray: TStringArray;
- begin
- if (FileExists('nickreg/server/stats.txt') = true) then begin
- temparray := Explode(ReadFile('nickreg/server/stats.txt'),CRLF);
- Visit := temparray[0]; AlphaV := temparray[1]; BlueV := temparray[2]; CharlieV := temparray[3]; DeltaV := temparray[4]; SpecV := temparray[5];
- SKill := temparray[6]; STeamKill := temparray[7]; SSelfkils := temparray[8]; SKick := temparray[9];
- end;
- end;
- procedure UpdateServStats();
- var outdata: string;
- begin
- if (FileExists('nickreg/server/stats.txt') = true) then begin
- outdata := Visit+CRLF+AlphaV+CRLF+BlueV+CRLF+CharlieV+CRLF+DeltaV+CRLF+SpecV+CRLF+SKill+CRLF+STeamKill+CRLF+SSelfkils+CRLF+SKick;
- WriteFile('nickreg/server/stats.txt',outdata);
- if (lowercase(EnableServerStats) = lowercase('ON')) then ServerLoad();
- end;
- end;
- procedure ResetSeverStats();
- var outdata: string;
- begin
- outdata := '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0';
- WriteFile('nickreg/server/stats.txt',outdata);
- ServerLoad();
- end;
- procedure LoadRanks();
- var i: word; data: array of string;
- begin
- ranks := [];
- if (FileExists('nickreg/server/rankpoint.db')) then begin
- data := Explode(ReadFile('nickreg/server/rankpoint.db'), CRLF);
- SetArrayLength(ranks, GetArrayLength(data) div 2);
- if (GetArrayLength(ranks) > 0) then for i := 0 to GetArrayLength(ranks) - 1 do begin
- ranks[i].Name := data[i * 2];
- ranks[i].Points := StrtoInt(data[i * 2 + 1]);
- end;
- end;
- end;
- procedure DeleteInRank(ID:byte);
- var i:word; outdata:string;
- begin
- outdata := '';
- if (GetArrayLength(ranks) > 0) then begin
- for i := 0 to GetArrayLength(ranks) - 1 do begin
- if (ranks[i].Name = GetPlayerStat(ID, 'Name')) then if (GetArrayLength(ranks)<=1) then begin
- outdata := '';
- break;
- end else i:=i+1;
- outdata := outdata + ranks[i].Name + CRLF + inttostr(ranks[i].Points) + CRLF;
- end;
- Delete(outdata, Length(outdata) - 1, 2);
- end;
- WriteFile('nickreg/server/rankpoint.db', outdata);
- LoadRanks();
- end;
- procedure RestartRank();
- var i: word; outdata: string; gracze, temparray: TStringArray; b: byte; n, n3: integer; n2: double;
- begin
- gracze := Explode(ReadFile('nickreg/server/players.db'),CRLF);
- n := 1;
- n3 := ((GetArrayLength(gracze)-1)+(GetArrayLength(ranks)-2));
- for i:= 2 to (GetArrayLength(gracze)-1) do begin
- if (FileExists('nickreg/'+filterFileName(gracze[i-1])+'.txt') = true) then begin
- n := n+1;
- temparray := Explode(ReadFile('nickreg/'+filterFileName(gracze[i-1])+'.txt'),CRLF);
- outdata := temparray[0]+CRLF+temparray[1]+CRLF+temparray[2]+CRLF+temparray[3]+CRLF+temparray[4]+CRLF+temparray[5]+CRLF+temparray[6]+CRLF+temparray[7]+CRLF+temparray[8]+CRLF+temparray[9]+CRLF+temparray[10]+CRLF+temparray[11]+CRLF+temparray[12]+CRLF+
- temparray[13]+CRLF+temparray[14]+CRLF+temparray[15]+CRLF+temparray[16]+CRLF+temparray[17]+CRLF+temparray[18]+CRLF+temparray[19]+CRLF+temparray[20]+CRLF+temparray[21]+CRLF+temparray[22]+CRLF+temparray[23]+CRLF+temparray[24]+CRLF+
- temparray[25]+CRLF+temparray[26]+CRLF+temparray[27]+CRLF+temparray[28]+CRLF+temparray[29]+CRLF+temparray[30]+CRLF+temparray[31]+CRLF+temparray[32]+CRLF+temparray[33]+CRLF+temparray[34]+CRLF+temparray[35]+CRLF+temparray[36]+CRLF+
- temparray[37]+CRLF+temparray[38]+CRLF+PointsForStart+CRLF+temparray[40]+CRLF+temparray[41]+CRLF+FormatDate('dd mmmm yyyy')+' at: '+ FormatDate('hh:nn:ss')+' - ResetRanks';
- WriteFile('nickreg/'+filterFileName(gracze[i-1])+'.txt',outdata);
- n2 := ((single(n)/single(n3))*100);
- DrawTextEx(0,73,'Restart Ranks: '+FormatFloat('0.00',n2)+'%',120,$FF0000,0.065,48,400);
- end;
- end;
- for b := 1 to 32 do if (GetPlayerStat(b, 'Active')=true) then LoadNickname(b);
- outdata := '';
- if (GetArrayLength(ranks) > 0) then begin
- for i := 0 to GetArrayLength(ranks) - 1 do begin
- n := n+1;
- outdata := outdata + ranks[i].Name + CRLF + PointsForStart + CRLF;
- n2 := ((single(n)/single(n3))*100);
- DrawTextEx(0,73,'Restart Ranks: '+FormatFloat('0.00',n2)+'%',120,$FF0000,0.065,48,400);
- end;
- Delete(outdata, Length(outdata) - 1, 2);
- end;
- WriteFile('nickreg/server/rankpoint.db', outdata);
- LoadRanks();
- DrawTextEx(0,73,'Restart Ranks: Completed!',260,$FF0000,0.065,48,400);
- end;
- procedure SaveRanks();
- var i: word; buffer: string;
- begin
- buffer := '';
- if (GetArrayLength(ranks) > 0) then begin
- for i := 0 to GetArrayLength(ranks) - 1 do buffer := buffer + ranks[i].Name + CRLF + InttoStr(ranks[i].Points) + CRLF;
- Delete(buffer, Length(buffer) - 1, 2);
- end;
- WriteFile('nickreg/server/rankpoint.db', buffer);
- end;
- procedure UpdateRanks(ID: byte);
- var i, j, lowpoints: integer;
- begin
- if (GetArrayLength(ranks) = 0) then lowpoints := 0 else lowpoints := ranks[GetArrayLength(ranks) - 1].Points;
- if (strtoint(iif((GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4),PlayerStats[ID].TeamKills,PlayerStats[ID].Kills)) >= StrtoInt(LimitKills)) then begin
- if ((strtoint(PlayerStats[ID].Points) > lowpoints) or (GetArrayLength(ranks) < rank_store)) then begin
- for i := 0 to GetArrayLength(ranks) - 1 do if (ranks[i].Name = GetPlayerStat(ID, 'Name')) then begin
- if (GetArrayLength(ranks) >= i + 2) then for j := i + 1 to GetArrayLength(ranks) - 1 do begin
- ranks[j - 1].Name := ranks[j].Name;
- ranks[j - 1].Points := ranks[j].Points;
- end;
- SetArrayLength(ranks, GetArrayLength(ranks) - 1);
- break;
- end;
- for i := 0 to GetArrayLength(ranks) - 1 do if (strtoint(PlayerStats[ID].Points) > ranks[i].Points) then break;
- SetArrayLength(ranks, GetArrayLength(ranks) + 1);
- if (GetArrayLength(ranks) >= i + 2) then for j := GetArrayLength(ranks) - 1 downto i + 1 do begin
- ranks[j].Name := ranks[j - 1].Name;
- ranks[j].Points := ranks[j - 1].Points;
- end;
- ranks[i].Name := GetPlayerStat(ID, 'Name');
- ranks[i].Points := strtoint(PlayerStats[ID].Points);
- end;
- end;
- end;
- procedure LoadTopMap();
- var i: word; data: array of string;
- begin
- TopMap := [];
- if (FileExists('nickreg/server/MapPlayed.db')) then begin
- data := Explode(ReadFile('nickreg/server/MapPlayed.db'), CRLF);
- SetArrayLength(TopMap, GetArrayLength(data) div 2);
- if (GetArrayLength(TopMap) > 0) then for i := 0 to GetArrayLength(TopMap) - 1 do begin
- TopMap[i].Name := data[i * 2];
- TopMap[i].Played := StrtoInt(data[i * 2 + 1]);
- end;
- end;
- end;
- procedure ResetMapPlayed();
- var outdata: string; mapy, temparray: TStringArray; i, n, n3: word; n2: double;
- begin
- mapy := Explode(ReadFile('nickreg/maps/maps.db'),CRLF);
- n := 1;
- n3 := ((GetArrayLength(mapy)-1)+(GetArrayLength(TopMap)-2));
- for i:= 2 to (GetArrayLength(mapy)-1) do begin
- if (FileExists('nickreg/maps/'+mapy[i-1]+'.txt') = true) then begin
- n := n+1;
- temparray := Explode(ReadFile('nickreg/maps/'+mapy[i-1]+'.txt'),CRLF);
- outdata := temparray[0]+CRLF+temparray[1]+CRLF+temparray[2]+CRLF+temparray[3]+CRLF+temparray[4]+CRLF+temparray[5]+CRLF+temparray[6]+CRLF+temparray[7]+CRLF+'0'+CRLF+temparray[9]+CRLF+temparray[10];
- WriteFile('nickreg/maps/'+mapy[i-1]+'.txt',outdata);
- n2 := ((single(n)/single(n3))*100);
- DrawTextEx(0,73,'Restart all map played: '+FormatFloat('0.00',n2)+'%',120,$FF0000,0.065,48,400);
- end;
- end;
- MapStatsLoad(currentmap);
- outdata := '';
- if (GetArrayLength(TopMap) > 0) then begin
- for i := 0 to GetArrayLength(TopMap) - 1 do begin
- n := n+1;
- outdata := outdata + TopMap[i].Name + CRLF + '0' + CRLF;
- n2 := ((single(n)/single(n3))*100);
- DrawTextEx(0,73,'Restart all map played: '+FormatFloat('0.00',n2)+'%',120,$FF0000,0.065,48,400);
- end;
- Delete(outdata, Length(outdata) - 1, 2);
- end;
- WriteFile('nickreg/server/MapPlayed.db', outdata);
- LoadTopMap();
- DrawTextEx(0,73,'Restart all map played: Completed!',260,$FF0000,0.065,48,400);
- end;
- procedure SaveTopMap();
- var i: word; buffer: string;
- begin
- buffer := '';
- if (GetArrayLength(TopMap) > 0) then begin
- for i := 0 to GetArrayLength(TopMap) - 1 do buffer := buffer + TopMap[i].Name + CRLF + InttoStr(TopMap[i].Played) + CRLF;
- Delete(buffer, Length(buffer) - 1, 2);
- end;
- WriteFile('nickreg/server/MapPlayed.db', buffer);
- end;
- procedure UpdateTopMap();
- var i, j, lowPlayed: integer;
- begin
- if (GetArrayLength(TopMap) = 0) then lowPlayed := 0 else lowPlayed := TopMap[GetArrayLength(TopMap) - 1].Played;
- if ((strtoint(MapPlays) > lowPlayed) or (GetArrayLength(TopMap) < rank_store)) then begin
- for i := 0 to GetArrayLength(TopMap) - 1 do if (TopMap[i].Name = PrevMap) then begin
- if (GetArrayLength(TopMap) >= i + 2) then for j := i + 1 to GetArrayLength(TopMap) - 1 do begin
- TopMap[j - 1].Name := TopMap[j].Name;
- TopMap[j - 1].Played := TopMap[j].Played;
- end;
- SetArrayLength(TopMap, GetArrayLength(TopMap) - 1);
- break;
- end;
- for i := 0 to GetArrayLength(TopMap) - 1 do if (strtoint(MapPlays) > TopMap[i].Played) then break;
- SetArrayLength(TopMap, GetArrayLength(TopMap) + 1);
- if (GetArrayLength(TopMap) >= i + 2) then for j := GetArrayLength(TopMap) - 1 downto i + 1 do begin
- TopMap[j].Name := TopMap[j - 1].Name;
- TopMap[j].Played := TopMap[j - 1].Played;
- end;
- TopMap[i].Name := PrevMap;
- TopMap[i].Played := strtoint(MapPlays);
- end;
- end;
- procedure LastPlay(ID:byte; Name: string);
- var op: integer; temparray: TStringArray; fileData: string; tr: byte;
- begin
- if (lowercase(EnableLastPlayed) = lowercase('ON')) then begin
- op := StrToID(Name); tr := 0;
- if (FileExists('nickreg/'+filterFileName(Name)+'.txt') = true) then begin
- filedata := ReadFile('nickreg/'+filterFileName(Name)+'.txt');
- temparray := Explode(filedata,CRLF);
- tr := 1;
- end else
- begin
- if (op = 254) then WriteConsole(ID,'Player not found ('+Name+')',BAD) else begin
- if (FileExists('nickreg/'+filterFileName(getPlayerStat(op,'Name'))+'.txt') = true) then begin
- filedata := ReadFile('nickreg/'+filterFileName(getPlayerStat(op,'Name'))+'.txt');
- temparray := Explode(filedata,CRLF);
- tr := 2;
- end;
- end;
- end;
- if (tr = 1) or (tr = 2) then WriteConsole(iif(lowercase(DisLastPlayed) = lowercase('ON'),0,ID),'Player '+iif(tr=1,Name,getPlayerStat(op,'Name'))+' seen lately: '+temparray[42],GOOD);
- end else WriteConsole(ID,'Function deactivated by an administrator!',BAD);
- end;
- procedure ResetPlayerStats(ID: byte);
- var outdata: string;
- begin
- outdata := PlayerInfo[ID].Name+CRLF+PlayerInfo[ID].Password+CRLF+GetPlayerStat(ID,'ip')+CRLF+GetPlayerStat(ID,'HWID')+CRLF+PlayerInfo[ID].Auto+CRLF+'0'+CRLF+'OFF'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+
- '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+
- '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+PointsForStart+CRLF+'0'+CRLF+PlayerInfo[ID].DelAcc+CRLF+FormatDate('dd mmmm yyyy')+' at: '+ FormatDate('hh:nn:ss');
- WriteFile('nickreg/'+filterFileName(GetPlayerStat(ID,'name'))+'.txt',outdata);
- LoadNickname(ID);
- DeleteInRank(ID);
- end;
- procedure RestartAllPlayerStats();
- var gracze, temparray: TStringArray; i, n, n3: word; outdata: string; b: byte; n2: double;
- begin
- gracze := Explode(ReadFile('nickreg/server/players.db'),CRLF);
- n := 1;
- n3 := ((GetArrayLength(gracze)-1)+(GetArrayLength(ranks)-2));
- for i:= 1 to (GetArrayLength(gracze)-1) do begin
- if (FileExists('nickreg/'+filterFileName(gracze[i-1])+'.txt') = true) then begin
- n := n+1;
- temparray := Explode(ReadFile('nickreg/'+filterFileName(gracze[i-1])+'.txt'),CRLF);
- outdata := temparray[0]+CRLF+temparray[1]+CRLF+temparray[2]+CRLF+temparray[3]+CRLF+temparray[4]+CRLF+temparray[5]+CRLF+temparray[6]+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+
- '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+
- '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+PointsForStart+CRLF+'0'+CRLF+temparray[41]+CRLF+FormatDate('dd mmmm yyyy')+' at: '+FormatDate('hh:nn:ss')+' - Restart';
- WriteFile('nickreg/'+filterFileName(gracze[i-1])+'.txt',outdata);
- n2 := ((single(n)/single(n3))*100);
- DrawTextEx(0,73,'Restart all players stats: '+FormatFloat('0.00',n2)+'%',120,$FF0000,0.065,48,400);
- end;
- end;
- for b := 1 to 32 do if (GetPlayerStat(b, 'Active')=true) then LoadNickname(b);
- outdata := '';
- if (GetArrayLength(ranks) > 0) then begin
- for i := 0 to GetArrayLength(ranks) - 1 do begin
- n := n+1;
- outdata := outdata + ranks[i].Name + CRLF + PointsForStart + CRLF;
- n2 := ((single(n)/single(n3))*100);
- DrawTextEx(0,73,'Restart all players stats: '+FormatFloat('0.00',n2)+'%',120,$FF0000,0.065,48,400);
- end;
- Delete(outdata, Length(outdata) - 1, 2);
- end;
- WriteFile('nickreg/server/rankpoint.db', outdata);
- LoadRanks();
- DrawTextEx(0,73,'Restart all players stats: Completed!',260,$FF0000,0.065,48,400);
- end;
- procedure RestartAllMapStats();
- var mapy: TStringArray; outdata: string; i, n, n3: word; n2: double;
- begin
- mapy := Explode(ReadFile('nickreg/maps/maps.db'),CRLF);
- n := 1;
- n3 := ((GetArrayLength(mapy)-1)+(GetArrayLength(TopMap)-2));
- for i:= 1 to (GetArrayLength(mapy)-1) do begin
- if (FileExists('nickreg/maps/'+mapy[i-1]+'.txt') = true) then begin
- n := n+1;
- outdata := '0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0'+CRLF+'0';
- WriteFile('nickreg/maps/'+mapy[i-1]+'.txt',outdata);
- n2 := ((single(n)/single(n3))*100);
- DrawTextEx(0,73,'Restart all maps stats: '+FormatFloat('0.00',n2)+'%',120,$FF0000,0.065,48,400);
- end;
- MapStatsLoad(currentmap);
- end;
- outdata := '';
- if (GetArrayLength(TopMap) > 0) then begin
- for i := 0 to GetArrayLength(TopMap) - 1 do begin
- n := n+1;
- outdata := outdata + TopMap[i].Name + CRLF + '0' + CRLF;
- n2 := ((single(n)/single(n3))*100);
- DrawTextEx(0,73,'Restart all maps stats: '+FormatFloat('0.00',n2)+'%',120,$FF0000,0.065,48,400);
- end;
- Delete(outdata, Length(outdata) - 1, 2);
- end;
- WriteFile('nickreg/server/MapPlayed.db', outdata);
- LoadTopMap();
- DrawTextEx(0,73,'Restart all maps stats: Completed!',260,$FF0000,0.065,48,400);
- end;
- function OnCommand(ID: Byte; Text: string): boolean;
- var i: byte;
- begin
- if (lowercase(Text) = lowercase('/ResetAllMapStats')) then begin
- RestartAllMapStats();
- WriteConsole(0,'Restarted all map statystic!',GOOD);
- end;
- if (lowercase(Text) = lowercase('/ResetAllPlayerStats')) then begin
- RestartAllPlayerStats();
- WriteConsole(0,'Restarted statistics of all players.',GOOD);
- end;
- if (lowercase(Text) = lowercase('/UpdateStats')) then begin
- UpdateServStats();
- for i := 1 to 32 do if (GetPlayerStat(i, 'Active') = true) then begin
- UpdateNickname(i);
- if (lowercase(EnableTop) = lowercase('ON')) then begin
- if (GetPlayerStat(i, 'Human') = true) then UpdateRanks(i);
- SaveRanks();
- WriteConsole(i,'Update Stats!',GOOD);
- end;
- end;
- end;
- if MaskCheck(lowercase(Text),'/deleteacc *') then begin
- if (GetPiece(Text,' ',1) <> '') then begin
- try
- i := strtoint(GetPiece(Text,' ',1));
- if (GetPlayerStat(i,'Active') = true) then begin
- if (FileExists('nickreg/'+FilterFilename(GetPlayerStat(i,'name'))+'.txt') = true) then begin
- if (PlayerInfo[ID].DelAcc = 'NO') then begin
- DeleteInRank(ID);
- PlayerInfo[i].DelAcc := 'YES';
- UpdateNickname(i);
- PlayerInfo[i].nickStatus := false;
- WriteConsole(ID,'Player account '+GetPlayerStat(strtoint(GetPiece(Text,' ',1)),'Name')+' successfully removed.',GOOD);
- WriteConsole(i,' ',GOOD); WriteConsole(i,' ',GOOD); WriteConsole(i,' ',GOOD); WriteConsole(i,' ',GOOD);
- WriteConsole(i,' Your account has been deleted.',BAD);
- WriteConsole(i,' You logged out! ',BAD);
- WriteConsole(i,' ',GOOD); WriteConsole(i,' ',GOOD); WriteConsole(i,' ',GOOD);
- end else WriteConsole(ID,'His player does not have a account.',BAD);
- end else WriteConsole(ID,'His player does not have a account.',BAD);
- end else WriteConsole(ID,'None such player.',BAD);
- except WriteConsole(ID,'ID an incorrect.',BAD);
- end;
- end else WriteConsole(ID,'Not given ID.',BAD);
- end;
- if MaskCheck(lowercase(Text),'/ResetStatsID *') then begin
- if (GetPiece(Text,' ',1) <> '') then begin
- try
- if (GetPlayerStat(strtoint(GetPiece(Text,' ',1)),'Active') = true) then begin
- if (FileExists('nickreg/'+FilterFilename(GetPlayerStat(strtoint(GetPiece(Text,' ',1)),'name'))+'.txt') = true) then begin
- ResetPlayerStats(strtoint(GetPiece(Text,' ',1)));
- WriteConsole(ID,'Restarted player statistics '+GetPlayerStat(strtoint(GetPiece(Text,' ',1)),'Name')+'.',GOOD);
- end else WriteConsole(ID,'The player does not have an account.',BAD);
- end else WriteConsole(ID,'None such player.',BAD);
- except WriteConsole(ID,'ID an incorrect.',BAD);
- end;
- end else WriteConsole(ID,'Not given ID.',BAD);
- end;
- if (lowercase(Text) = lowercase('/AdminCommands')) then begin
- WriteConsole(ID,'___Admin Commands:______________________________________',GOOD);
- WriteConsole(ID,'/UpdateStats - Quick update statistics |',GOOD);
- WriteConsole(ID,'/ResetRanks - Restarts ranks |',GOOD);
- WriteConsole(ID,'/ResetAllPlayerStats - Restarts all players stats |',GOOD);
- WriteConsole(ID,'/ResetAllMapStats - Restarts all maps stats |',GOOD);
- WriteConsole(ID,'/ResetServerStats - Restarts the server statistics |',GOOD);
- WriteConsole(ID,'/ResetMapTop - Restarts top maps |',GOOD);
- WriteConsole(ID,'/ReloadSettings - Reloads settings |',GOOD);
- WriteConsole(ID,'/ResetStatsID <ID> - Reset stats player (ID) |',GOOD);
- WriteConsole(ID,'/DeleteAcc <ID> - Delete of a player account (ID) |',GOOD);
- WriteConsole(ID,'_______________________________________________________|',GOOD);
- end;
- if (lowercase(Text) = lowercase('/ResetRanks')) then begin
- if (lowercase(EnableTop) = lowercase('ON')) then begin
- RestartRank();
- WriteConsole(0,'Restart ranks!',GOOD);
- end else WriteConsole(0,'Ranks is disabled!',GOOD);
- end;
- if (lowercase(Text) = lowercase('/ResetServerStats')) then begin
- ResetSeverStats();
- WriteConsole(0,'Restart server statistics!',GOOD);
- end;
- if (lowercase(Text) = lowercase('/ResetMapTop')) then begin
- if (lowercase(TopMapsON) = lowercase('ON')) then begin
- ResetMapPlayed();
- WriteConsole(0,'Restart Top Maps!',GOOD);
- end else WriteConsole(0,'Top Maps is disabled!',GOOD);
- end;
- if (lowercase(Text) = lowercase('/ReloadSettings')) then begin
- if LoadSettings('scripts/'+ ScriptName + '/settings.ini') then WriteLn(' [*] '+ ScriptName + ' -> Error while loading settings') else WriteLn(' [*] '+ ScriptName + ' -> Settings loaded successfully');
- WriteConsole(ID,'Settings loaded successfully!',GOOD);
- end;
- Result := false;
- end;
- function OnPlayerCommand(ID: Byte; Text: string): boolean;
- var pass, pass2, c: string; temparray: TStringArray;
- begin
- if MaskCheck(Text,'/deletemyacc *') then begin
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID,'name'))+'.txt') = true) and (PlayerInfo[ID].DelAcc = 'NO') then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- if (PlayerInfo[ID].Password <> '') then begin
- if (GetPiece(Text,' ',1)<>'') then begin
- pass := MD5Issue(GetPiece(Text,' ',1));
- if (pass = PlayerInfo[ID].Password) then begin
- DeleteInRank(ID);
- PlayerInfo[id].DelAcc := 'YES';
- UpdateNickname(ID);
- PlayerInfo[id].nickStatus := false;
- WriteConsole(id,' ',GOOD); WriteConsole(id,' ',GOOD); WriteConsole(id,' ',GOOD); WriteConsole(id,' ',GOOD);
- WriteConsole(id,' Your account has been deleted.',BAD);
- WriteConsole(id,' You logged out! ',BAD);
- WriteConsole(id,' ',GOOD); WriteConsole(id,' ',GOOD); WriteConsole(id,' ',GOOD);
- end else WriteConsole(ID,'You have entered a wrong password.',BAD);
- end else WriteConsole(ID,'You must enter a password!',BAD);
- end else WriteConsole(ID,'You can`t delete account without password! Type /addpassword <password>',BAD);
- end else WriteConsole(ID,'Please login first!',BAD);
- end else WriteConsole(ID,'Do not have an account.',BAD);
- end;
- if regExpMatch('^/(resetstats|restartstats)$',lowercase(Text)) then begin
- if (lowercase(EnableResetStats) = lowercase('ON')) then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- ResetPlayerStats(ID);
- WriteConsole(ID,'Restarted your stats!',GOOD);
- end else WriteConsole(ID,'Login to restart your stats!',GOOD);
- end else WriteConsole(ID,'Function deactivated by an administrator!',BAD);
- end;
- if MaskCheck(Text,'/create *') then begin
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID,'name'))+'.txt') = false) or (PlayerInfo[ID].DelAcc = 'YES') then begin
- if (PlayerInfo[ID].NickStatus = false) then begin
- delete(Text,1,8);
- if (Text <> '') then begin
- if (regExpMatch(' ',text)=false) then begin
- if (length(Text) < 17) then begin
- if (lowercase(AntyMajor) = lowercase('ON')) then if (lowercase(GetPlayerStat(ID,'name')) = lowercase('Major')) then begin
- WriteConsole(ID,'Registration for players with nick major have been disable!',BAD);
- exit;
- end else
- begin
- pass := MD5Issue(Text);
- SaveNickname(pass,DefaultAutoLogin,ID);
- LoadNickname(ID);
- WriteConsole(ID,'Nickname ' + GetPlayerStat(ID,'name') + ' successfully registered!',GOOD);
- WriteConsole(ID,'Your password is ' + Text + ' - do not forget it!',GOOD);
- WriteConsole(ID,'To prove that you really are later, use "/login ' + Text + '" to login.',GOOD);
- WriteLn('NickReg: ' + GetPlayerStat(ID,'name') + ' registered from ' + GetPlayerStat(ID,'HWID'));
- PlayerInfo[ID].NickStatus := true;
- end;
- end else WriteConsole(ID,'Max length password is 16 characters!',BAD);
- end else WriteConsole(ID,'Your password can not contain spaces.',BAD);
- end else WriteConsole(ID,'No password found. Please try again.',BAD);
- end else WriteConsole(ID,'You are logged in, please logout and try again.',BAD);
- end else WriteConsole(ID,'You are already a registered user!',BAD);
- end;
- if MaskCheck(Text,'/changepass * *') then begin
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID,'name'))+'.txt') = true) and (PlayerInfo[ID].DelAcc = 'NO') then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- if (PlayerInfo[ID].Password<>'') then begin
- delete(Text,1,12);
- pass := MD5Issue(GetPiece(Text,' ',0));
- if (pass = PlayerInfo[ID].Password) then begin
- delete(Text,1,Length(GetPiece(Text,' ',0))+1);
- if (regExpMatch(' ',text)=false) then begin
- if (length(Text) < 17) then begin
- pass2 := MD5Issue(Text);
- PlayerInfo[ID].Password := pass2;
- UpdateNickname(ID);
- WriteConsole(ID,'Password changed to: '+Text,GOOD);
- end else WriteConsole(ID,'Max length password is 16 characters!',BAD);
- end else WriteConsole(ID,'Your password can not contain spaces.',BAD);
- end else WriteConsole(ID,'Wrong password!',BAD);
- end else WriteConsole(ID,'Do not have a password. Type /addpassword <pass>',BAD);
- end else WriteConsole(ID,'Please login first!',BAD);
- end else WriteConsole(ID,'No profile found!',BAD);
- end;
- if MaskCheck(Text,'/changenick * *') then begin
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID,'name'))+'.txt') = true) and (PlayerInfo[ID].DelAcc = 'NO') then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- if (PlayerInfo[ID].Password<>'') then begin
- delete(Text,1,12);
- pass := MD5Issue(GetPiece(Text,' ',0));
- delete(Text,1,Length(GetPiece(Text,' ',0))+1);
- if (PlayerInfo[ID].Password = pass) then begin
- if (length(Text) < 25) then begin
- if (FileExists('nickreg/'+filterFileName(Text)+'.txt') = true) then begin
- temparray := Explode(ReadFile('nickreg/'+filterFileName(Text)+'.txt'),CRLF);
- c:=temparray[41];
- end else c:='YES';
- if (FileExists('nickreg/'+filterFileName(Text)+'.txt') = false) or (c = 'YES') then begin
- if (lowercase(AntyMajor) = lowercase('ON')) then begin
- if (lowercase(Text) <> lowercase('Major')) then begin
- DeleteInRank(ID); PlayerInfo[ID].DelAcc := 'YES'; UpdateNickname(ID);
- PlayerInfo[ID].Name := Text; PlayerInfo[ID].DelAcc := 'NO'; UpdateNickname(ID); PlayerInfo[ID].nickStatus := false;
- WriteConsole(ID,'NickName changed to: '+Text,GOOD);
- WriteConsole(ID,'Please rejoin the server with your new nick to load your new profile.',GOOD);
- end else WriteConsole(ID,'You can not change your nick to Major!',BAD);
- end else
- begin
- DeleteInRank(ID); PlayerInfo[ID].DelAcc := 'YES'; UpdateNickname(ID);
- PlayerInfo[ID].Name :=Text; PlayerInfo[ID].DelAcc := 'NO'; UpdateNickname(ID); PlayerInfo[ID].nickStatus := false;
- WriteConsole(ID,'NickName changed to: '+Text,GOOD);
- WriteConsole(ID,'Please rejoin the server with your new nick to load your new profile.',GOOD);
- end;
- end else WriteConsole(ID,'That nickname is already taken!',BAD);
- end else WriteConsole(ID,'Nickname is over 24 characters, please pick another.',BAD);
- end else WriteConsole(ID,'Wrong Password!',BAD);
- end else WriteConsole(ID,'Do not have a password. Type /addpassword <pass>',BAD);
- end else WriteConsole(ID,'Please login first!',BAD);
- end else WriteConsole(ID,'No profile found!',BAD);
- end;
- if MaskCheck(Text,'/login *') then begin
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID,'name'))+'.txt') = true) and (PlayerInfo[ID].DelAcc = 'NO') then begin
- if (PlayerInfo[ID].NickStatus = false) then begin
- pass := MD5Issue(GetPiece(Text,' ',1));
- if (pass = PlayerInfo[ID].Password) then begin
- PlayerInfo[ID].NickStatus := true;
- WriteConsole(ID,'You are now logged in!',GOOD);
- PlayerInfo[ID].startKickTimer := 0;
- if (lowercase(EnableTop) = lowercase('ON')) then UpdateRanks(ID);
- UpdateNickname(ID);
- end else WriteConsole(ID,'Wrong password.',BAD);
- end else WriteConsole(ID,'You are already logged in!',BAD);
- end else WriteConsole(ID,'No profile found!',BAD);
- end;
- if (Text = '/logout') then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- if (PlayerInfo[ID].Password <> '') then begin
- PlayerInfo[ID].NickStatus := false;
- WriteConsole(ID,'You has been logged out!',GOOD);
- WriteConsole(ID,'Type /login ''password'' to login.',GOOD);
- end else WriteConsole(ID,'You can`t logout without password! Type /addpassword <password>',BAD);
- end else WriteConsole(ID,'Already logged out!',BAD);
- end;
- if MaskCheck(Text,'/autologin *') then begin
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID,'name'))+'.txt') = true) and (PlayerInfo[ID].DelAcc = 'NO') then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- case (lowercase(GetPiece(Text,' ',1))) of
- lowercase('OFF'): begin
- if (PlayerInfo[ID].Password <> '') then begin
- PlayerInfo[ID].Auto := 'OFF';
- WriteConsole(ID,'You have disabled auto login.',GOOD);
- end else
- begin
- WriteConsole(ID,'Unfortunately you do not have a password, we can not change the autologin.',BAD);
- WriteConsole(ID,'Add a password and can try again. To add please use /addpassword <password>',BAD);
- end;
- end;
- lowercase('IP'): begin
- PlayerInfo[ID].Auto := 'IP';
- WriteConsole(ID,'AutoLogin changed to: IP',GOOD);
- end;
- lowercase('HWID'): begin
- PlayerInfo[ID].Auto := 'HWID';
- WriteConsole(ID,'AutoLogin changed to: HWID',GOOD);
- end;
- lowercase('NICK'): begin
- PlayerInfo[ID].Auto := 'NICK';
- WriteConsole(ID,'AutoLogin changed to: NICK',GOOD);
- WriteConsole(ID,'Your account is now not protected!',BAD);
- end;
- end;
- if regExpMatch('^(off|hwid|ip|nick)$',lowercase(GetPiece(Text,' ',1))) then UpdateNickname(ID) else WriteConsole(ID,'Please select the type of AutoLogin: "IP" or "HWID" or "OFF" or "NICK".',BAD);
- end else WriteConsole(ID,'Please login first!',BAD);
- end else WriteConsole(ID,'No profile found!',BAD); //Dominik
- end;
- if MaskCheck(Text,'/addpassword *') then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- if (PlayerInfo[ID].Password = '') then begin
- delete(Text,1,13);
- if (Text <> '') then begin
- if (regExpMatch(' ',text)=false) then begin
- pass := MD5Issue(Text);
- PlayerInfo[ID].Password := pass;
- UpdateNickname(ID);
- WriteConsole(ID,'Added password: '+Text+'. Remember this!',GOOD);
- end else WriteConsole(ID,'Your password can not contain spaces.',BAD);
- end else WriteConsole(ID,'No password found. Please try again.',BAD);
- end else WriteConsole(ID,'You already have a password, please use to change "/changepass <old_password> <nowe_password>"',BAD);
- end else WriteConsole(ID,'You are not logged in, login or join again.',BAD);
- end;
- if MaskCheck(Text,'/lastplayed *') then begin delete(Text,1,12); LastPlay(ID,text); end;
- Result := false;
- end;
- procedure OnPlayerDeathGiveAssists(Victim: byte);
- var i: byte;
- begin
- if (lowercase(OtherStatsON) = lowercase('ON')) then begin
- for i := 1 to 32 do if (Victim <> i) and (PlayersInfoArr[Victim].KilledBy <> i) and ((GetplayerStat(Victim,'Team') <> GetplayerStat(i,'Team')) or (GameStyle=0) or (GameStyle=1) or (GameStyle=4) and (GetplayerStat(i,'Active') = true)) then begin
- if (PlayersInfoArr[Victim].DamageRecievedByCooldown[i] > 0) or (CooldownTimer = 0) then begin
- if (PlayersInfoArr[Victim].DamageRecievedByID[i] > AssistMinimumDamagePercent) and (PlayerInfo[i].NickStatus = true) then begin
- PlayerStats[i].Asysta := inttostr(strtoint(PlayerStats[i].Asysta) + 1);
- if (lowercase(RealTimeUpdate) = lowercase('ON')) then UpdateNickname(i);
- end;
- end;
- end;
- end;
- end;
- Procedure RemoveAllDamageToOnDeath(ID:byte);
- var i: byte;
- Begin
- for i := 1 to 32 do begin
- PlayersInfoArr[i].DamageRecievedByCooldown[ID] := 0;
- PlayersInfoArr[i].DamageRecievedByID[33] := PlayersInfoArr[i].DamageRecievedByID[33] + PlayersInfoArr[i].DamageRecievedByID[ID];
- PlayersInfoArr[i].DamageRecievedByID[ID] := 0;
- end;
- end;
- Function TotalPercentDamageRecieved(ID:byte): double;
- var i: byte; TotalDamagePercent: double;
- Begin
- TotalDamagePercent := 0;
- for i := 1 to 33 do if (PlayersInfoArr[ID].DamageRecievedByID[i] <> 0) then TotalDamagePercent := TotalDamagePercent + PlayersInfoArr[ID].DamageRecievedByID[i];
- result := TotalDamagePercent;
- end;
- Function MostPercentDamagedoneBy(ID:byte): integer;
- var i: byte; MostPercentDamagedone: double;
- Begin
- MostPercentDamagedone := 0;
- for i := 1 to 33 do if (PlayersInfoArr[ID].DamageRecievedByID[i] > MostPercentDamagedone) then begin
- MostPercentDamagedone := PlayersInfoArr[ID].DamageRecievedByID[i];
- result := i;
- end;
- end;
- Procedure RemoveDamageDoneBy(ID: byte; DamagePercent: Double);
- var i: byte; CountAttackers: integer; DividedDamagePercent: double; DamagePercentLeft: double;
- Begin
- CountAttackers := 0;
- for i := 1 to 32 do if (GetPlayerStat(i, 'Active') = true) then if (PlayersInfoArr[ID].DamageRecievedByID[i] <> 0) then inc(CountAttackers,1);
- if (CountAttackers > 0) then begin
- DividedDamagePercent := (DamagePercent/CountAttackers);
- for i := 1 to 33 do if (PlayersInfoArr[ID].DamageRecievedByID[i] <> 0) then begin
- if ((PlayersInfoArr[ID].DamageRecievedByID[i] - DividedDamagePercent) < 0) then begin
- PlayersInfoArr[ID].DamageRecievedByID[i] := 0;
- DamagePercentLeft := (DividedDamagePercent - PlayersInfoArr[ID].DamageRecievedByID[i]);
- end else PlayersInfoArr[ID].DamageRecievedByID[i] := (PlayersInfoArr[ID].DamageRecievedByID[i] - DividedDamagePercent);
- end;
- end;
- if (DamagePercentLeft <> 0) then RemoveDamageDoneBy(ID,DamagePercentLeft);
- end;
- procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
- var ID, DeathMatchPlayersAliveBeforeThisKill, AlphaPlayersAliveBeforeThisKill,BravoPlayersAliveBeforeThisKill,CharliePlayersAliveBeforeThisKill,DeltaPlayersAliveBeforeThisKill, AliveteamsCountBeforeKill, x: integer;
- begin
- if (Killer = Victim) then begin
- if (lowercase(EnableServerStats) = lowercase('ON')) then SSelfkils := inttostr(strtoint(SSelfkils) + 1);
- if (lowercase(MapStatsON) = lowercase('ON')) then MapSelfkills := inttostr(strtoint(MapSelfkills) + 1);
- if (lowercase(EnableStats) = lowercase('ON')) then PlayerStats[Victim].SelfKills := inttostr(strtoint(PlayerStats[Victim].SelfKills) + 1);
- end;
- if (killer <> victim) then begin
- if (GetPlayerStat(Killer, 'Active') = true) then begin
- if (GetPlayerStat(Killer,'team')<>GetPlayerStat(Victim,'team')) then begin
- if (lowercase(EnableServerStats) = lowercase('ON')) then SKill := inttostr(strtoint(SKill) + 1);
- if (lowercase(MapStatsON) = lowercase('ON')) then MapKills := inttostr(strtoint(MapKills ) + 1);
- if (lowercase(EnableStats) = lowercase('ON')) then begin
- PlayerStats[Killer].Kills := inttostr(strtoint(PlayerStats[Killer].Kills) + 1);
- x := Punkty2(Killer, Victim);
- PlayerStats[Killer].Points := inttostr(strtoint(PlayerStats[Killer].Points) + x);
- PlayerStats[Victim].Points := inttostr(strtoint(PlayerStats[Victim].Points) - x);
- if (GetPlayerStat(Victim,'Flagger')=true) then PlayerStats[Killer].KillFlager := inttostr(strtoint(PlayerStats[Killer].KillFlager)+1);
- end;
- end;
- if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then begin
- if (lowercase(EnableStats) = lowercase('ON')) then if (GetPlayerStat(Victim,'Flagger')=true) then PlayerStats[Killer].KillFlager := inttostr(strtoint(PlayerStats[Killer].KillFlager)+1);
- if (GetPlayerStat(Killer,'alive')=false) and (lowercase(OtherStatsON) = lowercase('ON')) then PlayerStats[Killer].PosKill := inttostr(strtoint(PlayerStats[Killer].PosKill) + 1);
- end else if (GetPlayerStat(Killer,'team')<>GetPlayerStat(Victim,'team')) then if (GetPlayerStat(Killer,'alive')=false) and (lowercase(OtherStatsON) = lowercase('ON')) then PlayerStats[Killer].PosKill := inttostr(strtoint(PlayerStats[Killer].PosKill) + 1);
- if (GetPlayerStat(Killer,'team')=GetPlayerStat(Victim,'team')) then begin
- if (lowercase(EnableServerStats) = lowercase('ON')) then if(GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then SKill := inttostr(strtoint(SKill) + 1) else STeamKill := inttostr(strtoint(STeamKill) + 1);
- if (lowercase(MapStatsON) = lowercase('ON')) then if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then MapKills := inttostr(strtoint(MapKills) + 1) else MapTeamkills := inttostr(strtoint(MapTeamkills) + 1);
- if (lowercase(EnableStats) = lowercase('ON')) then begin
- if (GameStyle = 1) and (GetPlayerStat(Killer, 'Flagger')) then PlayerStats[Killer].TeamKills := inttostr(strtoint(PlayerStats[Killer].TeamKills) +2) else PlayerStats[Killer].TeamKills := inttostr(strtoint(PlayerStats[Killer].TeamKills) + 1);
- if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then begin
- x := Punkty2(Killer, Victim);
- PlayerStats[Killer].Points := inttostr(strtoint(PlayerStats[Killer].Points) + x);
- PlayerStats[Victim].Points := inttostr(strtoint(PlayerStats[Victim].Points) - x);
- end;
- end;
- end;
- end;
- if (GetPlayerStat(victim, 'Active') = true) then begin
- if (lowercase(EnableStats) = lowercase('ON')) then PlayerStats[Victim].Deaths := inttostr(strtoint(PlayerStats[Victim].Deaths) + 1);
- if (GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6) then if (lowercase(EnableStats) = lowercase('ON')) then if (GetPlayerStat(Victim,'Team') = GetPlayerStat(Killer,'Team')) then PlayerStats[Victim].DeathsByTeam := inttostr(strtoint(PlayerStats[Victim].DeathsByTeam) + 1);
- end;
- if (lowercase(OtherStatsON) = lowercase('ON')) then begin
- if (GetPlayerStat(atc[victim], 'Team') = GetPlayerStat(killer, 'Team')) then begin
- if (atc[victim] > 0) and (GetPlayerStat(atc[victim], 'Alive') = true) and not (killer = atc[victim]) and (PlayerInfo[killer].NickStatus) then begin
- PlayerStats[killer].Wybawiciel := inttostr(strtoint(PlayerStats[killer].Wybawiciel) + 1);
- atc[victim] := 0;
- end;
- end;
- if (Revenge[Killer] = idtoname(victim)) and (PlayerInfo[Killer].NickStatus = true) then begin
- PlayerStats[killer].Zemsta := inttostr(strtoint(PlayerStats[killer].Zemsta) + 1);
- Revenge[Killer] := '';
- end;
- if (Revenge[Victim] = '') then Revenge[Victim] := idtoname(Killer);
- if (Revenge[Victim] = Revenge[Victim]) then Revenge[Victim] := idtoname(Killer);
- if (Revenge[Victim] = Revenge[Killer]) then Revenge[Victim] := idtoname(Killer);
- end;
- end;
- RemoveAllDamageToOnDeath(Victim);
- PlayersInfoArr[Victim].KilledBy := Killer;
- if (Survival = true) then begin
- if (DeathmatchPlayers <> 0) and (AlphaPlayers = 0) and (BravoPlayers = 0) and (CharliePlayers = 0) and (DeltaPlayers = 0) then begin
- DeathMatchPlayersAliveBeforeThisKill := 0;
- for ID:=1 to 32 do if (GetPlayerStat(ID,'Active') = true) then if ((GetPlayerStat(ID, 'Alive') = true) or (ID = Victim)) then inc(DeathMatchPlayersAliveBeforeThisKill,1);
- if ((DeathMatchPlayersAliveBeforeThisKill > 1)) then OnPlayerDeathGiveAssists(victim);
- end else
- begin
- for ID:=1 to 32 do if (GetPlayerStat(ID,'Active') = true) then begin
- if ((GetPlayerStat(ID, 'Alive') = true) or (ID = Victim)) then begin
- case (GetPlayerStat(ID, 'Team')) of
- 1: AlphaPlayersAliveBeforeThisKill := AlphaPlayersAliveBeforeThisKill + 1;
- 2: BravoPlayersAliveBeforeThisKill := BravoPlayersAliveBeforeThisKill + 1;
- 3: CharliePlayersAliveBeforeThisKill := CharliePlayersAliveBeforeThisKill + 1;
- 4: DeltaPlayersAliveBeforeThisKill := DeltaPlayersAliveBeforeThisKill + 1;
- end;
- end;
- end;
- AliveteamsCountBeforeKill := 0;
- if (AlphaPlayersAliveBeforeThisKill > 0) then inc(AliveteamsCountBeforeKill,1); if (BravoPlayersAliveBeforeThisKill > 0) then inc(AliveteamsCountBeforeKill,1);
- if (CharliePlayersAliveBeforeThisKill > 0) then inc(AliveteamsCountBeforeKill,1); if (DeltaPlayersAliveBeforeThisKill > 0) then inc(AliveteamsCountBeforeKill,1);
- if ((AliveteamsCountBeforeKill > 1)) then OnPlayerDeathGiveAssists(victim);
- end;
- end else OnPlayerDeathGiveAssists(victim);
- if (lowercase(RealTimeUpdate) = lowercase('ON')) then begin
- UpdateServStats();
- UpdateMapStats(currentmap);
- UpdateNickname(Killer);
- UpdateNickname(Victim);
- if (lowercase(EnableTop) = lowercase('ON')) then begin
- if (GetPlayerStat(killer, 'Active') = true) then if (PlayerInfo[killer].NickStatus) then begin
- if (GetPlayerStat(killer, 'Human') = true) then UpdateRanks(killer);
- SaveRanks();
- end;
- if (GetPlayerStat(Victim, 'Active') = true) then if (PlayerInfo[Victim].NickStatus) then begin
- if (GetPlayerStat(Victim, 'Human') = true) then UpdateRanks(Victim);
- SaveRanks();
- end;
- end;
- end;
- end;
- procedure OnMapChange(NewMap: String);
- var i: byte;
- begin
- for i := 1 to 32 do if (GetPlayerStat(i, 'Active') = true) then begin
- Revenge[i] := '';
- if (lowercase(EnableTop) = lowercase('ON')) then if (PlayerInfo[i].NickStatus = true) then begin
- if (GetPlayerStat(i, 'Human') = true) then UpdateRanks(i);
- SaveRanks();
- end;
- if (lowercase(RealTimeUpdate) <> lowercase('ON')) then begin
- UpdateNickname(i);
- WriteConsole(i,'Stats update!',GOOD);
- end;
- end;
- Go := false;
- for i := 1 to 32 do Voted[i] := false;
- VFor := 0; Time := 0;
- if (lowercase(EnableFlagStats) = lowercase('ON')) then begin
- INF_BravoNewScore := BravoScore; HTF_BravoNewScore := BravoScore; HTF_AlphaNewScore := AlphaScore;
- end;
- if (prevmap <> '') then if (lowercase(MapStatsON) = lowercase('ON')) then begin
- MapPlays := inttostr(strtoint(MapPlays) + 1);
- UpdateMapStats(prevmap);
- MapStatsLoad(prevmap);
- if (lowercase(TopMapsON) = lowercase('ON')) then begin
- UpdateTopMap();
- SaveTopMap();
- end;
- end;
- if (lowercase(MapStatsON) = lowercase('ON')) then MapStatsLoad(newmap);
- PrevMap := newmap;
- end;
- procedure PokazTop(const ID: byte);
- var i, High: integer;
- begin
- if (lowercase(EnableTop) = lowercase('ON')) then begin
- if (GetArrayLength(ranks) > 0) then begin
- if (GetArrayLength(ranks) < TopLines) then high := GetArrayLength(ranks) - 1 else high := TopLines - 1;
- WriteConsole(iif(lowercase(DisTop) = lowercase('ON'),0,ID), 'Top ' + InttoStr(high + 1) + ' ranked players:', GOOD);
- for i := 0 to high do WriteConsole(iif(lowercase(DisTop) = lowercase('ON'),0,ID), InttoStr(i + 1) + '. ' + ranks[i].Name + ' - ' + InttoStr(ranks[i].Points) + ' pts.', GOOD);
- end else WriteConsole(ID, 'No players are ranked yet.', BAD);
- end else WriteConsole(ID,'Top have been disabled by an administrator.',BAD);
- end;
- procedure PokazTopID(ID: byte; csa: integer);
- var b, High: integer;
- begin
- if (lowercase(EnableTop) = lowercase('ON')) then begin
- if (GetArrayLength(ranks) > 0) then begin
- if (csa<=30) and (csa>0) then begin
- if (GetArrayLength(ranks) < csa) then high := GetArrayLength(ranks) - 1 else high := csa - 1;
- WriteConsole(iif(lowercase(DisTop) = lowercase('ON'),0,ID), 'Top ' + InttoStr(high + 1) + ' ranked players:', GOOD);
- for b := 0 to high do WriteConsole(iif(lowercase(DisTop) = lowercase('ON'),0,ID), InttoStr(b + 1) + '. ' + ranks[b].Name + ' - ' + InttoStr(ranks[b].Points) + ' pts.', GOOD);
- end else WriteConsole(ID,'The maximum top is 30 players.',BAD);
- end else WriteConsole(ID, 'No players are ranked yet.', BAD);
- end else WriteConsole(ID,'Top have been disabled by an administrator.',BAD);
- end;
- procedure RankID(ID: byte; i: integer);
- var b: integer;
- begin
- if (lowercase(EnableTop) = lowercase('ON')) and (lowercase(EnableRankID) = lowercase('ON')) then begin
- b:=i; i := i-1;
- if (GetArrayLength(ranks) > i) and (i >= 0) then WriteConsole(iif(lowercase(DisRankID) = lowercase('ON'),0,ID),'Player '+ranks[i].Name+' is a '+inttostr(b)+' in the ranking of '+InttoStr(ranks[i].Points)+' pts.', GOOD) else WriteConsole(ID,'There is no player in that position in the ranking.',BAD);
- end else WriteConsole(ID,'!rankid <number> have been disabled by an administrator.',BAD);
- end;
- procedure RankTXT(ID: byte; text: string);
- var b, op: integer; tr: byte;
- begin
- if (lowercase(EnableTop) = lowercase('ON')) and (lowercase(EnableRank) = lowercase('ON')) then begin
- if (text = '') then begin
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID, 'Name'))+'.txt') = true) and (PlayerInfo[ID].DelAcc = 'NO') then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- if (strtoint(iif((GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6),PlayerStats[ID].Kills, PlayerStats[ID].TeamKills)) >= StrtoInt(LimitKills)) then begin
- if (GetArrayLength(ranks) > 0) then for b := 0 to GetArrayLength(ranks) - 1 do if (ranks[b].Name = GetPlayerStat(ID, 'name')) then begin
- WriteConsole(iif(lowercase(DisRank) = lowercase('ON'),0,ID),'Player '+GetPlayerStat(ID,'name')+' is a '+InttoStr(b + 1)+' in the ranking of '+PlayerStats[ID].Points+' pts.', GOOD);
- exit;
- end;
- end else WriteConsole(ID,'You must possess a minimum of '+LimitKills+' killings. Have: '+iif((GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6),PlayerStats[ID].Kills, PlayerStats[ID].TeamKills),BAD);
- end else WriteConsole(ID,'Login to see the stats!',BAD);
- end else WriteConsole(ID,'Please register! For instructions type: !reginfo',BAD);
- end else
- begin
- op := StrToID(Text); tr := 0;
- if (FileExists('nickreg/'+filterFileName(Text)+'.txt') = true) then tr := 1 else if (op = 254) then WriteConsole(ID,'Player not found ('+Text+')',BAD) else if (FileExists('nickreg/'+filterFileName(getPlayerStat(op,'Name'))+'.txt') = true) then tr := 2;
- if (tr = 1) or (tr = 2) then begin
- if (GetArrayLength(ranks) > 0) then for b := 0 to GetArrayLength(ranks) - 1 do if (ranks[b].Name = iif(tr=1,text,getPlayerStat(op,'Name'))) then begin
- if (GetArrayLength(ranks) > b) and (b >= 0) then WriteConsole(iif(lowercase(DisRankOther) = lowercase('ON'),0,ID),'Player '+ranks[b].Name+' is a '+inttostr(b+1)+' in the ranking of '+InttoStr(ranks[b].Points)+' pts.', GOOD) else WriteConsole(ID,'There is no player in that position in the ranking.',BAD);
- end;
- end;
- end;
- end else WriteConsole(ID,'!rank have been disabled by an administrator.',BAD);
- end;
- procedure PokazTopMaps(const ID: byte);
- var i, High: integer;
- begin
- if (lowercase(TopMapsON) = lowercase('ON')) and (lowercase(MapStatsON) = lowercase('ON')) then begin
- if (GetArrayLength(TopMap) > 0) then begin
- if (GetArrayLength(TopMap) < TopLines) then high := GetArrayLength(TopMap) - 1 else high := TopLines - 1;
- WriteConsole(iif(lowercase(DisTopMaps) = lowercase('ON'),0,ID), 'Top ' + InttoStr(high + 1) + ' most often played maps:', GOOD);
- for i := 0 to high do WriteConsole(iif(lowercase(DisTopMaps) = lowercase('ON'),0,ID), InttoStr(i + 1) + '. ' + TopMap[i].Name + ' - ' + InttoStr(TopMap[i].Played) + ' plays.', GOOD);
- end else WriteConsole(ID, 'No maps in the rankings.', BAD);
- end else WriteConsole(ID, 'Top maps have been disabled by an administrator.', BAD);
- end;
- Procedure Inne(ID: byte);
- var cel: double;
- begin
- if (lowercase(OtherStatsON) = lowercase('ON')) then begin
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID, 'Name'))+'.txt') = true) and (PlayerInfo[ID].DelAcc = 'NO') then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- if (GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6) then begin
- if (strtoint(PlayerStats[ID].Kills) >= StrtoInt(LimitKills)) then begin
- cel := (single(strtoint(PlayerStats[ID].ShootHit))*100/Single(strtoint(PlayerStats[ID].Shoot)));
- if (cel > 100) then cel := 100.00;
- WriteConsole(iif(lowercase(DisOtherStats) = lowercase('ON'),0,ID),'Shots: '+PlayerStats[ID].Shoot+', Hits: '+PlayerStats[ID].ShootHit+', Mishit: '+inttostr(strtoint(PlayerStats[ID].Shoot)-strtoint(PlayerStats[ID].ShootHit))+', Accuracy: '+FormatFloat('0.00',cel)+'%',GOOD);
- WriteConsole(iif(lowercase(DisOtherStats) = lowercase('ON'),0,ID),iif(FriendlyFire,'Friendly shoots: '+PlayerStats[ID].ShootFriendly+', ','')+'Savior kill: '+PlayerStats[ID].Wybawiciel+', Revenge: '+PlayerStats[ID].Zemsta+', Assist: '+PlayerStats[ID].Asysta+', Posthumous kill: '+PlayerStats[ID].PosKill,GOOD);
- end else WriteConsole(ID,'You must possess a minimum of '+LimitKills+' killings. Have: '+PlayerStats[ID].Kills,BAD);
- end;
- if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then begin
- if (strtoint(PlayerStats[ID].TeamKills) >= StrtoInt(LimitKills)) then begin
- cel := (single(strtoint(PlayerStats[ID].ShootHit))*100/Single(strtoint(PlayerStats[ID].Shoot)));
- if (cel > 100) then cel := 100.00;
- WriteConsole(iif(lowercase(DisOtherStats) = lowercase('ON'),0,ID),'Shots: '+PlayerStats[ID].Shoot+', Hits: '+PlayerStats[ID].ShootHit+', Mishit: '+inttostr(strtoint(PlayerStats[ID].Shoot)-strtoint(PlayerStats[ID].ShootHit))+', Accuracy: '+FormatFloat('0.00',cel)+'%',GOOD);
- WriteConsole(iif(lowercase(DisOtherStats) = lowercase('ON'),0,ID),'Savior kill: '+PlayerStats[ID].Wybawiciel+', Revenge: '+PlayerStats[ID].Zemsta+', Assist: '+PlayerStats[ID].Asysta+', Posthumous kill: '+PlayerStats[ID].PosKill,GOOD);
- end else WriteConsole(ID,'You must possess a minimum of '+LimitKills+' killings. Have: '+PlayerStats[ID].TeamKills,BAD);
- end;
- end else WriteConsole(ID,'Login to see the stats!',BAD);
- end else WriteConsole(ID,'Please register! For instructions type: !reginfo',BAD);
- end else WriteConsole(ID,'Statistics have been disabled by an administrator.',BAD);
- end;
- Procedure InneOther(ID:byte; Text:string);
- var cel: double; op: integer; temparray: TStringArray; fileData: string; tr: byte;
- begin
- if (lowercase(OtherStatsON) = lowercase('ON')) then begin
- op := StrToID(Text); tr := 0;
- if (FileExists('nickreg/'+filterFileName(Text)+'.txt') = true) then begin
- filedata := ReadFile('nickreg/'+filterFileName(Text)+'.txt');
- temparray := Explode(filedata,CRLF);
- tr := 1;
- end else
- begin
- if (op = 254) then WriteConsole(ID,'Player not found ('+Text+')',BAD) else begin
- if (FileExists('nickreg/'+filterFileName(getPlayerStat(op,'Name'))+'.txt') = true) then begin
- filedata := ReadFile('nickreg/'+filterFileName(getPlayerStat(op,'Name'))+'.txt');
- temparray := Explode(filedata,CRLF);
- if (temparray[41] = 'NO') then tr := 2 else WriteConsole(ID,'The player does not have an account.',BAD);
- end;
- end;
- end;
- if (tr = 1) or (tr = 2) then begin
- if (GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6) then begin
- if (strtoint(temparray[7]) >= StrtoInt(LimitKills)) then begin
- cel := (single(strtoint(temparray[23]))*100/Single(strtoint(temparray[22])));
- if (cel > 100) then cel := 100.00;
- WriteConsole(iif(lowercase(DisStatsOther) = lowercase('ON'),0,ID),'OtherStats player '+iif(tr=1,text,getPlayerStat(op,'Name'))+':',GOOD);
- WriteConsole(iif(lowercase(DisOtherOther) = lowercase('ON'),0,ID),'Shots: '+temparray[22]+', Hits: '+temparray[23]+', Mishit: '+inttostr(strtoint(temparray[22])-strtoint(temparray[23]))+', Accuracy: '+FormatFloat('0.00',cel)+'%',GOOD);
- WriteConsole(iif(lowercase(DisOtherOther) = lowercase('ON'),0,ID),+iif(FriendlyFire=true,'Friendly shoots: '+temparray[24]+', ','')+'Savior kill: '+temparray[25]+', Revenge: '+temparray[26]+', Assist: '+temparray[27]+', Posthumous kill: '+temparray[5],GOOD);
- end else WriteConsole(ID,'The player does not have required number of kills. It has: '+temparray[7]+'/'+LimitKills,BAD);
- end;
- if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then begin
- if (strtoint(temparray[8]) >= StrtoInt(LimitKills)) then begin
- cel := (single(strtoint(temparray[23]))*100/Single(strtoint(temparray[22])));
- if (cel > 100) then cel := 100.00;
- WriteConsole(iif(lowercase(DisStatsOther) = lowercase('ON'),0,ID),'OtherStats player '+iif(tr=1,text,getPlayerStat(op,'Name'))+':',GOOD);
- WriteConsole(iif(lowercase(DisOtherOther) = lowercase('ON'),0,ID),'Shots: '+temparray[22]+', Hits: '+temparray[23]+', Mishit: '+inttostr(strtoint(temparray[22])-strtoint(temparray[23]))+', Accuracy: '+FormatFloat('0.00',cel)+'%',GOOD);
- WriteConsole(iif(lowercase(DisOtherOther) = lowercase('ON'),0,ID),+iif(FriendlyFire=true,'Friendly shoots: '+temparray[24]+', ','')+'Savior kill: '+temparray[25]+', Revenge: '+temparray[26]+', Assist: '+temparray[27]+', Posthumous kill: '+temparray[5],GOOD);
- end else WriteConsole(ID,'The player does not have required number of kills. It has: '+temparray[8]+'/'+LimitKills,BAD);
- end;
- end;
- end else WriteConsole(ID,'Statistics have been disabled by an administrator.',BAD);
- end;
- Procedure WinStats(ID: byte);
- var cel: double;
- begin
- if (lowercase(WinStatsON) = lowercase('ON')) then begin
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID, 'Name'))+'.txt') = true) and (PlayerInfo[ID].DelAcc = 'NO') then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- if (strtoint(PlayerStats[ID].Kills) >= StrtoInt(LimitKills)) then begin
- cel := (single(strtoint(PlayerStats[ID].ShootHit))*100/Single(strtoint(PlayerStats[ID].Shoot)));
- if (cel > 100) then cel := 100.00;
- CEL := (Single(strtoint(PlayerStats[ID].Win))/Single(strtoint(PlayerStats[ID].Lose)));
- WriteConsole(iif(lowercase(DisWinStats) = lowercase('ON'),0,ID),'Wins: '+PlayerStats[ID].Win+', Lose: '+PlayerStats[ID].Lose+', Draws: '+PlayerStats[ID].Remis+', Win/Lose ratio: '+FormatFloat('0.00',cel),GOOD);
- if (GameStyle <> 0) and (GameStyle <> 1) and (GameStyle <> 4) then WriteConsole(iif(lowercase(DisWinStats) = lowercase('ON'),0,ID),'AlphaWin: '+PlayerStats[ID].AlphaWins+', AlphaLose: '+PlayerStats[ID].AlphaLose+', BrawoWin: '+PlayerStats[ID].BravoWins+', BravoLose: '+PlayerStats[ID].BravoLose,GOOD);
- if (GameStyle = 2) then WriteConsole(iif(lowercase(DisWinStats) = lowercase('ON'),0,ID),'CharlieWin: '+PlayerStats[ID].CharlieWin+', CharlieLose: '+PlayerStats[ID].CharlieLose+', DeltaWin: '+PlayerStats[ID].DeltaWin+', DeltaLose: '+PlayerStats[ID].DeltaLose,GOOD);
- end else WriteConsole(ID,'You must possess a minimum of '+LimitKills+' killings. Have: '+PlayerStats[ID].Kills,BAD);
- end else WriteConsole(ID,'Login to see the stats!',BAD);
- end else WriteConsole(ID,'Please register! For instructions type: !reginfo',BAD);
- end else WriteConsole(ID,'Statistics have been disabled by an administrator.',BAD);
- end;
- Procedure WinStatsOther(ID:byte; Text:string);
- var cel: double; op: integer; temparray: TStringArray; fileData: string; tr: byte;
- begin
- if (lowercase(WinStatsON) = lowercase('ON')) then begin
- op := StrToID(Text); tr := 0;
- if (FileExists('nickreg/'+filterFileName(Text)+'.txt') = true) then begin
- filedata := ReadFile('nickreg/'+filterFileName(Text)+'.txt');
- temparray := Explode(filedata,CRLF);
- tr := 1;
- end else
- begin
- if (op = 254) then WriteConsole(ID,'Player not found ('+Text+')',BAD) else begin
- if (FileExists('nickreg/'+filterFileName(getPlayerStat(op,'Name'))+'.txt') = true) then begin
- filedata := ReadFile('nickreg/'+filterFileName(getPlayerStat(op,'Name'))+'.txt');
- temparray := Explode(filedata,CRLF);
- if (temparray[41] = 'NO') then tr := 2 else WriteConsole(ID,'The player does not have an account.',BAD);
- end;
- end;
- end;
- if (tr = 1) or (tr = 2) then begin
- if (strtoint(iif((GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6),temparray[7], temparray[8])) >= StrtoInt(LimitKills)) then begin
- cel := (single(strtoint(temparray[23]))*100/Single(strtoint(temparray[22])));
- if (cel > 100) then cel := 100.00;
- CEL := (Single(strtoint(temparray[28]))/Single(strtoint(temparray[29])));
- WriteConsole(iif(lowercase(DisStatsOther) = lowercase('ON'),0,ID),'WinsStats player '+iif(tr=1,text,getPlayerStat(op,'Name'))+':',GOOD);
- WriteConsole(iif(lowercase(DisWinStatsOther) = lowercase('ON'),0,ID),'Wins: '+temparray[28]+', Lose: '+temparray[29]+', Draws: '+temparray[30]+', Win/Lose ratio: '+FormatFloat('0.00',cel),GOOD);
- if (GameStyle <> 0) and (GameStyle <> 1) and (GameStyle <> 4) then WriteConsole(iif(lowercase(DisWinStatsOther) = lowercase('ON'),0,ID),'AlphaWin: '+temparray[31]+', AlphaLose: '+temparray[32]+', BrawoWin: '+temparray[33]+', BravoLose: '+temparray[34],GOOD);
- if(GameStyle = 2) then WriteConsole(iif(lowercase(DisWinStatsOther) = lowercase('ON'),0,ID),'CharlieWin: '+temparray[35]+', CharlieLose: '+temparray[36]+', DeltaWin: '+temparray[37]+', DeltaLose: '+temparray[38],GOOD);
- end else WriteConsole(ID,'The player does not have required number of kills. It has: '+iif((GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6),temparray[7], temparray[8])+'/'+LimitKills,BAD);
- end;
- end else WriteConsole(ID,'Statistics have been disabled by an administrator.',BAD);
- end;
- Procedure Stats(ID: byte);
- var i: integer; KD: double;
- begin
- if (lowercase(EnableStats) = lowercase('ON')) then begin
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID, 'Name'))+'.txt') = true) and (PlayerInfo[ID].DelAcc = 'NO') then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- if (GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6) then begin
- if (strtoint(PlayerStats[ID].Kills) >= StrtoInt(LimitKills)) then begin
- if (strtoint(PlayerStats[ID].Kills) <> 0) or (strtoint(PlayerStats[ID].Deaths) <> 0) then begin
- if (GetArrayLength(ranks) > 0) then for i := 0 to GetArrayLength(ranks) - 1 do if (ranks[i].Name = GetPlayerStat(ID, 'name')) then begin
- KD := single(strtoint(PlayerStats[ID].Kills)) / single(strtoint(PlayerStats[ID].Deaths));
- WriteConsole(iif(lowercase(DisStats) = lowercase('ON'),0,ID), 'Rank: ' + InttoStr(i + 1) + '/' + InttoStr(GetArrayLength(ranks)) + ', Points: '+PlayerStats[ID].Points+', K/D: '+FormatFloat('0.00',KD)+', PlayerRate: '+inttostr(Punkty(ID)), GOOD);
- WriteConsole(iif(lowercase(DisStats) = lowercase('ON'),0,ID),'Kills: '+PlayerStats[ID].Kills+', Death: '+PlayerStats[ID].Deaths+', Selfkills: '+PlayerStats[ID].SelfKills,GOOD);
- if (FriendlyFire) then WriteConsole(iif(lowercase(DisStats) = lowercase('ON'),0,ID),'Teamkills: '+PlayerStats[ID].TeamKills+', Killed By Friend: '+PlayerStats[ID].DeathsByTeam,GOOD);
- exit;
- end;
- end else WriteConsole(ID,'We are sorry for the moment we have too little information about you.',BAD);
- end else WriteConsole(ID,'You must possess a minimum of '+LimitKills+' killings. Have: '+PlayerStats[ID].Kills,BAD);
- end;
- if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then begin
- if (strtoint(PlayerStats[ID].TeamKills) >= StrtoInt(LimitKills)) then begin
- if (strtoint(PlayerStats[ID].TeamKills) <> 0) or (strtoint(PlayerStats[ID].Deaths) <> 0) then begin
- if (GetArrayLength(ranks) > 0) then for i := 0 to GetArrayLength(ranks) - 1 do
- if (ranks[i].Name = GetPlayerStat(ID, 'name')) then begin
- KD := single(strtoint(PlayerStats[ID].TeamKills)) / single(strtoint(PlayerStats[ID].Deaths));
- WriteConsole(iif(lowercase(DisStats) = lowercase('ON'),0,ID), 'Rank: ' + InttoStr(i + 1) + '/' + InttoStr(GetArrayLength(ranks)) + ', Points: '+PlayerStats[ID].Points+', K/D: '+FormatFloat('0.00',KD)+', PlayerRate: '+inttostr(Punkty(ID)), GOOD);
- WriteConsole(iif(lowercase(DisStats) = lowercase('ON'),0,ID),'Kills: '+PlayerStats[ID].TeamKills+', Death: '+PlayerStats[ID].Deaths+', Selfkills: '+PlayerStats[ID].SelfKills,GOOD);
- exit;
- end;
- end else WriteConsole(ID,'We are sorry for the moment we have too little information about you.',BAD);
- end else WriteConsole(ID,'You must possess a minimum of '+LimitKills+' killings. Have: '+PlayerStats[ID].TeamKills,BAD);
- end;
- end else WriteConsole(ID,'Login to see the stats!',BAD);
- end else WriteConsole(ID,'Please register! For instructions type: !reginfo',BAD);
- end else WriteConsole(ID,'Statistics have been disabled by an administrator.',BAD);
- end;
- Procedure StatsOther(ID:byte; Text:string);
- var op, i: integer; temparray: TStringArray; fileData: string; tr: byte; KD: double;
- begin
- if (lowercase(EnableStats) = lowercase('ON')) then begin
- op := StrToID(Text); tr := 0;
- if (FileExists('nickreg/'+filterFileName(Text)+'.txt') = true) then begin
- filedata := ReadFile('nickreg/'+filterFileName(Text)+'.txt');
- temparray := Explode(filedata,CRLF);
- tr := 1;
- end else
- begin
- if (op = 254) then WriteConsole(ID,'Player not found ('+Text+')',BAD) else begin
- if (FileExists('nickreg/'+filterFileName(getPlayerStat(op,'Name'))+'.txt') = true) then begin
- filedata := ReadFile('nickreg/'+filterFileName(getPlayerStat(op,'Name'))+'.txt');
- temparray := Explode(filedata,CRLF);
- if (temparray[41] = 'NO') then tr := 2 else WriteConsole(ID,'The player does not have an account.',BAD);
- end;
- end;
- end;
- if (tr = 1) or (tr = 2) then begin
- if (GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6) then begin
- if (strtoint(temparray[7]) >= StrtoInt(LimitKills)) then begin
- if (strtoint(temparray[7]) = 0) or (strtoint(temparray[9]) <> 0) then begin
- if (GetArrayLength(ranks) > 0) then for i := 0 to GetArrayLength(ranks) - 1 do if (ranks[i].Name = temparray[0]) then begin
- WriteConsole(iif(lowercase(DisStatsOther) = lowercase('ON'),0,ID),'Player statistics '+iif(tr=1,text,getPlayerStat(op,'Name'))+':',GOOD);
- KD := single(strtoint(temparray[7])) / single(strtoint(temparray[9]));
- WriteConsole(iif(lowercase(DisStatsOther) = lowercase('ON'),0,ID), 'Rank: ' + InttoStr(i + 1) + '/' + InttoStr(GetArrayLength(ranks)) + ', Points: '+temparray[39], GOOD);
- WriteConsole(iif(lowercase(DisStatsOther) = lowercase('ON'),0,ID),'Kills: '+temparray[7]+', Death: '+temparray[9]+', Selfkills: '+temparray[11]+', K/D: '+FormatFloat('0.00',KD),GOOD);
- if (FriendlyFire) then WriteConsole(iif(lowercase(DisStatsOther) = lowercase('ON'),0,ID),'Teamkills: '+temparray[8]+', Killed By Friend: '+temparray[10],GOOD);
- exit;
- end;
- end else WriteConsole(ID,'Have too enough information about this player.',BAD);
- end else WriteConsole(ID,'The player does not have required number of kills. It has: '+temparray[7]+'/'+LimitKills,BAD);
- end;
- if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then begin
- if (strtoint(temparray[8]) >= StrtoInt(LimitKills)) then begin
- if (strtoint(temparray[8]) <> 0) or (strtoint(temparray[9]) <> 0) then begin
- if (GetArrayLength(ranks) > 0) then for i := 0 to GetArrayLength(ranks) - 1 do
- if (ranks[i].Name = temparray[0]) then begin
- WriteConsole(iif(lowercase(DisStatsOther) = lowercase('ON'),0,ID),'Player statistics '+iif(tr=1,Text,getPlayerStat(op,'Name'))+':',GOOD);
- KD := single(strtoint(temparray[8])) / single(strtoint(temparray[9]));
- WriteConsole(iif(lowercase(DisStatsOther) = lowercase('ON'),0,ID), 'Rank: ' + InttoStr(i + 1) + '/' + InttoStr(GetArrayLength(ranks)) + ', Points: '+temparray[39], GOOD);
- WriteConsole(iif(lowercase(DisStatsOther) = lowercase('ON'),0,ID),'Kills: '+temparray[8]+', Death: '+temparray[9]+', Selfkills: '+temparray[11]+', K/D: '+FormatFloat('0.00',KD),GOOD);
- exit;
- end;
- end else WriteConsole(ID,'Have too enough information about this player.',BAD);
- end else WriteConsole(ID,'The player does not have required number of kills. It has: '+temparray[8]+'/'+LimitKills,BAD);
- end;
- end;
- end else WriteConsole(ID,'Statistics have been disabled by an administrator.',BAD);
- end;
- Procedure FlagStats(ID: byte);
- begin
- if (lowercase(EnableFlagStats) = lowercase('ON')) then begin
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID, 'Name'))+'.txt') = true) and (PlayerInfo[ID].DelAcc = 'NO') then begin
- if (PlayerInfo[ID].NickStatus = true) then begin
- if (GameStyle = 1) then if (strtoint(PlayerStats[ID].TeamKills) >= StrtoInt(LimitKills)) then WriteConsole(iif(lowercase(DisFlagStats) = lowercase('ON'),0,ID),'Flag Grabs: '+PlayerStats[ID].FlagGrab+', Flag Drop: '+PlayerStats[ID].FlagDrop+', Kill Flager: '+PlayerStats[ID].KillFlager, GOOD) else WriteConsole(ID,'You must possess a minimum of '+LimitKills+' killings. Have: '+PlayerStats[ID].TeamKills,BAD);
- if (strtoint(PlayerStats[ID].Kills) >= StrtoInt(LimitKills)) then begin
- if (GameStyle = 3) then begin
- WriteConsole(iif(lowercase(DisFlagStats) = lowercase('ON'),0,ID),'Flag Grabs: '+PlayerStats[ID].FlagGrab+', Flag Return: '+PlayerStats[ID].FlagReturn+', Flag Score: '+PlayerStats[ID].FlagScore+', Flag Drop: '+PlayerStats[ID].FlagDrop, GOOD);
- WriteConsole(iif(lowercase(DisFlagStats) = lowercase('ON'),0,ID),'Alpha Caps: '+PlayerStats[ID].AlphaCaps+', Bravo Caps: '+PlayerStats[ID].BravoCaps+', Kill Flager: '+PlayerStats[ID].KillFlager, GOOD);
- end;
- if (GameStyle = 5) then begin
- WriteConsole(iif(lowercase(DisFlagStats) = lowercase('ON'),0,ID),'Flag Grabs: '+PlayerStats[ID].FlagGrab+', Flag Return: '+PlayerStats[ID].FlagReturn+', Flag Drop: '+PlayerStats[ID].FlagDrop, GOOD);
- WriteConsole(iif(lowercase(DisFlagStats) = lowercase('ON'),0,ID),'Alpha Caps: '+PlayerStats[ID].AlphaCaps+' Bravo Points: '+PlayerStats[ID].INF_Blue+' Alpha Points: '+PlayerStats[ID].INF_Red+', Kill Flager: '+PlayerStats[ID].KillFlager, GOOD);
- end;
- if (GameStyle = 6) then begin
- WriteConsole(iif(lowercase(DisFlagStats) = lowercase('ON'),0,ID),'Flag Grabs: '+PlayerStats[ID].FlagGrab+', Flag Drop: '+PlayerStats[ID].FlagDrop, GOOD);
- WriteConsole(iif(lowercase(DisFlagStats) = lowercase('ON'),0,ID),'Alpha Points: '+PlayerStats[ID].HTF_Red+' Bravo Points: '+PlayerStats[ID].HTF_Blue+', Kill Flager: '+PlayerStats[ID].KillFlager, GOOD);
- end;
- end else WriteConsole(ID,'You must possess a minimum of '+LimitKills+' killings. Have: '+PlayerStats[ID].Kills,BAD);
- end else WriteConsole(ID,'Login to see the flag stats!',BAD);
- end else WriteConsole(ID,'Please register! For instructions type: !reginfo',BAD);
- if (GameStyle = 0) then WriteConsole(ID,'It is not available in a deathmatch mode.',BAD);
- if (GameStyle = 2) then WriteConsole(ID,'It is not available in a TDM mode.',BAD);
- if (GameStyle = 4) then WriteConsole(ID,'It is not available in a rambo mode.',BAD);
- end else WriteConsole(ID,'Statistics have been disabled by an administrator.',BAD);
- end;
- Procedure FlagStatsOther(ID: byte; Text:string);
- var op: integer; temparray: TStringArray; fileData: string; tr: byte;
- begin
- if (GameStyle=0) or (GameStyle=2) or (GameStyle=4) then begin
- if (GameStyle = 0) then WriteConsole(ID,'It is not available in a mode deathmatch.',BAD);
- if (GameStyle = 2) then WriteConsole(ID,'It is not available in a mode TDM.',BAD);
- if (GameStyle = 4) then WriteConsole(ID,'It is not available in a rambo mode.',BAD);
- exit;
- end;
- if (lowercase(EnableFlagStats) = lowercase('ON')) then begin
- op := StrToID(Text); tr := 0;
- if (FileExists('nickreg/'+filterFileName(Text)+'.txt') = true) then begin
- filedata := ReadFile('nickreg/'+filterFileName(Text)+'.txt');
- temparray := Explode(filedata,CRLF);
- tr := 1;
- end else
- begin
- if (op = 254) then WriteConsole(ID,'Player not found ('+Text+')',BAD) else begin
- if (FileExists('nickreg/'+filterFileName(getPlayerStat(op,'Name'))+'.txt') = true) then begin
- filedata := ReadFile('nickreg/'+filterFileName(getPlayerStat(op,'Name'))+'.txt');
- temparray := Explode(filedata,CRLF);
- if (temparray[41] = 'NO') then tr := 2 else WriteConsole(ID,'The player does not have an account.',BAD);
- end;
- end;
- end;
- if (tr = 1) or (tr = 2) then begin
- if (strtoint(iif((GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6),temparray[7], temparray[8])) >= StrtoInt(LimitKills)) then begin
- if (GameStyle = 1) then begin
- WriteConsole(iif(lowercase(DisFlagStatsOther) = lowercase('ON'),0,ID),'Player flag statistics '+iif(tr=1,Text,getPlayerStat(op,'Name'))+':',GOOD);
- WriteConsole(iif(lowercase(DisFlagStatsOther) = lowercase('ON'),0,ID),'Flag Grabs: '+temparray[12]+', Flag Drop: '+temparray[15]+', Kill Flager: '+temparray[40], GOOD);
- end;
- if (GameStyle = 3) then begin
- WriteConsole(iif(lowercase(DisFlagStatsOther) = lowercase('ON'),0,ID),'Player flag statistics '++iif(tr=1,text,getPlayerStat(op,'Name'))++':',GOOD);
- WriteConsole(iif(lowercase(DisFlagStatsOther) = lowercase('ON'),0,ID),'Flag Grabs: '+temparray[12]+', Flag Return: '+temparray[13]+', Flag Score: '+temparray[14]+', Flag Drop: '+temparray[15], GOOD);
- WriteConsole(iif(lowercase(DisFlagStatsOther) = lowercase('ON'),0,ID),'Alpha Caps: '+temparray[16]+', Bravo Caps: '+temparray[17]+', Kill Flager: '+temparray[40], GOOD);
- end;
- if (GameStyle = 5) then begin
- WriteConsole(iif(lowercase(DisFlagStatsOther) = lowercase('ON'),0,ID),'Player flag statistics '+iif(tr=1,Text,getPlayerStat(op,'Name'))+':',GOOD);
- WriteConsole(iif(lowercase(DisFlagStatsOther) = lowercase('ON'),0,ID),'Flag Grabs: '+temparray[12]+', Flag Return: '+temparray[13]+', Flag Drop: '+temparray[15], GOOD);
- WriteConsole(iif(lowercase(DisFlagStatsOther) = lowercase('ON'),0,ID),'Alpha Caps: '+temparray[16]+' Bravo Points: '+temparray[19]+' Alpha Points: '+temparray[18]+', Kill Flager: '+temparray[40], GOOD);
- end;
- if (GameStyle = 6) then begin
- WriteConsole(iif(lowercase(DisFlagStatsOther) = lowercase('ON'),0,ID),'Player flag statistics '+iif(tr=1,Text,getPlayerStat(op,'Name'))+':',GOOD);
- WriteConsole(iif(lowercase(DisFlagStatsOther) = lowercase('ON'),0,ID),'Flag Grabs: '+temparray[12]+', Flag Return: '+temparray[13]+', Flag Drop: '+temparray[15], GOOD);
- WriteConsole(iif(lowercase(DisFlagStatsOther) = lowercase('ON'),0,ID),'Alpha Points: '+temparray[20]+' Bravo Points: '+temparray[21]+', Kill Flager: '+temparray[40], GOOD);
- end;
- end else WriteConsole(ID,'The player does not have required number of kills. It has: '+iif((GameStyle = 2) or (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6),temparray[7], temparray[8])+'/'+LimitKills,BAD);
- end;
- end else WriteConsole(ID,'Statistics have been disabled by an administrator.',BAD);
- end;
- Procedure ServerStats(ID: byte);
- begin
- if (lowercase(EnableServerStats) = lowercase('ON')) then begin
- WriteConsole(iif(lowercase(DisServerStats) = lowercase('ON'),0,ID),'Server Visit: '+Visit+', Server Kills: '+SKill+', Server Selfkills: '+SSelfkils+iif(FriendlyFire,', Team Kills: '+STeamKill,''),GOOD);
- WriteConsole(iif(lowercase(DisServerStats) = lowercase('ON'),0,ID),'Joins Alpha: '+AlphaV+', Joins Bravo: '+BlueV+', Joins Spec: '+SpecV+iif(GameStyle<>2,', Kick of Game: '+SKick,''), GOOD);
- if (GameStyle = 2) then WriteConsole(iif(lowercase(DisServerStats) = lowercase('ON'),0,ID),'Joins Charle: '+CharlieV+', Joins Delta: '+DeltaV+', Kick of Game: '+SKick, GOOD);
- end else WriteConsole(ID,'Statistics have been disabled by an administrator.',BAD);
- end;
- Procedure DisplayMapStats(ID: byte);
- begin
- if (lowercase(MapStatsON) = lowercase('ON')) then begin
- if (FileExists('nickreg/maps/'+currentmap+'.txt') = true) then begin
- WriteConsole(iif(lowercase(DisMapStats) = lowercase('ON'),0,ID),'Maps Statistics: '+currentmap, GOOD);
- if (GameStyle = 3) or (GameStyle = 5) then WriteConsole(iif(lowercase(DisMapStats) = lowercase('ON'),0,ID),'Flag Caps: '+MapFlagCaps+', Flag Grabs: '+MapFlagGrabs+', Flag Returns: '+MapFlagReturns+', Flag Drop: '+MapFlagDrop, GOOD);
- if (GameStyle = 6) or (GameStyle = 1) then WriteConsole(iif(lowercase(DisMapStats) = lowercase('ON'),0,ID),'Flag Grabs: '+MapFlagGrabs+', Flag Drop: '+MapFlagDrop, GOOD);
- WriteConsole(iif(lowercase(DisMapStats) = lowercase('ON'),0,ID),'Games played: '+MapPlays+', Players Joined: '+MapPlayerJoins+', Players Left: '+MapPlayerLeaves+', Players Kicked: '+MapPlayerKicks, GOOD);
- WriteConsole(iif(lowercase(DisMapStats) = lowercase('ON'),0,ID),'Kills: '+MapKills+', Selfkills: '+MapSelfkills+iif((GameStyle=0) or (GameStyle=1) or (GameStyle=4),'',iif(friendlyfire,', Teamkills: '+MapTeamkills,'')), GOOD);
- end;
- end else WriteConsole(ID,'Statistics maps have been disabled by an administrator.', BAD);
- end;
- Procedure DisplayMapStatsMAP(ID: byte; Text: string);
- var temparray: TStringArray; fileData: string;
- begin
- if (lowercase(MapStatsON) = lowercase('ON')) then begin
- if (FileExists('nickreg/maps/'+Text+'.txt') = true) then begin
- filedata := ReadFile('nickreg/maps/'+Text+'.txt');
- temparray := Explode(filedata,CRLF);
- WriteConsole(iif(lowercase(DisMapStats) = lowercase('ON'),0,ID),'Maps Statistics: '+Text, GOOD);
- if (GameStyle = 3) or (GameStyle = 5) or (GameStyle = 6) then WriteConsole(iif(lowercase(DisMapStats) = lowercase('ON'),0,ID),'Flag Caps: '+temparray[3]+', Flag Grabs: '+temparray[4]+', Flag Returns: '+temparray[5]+', Flag Drop: '+temparray[6], GOOD);
- WriteConsole(iif(lowercase(DisMapStats) = lowercase('ON'),0,ID),'Games played: '+temparray[7]+', Players Joined: '+temparray[8]+', Players Left: '+temparray[9]+', Players Kicked: '+temparray[10], GOOD);
- WriteConsole(iif(lowercase(DisMapStats) = lowercase('ON'),0,ID),'Kills: '+temparray[0]+', Selfkills: '+temparray[1]+iif((GameStyle=0) or (GameStyle=1) or (GameStyle=4),'',iif(friendlyfire,', Teamkills: '+temparray[2],'')), GOOD);
- end else WriteConsole(ID,'Not found statistics map: '+Text, BAD);
- end else WriteConsole(ID,'Statistics maps have been disabled by an administrator.', BAD);
- end;
- Procedure VoteUpdate(ID: byte);
- var i: integer; KD: double;
- begin
- if (lowercase(EnableVoteUpdate) = lowercase('ON')) then begin
- if (Voted[ID] = false) then begin
- if (Go = false) then Time := InitTime else Time := (Time + AddTime);
- Go := true; Voted[ID] := true; VFor := VFor + 1;
- KD := single(100 * VFor) / single(NumPlayers-NumBots);
- if (KD >= Procent) then begin
- Go := false;
- for i := 1 to 32 do Voted[i] := false;
- VFor := 0; Time := 0;
- WriteConsole(0,'Voting for updating statistics, passed.', GOOD);
- WriteConsole(0,'Stats update!',GOOD);
- UpdateServStats();
- for i := 1 to 32 do if (GetPlayerStat(i, 'Active') = true) then begin
- UpdateNickname(i);
- if (lowercase(EnableTop) = lowercase('ON')) then if (GetPlayerStat(i, 'Active') = true) then if (GetPlayerStat(i, 'Human') = true) then UpdateRanks(i);
- SaveRanks();
- end;
- end else
- begin
- KD := single(100 * VFor) / single(NumPlayers-NumBots);
- WriteConsole(0,FormatFloat('0.00',KD)+ '% / ' + InttoStr(Procent) + '% required for a vote pass', GOOD);
- end;
- end else WriteConsole(ID,'You have already voted.',BAD);
- end else WriteConsole(ID,'Function deactivated by an administrator!',BAD);
- end;
- procedure AutoLogin(ID: byte);
- begin
- if (length(getPlayerStat(ID, 'name' )) > 24) then begin
- WriteConsole(ID,'...your name is over 24 characters, please change it.',BAD);
- KickPlayer(ID); Exit;
- end;
- LoadNickname(ID);
- case (lowercase(PlayerInfo[ID].Auto)) of
- lowercase('HWID'): begin
- if (getPlayerStat(ID,'HWID') = PlayerInfo[ID].HWID) then begin
- PlayerInfo[ID].NickStatus := true;
- WriteConsole(ID,'Automatic login through HWID - Completed successfully!', GOOD);
- WriteConsole(ID,'Welcome back '+GetPlayerStat(ID,'name')+' (HWID: '+GetPlayerStat(ID,'HWID')+')',GOOD);
- if (PlayerInfo[ID].Password = '') then WriteConsole(ID,'To better protect account please add password /addpassword <password>',BAD);
- end else
- begin
- WriteConsole(ID,'Automatic login through HWID - The unsuccessful!', BAD);
- WriteConsole(ID,'The nickname '+GetPlayerStat(ID,'name')+' is REGISTERED!',BAD);
- if (lowercase(KickTimeON) = lowercase('ON')) then begin
- WriteConsole(ID,'Use "/login password" to login or you will be kicked in '+inttostr(KickTime)+' seconds', BAD);
- PlayerInfo[ID].startKickTimer:= 1; PlayerInfo[ID].kickTimer := KickTime;
- end else WriteConsole(ID,'Use "/login password" to login, otherwise you will not be charged your statistics!', BAD);
- end;
- end;
- lowercase('IP'): begin
- if (getPlayerStat(ID,'IP') = PlayerInfo[ID].IP) then begin
- PlayerInfo[ID].NickStatus := true;
- WriteConsole(ID,'Automatic login through IP - Completed successfully!', GOOD);
- WriteConsole(ID,'Welcome back '+GetPlayerStat(ID,'name')+' (IP: '+GetPlayerStat(ID,'ip')+')',GOOD);
- if (PlayerInfo[ID].Password = '') then WriteConsole(ID,'To better protect account please add password /addpassword <password>',BAD);
- end else
- begin
- WriteConsole(ID,'Automatic login through IP - The unsuccessful!', BAD);
- WriteConsole(ID,'The nickname '+GetPlayerStat(ID,'name')+' is REGISTERED!',BAD);
- if (lowercase(KickTimeON) = lowercase('ON')) then begin
- WriteConsole(ID,'Use "/login password" to login or you will be kicked in '+inttostr(KickTime)+' seconds', BAD);
- PlayerInfo[ID].startKickTimer := 1; PlayerInfo[ID].kickTimer := KickTime;
- end else WriteConsole(ID,'Use "/login password" to login, otherwise you will not be charged your statistics!', BAD);
- end;
- end;
- lowercase('NICK'): begin
- if (getPlayerStat(ID, 'name' ) = PlayerInfo[ID].Name) then begin
- PlayerInfo[ID].NickStatus := true;
- WriteConsole(ID,'Automatic login through nick - Completed successfully!', GOOD);
- WriteConsole(ID,'Welcome back '+GetPlayerStat(ID,'name')+' (Nick: '+GetPlayerStat(ID,'name')+')',GOOD);
- if (PlayerInfo[ID].Password = '') then WriteConsole(ID,'To better protect account please add password /addpassword <password>',BAD);
- end else
- begin
- WriteConsole(ID,'Automatic login through nick - The unsuccessful!', BAD);
- WriteConsole(ID,'The nickname '+GetPlayerStat(ID,'name')+' is REGISTERED!',BAD);
- if (lowercase(KickTimeON) = lowercase('ON')) then begin
- WriteConsole(ID,'Use "/login password" to login or you will be kicked in '+inttostr(KickTime)+' seconds', BAD);
- PlayerInfo[ID].startKickTimer := 1; PlayerInfo[ID].kickTimer := KickTime;
- end else WriteConsole(ID,'Use "/login password" to login, otherwise you will not be charged your statistics!', BAD);
- end;
- end;
- lowercase('OFF'): begin
- WriteConsole(ID,'Autologin disabled, please login!', BAD);
- WriteConsole(ID,'The nickname '+GetPlayerStat(ID,'name')+' is REGISTERED!',BAD);
- if (lowercase(KickTimeON) = lowercase('ON')) then begin
- WriteConsole(ID,'Use "/login password" to login or you will be kicked in '+inttostr(KickTime)+' seconds', BAD);
- PlayerInfo[ID].startKickTimer := 1; PlayerInfo[ID].kickTimer := KickTime;
- end else WriteConsole(ID,'Use "/login password" to login, otherwise you will not be charged your statistics!', BAD);
- end;
- end;
- if (PlayerInfo[ID].NickStatus) then begin
- if (GetPlayerStat(ID,'Human') = true) then UpdateRanks(ID);
- SaveRanks();
- end;
- end;
- procedure Informacje(ID: byte; Text:String);
- var gracze: TStringArray;
- begin
- if regExpMatch('^!(reginfo)$',lowercase(Text)) then begin
- WriteConsole(ID,'____Registration Commands _______________________________________________________'+iif(PlayerInfo[ID].LoginMes='ON','_','___'),GOOD);
- WriteConsole(ID,'/create <password>, /login <password>, /logout, /deletemyacc <pass>'+iif(lowercase(EnableResetStats) = lowercase('ON'),', /resetstats',' ')+iif(PlayerInfo[ID].LoginMes='ON',' |',' |'),GOOD);
- WriteConsole(ID,'/changepass <old password> <newpassword>, /changenick <password> <newnick> '+iif(PlayerInfo[ID].LoginMes='ON',' |',' |'),GOOD);
- if (PlayerInfo[ID].Password = '') or (lowercase(EnableLastPlayed) = lowercase('ON')) or (lowercase(EnableSearch) = lowercase('ON')) or (lowercase(EnableRank) = lowercase('ON')) or (lowercase(EnableRankID) = lowercase('ON')) then WriteConsole(ID,iif(lowercase(EnableLastPlayed)=lowercase('ON'),'/lastplayed <name>','')+iif(PlayerInfo[ID].Password='',iif(lowercase(EnableLastPlayed)=lowercase('ON'),', ','')+'/addpassword <pass>'+iif(lowercase(EnableRank)=lowercase('ON'),', !rank',''),iif(lowercase(EnableRank)=lowercase('ON'),iif(lowercase(EnableLastPlayed) = lowercase('ON'),', ','')+'!rank, !rank <name>',''))+iif(lowercase(EnableRankID) = lowercase('ON'),iif((PlayerInfo[ID].Password = '') or (lowercase(EnableRank) = lowercase('ON')) or (lowercase(EnableLastPlayed) = lowercase('ON')),', ','')+'!rankid <number>','') + iif(lowercase(EnableSearch) = lowercase('ON'),iif((PlayerInfo[ID].Password = '') or (lowercase(EnableRank) = lowercase('ON')) or (lowercase(EnableRankID) = lowercase('ON')) or (lowercase(EnableLastPlayed) = lowercase('ON')),', ','')+'!search <name>','') +iif(lowercase(EnableLastPlayed) = lowercase('ON'),'',' ')+iif(PlayerInfo[ID].Password='',iif(lowercase(EnableRank) = lowercase('ON'),'',' '),' '+iif(lowercase(EnableRank) = lowercase('ON'),'',iif(lowercase(EnableLastPlayed) = lowercase('ON'),' ',' ')+' '))+ iif(lowercase(EnableRankID) = lowercase('ON'),'',iif((PlayerInfo[ID].Password = '') or (lowercase(EnableRank) = lowercase('ON')) or (lowercase(EnableLastPlayed) = lowercase('ON')),' ','')+' ')+ iif(lowercase(EnableSearch) = lowercase('ON'),'',iif((PlayerInfo[ID].Password = '') or (lowercase(EnableRank) = lowercase('ON')) or (lowercase(EnableRankID) = lowercase('ON')) or (lowercase(EnableLastPlayed) = lowercase('ON')),'',' ')+' ')+iif(PlayerInfo[ID].LoginMes='ON',' |',' |'),GOOD);
- WriteConsole(ID,'____Stats Commands_______________________________________________________________'+iif(PlayerInfo[ID].LoginMes='ON','|','__|'),GOOD);
- if (lowercase(EnableStats) = lowercase('ON')) or (lowercase(MapStatsON) = lowercase('ON')) then WriteConsole(ID,iif(lowercase(EnableStats) = lowercase('ON') ,'!stats ','')+iif(lowercase(MapStatsON) = lowercase('ON') ,+iif(lowercase(EnableStats) = lowercase('ON'),'| ','')+'!mapstats ','')+iif(lowercase(EnableStats) = lowercase('ON'), '',' ')+iif(lowercase(MapStatsON) = lowercase('ON') ,'',' ')+' - View statistics: '+iif(lowercase(EnableStats) = lowercase('ON'),'players ','')+iif(lowercase(MapStatsON) = lowercase('ON'),+iif(lowercase(EnableStats) = lowercase('ON'),'| ','')+ 'maps','')+iif(lowercase(EnableStats) = lowercase('ON'),'',' ')+iif(lowercase(MapStatsON) = lowercase('ON'),'',' ')+' '+iif(PlayerInfo[ID].LoginMes='ON',' |',' |'),GOOD);
- if (lowercase(EnableTop) = lowercase('ON')) or (lowercase(TopMapsON) = lowercase('ON')) then WriteConsole(ID,iif(lowercase(EnableTop) = lowercase('ON') ,'!top ','')+iif(lowercase(TopMapsON) = lowercase('ON') ,+iif(lowercase(EnableTop) = lowercase('ON'),'| ','')+'!topmaps ','')+iif(lowercase(EnableTop) = lowercase('ON'), '',' ')+iif(lowercase(TopMapsON) = lowercase('ON') ,'',' ')+' - Top '+inttostr(TopLines)+': '+iif(lowercase(EnableTop) = lowercase('ON'),'players ','')+iif(lowercase(TopMapsON) = lowercase('ON'),+iif(lowercase(EnableTop) = lowercase('ON'),'| ','')+ 'map plays','')+iif(Length(inttostr(TopLines)) = 1,' ',' ')+iif(lowercase(EnableTop) = lowercase('ON'),'',' ')+iif(lowercase(TopMapsON) = lowercase('ON'),'',' ')+' '+iif(PlayerInfo[ID].LoginMes='ON',' |',' |'),GOOD);
- if (lowercase(EnableFlagStats) = lowercase('ON')) or (lowercase(OtherStatsON) = lowercase('ON')) then WriteConsole(ID,iif(lowercase(EnableFlagStats) = lowercase('ON'),'!flagstats ','')+iif(lowercase(OtherStatsON) = lowercase('ON'),+iif(lowercase(EnableFlagStats) = lowercase('ON'),'| ','')+'!otherstats ','')+iif(lowercase(EnableFlagStats) = lowercase('ON'),'',' ')+iif(lowercase(OtherStatsON) = lowercase('ON'),'',' ')+' - View '+iif(lowercase(EnableFlagStats) = lowercase('ON'),'flag ','')+iif(lowercase(OtherStatsON) = lowercase('ON'),+iif(lowercase(EnableFlagStats) = lowercase('ON'),'| ','')+ 'other','')+' statistics '+iif(lowercase(EnableFlagStats) = lowercase('ON'),'',' ')+iif(lowercase(OtherStatsON) = lowercase('ON'),'',' ')+' '+iif(PlayerInfo[ID].LoginMes='ON',' |',' |'),GOOD);
- if (lowercase(EnableServerStats) = lowercase('ON')) or (lowercase(WinStatsON) = lowercase('ON')) then WriteConsole(ID,iif(lowercase(WinStatsON) = lowercase('ON'),'!winstats ','')+iif(lowercase(EnableServerStats) = lowercase('ON'),+iif(lowercase(WinStatsON) = lowercase('ON'),'| ','')+'!serverstats (!ss) ','')+iif(lowercase(WinStatsON) = lowercase('ON'),'',' ')+iif(lowercase(EnableServerStats) = lowercase('ON'),'',' ')+' - View '+iif(lowercase(WinStatsON) = lowercase('ON'),'winstats ','')+iif(lowercase(EnableServerStats) = lowercase('ON'),+iif(lowercase(WinStatsON) = lowercase('ON'),'| ','')+ 'server ','')+'statistics '+iif(lowercase(WinStatsON) = lowercase('ON'),'',' ')+iif(lowercase(EnableServerStats) = lowercase('ON'),'',' ')+' '+iif(PlayerInfo[ID].LoginMes='ON',' |',' |'),GOOD);
- if (lowercase(EnableVoteUpdate) = lowercase('ON')) then WriteConsole(ID,'!voteupdate - Vote per actualized statistics '+iif(PlayerInfo[ID].LoginMes='ON',' |',' |'),GOOD);
- WriteConsole(ID,'_________________________________________________________________________________'+iif(PlayerInfo[ID].LoginMes='ON','|','__|'),GOOD);
- if (PlayerInfo[ID].LoginMes = 'OFF') then WriteConsole(ID,'Type !login for example will display info how to login! (Use to OFF this messages) |',BAD);
- if (PlayerInfo[ID].LoginMes = 'OFF') then WriteConsole(ID,'___________________________________________________________________________________|',BAD);
- end;
- if regExpMatch('^!(autor|author|credit|credits|contact|tworca|info|help|zitrofun|zitro|fun)$',lowercase(Text)) then begin
- WriteConsole(ID,'Author scripts: dominikk26',GOOD);
- WriteConsole(ID,'E-mail: dominikk262@wp.pl',GOOD);
- WriteConsole(ID,YouInfo,GOOD);
- WriteConsole(ID,'Script Version: '+ZitroVersion,GOOD);
- gracze := Explode(ReadFile('nickreg/server/players.db'),CRLF);
- WriteConsole(ID,'Registered players: '+inttostr(GetArrayLength(gracze)-2),GOOD);
- end;
- if regExpMatch('^!(login)$',lowercase(Text)) then begin
- WriteConsole(ID,'Type /login ''your password'' to login.',GOOD);
- WriteConsole(ID,'Press the first "/" and write command. Do not press "T".',GOOD);
- WriteConsole(ID,'Example: Press "/" write "login" add space and write "your password" and enter.',GOOD);
- if (PlayerInfo[ID].LoginMes = 'OFF') then begin
- PlayerInfo[ID].LoginMes := 'ON';
- UpdateNickname(ID);
- end;
- end;
- if regExpMatch('^!(addpassword)$',lowercase(Text)) then if (PlayerInfo[ID].Password = '') then WriteConsole(ID,'Type /addpassword <password> to add a password',GOOD) else WriteConsole(ID,'You already have the password function switched off',GOOD);
- end;
- procedure OnFlagScore(ID, TeamFlag: byte);
- var i: byte; KD, AB: double;
- begin
- if (lowercase(MapStatsON) = lowercase('ON')) then begin
- MapFlagCaps := inttostr(strtoint(MapFlagCaps) + 1);
- UpdateMapStats(currentmap);
- end;
- if (lowercase(EnableFlagStats) = lowercase('ON')) then begin
- flager[ID] := 0;
- if (PlayerInfo[ID].NickStatus = true) then begin
- PlayerStats[ID].FlagScore := inttostr(strtoint(PlayerStats[ID].FlagScore) + 1);
- UpdateNickname(ID);
- if (GetPlayerStat(ID,'Team') = 1) then begin
- PlayerStats[ID].AlphaCaps := inttostr(strtoint(PlayerStats[ID].AlphaCaps) + 1);
- UpdateNickname(ID);
- end;
- if (GetPlayerStat(ID,'Team') = 2) then begin
- PlayerStats[ID].BravoCaps := inttostr(strtoint(PlayerStats[ID].BravoCaps) + 1);
- UpdateNickname(ID);
- end;
- end;
- if (GameStyle = 5) then begin
- for i:=1 to 32 do begin
- if (GetPlayerStat(i,'Active')=true) and (PlayerInfo[ID].NickStatus = true) then begin
- if (GetPlayerStat(i,'Team')=1) then begin
- if not (BravoPlayers = 0) then begin
- AB := (single(AlphaPlayers) / single(BravoPlayers));
- KD := (single(StrtoInt(ReadINI('soldat.ini','GAME','Red_Points_Capture','30'))) / strtoint(FormatFloat('0',AB)));
- end else KD := (StrtoInt(ReadINI('soldat.ini','GAME','Red_Points_Capture','30')) - 5);
- PlayerStats[ID].INF_Red := (inttostr(strtoint(PlayerStats[ID].INF_Red) + strtoint(FormatFloat('0',KD))));
- UpdateNickname(i);
- end;
- end;
- end;
- end;
- end;
- end;
- procedure OnFlagDrop(ID, TeamFlag: byte);
- begin
- if (lowercase(MapStatsON) = lowercase('ON')) then begin
- MapFlagDrop := inttostr(strtoint(MapFlagDrop) + 1);
- UpdateMapStats(currentmap);
- end;
- if (lowercase(EnableFlagStats) = lowercase('ON')) then if (PlayerInfo[ID].NickStatus = true) then begin
- PlayerStats[ID].FlagDrop := inttostr(strtoint(PlayerStats[ID].FlagDrop) + 1);
- UpdateNickname(ID);
- end;
- end;
- procedure AppOnIdle(Ticks: integer);
- var b, i: byte;
- begin
- ShootKeyCheck();
- if (NumPlayers = 0) then AppOnIdleTimer := 120 else AppOnIdleTimer := 1;
- if Ticks mod (6 * 1) = 0 then for i := 1 to 32 do if(GetPlayerStat(i,'Active')=true) then begin
- if (flager[i] = 0) then if (GetPlayerStat(i,'Flagger') = true) then flager[i] := 1;
- if (flager[i] = 1) then if (GetPlayerStat(i,'Flagger') = false) and (GetPlayerStat(i, 'alive') = false) then begin
- OnFlagDrop(i, GetPlayerStat(i, 'Team'));
- flager[i] := 0;
- end;
- end;
- if Ticks mod (3600 * 11) = 0 then if (lowercase(TimeMesON) = lowercase('ON')) then WriteConsole(0, 'Enter !reginfo to see command. Information: !contact', GOOD);
- if Ticks mod (60 * 1) = 0 then begin
- for b := 1 to 32 do if(GetPlayerStat(b,'Active')=true) then begin
- if (PlayerInfo[b].startKickTimer = 1) then begin
- dec(PlayerInfo[b].kickTimer,1);
- if (PlayerInfo[b].kickTimer = 0) then begin
- WriteConsole(b,'You need to register your nickname!',BAD);
- kickPlayer(b);
- end;
- end;
- end;
- if (Time > 0) then Time := (Time - 1) else if (Go) then begin
- Go := false;
- for i := 1 to 32 do if (GetPlayerStat(i,'Active')=true) then begin
- Voted[i] := false;
- WriteConsole(i,'Voting for updating statistics, ending in unsuccessful!',BAD);
- end;
- VFor := 0; Time := 0; //By
- end;
- if (lowercase(EnableFlagStats) = lowercase('ON')) then begin
- if (GameStyle = 5) then if (BravoScore <> INF_BravoNewScore) then begin
- INF_BravoNewScore := BravoScore;
- for i:=1 to 32 do if (GetPlayerStat(i,'Active')=true) then if (GetPlayerStat(i,'Team')=2) then begin
- PlayerStats[i].INF_Blue := inttostr(strtoint(PlayerStats[i].INF_Blue) + 1);
- UpdateNickname(i);
- end;
- end;
- if (GameStyle = 6) then begin
- if (AlphaScore <> HTF_AlphaNewScore) then begin
- HTF_AlphaNewScore := AlphaScore;
- for i:=1 to 32 do if (GetPlayerStat(i,'Active')=true) then if (GetPlayerStat(i,'Team')=1) then begin
- PlayerStats[i].HTF_Red := inttostr(strtoint(PlayerStats[i].HTF_Red) + 1);
- UpdateNickname(i);
- end;
- end;
- if (BravoScore <> HTF_BravoNewScore) then begin
- HTF_BravoNewScore := BravoScore;
- for i:=1 to 32 do if (GetPlayerStat(i,'Active')=true) then if (GetPlayerStat(i,'Team')=2) then begin
- PlayerStats[i].HTF_Blue := inttostr(strtoint(PlayerStats[i].HTF_Blue) + 1);
- UpdateNickname(i);
- end;
- end;
- end;
- end;
- if (lowercase(TimeMesON) = lowercase('ON')) then if Ticks mod (3600 * TimeMes) = 0 then for b := 1 to 32 do if (GetPlayerStat(b,'Active')=true) then if (PlayerInfo[b].Password = '') then if (PlayerInfo[b].DelAcc = 'NO') then WriteConsole(b,'To better protect account please add password /addpassword <password>',BAD);
- for b := 1 to 32 do if (GetPlayerStat(b,'Active')=true) then begin
- if (timer[b] = 1) then begin
- dec(Ttimer[b],1);
- if (Ttimer[b] = 0) then begin
- atc[b] := 0; timer[b] := 0;
- end;
- end;
- if (CooldownTimer <> 0) then for i := 1 to 32 do if (PlayersInfoArr[b].DamageRecievedByCooldown[i] >= 1) then PlayersInfoArr[b].DamageRecievedByCooldown[i] := PlayersInfoArr[b].DamageRecievedByCooldown[i] - 1;
- if (((Getplayerstat(b,'Health')*100)/MaxHealth) > ((100-TotalPercentDamageRecieved(b)))) then RemoveDamageDoneBy(b,((Getplayerstat(b,'Health')*100)/MaxHealth) - (100-TotalPercentDamageRecieved(b)));
- if (lowercase(TimeMesON) = lowercase('ON')) then if (lowercase(AntyMajor) = lowercase('ON')) then if (lowercase(GetPlayerStat(b,'name')) = lowercase('Major')) then exit else if ((FileExists('nickreg/'+FilterFilename(GetPlayerStat(b,'name'))+'.txt') = false) or (PlayerInfo[b].DelAcc = 'YES')) then DrawTextEx(b,72,'Type /create <password> to create account',160,$FF0000,0.07,106,420) else if (PlayerInfo[b].NickStatus = false) then DrawTextEx(b,72,'Type /login <password> to login.',160,$FF0000,0.07,184,420) else if (PlayerInfo[b].Password = '') then DrawTextEx(b,72,' Plese add password'+CRLF+'Type /addpassword <password>',160,$FF0000,0.07,188,405);
- end;
- end;
- end;
- procedure OnPlayerSpeak(ID: byte; Text: string);
- var i: byte; n, c: integer; b: word; gracze: TStringArray; buffer: array[1..10] of string; buffer2: string;
- begin
- if regExpMatch('^!(otherstats)$',lowercase(Text)) then Inne(ID) else if MaskCheck(Text,'!otherstats *') then InneOther(ID,Copy(Text,13,Length(Text)));
- if regExpMatch('^!(winstats)$',lowercase(Text)) then WinStats(ID) else if MaskCheck(Text,'!winstats *') then WinStatsOther(ID,Copy(Text,11,Length(Text)));
- if regExpMatch('^!(top)$',lowercase(Text)) then PokazTop(ID) else if MaskCheck(lowercase(Text),'!top *') then PokazTopID(ID,strtoint(Copy(Text,6,Length(Text))));
- if regExpMatch('^!(rank)$',lowercase(Text)) then RankTXT(ID,Copy(Text,7,Length(Text))) else if MaskCheck(lowercase(Text),'!rank *') then RankTXT(ID,Copy(Text,7,Length(Text)));
- if MaskCheck(lowercase(Text),'!rankid *') then RankID(ID,strtoint(Copy(Text,9,Length(Text))));
- if regExpMatch('^!(maptop|topmap|topmaps|mapstop)$',lowercase(Text)) then PokazTopMaps(ID);
- if regExpMatch('^!(reginfo|autor|author|credit|credits|contact|tworca|info|help|zitrofun|zitro|fun|create|login|logout|changepass|changenick|addpassword|lastplayed|resetstats)$',lowercase(Text)) then Informacje(ID, Text);
- if regExpMatch('^!(stats|raning|statystyki)$',lowercase(Text)) then Stats(ID) else if MaskCheck(Text,'!stats *') then StatsOther(ID,Copy(Text,8,Length(Text)));
- if regExpMatch('^!(flag|flagstats|flaga|statsflag|statsflaga)$',lowercase(Text)) then FlagStats(ID) else if MaskCheck(Text,'!flagstats *') then FlagStatsOther(ID,Copy(Text,12,Length(Text)));
- if regExpMatch('^!(serverstats|serwerstats|ss|servstats|serwstats|serstats|statsser|statsserv|statsserw)$',lowercase(Text)) then ServerStats(ID);
- if regExpMatch('^!(voteupdate|update|updatevote|aktualizuj|aktualizacja|updaterank|updateranks)$',lowercase(Text)) then VoteUpdate(ID);
- if regExpMatch('^!(mapstats|statsmap|mapastats|mapastatystyki)$',lowercase(Text)) then DisplayMapStats(ID) else if MaskCheck(Text,'!mapstats *') then DisplayMapStatsMAP(ID,Copy(Text,11,Length(Text)));
- if MaskCheck(lowercase(Text),'!search *') then begin
- if (lowercase(EnableSearch) = lowercase('ON')) then begin delete(Text,1,8);
- if (Text<>'') then begin
- gracze := Explode(ReadFile('nickreg/server/players.db'),CRLF);
- c := 1; n := 0;
- for b:= 2 to (GetArrayLength(gracze)-1) do begin
- if (ContainsString(lowercase(gracze[b-1]),lowercase(Text))=true) then begin
- if (length(buffer[c])<72) then buffer[c] := buffer[c]+iif((buffer[c]<>''),', ','')+gracze[b-1] else begin
- inc(c,1);
- buffer[c] := buffer[c]+iif((buffer[c]<>''),', ','')+gracze[b-1];
- end;
- n := n+1;
- if (n=50) then break;
- end;
- end;
- WriteConsole(ID,'Search for '+Text+':',GOOD);
- for i := 1 to 10 do begin
- if (buffer[i] <> '') then WriteConsole(ID,buffer[i],GOOD);
- buffer2 := buffer2+buffer[i];
- end;
- if (buffer2 = '') then WriteConsole(ID,'Nothing was found!',BAD);
- end else WriteConsole(ID,'You must enter the text.',BAD);
- end else WriteConsole(ID,'Function search has been disabled by an administrator.',BAD);
- end;
- end;
- function OnPlayerDamageEx(Victim, Shooter: Byte; Damage: Integer; Weapon: Byte): Integer;
- var TmpDble: double;
- begin
- if (Victim <> Shooter) then begin
- if (lowercase(OtherStatsON) = lowercase('ON')) then if (PlayerInfo[Shooter].NickStatus = true) then begin
- if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then begin
- if ((Weapon = 16) and (Damage >= 25)) or ((Weapon = 7) and (Damage >= 40)) then PlayerStats[Shooter].ShootHit := inttostr(strtoint(PlayerStats[Shooter].ShootHit) + 1);
- if (Weapon <> 16) and (Weapon <> 7) and (Weapon <> 50) and (Weapon <> 15) then PlayerStats[Shooter].ShootHit := inttostr(strtoint(PlayerStats[Shooter].ShootHit) + 1);
- end else
- begin
- if (GetPlayerStat(Shooter,'Team')<>GetPlayerStat(Victim,'Team')) then begin
- if ((Weapon = 16) and (Damage >= 25)) or ((Weapon = 7) and (Damage >= 40)) then PlayerStats[Shooter].ShootHit := inttostr(strtoint(PlayerStats[Shooter].ShootHit) + 1);
- if (Weapon <> 16) and (Weapon <> 7) and (Weapon <> 50) and (Weapon <> 15) then PlayerStats[Shooter].ShootHit := inttostr(strtoint(PlayerStats[Shooter].ShootHit) + 1);
- end;
- if (GetPlayerStat(Victim,'Team')=GetPlayerStat(Shooter,'Team')) then PlayerStats[Shooter].ShootFriendly := inttostr(strtoint(PlayerStats[Shooter].ShootFriendly) + 1);
- end;
- if (lowercase(RealTimeUpdate) = lowercase('ON')) then UpdateNickname(Shooter);
- end;
- if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then begin
- if (GetPlayerStat(Shooter,'active') = true) then begin
- atc[Shooter] := Victim;
- Ttimer[Shooter] := TimeCon;
- timer[Shooter] := 1;
- end;
- end else
- begin
- if not (GetPlayerStat(Shooter, 'Team') = GetPlayerStat(Victim, 'Team')) then begin
- if (GetPlayerStat(Shooter,'active') = true) then begin
- atc[Shooter] := Victim;
- Ttimer[Shooter] := TimeCon;
- timer[Shooter] := 1;
- end;
- end;
- end;
- end;
- if (Damage > 0) then begin
- if (GetplayerStat(victim,'Alive') = true) then begin
- if ((GetplayerStat(Victim,'Health') - damage) <= 0) then begin
- if (GetplayerStat(Victim,'Health') > 0) then begin
- TmpDble := ((GetplayerStat(Victim,'Health')*100)/MaxHealth);
- PlayersInfoArr[Victim].DamageRecievedByID[Shooter] := (PlayersInfoArr[Victim].DamageRecievedByID[Shooter] + TmpDble);
- PlayersInfoArr[Victim].DamageRecievedByCooldown[Shooter] := CooldownTimer;
- end else begin
- if (TotalPercentDamageRecieved(victim) < 100) then begin
- TmpDble := 100 - TotalPercentDamageRecieved(victim);
- PlayersInfoArr[Victim].DamageRecievedByID[Shooter] := (PlayersInfoArr[Victim].DamageRecievedByID[Shooter] + TmpDble);
- PlayersInfoArr[Victim].DamageRecievedByCooldown[Shooter] := CooldownTimer;
- end;
- end;
- end else begin
- TmpDble := ((Damage*100)/MaxHealth);
- PlayersInfoArr[Victim].DamageRecievedByID[Shooter] := (PlayersInfoArr[Victim].DamageRecievedByID[Shooter] + TmpDble);
- PlayersInfoArr[Victim].DamageRecievedByCooldown[Shooter] := CooldownTimer;
- end;
- end else begin
- if (MostPercentDamagedoneBy(Victim) > 0) then begin
- if (TotalPercentDamageRecieved(victim) = 0) then begin
- PlayersInfoArr[Victim].DamageRecievedByID[Shooter] := 100;
- PlayersInfoArr[Victim].DamageRecievedByCooldown[Shooter] := CooldownTimer;
- end else if (TotalPercentDamageRecieved(victim) < 100) then begin
- TmpDble := 100 - TotalPercentDamageRecieved(victim);
- PlayersInfoArr[Victim].DamageRecievedByID[Shooter] := (PlayersInfoArr[Victim].DamageRecievedByID[Shooter] + TmpDble);
- PlayersInfoArr[Victim].DamageRecievedByCooldown[Shooter] := CooldownTimer;
- end;
- end else if (TotalPercentDamageRecieved(victim) < 100) then begin
- TmpDble := (100 - TotalPercentDamageRecieved(victim));
- PlayersInfoArr[Victim].DamageRecievedByID[Shooter] := (PlayersInfoArr[Victim].DamageRecievedByID[Shooter] + TmpDble);
- PlayersInfoArr[Victim].DamageRecievedByCooldown[Shooter] := CooldownTimer;
- end;
- end;
- end else if (Damage < 0) then RemoveDamageDoneBy(victim,(Damage*100)/MaxHealth);
- Result:=damage;
- end;
- Procedure OnJoinTeam(ID, Team: byte);
- var i: byte;
- begin
- if (GetPlayerStat(ID,'Human') = true) then begin
- if (lowercase(AntyMulti) = lowercase('ON')) then for i := 1 to 32 do if (GetPlayerStat(i,'Active') = true) then if (GetPlayerStat(i,'HWID') = GetPlayerStat(ID,'HWID')) and (i<>ID) then begin
- WriteConsole(ID,'Please stop buggs! You can not, go two accounts per server at a time.',BAD);
- WriteConsole(0,'[ZitroFUN] I detected two players with the same HWID, '+GetPlayerStat(i,'Name')+' and '+GetPlayerStat(ID,'Name'),BAD);
- KickPlayer(ID);
- end;
- if (lowercase(EnableServerStats) = lowercase('ON')) then begin
- case (Team) of
- 1: AlphaV := inttostr(strtoint(Visit) + 1);
- 2: BlueV := inttostr(strtoint(BlueV) + 1);
- 3: CharlieV := inttostr(strtoint(CharlieV) + 1);
- 4: DeltaV := inttostr(strtoint(DeltaV) + 1);
- 5: SpecV := inttostr(strtoint(SpecV) + 1);
- end;
- end;
- UpdateServStats();
- end;
- end;
- Procedure AutoRegLog(ID: byte);
- begin
- if (lowercase(AntyMajor) = lowercase('ON')) then if (lowercase(GetPlayerStat(ID,'name')) <> lowercase('Major')) then LoadNickname(ID) else begin
- WriteConsole(ID,'Change the nickname to use statistics.',BAD);
- Exit;
- end;
- if (FileExists('nickreg/'+filterFileName(GetPlayerStat(ID,'name'))+'.txt') = false) or (PlayerInfo[ID].DelAcc = 'YES') then begin
- if (lowercase(AutoRegister) = lowercase('ON')) then begin
- AutoSaveNickname(DefaultAutoLogin, ID);
- LoadNickname(ID);
- WriteConsole(ID,'Nickname ' + GetPlayerStat(ID,'name') + ' successfully auto registered!',GOOD);
- WriteConsole(ID,'To better protect account add password /addpassword <password>',GOOD);
- WriteConsole(ID,'We will automatically you to login via HWID you can change the IP or add a password and disable autologin.',GOOD);
- WriteLn('NickReg: ' + GetPlayerStat(ID,'name') + ' registered from ' + GetPlayerStat(ID,'HWID'));
- PlayerInfo[ID].NickStatus := true;
- end else
- begin
- WriteConsole(ID,'The nickname '+GetPlayerStat(ID,'name')+' is not registered!',GOOD);
- WriteConsole(ID,'To protect your nickname type: /create <yourpasswordhere>',GOOD);
- end;
- end else if (PlayerInfo[ID].DelAcc = 'NO') then AutoLogin(ID) else
- begin
- WriteConsole(ID,'The nickname '+GetPlayerStat(ID,'name')+' is not registered!',GOOD);
- WriteConsole(ID,'To protect your nickname type: /create <yourpasswordhere>',GOOD);
- end;
- end;
- procedure OnJoinGame(ID, Team: byte);
- var i: byte;
- begin
- if (lowercase(MapStatsON) = lowercase('ON')) then begin
- MapPlayerJoins := inttostr(strtoint(MapPlayerJoins) + 1);
- UpdateMapStats(currentmap);
- end;
- if (lowercase(EnableServerStats) = lowercase('ON')) then begin
- Visit := inttostr(strtoint(Visit) + 1);
- UpdateServStats();
- end;
- AutoRegLog(ID);
- PlayersInfoArr[ID].KilledBy := 0;
- for i := 1 to 33 do begin
- PlayersInfoArr[ID].DamageRecievedByID[i] := 0;
- PlayersInfoArr[ID].DamageRecievedByCooldown[i] := 0;
- end;
- end;
- procedure OnFlagGrab(ID, TeamFlag: byte;GrabbedInBase: boolean);
- begin
- if (lowercase(MapStatsON) = lowercase('ON')) then begin
- MapFlagGrabs := inttostr(strtoint(MapFlagGrabs) + 1);
- UpdateMapStats(currentmap);
- end;
- if (lowercase(EnableFlagStats) = lowercase('ON')) then if (PlayerInfo[ID].NickStatus = true) then begin
- PlayerStats[ID].FlagGrab := inttostr(strtoint(PlayerStats[ID].FlagGrab) + 1);
- UpdateNickname(ID);
- end;
- end;
- procedure OnFlagReturn(ID, TeamFlag: byte);
- begin
- if (lowercase(MapStatsON) = lowercase('ON')) then begin
- MapFlagReturns := inttostr(strtoint(MapFlagReturns) + 1);
- UpdateMapStats(currentmap);
- end;
- if (lowercase(EnableFlagStats) = lowercase('ON')) then if (PlayerInfo[ID].NickStatus = true) then begin
- PlayerStats[ID].FlagReturn := inttostr(strtoint(PlayerStats[ID].FlagReturn) + 1);
- UpdateNickname(ID);
- end;
- end;
- procedure OnPlayerRespawn(ID: byte);
- var i: byte;
- begin
- for i:=1 to 33 do begin
- PlayersInfoArr[ID].DamageRecievedByID[i] := 0;
- PlayersInfoArr[ID].DamageRecievedByCooldown[i] := 0;
- end;
- PlayersInfoArr[ID].KilledBy := 0;
- end;
- procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);
- var i: byte;
- begin
- if (lowercase(MapStatsON) = lowercase('ON')) then begin
- if (kicked) then MapPlayerKicks := inttostr(strtoint(MapPlayerKicks) + 1) else MapPlayerLeaves := inttostr(strtoint(MapPlayerLeaves) + 1);
- UpdateMapStats(currentmap);
- end;
- if (lowercase(EnableServerStats) = lowercase('ON')) then begin
- if (kicked) then SKick := inttostr(strtoint(SKick) + 1);
- UpdateServStats();
- end;
- if (lowercase(EnableTop) = lowercase('ON')) then if (PlayerInfo[ID].NickStatus = true) then begin
- if (GetPlayerStat(ID, 'Human') = true) then UpdateRanks(ID);
- SaveRanks();
- end;
- if (Voted[ID]) then begin
- Voted[ID] := false; VFor := (VFor - 1);
- end else
- begin
- if (NumPlayers > 1) then if (VFor / (NumPlayers - 1) * 100 >= Procent) then begin
- Go := false;
- for i := 1 to 32 do Voted[i] := false;
- VFor := 0; Time := 0;
- for i := 1 to 32 do if (GetPlayerStat(i, 'Active') = true) then begin
- WriteConsole(i,'Votes for updated statistics finished successfully.',GOOD);
- WriteConsole(i,'Updated stats!',GOOD);
- UpdateNickname(i);
- if (lowercase(EnableTop) = lowercase('ON')) then if (GetPlayerStat(i, 'Human') = true) then UpdateRanks(i);
- SaveRanks();
- end;
- end;
- end;
- if (PlayerInfo[ID].NickStatus = true) then begin
- UpdateNickname(ID);
- ResetVar(ID);
- end;
- for i := 1 to 32 do begin
- if (Getplayerstat(i,'Active')) then begin
- if (PlayersInfoArr[i].DamageRecievedByID[ID] <> 0) then begin
- PlayersInfoArr[i].DamageRecievedByID[33] := (PlayersInfoArr[i].DamageRecievedByID[33] + PlayersInfoArr[i].DamageRecievedByID[ID]);
- PlayersInfoArr[i].DamageRecievedByID[ID] := 0;
- end;
- end;
- end;
- for i := 1 to 33 do PlayersInfoArr[ID].DamageRecievedByID[i] := 0;
- PlayersInfoArr[ID].KilledBy := 0;
- end;
- procedure OnGameEnd();
- var i, c: byte; l, l2: boolean;
- begin
- if (GameStyle = 0) or (GameStyle = 1) or (GameStyle = 4) then begin
- l:=false; l2:=false;
- if (MinimalKills = 0) then MinimalKills := Round(StrtoInt(ReadINI('soldat.ini','GAME',iif(GameStyle = 0,'Deathmatch_Limit',iif(GameStyle=1,'Pointmatch_Limit','Rambomatch_Limit')),'35'))/2);
- for i := 1 to 32 do if (GetPlayerStat(i,'Active')=true) then if (GetPlayerStat(i,'Kills')>=MinimalKills) then begin
- l:= true; break;
- end;
- if (l=true) then begin
- for i := 1 to 32 do if (GetPlayerStat(i,'Active')=true) then begin
- if (GetPlayerStat(c,'Kills')=GetPlayerStat(i,'Kills')) then begin
- if (GetPlayerStat(c,'Deaths')>GetPlayerStat(i,'Deaths')) then c:=i;
- end else if (GetPlayerStat(c,'Kills')<GetPlayerStat(i,'Kills')) then c:=i;
- end;
- for i := 1 to 32 do if (GetPlayerStat(i,'Active')=true) then begin
- if (i<>c) then begin
- if ((GetPlayerStat(c,'Kills')=GetPlayerStat(i,'Kills')) and (GetPlayerStat(c,'Deaths')=GetPlayerStat(i,'Deaths'))) then begin
- l2:=true;
- PlayerStats[i].Remis := inttostr(strtoint(PlayerStats[i].Remis) + 1);
- end else PlayerStats[i].lose := inttostr(strtoint(PlayerStats[i].lose) + 1);
- UpdateNickname(i);
- end;
- end;
- if (l2=true) then PlayerStats[c].Remis := inttostr(strtoint(PlayerStats[c].Remis) + 1) else PlayerStats[c].Win := inttostr(strtoint(PlayerStats[c].Win) + 1);
- UpdateNickname(c);
- end; exit;
- end;
- case (GameStyle) of
- 3,5,6: begin
- for i := 1 to 32 do if (GetPlayerStat(i,'Active')) then begin
- if (GetPlayerStat(i,'Team') = 1) then begin
- if (StrtoInt(ReadINI('soldat.ini','GAME',iif(GameStyle = 3,'Capture_Limit',iif(GameStyle=5,'Infiltration_Limit','Hold_Limit')),'10')) = AlphaScore) or ((BravoScore < AlphaScore) and (CharlieScore < AlphaScore) and (DeltaScore < AlphaScore)) then begin
- PlayerStats[i].AlphaWins := inttostr(strtoint(PlayerStats[i].AlphaWins) + 1);
- PlayerStats[i].Win := inttostr(strtoint(PlayerStats[i].Win) + 1);
- end else
- begin
- if (AlphaScore < BravoScore) or (AlphaScore < DeltaScore) or (AlphaScore < CharlieScore) then begin
- PlayerStats[i].AlphaLose := inttostr(strtoint(PlayerStats[i].AlphaLose) + 1);
- PlayerStats[i].lose := inttostr(strtoint(PlayerStats[i].lose) + 1);
- end else PlayerStats[i].Remis := inttostr(strtoint(PlayerStats[i].Remis) + 1);
- end;
- end;
- if (GetPlayerStat(i,'Team') = 2) then begin
- if (StrtoInt(ReadINI('soldat.ini','GAME','Teammatch_Limit','60')) = BravoScore) or ((AlphaScore < BravoScore) and (CharlieScore < BravoScore) and (DeltaScore < BravoScore)) then begin
- PlayerStats[i].BravoWins := inttostr(strtoint(PlayerStats[i].BravoWins) + 1);
- PlayerStats[i].Win := inttostr(strtoint(PlayerStats[i].Win) + 1);
- end else
- begin
- if (BravoScore < AlphaScore) or (BravoScore < DeltaScore) or (BravoScore < CharlieScore) then begin
- PlayerStats[i].BravoLose := inttostr(strtoint(PlayerStats[i].BravoLose) + 1);
- PlayerStats[i].lose := inttostr(strtoint(PlayerStats[i].lose) + 1)
- end else PlayerStats[i].Remis := inttostr(strtoint(PlayerStats[i].Remis) + 1);
- end;
- end;
- UpdateNickname(i);
- end;
- end;
- 2: begin
- for i := 1 to 32 do if (GetPlayerStat(i,'Active')) then begin
- case (GetPlayerStat(i,'Team')) of
- 1: begin
- if (StrtoInt(ReadINI('soldat.ini','GAME','Teammatch_Limit','60')) = AlphaScore) or ((BravoScore < AlphaScore) and (CharlieScore < AlphaScore) and (DeltaScore < AlphaScore)) then begin
- PlayerStats[i].AlphaWins := inttostr(strtoint(PlayerStats[i].AlphaWins) + 1);
- PlayerStats[i].Win := inttostr(strtoint(PlayerStats[i].Win) + 1);
- end else
- begin
- if (AlphaScore < BravoScore) or (AlphaScore < DeltaScore) or (AlphaScore < CharlieScore) then begin
- PlayerStats[i].AlphaLose := inttostr(strtoint(PlayerStats[i].AlphaLose) + 1);
- PlayerStats[i].lose := inttostr(strtoint(PlayerStats[i].lose) + 1);
- end else PlayerStats[i].Remis := inttostr(strtoint(PlayerStats[i].Remis) + 1);
- end;
- end;
- 2: begin
- if (StrtoInt(ReadINI('soldat.ini','GAME','Teammatch_Limit','60')) = BravoScore) or ((AlphaScore < BravoScore) and (CharlieScore < BravoScore) and (DeltaScore < BravoScore)) then begin
- PlayerStats[i].BravoWins := inttostr(strtoint(PlayerStats[i].BravoWins) + 1);
- PlayerStats[i].Win := inttostr(strtoint(PlayerStats[i].Win) + 1);
- end else
- begin
- if (BravoScore < AlphaScore) or (BravoScore < DeltaScore) or (BravoScore < CharlieScore) then begin
- PlayerStats[i].BravoLose := inttostr(strtoint(PlayerStats[i].BravoLose) + 1);
- PlayerStats[i].lose := inttostr(strtoint(PlayerStats[i].lose) + 1)
- end else PlayerStats[i].Remis := inttostr(strtoint(PlayerStats[i].Remis) + 1);
- end;
- end;
- 3: begin
- if (StrtoInt(ReadINI('soldat.ini','GAME','Teammatch_Limit','60')) = CharlieScore) or ((AlphaScore < CharlieScore) and (BravoScore < CharlieScore) and (DeltaScore < CharlieScore)) then begin
- PlayerStats[i].CharlieWin := inttostr(strtoint(PlayerStats[i].CharlieWin) + 1);
- PlayerStats[i].Win := inttostr(strtoint(PlayerStats[i].Win) + 1);
- end else
- begin
- if (CharlieScore < AlphaScore) or (CharlieScore < BravoScore) or (CharlieScore < DeltaScore) then begin
- PlayerStats[i].CharlieLose := inttostr(strtoint(PlayerStats[i].CharlieLose) + 1);
- PlayerStats[i].lose := inttostr(strtoint(PlayerStats[i].lose) + 1)
- end else PlayerStats[i].Remis := inttostr(strtoint(PlayerStats[i].Remis) + 1);
- end;
- end;
- 4: begin
- if (StrtoInt(ReadINI('soldat.ini','GAME','Teammatch_Limit','60')) = DeltaScore) or ((AlphaScore < DeltaScore) and (BravoScore < DeltaScore) and (CharlieScore < DeltaScore)) then begin
- PlayerStats[i].DeltaWin := inttostr(strtoint(PlayerStats[i].DeltaWin) + 1);
- PlayerStats[i].Win := inttostr(strtoint(PlayerStats[i].Win) + 1);
- end else
- begin
- if (DeltaScore < AlphaScore) or (DeltaScore < BravoScore) or (DeltaScore < CharlieScore) then begin
- PlayerStats[i].DeltaLose := inttostr(strtoint(PlayerStats[i].DeltaLose) + 1);
- PlayerStats[i].lose := inttostr(strtoint(PlayerStats[i].lose) + 1)
- end else PlayerStats[i].Remis := inttostr(strtoint(PlayerStats[i].Remis) + 1);
- end;
- end;
- end;
- UpdateNickname(i);
- end;
- end;
- end;
- end;
- procedure ActivateServer();
- var b: byte;
- begin
- AppOnIdleTimer := 1;
- MaxHealth := iif(Command('/realistic')='1',65,150);
- if (ReadINI('soldat.ini','GAME','Friendly_Fire','0') = '1') then FriendlyFire:=true else FriendlyFire:=false;
- if (ReadINI('soldat.ini','GAME','Survival_Mode','0') = '1') then Survival:=true else Survival:=false;
- if (FileExists('nickreg/server/players.db') = false) then WriteLnFile('nickreg/server/players.db','[PlayersList]'); if (FileExists('nickreg/maps/maps.db') = false) then WriteLnFile('nickreg/maps/maps.db','[MapList]');
- if LoadSettings('scripts/'+ ScriptName + '/settings.ini') then WriteLn(' [*] '+ ScriptName + ' -> Error while loading settings') else WriteLn(' [*] '+ ScriptName + ' -> Settings loaded successfully');
- WriteConsole(0, 'ZitroFun '+ZitroVersion+' recompiled - successfully :)', $FFFFAA00);
- if (lowercase(EnableTop) = lowercase('ON')) then LoadRanks();
- for b := 1 to 32 do begin
- ResetVar(b);
- if (GetPlayerStat(b,'Active')=true) then begin
- LoadNickname(b);
- if (PlayerInfo[b].DelAcc = 'NO') then AutoLogin(b) else
- begin
- WriteConsole(b,'The nickname '+GetPlayerStat(b,'name')+' is not registered!',GOOD);
- WriteConsole(b,'To protect your nickname type: /create <yourpasswordhere>',GOOD);
- end;
- end;
- end;
- CreateServerStats();
- if (lowercase(EnableServerStats) = lowercase('ON')) then ServerLoad();
- if (lowercase(MapStatsON) = lowercase('ON')) then MapStatsLoad(currentmap);
- if (lowercase(TopMapsON) = lowercase('ON')) then LoadTopMap();
- INF_BravoNewScore := 0; HTF_BravoNewScore := 0; HTF_AlphaNewScore := 0;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement