Author Topic: Killing Sprees  (Read 24318 times)

0 Members and 1 Guest are viewing this topic.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Killing Sprees
« Reply #20 on: March 14, 2007, 07:59:00 pm »
Lol. Had a line in there that was for testing purposes only.
Command('/say ' + killer + ' - ' + inttostr(kills));
Find and remove that line if you are using script.

Also updated first post.

Offline Mikeman

  • Soldier
  • **
  • Posts: 150
    • Nuke Corruption
Re: Killing Sprees
« Reply #21 on: March 15, 2007, 02:53:28 am »
Yeah I was thinking why there's that :D I deleted it when I noticed it ingame  :P

Offline xJapx

  • Major(1)
  • Posts: 17
Re: Killing Sprees
« Reply #22 on: April 03, 2007, 07:28:07 am »
I've changed mikembm's script a bit, so now it resets the kill count when map changes, and also after the map it says who made the longest spree. Admin can also use the /spree command to see who has made the highest spree so far in that map. (Using EnEsCe's, improved by Yako's OnMapChange script!)

Code: [Select]
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 OnMapChange();
begin
ResetKills();
HighestSpree();
end;

procedure ActivateServer();
begin
CurMap := CurrentMap;
NexMap := NextMap;
end;

procedure AppOnIdle(Ticks: integer);
begin
 if Ticks mod 2 = 0 then begin //Every 2 seconds
  if ((CurMap <> CurrentMap) and (TimeLeft > 0)) then
  begin
  OnMapChange; //Map has changed!
  CurMap := CurrentMap;
  end;
 end;
end;

procedure OnCommand(ID: integer;Text: string);
var
i: integer;
begin
if GetPiece(Text, ' ', 1) = '/map' then
 begin
 if GetPiece(Text, ' ', 2) = CurrentMap then
  begin
  ResetKills();
  HighestSpree();
  end;
 end;
 if GetPiece(Text, ' ', 1) = '/restart' then
 begin
  ResetKills();
  HighestSpree();
 end;
 if GetPiece(Text, ' ', 1) = '/spree' then
begin
if HKills > 1 then begin
Command('/say Highest spree by: ' + HName + ' with ' + IntToStr(HKills) + ' kills!');
end;
end
end;

procedure OnJoinTeam(IP, Nickname: string;Team: byte);
begin
kills[NameToId(Nickname)] := 0;
end;

procedure OnLeaveGame(IP, Nickname: string;Team: byte);
begin
kills[NameToId(Nickname)] := 0;
end;

procedure OnPlayerKill(Killer,Victim,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[x] 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 := NameToId(killer);
j := NameToId(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 := killer;
end;

if (kills[j] >= killsNeeded) then begin
Command('/say ' + victim + '''s ' + inttostr(kills[j]) + ' kills spree ended by ' + killer);
end;
kills[j] := 0;

if (kills[i] <= Arrayhigh(spree) + 1) then begin
if (spree[kills[i]] <> '') then Command('/say ' + killer + spree[kills[i]]);
end;
end;
end;

This should work. If I did something wrong please tell me.

Offline Stealth

  • Soldier
  • **
  • Posts: 132
    • Just Deserts...
Re: Killing Sprees
« Reply #23 on: April 12, 2007, 12:44:40 pm »
Would it be possible to add a bit so if a player gets a Triple Kill, Multi Kill, + it will announce it also?
Soldat on Linux: It does work! Need help?

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Killing Sprees
« Reply #24 on: April 12, 2007, 08:35:53 pm »
Would it be possible to add a bit so if a player gets a Triple Kill, Multi Kill, + it will announce it also?

Possible; but that involves all sorts of timing crap. That becomes quite intensive to check every player.

Offline Stealth

  • Soldier
  • **
  • Posts: 132
    • Just Deserts...
Re: Killing Sprees
« Reply #25 on: April 13, 2007, 08:56:27 am »
Oh. I would think it'd be easier, unless Soldat is not reporting those time of variables. I would think there's something on each Soldat like: multikill =0 and the Soldat engine itself is the one that checks the timing and what not. And then once that person reaches "double kill", the multikill variable goes up. Then all this script would have to do is check after each kill if that player's "multikill" is > 1 and announce it on server, so other people can see it as well.
Soldat on Linux: It does work! Need help?

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Killing Sprees
« Reply #26 on: April 13, 2007, 09:28:46 am »
Multi-kills are client side, the server has no idea of it happening; so its not easy. You would have to make a script to count the time between the players kills and if its within xxx seconds, then it counts as a multi-kill.

Offline xJapx

  • Major(1)
  • Posts: 17
Re: Killing Sprees
« Reply #27 on: April 13, 2007, 11:51:04 am »
Yea true, it's a different script. And it is not really practical to use it, could get spammed too much, and seeing it in 2 places would look a bit weird.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Killing Sprees
« Reply #28 on: June 18, 2007, 08:51:17 pm »
Script has been updated for new server version

Offline K_Sparkz

  • Major(1)
  • Posts: 13
Re: Killing Sprees
« Reply #29 on: June 25, 2007, 10:52:04 am »
I can't make it work on the new server version.... rly dont know whats wrong, the compiling completes perfect, and shows no errors.. but there is simply no killing spree on the server! I Combined them manually, and with your script combiner, and everything seems in order.. but. just doesnt show anything ingame??

Offline kornsick

  • Major(1)
  • Posts: 42
  • Fhtagn!
    • Soldat Server @ StarNet
Re: Killing Sprees
« Reply #30 on: June 25, 2007, 03:09:06 pm »
I can't make it work on the new server version.... rly dont know whats wrong, the compiling completes perfect, and shows no errors.. but there is simply no killing spree on the server! I Combined them manually, and with your script combiner, and everything seems in order.. but. just doesnt show anything ingame??
Your game mode must be with teams, for death match you'll have to edit the script like i did.

Offline K_Sparkz

  • Major(1)
  • Posts: 13
Re: Killing Sprees
« Reply #31 on: June 25, 2007, 04:04:47 pm »
oh... ofcourse!! thx m8

Offline Mikeman

  • Soldier
  • **
  • Posts: 150
    • Nuke Corruption
Re: Killing Sprees
« Reply #32 on: June 26, 2007, 12:45:58 am »
Can someone edit the script for DM server, or does it work in it?

Offline kornsick

  • Major(1)
  • Posts: 42
  • Fhtagn!
    • Soldat Server @ StarNet
Re: Killing Sprees
« Reply #33 on: June 26, 2007, 04:20:57 am »
Code: [Select]
var
kills: array[1..32] of byte;

procedure OnJoinGame(ID, Team: byte);
begin
kills[ID] := 0;
end;

procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);
begin
kills[ID] := 0;
end;

procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
var
spree: array[1..17] of string;
killsNeeded: byte;
begin
killsNeeded := 5; //number of kills needed to count as a killing spree
//spree[x] 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 Godlike!';
if killer <> victim then begin
if (GetPlayerStat(killer,'name') <> GetPlayerStat(victim,'name')) then begin
kills[killer] := kills[killer] + 1;
if (kills[victim] >= killsNeeded) then begin
Command('/say ' + GetplayerStat(victim,'name') + '''s ' + inttostr(kills[victim]) + ' kills spree ended by ' + GetPlayerStat(killer,'name'));
end;
kills[victim] := 0;
if (kills[killer] <= Arrayhigh(spree) + 1) then begin
if (spree[kills[killer]] <> '') then Command('/say ' + GetPlayerStat(killer,'name') + spree[kills[killer]]);
end;
end
else begin
if (kills[killer] > 0) then SayToPlayer(killer, 'Your spree kills have been reset for team killing');
kills[killer] := 0;
end;
end;
end;

i think this would work.

Offline Spasm

  • Soldier
  • **
  • Posts: 241
  • Elite CTF Owner
    • Elite CTF
Re: Killing Sprees
« Reply #34 on: August 14, 2007, 12:50:29 pm »
there a zip file for this?
Owner/Founder- Elite CTF -  http://elitectf.com
OwnedVision - http://ownedvision.com
--An EliteCTF Production.
Snipe & Slice - Saw & Law - One Shots

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: Killing Sprees
« Reply #35 on: August 14, 2007, 01:39:54 pm »
I can make one really quick:
...here.

(Zipped file is the xJapx version)
« Last Edit: August 14, 2007, 01:44:15 pm by Iq Unlimited »

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Killing Sprees
« Reply #36 on: August 14, 2007, 02:42:41 pm »
ty since 2.6.2 all posts should be modified
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline Spasm

  • Soldier
  • **
  • Posts: 241
  • Elite CTF Owner
    • Elite CTF
Re: Killing Sprees
« Reply #37 on: August 17, 2007, 06:24:12 am »
Hmm.. is this compatible with 2.6.2?  Maybe I made an error.
Owner/Founder- Elite CTF -  http://elitectf.com
OwnedVision - http://ownedvision.com
--An EliteCTF Production.
Snipe & Slice - Saw & Law - One Shots

Offline Freedom

  • Major
  • *
  • Posts: 97
  • Veritas Vincit
Re: Killing Sprees
« Reply #38 on: August 17, 2007, 06:40:40 am »
Yes, it is.
Cum pare contendere anceps est, cum superiore furiosum, cum inferiore sordidum.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Killing Sprees
« Reply #39 on: August 17, 2007, 11:21:50 am »
Code: [Select]
if killer <> victim then begin
  if (GetPlayerStat(killer,'team') <> GetPlayerStat(victim,'team')) then begin
  ...
  end;
end;
Wouldn't "GetPlayerStat(killer,'team') <> GetPlayerStat(victim,'team')" already rule out that Killer <> Victim?