Author Topic: Killing Sprees  (Read 22740 times)

0 Members and 1 Guest are viewing this topic.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Killing Sprees
« on: January 12, 2007, 10:25:17 am »
Script Name: Killing Sprees
Script Description: Shows who is on killing sprees and who ends their spree
Original Author(s): Bmekim (Remake of EnEsCe's script)
Core Version: 2.6.1
Code: 
Code: [Select]
var
kills: array[1..32] of byte;

procedure OnJoinTeam(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,'team') <> GetPlayerStat(victim,'team')) 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;
« Last Edit: August 17, 2007, 01:25:29 pm by mikembm »

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Killing Sprees
« Reply #1 on: January 12, 2007, 10:45:57 am »
New spree names are done every 5 kills, not every 2.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Killing Sprees
« Reply #2 on: January 12, 2007, 10:48:26 am »
Well obviously its changeable per your wants...
When I made it, it was for a R/S server where continuous kills are harder to get.
So it's basically just up to the server owner on what he thinks is right.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Killing Sprees
« Reply #3 on: January 14, 2007, 03:26:14 pm »
actually continuous kills are easier to get in R/S o_O

cool idea nevertheless
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Killing Sprees
« Reply #4 on: February 11, 2007, 09:13:52 pm »
Fixed a small bug in script.

Offline xtishereb

  • Flagrunner
  • ****
  • Posts: 908
  • I swear, my chainsaw killed you on its own.
Re: Killing Sprees
« Reply #5 on: February 13, 2007, 05:59:52 pm »
It's the bug where if someone leaves, and then someone joins and has the same number as them, they continue their spree, right?

Anyway, this script is great. I use it on my dedicated server I sometimes use for zombie matches.
<3*xwd
love conquers all

Offline Mercury92

  • Camper
  • ***
  • Posts: 284
Re: Killing Sprees
« Reply #6 on: February 25, 2007, 03:18:30 am »
Hi! How actaully i add them to my server. Open textfile. Paste, save as name.pas , add to includes script name, Run server and oops server is shutting down. Can anyone tell me how actually these things are done?
[saw]  on 1.5.1

Offline rumpel

  • Camper
  • ***
  • Posts: 410
Re: Killing Sprees
« Reply #7 on: February 25, 2007, 11:39:54 am »
how i can use this script?
banned.

Offline Underworld

  • Camper
  • ***
  • Posts: 338
  • Mapper
Re: Killing Sprees
« Reply #8 on: March 03, 2007, 03:44:09 pm »
i want to know the same thing...
I don't understand
do you mean that there is a /faceplam commmand ?
and this command should drop a random item ?

Offline xtishereb

  • Flagrunner
  • ****
  • Posts: 908
  • I swear, my chainsaw killed you on its own.
Re: Killing Sprees
« Reply #9 on: March 03, 2007, 04:18:35 pm »
If you want to run a script, you need to combine it with the other scripts your server runs. See this topic for information on how to combine scripts.
<3*xwd
love conquers all

Teh Leet

  • Guest
Re: Killing Sprees
« Reply #10 on: March 03, 2007, 09:52:15 pm »
avarax is right about continuous kills but good job keep up good owrk m8

Offline Therier

  • Soldier
  • **
  • Posts: 102
Re: Killing Sprees
« Reply #11 on: March 06, 2007, 04:09:08 am »
Does this server script work on Linux servers? I ask because my server is on Linux.

Offline Clawbug

  • Veteran
  • *****
  • Posts: 1393
  • 1184!
Re: Killing Sprees
« Reply #12 on: March 06, 2007, 08:41:05 am »
It seems it should work. If I recall right, there is a bug in split()-function, which does not work like it should in Linux machines, because Linux handles it in different way. It seems there is no split(), thus I assume it works.

Fight! Win! Prevail!

Offline Mikeman

  • Soldier
  • **
  • Posts: 150
    • Nuke Corruption
Re: Killing Sprees
« Reply #13 on: March 10, 2007, 03:48:30 pm »
nice script, after a few tries I got it working. Thanks  ;)

Offline n0fx

  • Major(1)
  • Posts: 18
Re: Killing Sprees
« Reply #14 on: March 12, 2007, 05:07:12 pm »
i tried to combine this code with the networkcore.pas .. i really dunno whats wrongs ;x

Quote
var
kills: array[1..32] of integer;

function OnRequestGame(IP: string;State: integer):integer;
begin
Result := State;
end;

procedure OnJoinGame(IP, Nickname: string;Team: byte);
begin
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 OnFlagGrab(ID: integer;TeamFlag: byte;GrabbedInBase: boolean);
begin
end;

procedure OnFlagReturn(ID: integer;TeamFlag: byte);
begin
end;

procedure OnFlagScore(ID: integer;TeamFlag: byte);
begin
end;

procedure OnPlayerKill(Killer,Victim,Weapon: string);
var
spree: array[1..11] of string;
i: integer;
j: integer;
killsNeeded: integer;

begin
killsNeeded := 3; //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[5] := ' is on a Rampage!';
spree[7] := ' is Dominating!';
spree[9] := ' is Unstoppable!';
spree[11] := ' is Godlike!';
i := NameToId(killer);
j := NameToId(victim);

if (killer <> victim) then begin //needed for servers with survival mode
   kills := kills + 1;

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

procedure OnPlayerRespawn(ID: integer);
begin
end;

procedure OnPlayerSpeak(Name,Text: string);
begin
end;

« Last Edit: March 12, 2007, 05:17:17 pm by n0fx »

Offline n0fx

  • Major(1)
  • Posts: 18
Re: Killing Sprees
« Reply #15 on: March 12, 2007, 06:38:15 pm »
ty .. now everything works fine ;q

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Killing Sprees
« Reply #16 on: March 12, 2007, 06:57:21 pm »
Modified script to not increment a player's spree kills amount if it was a team kill.
Also if it is a team kill it will reset their spree kills to 0 and send them a message.
All information is in my first post.

Offline Mikeman

  • Soldier
  • **
  • Posts: 150
    • Nuke Corruption
Re: Killing Sprees
« Reply #17 on: March 14, 2007, 01:52:55 am »
There's is some bug, when FF is off and I kill enemy it tells ''Your spree kills have been reset for team killing'' etc.

EDIT: Doesn't happen always, I think it has something to do with autobalance.. when teammate goes to enemy team..
« Last Edit: March 14, 2007, 01:55:07 am by Mikeman »

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Killing Sprees
« Reply #18 on: March 14, 2007, 02:07:54 am »
There's is some bug, when FF is off and I kill enemy it tells ''Your spree kills have been reset for team killing'' etc.

EDIT: Doesn't happen always, I think it has something to do with autobalance.. when teammate goes to enemy team..

You sure about that...? Because if you look at the code you will see that the only way it can show that message is if people are on the same team. Also note that the IDtoTeam function will not work with bots.


EDIT: Posted older script after new one in first post if your server has FF off.
« Last Edit: March 14, 2007, 02:17:56 am by mikembm »

Offline Mikeman

  • Soldier
  • **
  • Posts: 150
    • Nuke Corruption
Re: Killing Sprees
« Reply #19 on: March 14, 2007, 02:23:51 am »
I'm sure, because few players in the server was saying about it too.. and I didn't use bots, it was my public 14 slot realistic server. I can post screen next time I get the message of killing enemy  :)
« Last Edit: March 14, 2007, 03:28:22 am by Mikeman »

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?

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Killing Sprees
« Reply #40 on: August 17, 2007, 01:27:26 pm »
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?

If you look at it better you will see that there is an else statement after it checks if teams are equal. I just accidentally indented it so you probably missed it. Anyways it does rule it out but it doesn't allow you to know if the killer was the victim - which is needed.

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Killing Sprees
« Reply #41 on: October 30, 2007, 12:45:55 pm »
ll 0 ll? Where is the download link? -_-

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Killing Sprees
« Reply #42 on: October 31, 2007, 02:52:55 am »

Offline Xaero

  • Soldier
  • **
  • Posts: 143
Re: Killing Sprees
« Reply #43 on: October 31, 2007, 02:56:00 pm »
Nice, I play regulary on a server using this script. It's quite fun :)

Offline Leipod

  • Major(1)
  • Posts: 15
  • Hi :D
Re: Killing Sprees
« Reply #44 on: November 13, 2007, 04:03:04 pm »
I have a problem with this script. When I join the server, it says: Not enough parameters.
When I kill someone, and when i leave the game too, it says: Out of range
I just downloaded the zipfile of the script from xJapx, and didn't do anything special.
The screenshot shows the errors when i join or leave the game.

Plz help.

EDIT: I installed it on the soldatserver 2.6.3. Does anyone knows if it's compatible with it? :P
« Last Edit: November 14, 2007, 09:39:25 am by Leipod »
Ingame: {ARG} Shad0w