0 Members and 1 Guest are viewing this topic.
var kills: array[1..32] of integer; CurMap,NexMap: string; HKills: integer; HName: string; procedure ResetKills(); var i: integer; begin for i := 1 to 32 do begin kills[i] := 0; end; end; procedure HighestSpree(); begin if HKills > 1 then begin Command('/say Highest spree by: ' + HName + ' with ' + IntToStr(HKills) + ' kills!'); HName := ''; HKills := 0; end; end; procedure ks_OnMapChange(); begin ResetKills(); HighestSpree(); end; procedure ks_ActivateServer(); begin CurMap := CurrentMap; NexMap := NextMap; end; procedure ks_AppOnIdle(Ticks: integer); begin if Ticks mod 2 = 0 then begin //Every 2 seconds if ((CurMap <> CurrentMap) and (TimeLeft > 0)) then begin ks_OnMapChange(); //Map has changed! CurMap := CurrentMap; end; end; end; procedure ks_OnCommand(ID: byte;Text: string); begin if StrPos('/map', Text) = 1 then begin if StrPos(CurrentMap, Text) = 6 then begin ResetKills(); HighestSpree(); end; end; if StrPos('/restart', Text) = 1 then begin ResetKills(); HighestSpree(); end; if StrPos('/spree', Text) = 1 then begin if HKills > 1 then begin Command('/say Highest spree by: ' + HName + ' with ' + IntToStr(HKills) + ' kills!'); end; end; end; procedure ks_OnLeaveGame(ID, Team: byte; Kicked: boolean); begin kills[ID] := 0; end; procedure ks_OnPlayerKill(Killer, Victim: byte; Weapon: string); var spree: array[1..25] of string; i: integer; j: integer; killsNeeded: integer; begin killsNeeded := 5; //number of kills needed to count as a killing spree //spree where x represents the current number of spree kills player has //more can be added just be sure to change the spree array size spree[killsNeeded] := ' is on a Killing Spree!'; spree[8] := ' is on a Rampage!'; spree[11] := ' is Dominating!'; spree[14] := ' is Unstoppable!'; spree[17] := ' is Wicked Sick!'; spree[20] := ' is Godlike!'; spree[25] := ' is Beyond Godlike!'; i := Killer; j := Victim; if Killer <> Victim then begin //needed for servers with survival mode kills[i] := kills[i] + 1 if kills[i] > HKills then begin HKills := kills[i]; HName := IDToName(Killer); end; if (kills[j] >= killsNeeded) then begin Command('/say ' + IDToName(Victim) + '''s ' + inttostr(kills[j]) + ' kills spree ended by ' + IDToName(Killer)); end; kills[j] := 0; if (kills[i] <= Arrayhigh(spree) + 1) then begin if (spree[kills[i]] <> '') then Command('/say ' + IDToName(killer) + spree[kills[i]]); end; end; end;