Author Topic: Killing Sprees  (Read 22242 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 »