PDA

View Full Version : COD2 MP: adding killing spree messages



michelboonstra74
15th July 2021, 16:36
I'd like to add killing spree messages to all my COD2 MP players. I have found this bit of script online, but if I add it to my maps\mp\gametypes\teams.gsc
it does not work (nor do I get an error). I guess this script may not be complete and/or the 'killspree' needs to be initialized before this bit? Does anyone know?
Thanks in advance!




if( isplayer(attacker) && isAlive(attacker))
{

if ( (attacker != self) && (getcvar("g_gametype") != "dm") && (attacker.team != self.team) )
{
attacker.killspree++;
}
if ( (attacker != self) && (getcvar("g_gametype") == "dm") )
{
attacker.killspree++;
}

rn = randomint(16);

if(attacker != self && isDefined(attacker.team) && isDefined(self.team) && attacker.team != self.team )
{
if (attacker.killspree == 2 || attacker.killspree == 3)
{
if(attacker.killspree == 3)
iprintln(attacker.name + &"^7is on a roll with ^1" + attacker.killspree + &"^7 kills!");
rn = randomint(10);
}
if (attacker.killspree == 4 || attacker.killspree == 5)
{
if(attacker.killspree == 5)
iprintln(attacker.name + " ^7is on a killing spree with ^1" + attacker.killspree + " ^7 kills!");
rn = randomint(8);
}
if (attacker.killspree > 5 && attacker.killspree < 10)
{
if(attacker.killspree == 10)
iprintln(attacker.name + " ^7is on fire with ^1" + attacker.killspree + " ^7 kills!");
rn = randomint(5);
}
if (attacker.killspree >= 10)
{
if(attacker.killspree == 15)
iprintln(attacker.name + " ^7is unstoppable with ^1" + attacker.killspree + "^7 kills!");
if(attacker.killspree == 20)
iprintln(attacker.name + " ^7is dominating with ^1" + attacker.killspree + "^7 kills!");
rn = randomint(5);
}
}
}

Edit by iznogod: Added code tags.

IzNoGoD
15th July 2021, 18:12
Be more specific how you add it to teams.gsc.

michelboonstra74
15th July 2021, 20:54
I'm sorry, I meant dm.gsc, not teams.gsc.
In there I placed it under:
Callback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime)

IzNoGoD
16th July 2021, 20:42
I'm sorry, I meant dm.gsc, not teams.gsc.
In there I placed it under:
Callback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime)

Why is the Killing spree sound in playerDAMAGE and not in playerKILLED?

Also, be more specific about how you added them. You cannot just throw them randomly in and expect them to work.

Also, be more specific about your test setup. Developer mode enabled? Soundalias correct? Sound files loaded? Any errors in client console regarding sounds, especially when they're supposed to be playing? Any debug iprints you put in that get triggered (or not, that's also information), any info on whether or not the dm.gsc you're referring to is actually being executed or if a stock one is loaded instead?

michelboonstra74
18th July 2021, 08:42
Thanks for the reply. Clearly I have little knowledge of scripting.. :confused: I have placed the killing spree script in playerKilled - but with no effect, or error in the log file so far.
( Dev mode = CoD2MP_s.exe +set thereisacow 1337 +set developer 1 +set logfile 1 +set g_log server_mp.log )
The modified dm.gsc is being executed instead of the stock version for sure. And as far as I can tell, the script doesn't need sound files.

In the mean time I found out that the killing spree script was part of the Merciless Mod 2, so I will have a look at that and try to figure out if I can get the killing spree bit to run in my personal mod.
If so, I'll post it in this thread.

IzNoGoD
18th July 2021, 09:29
Thanks for the reply. Clearly I have little knowledge of scripting.. :confused: I have placed the killing spree script in playerKilled - but with no effect, or error in the log file so far.
( Dev mode = CoD2MP_s.exe +set thereisacow 1337 +set developer 1 +set logfile 1 +set g_log server_mp.log )
The modified dm.gsc is being executed instead of the stock version for sure. And as far as I can tell, the script doesn't need sound files.

In the mean time I found out that the killing spree script was part of the Merciless Mod 2, so I will have a look at that and try to figure out if I can get the killing spree bit to run in my personal mod.
If so, I'll post it in this thread.

I still have no information about where exactly you put this script. Post the entire callback_playerkilled.

maxdamage99
19th July 2021, 06:13
try


if( isplayer(attacker) && isAlive(attacker))
{
if (!isDefined(attacker.killspree))
attacker.killspree = 0;

if ( (attacker != self) && (getcvar("g_gametype") != "dm") && (attacker.team != self.team) )
attacker.killspree++;
else
if ( (attacker != self) && (getcvar("g_gametype") == "dm") )
attacker.killspree++;

if(attacker != self && isDefined(attacker.team) && isDefined(self.team) && attacker.team != self.team )
{
iprintlnbold("attacker: " + attacker.name + " has killing spree: " + attacker.killspree + " when killing: " + self.name);

//if work, uncomment this

/*
switch (attacker.killspree)
{
case 1:
iprintln(attacker.name + " has 1 killing spree");
//just message();
break;
case 2:
iprintln(attacker.name + " has 2 killing spree");
//LearnSomeSimpleDeveloperLessons();
break;
case 3:
iprintln(attacker.name + " has 3 killing spree");
//Kick();
break;
case 4:
iprintln(attacker.name + " has 4 killing spree");
//GiveSex();
break;
case 5:
iprintln(attacker.name + " has 5 killing spree");
//GiveNades();
break;

default:
break;
}
*/
}
}

michelboonstra74
19th July 2021, 10:21
Ok, thank you both for your replies! Based on the Merciless mod, I changed it a bit.
In the maps\mp\gametypes\dm.gsc I just added these lines:
self.killspree = 0;
self thread cod2\_player::_KillSpree();


spawnPlayer()
{
self endon("disconnect");
self notify("spawned");
self notify("end_respawn");

resettimeout();

// Stop shellshock and rumble
self stopShellshock();
self stoprumble("damage_heavy");

self.sessionteam = "none";
self.sessionstate = "playing";
self.spectatorclient = -1;
self.archivetime = 0;
self.psoffsettime = 0;
self.statusicon = "";
self.maxhealth = 100;
self.health = self.maxhealth;

self.killspree = 0; // KILL SPREE

spawnpointname = "mp_dm_spawn";
spawnpoints = getentarray(spawnpointname, "classname");
spawnpoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_DM(sp awnpoints);

if(isdefined(spawnpoint))
self spawn(spawnpoint.origin, spawnpoint.angles);
else
maps\mp\_utility::error("NO " + spawnpointname + " SPAWNPOINTS IN MAP");

if(!isdefined(self.pers["savedmodel"]))
maps\mp\gametypes\_teamsDM::model();
else
maps\mp\_utility::loadModel(self.pers["savedmodel"]);

maps\mp\gametypes\_weapons::givePistol();
maps\mp\gametypes\_weapons::giveGrenades();
maps\mp\gametypes\_weapons::giveBinoculars();

self giveWeapon(self.pers["weapon"]);
self giveMaxAmmo(self.pers["weapon"]);
self setSpawnWeapon(self.pers["weapon"]);

if(!level.splitscreen)
{
if(level.scorelimit > 0)
self setClientCvar("cg_objectiveText", &"MP_GAIN_POINTS_BY_ELIMINATING", level.scorelimit);
else
self setClientCvar("cg_objectiveText", &"MP_GAIN_POINTS_BY_ELIMINATING_NOSCORE");
}
else
self setClientCvar("cg_objectiveText", &"MP_ELIMINATE_ENEMIES");

waittillframeend;
self notify("spawned_player");

self thread cod2\_player::_KillSpree(); // KILL SPREE

}


And in cod2\_player.gsc I added:



_KillSpree(attacker,killspree)
{
iprintlnbold("running killspree");


if( isplayer(attacker) && isAlive(attacker))
{
if (!isDefined(attacker.killspree))
attacker.killspree = 0;

if ( (attacker != self) && (getcvar("g_gametype") != "dm") && (attacker.team != self.team) )
attacker.killspree++;
else
if ( (attacker != self) && (getcvar("g_gametype") == "dm") )
attacker.killspree++;

if(attacker != self && isDefined(attacker.team) && isDefined(self.team) && attacker.team != self.team )
{
iprintlnbold("attacker: " + attacker.name + " has killing spree: " + attacker.killspree + " when killing: " + self.name);

switch (attacker.killspree)
{
case 1:
iprintln(attacker.name + " has 1 killing spree");
//just message();
break;
case 2:
iprintln(attacker.name + " has 2 killing spree");
//LearnSomeSimpleDeveloperLessons();
break;
case 3:
iprintln(attacker.name + " has 3 killing spree");
//Kick();
break;
case 4:
iprintln(attacker.name + " has 4 killing spree");
//GiveSex();
break;
case 5:
iprintln(attacker.name + " has 5 killing spree");
//GiveNades();
break;

default:
break;
}
}
}

}

The "running killspree" iprint is showing up in game (after every respawn as the player got killed) , but I do not get any killspree messages, nor error messages about it in the log file..

IzNoGoD
19th July 2021, 16:47
Why are you calling the killing spree code every time a player spawns? And, on a more important note, your killspree code takes 2 arguments, and you provide none.

https://i.gyazo.com/1d68f69a5cebda2863cacea46c3f190d.png

michelboonstra74
19th July 2021, 21:58
Thanks for the reply! In the Merciless mod, it was also in the 'spawnPlayer', so that's why I thought it should be done every time a player spawns.
But if i add the variables to the dm.gsc -> self thread cod2\_player::_KillSpree(attacker,killspree);
I get a script compile error: uninitialised variable 'killspree'
So I guess it needs to be initialised somewhere before? (again sorry, my knowledge about scripting is very limited)

maxdamage99
20th July 2021, 06:00
Your problem is not that you do not know how to program, but that you are chasing two rabbit (I don't know if you know such a saying :D) Why did you move the simplest code into a separate function and file? Please do as written in my post. If it works, then do whatever you want. By lumping everything together, you are expanding the places where there can be inconsistencies and errors.

P.S: my code in CodeCallBack_PlayerKilled(...) { }

michelboonstra74
22nd July 2021, 15:31
Thanks for your reply. I get the chasing rabbit analogy :-) I tried your suggestion in CodeCallBack_PlayerKilled, but then it results in a script compile error: uninitialised variable 'attacker'
I tried some different options (changing 'attacker' in 'eAttacker' ) but so far I haven't been able to get the kill spree messages..

maxdamage99
23rd July 2021, 05:18
Thanks for your reply. I get the chasing rabbit analogy :-) I tried your suggestion in CodeCallBack_PlayerKilled, but then it results in a script compile error: uninitialised variable 'attacker'
I tried some different options (changing 'attacker' in 'eAttacker' ) but so far I haven't been able to get the kill spree messages..

post full code of function "codeCallBack_PlayerKilled(...)" with first { and last }.

michelboonstra74
23rd July 2021, 07:49
CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration)

{
self endon("disconnect");
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);



if( isplayer(attacker) && isAlive(attacker))
{
if (!isDefined(attacker.killspree))
attacker.killspree = 0;

if ( (attacker != self) && (getcvar("g_gametype") != "dm") && (attacker.team != self.team) )
attacker.killspree++;
else
if ( (attacker != self) && (getcvar("g_gametype") == "dm") )
attacker.killspree++;

if(attacker != self && isDefined(attacker.team) && isDefined(self.team) && attacker.team != self.team )
{
iprintlnbold("attacker: " + attacker.name + " has killing spree: " + attacker.killspree + " when killing: " + self.name);

switch (attacker.killspree)
{
case 1:
iprintln(attacker.name + " has 1 killing spree");
//just message();
break;
case 2:
iprintln(attacker.name + " has 2 killing spree");
//LearnSomeSimpleDeveloperLessons();
break;
case 3:
iprintln(attacker.name + " has 3 killing spree");
//Kick();
break;
case 4:
iprintln(attacker.name + " has 4 killing spree");
//GiveSex();
break;
case 5:
iprintln(attacker.name + " has 5 killing spree");
//GiveNades();
break;

default:
break;
}
}
}



}

vanfreddy
24th July 2021, 15:24
attacker = eAttacker;


CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration)

{
self endon("disconnect");
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);

attacker = eAttacker;

if( isplayer(attacker) && isAlive(attacker))
{
if (!isDefined(attacker.killspree))
attacker.killspree = 0;

if ( (attacker != self) && (getcvar("g_gametype") != "dm") && (attacker.team != self.team) )
attacker.killspree++;
else
if ( (attacker != self) && (getcvar("g_gametype") == "dm") )
attacker.killspree++;

if(attacker != self && isDefined(attacker.team) && isDefined(self.team) && attacker.team != self.team )
{
iprintlnbold("attacker: " + attacker.name + " has killing spree: " + attacker.killspree + " when killing: " + self.name);

switch (attacker.killspree)
{
case 1:
iprintln(attacker.name + " has 1 killing spree");
//just message();
break;
case 2:
iprintln(attacker.name + " has 2 killing spree");
//LearnSomeSimpleDeveloperLessons();
break;
case 3:
iprintln(attacker.name + " has 3 killing spree");
//Kick();
break;
case 4:
iprintln(attacker.name + " has 4 killing spree");
//GiveSex();
break;
case 5:
iprintln(attacker.name + " has 5 killing spree");
//GiveNades();
break;

default:
break;
}
}
}



}

maxdamage99
25th July 2021, 12:06
try


CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration)
{
self endon("disconnect");

[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration); // what this?

if(isPlayer(eAttacker) && isAlive(eAttacker) && isDefined(eAttacker.team) && isDefined(self.team) && eAttacker != self)
{
if (!isDefined(eAttacker.killspree))
eAttacker.killspree = 0;

eAttacker.killspree += (eAttacker.team != self.team || getcvar("g_gametype") == "dm");

iprintlnbold("eAttacker: " + eAttacker.name + " has killing spree: " + eAttacker.killspree + " when killing: " + self.name);

switch (eAttacker.killspree)
{
case 1:
iprintln(eAttacker.name + " has 1 killing spree");
//just message();
break;
case 2:
iprintln(eAttacker.name + " has 2 killing spree");
//LearnSomeSimpleDeveloperLessons();
break;
case 3:
iprintln(eAttacker.name + " has 3 killing spree");
//Kick();
break;
case 4:
iprintln(eAttacker.name + " has 4 killing spree");
//GiveSex();
break;
case 5:
iprintln(eAttacker.name + " has 5 killing spree");
//GiveNades();
break;

default:
break;
}
}
}

IzNoGoD
25th July 2021, 15:22
You're going to need a bit of code inside the spawnplayer() too, to reset the killstreak counter upon respawn. (thats the lazy way, the better way would be to put it in playerkilled, spawnspectator and spawnintermission but i digress).

Furthermore, judging by the script you've showed, you're running it as a plugin, and only after the playerkilled callback has finished. This callback takes 2 seconds to finish, so your killstreak messages will be delayed. Probably not what you want.

vanfreddy
26th July 2021, 13:24
you can use my scrip
it supports last shoot kill,revenge kill and time based multikill (this way dont need resets )

save the following code in a file call it kspree.gsc put it in your maps/mp folder

and add this line in your Callback_PlayerKilled function in dm.gsc/ tdm.gsc (under level.mapended is a good place ):

maps\mp\gametypes\kspree::missions(self, Attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc);


missions(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc)
{
self endon("disconnected");
if(issubstr(sWeapon,"dummy")) return;
delay = 2500;
// sound = undefined;
text = undefined;
attacker.onspree = false;



if(!isdefined(attacker.spreezeit) || !isdefined(attacker.spreezeit_alt) ||!isdefined(attacker.KillsiRow))
{
attacker.spreezeit = 0;
attacker.spreezeit_alt = 0;
attacker.KillsiRow = 0;
}

if(isPlayer(attacker))
{
if(attacker != eInflictor)
{

eInflictor.lastkiller = attacker;


if(isAlive(attacker))
{


//LastShot
if(sWeapon == attacker getweaponslotweapon("primary") && attacker getweaponslotclipammo("primary") == 0 ||sWeapon == attacker getweaponslotweapon("primaryb") && attacker getweaponslotclipammo("primaryb") == 0 )
{
if(sMeansOfDeath != "MOD_PROJECTILE_SPLASH" && sMeansOfDeath != "MOD_MELEE" && sMeansOfDeath != "MOD_GRENADE_SPLASH")
{
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold("LASTSHOOT");
}
}

//Revenge
if(isdefined(attacker.lastkiller))
if(attacker.lastkiller != eInflictor)
attacker.lastkiller = undefined;
else
{
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold("REVENGE");

eInflictor iprintlnbold(" ");
eInflictor iprintlnbold(" ");
eInflictor iprintlnbold(" ");
eInflictor iprintlnbold(" ");
eInflictor iprintlnbold("REVENGE");
attacker.lastkiller = undefined;

}


//SpreeStop
if( isdefined(eInflictor.onspree) && eInflictor.onspree && isdefined(eInflictor.spreezeit_alt))
{
eInflictor.spreezeit = getTime();
if(eInflictor.spreezeit_alt + delay >= eInflictor.spreezeit)
iprintln("^2"+attacker.name +"^3 stops "+"^2"+eInflictor.name +"^3 on Killingspree ");
}


//KillSpree
attacker.KillsiRow++;
attacker.spreezeit = getTime();

switch(attacker.KillsiRow)
{
case 1:
attacker.spreezeit_alt = attacker.spreezeit;
break;
case 2:
// sound = "doublekill";
text = "DOUBLEKILL";
break;
case 3:
// sound = "multikill";
text = "MULTIKILL";
break;
case 4:
// sound = "ultrakill";
text = "ULTRAKILL";
break;
case 5:
// sound = "monsterkill";
text = "MONSTERKILL";
break;
case 6:
// sound = "godlike";
text = "GODLIKE";
break;

case 7:
attacker.spreezeit = 0;
attacker.spreezeit_alt = 0;
attacker.KillsiRow = 0;
break;

}

if( attacker.spreezeit_alt + delay > attacker.spreezeit && attacker.KillsiRow > 1)
{
attacker.onspree = true;
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold ( text );
iprintln ( attacker.name , text );
// attacker playLocalSound( sound );
attacker.spreezeit = gettime();
attacker.spreezeit_alt = attacker.spreezeit;

}
else if(attacker.spreezeit_alt + delay < attacker.spreezeit)
{
attacker.KillsiRow = 1;
attacker.spreezeit_alt = gettime();

}
}
}
}
}

i only use it in dm so if something weird going on in tdm let me know

michelboonstra74
27th July 2021, 18:22
try


CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration)
{
self endon("disconnect");

[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration); // what this?

if(isPlayer(eAttacker) && isAlive(eAttacker) && isDefined(eAttacker.team) && isDefined(self.team) && eAttacker != self)
{
if (!isDefined(eAttacker.killspree))
eAttacker.killspree = 0;

eAttacker.killspree += (eAttacker.team != self.team || getcvar("g_gametype") == "dm");

iprintlnbold("eAttacker: " + eAttacker.name + " has killing spree: " + eAttacker.killspree + " when killing: " + self.name);

switch (eAttacker.killspree)
{
case 1:
iprintln(eAttacker.name + " has 1 killing spree");
//just message();
break;
case 2:
iprintln(eAttacker.name + " has 2 killing spree");
//LearnSomeSimpleDeveloperLessons();
break;
case 3:
iprintln(eAttacker.name + " has 3 killing spree");
//Kick();
break;
case 4:
iprintln(eAttacker.name + " has 4 killing spree");
//GiveSex();
break;
case 5:
iprintln(eAttacker.name + " has 5 killing spree");
//GiveNades();
break;

default:
break;
}
}
}


Thank your for your reply. However, I still don't get kill spree messages.. it seems to ignore the script, I also don't get any error messages about it..

michelboonstra74
27th July 2021, 18:24
you can use my scrip
it supports last shoot kill,revenge kill and time based multikill (this way dont need resets )

save the following code in a file call it kspree.gsc put it in your maps/mp folder

and add this line in your Callback_PlayerKilled function in dm.gsc/ tdm.gsc (under level.mapended is a good place ):

maps\mp\gametypes\kspree::missions(self, Attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc);


missions(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc)
{
self endon("disconnected");
if(issubstr(sWeapon,"dummy")) return;
delay = 2500;
// sound = undefined;
text = undefined;
attacker.onspree = false;



if(!isdefined(attacker.spreezeit) || !isdefined(attacker.spreezeit_alt) ||!isdefined(attacker.KillsiRow))
{
attacker.spreezeit = 0;
attacker.spreezeit_alt = 0;
attacker.KillsiRow = 0;
}

if(isPlayer(attacker))
{
if(attacker != eInflictor)
{

eInflictor.lastkiller = attacker;


if(isAlive(attacker))
{


//LastShot
if(sWeapon == attacker getweaponslotweapon("primary") && attacker getweaponslotclipammo("primary") == 0 ||sWeapon == attacker getweaponslotweapon("primaryb") && attacker getweaponslotclipammo("primaryb") == 0 )
{
if(sMeansOfDeath != "MOD_PROJECTILE_SPLASH" && sMeansOfDeath != "MOD_MELEE" && sMeansOfDeath != "MOD_GRENADE_SPLASH")
{
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold("LASTSHOOT");
}
}

//Revenge
if(isdefined(attacker.lastkiller))
if(attacker.lastkiller != eInflictor)
attacker.lastkiller = undefined;
else
{
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold("REVENGE");

eInflictor iprintlnbold(" ");
eInflictor iprintlnbold(" ");
eInflictor iprintlnbold(" ");
eInflictor iprintlnbold(" ");
eInflictor iprintlnbold("REVENGE");
attacker.lastkiller = undefined;

}


//SpreeStop
if( isdefined(eInflictor.onspree) && eInflictor.onspree && isdefined(eInflictor.spreezeit_alt))
{
eInflictor.spreezeit = getTime();
if(eInflictor.spreezeit_alt + delay >= eInflictor.spreezeit)
iprintln("^2"+attacker.name +"^3 stops "+"^2"+eInflictor.name +"^3 on Killingspree ");
}


//KillSpree
attacker.KillsiRow++;
attacker.spreezeit = getTime();

switch(attacker.KillsiRow)
{
case 1:
attacker.spreezeit_alt = attacker.spreezeit;
break;
case 2:
// sound = "doublekill";
text = "DOUBLEKILL";
break;
case 3:
// sound = "multikill";
text = "MULTIKILL";
break;
case 4:
// sound = "ultrakill";
text = "ULTRAKILL";
break;
case 5:
// sound = "monsterkill";
text = "MONSTERKILL";
break;
case 6:
// sound = "godlike";
text = "GODLIKE";
break;

case 7:
attacker.spreezeit = 0;
attacker.spreezeit_alt = 0;
attacker.KillsiRow = 0;
break;

}

if( attacker.spreezeit_alt + delay > attacker.spreezeit && attacker.KillsiRow > 1)
{
attacker.onspree = true;
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold(" ");
attacker iprintlnbold ( text );
iprintln ( attacker.name , text );
// attacker playLocalSound( sound );
attacker.spreezeit = gettime();
attacker.spreezeit_alt = attacker.spreezeit;

}
else if(attacker.spreezeit_alt + delay < attacker.spreezeit)
{
attacker.KillsiRow = 1;
attacker.spreezeit_alt = gettime();

}
}
}
}
}

i only use it in dm so if something weird going on in tdm let me know

Thanks! I'll give it a try and let you know if it works with my config.

IzNoGoD
27th July 2021, 18:30
@michelboonstra see your pm inbox.

michelboonstra74
28th July 2021, 05:58
Thanks so much!, vanfreddy! Your script works like a charm, also in TDM - and even with bots. And my players love it, cheers!

maxdamage99
29th July 2021, 07:30
problem is in you, the only reason why the code below worked is because you were told a specific file where to add, most likely they prev code were just added to the wrong file

michelboonstra74
29th July 2021, 12:07
I agree that the error could very well be me ;) though I tried many ways to get it working, like different locations in the dm.gsc - and/or _callbacksetup.gsc. I have been able to get other things working - like getting a player to drop their gun, when hit in the arm - for example. But again, this scripting business is not something I know much about, just by trial and error I usually get it working somehow.
Anyway, I am very thankful for the help you guys gave me on this one!