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!


PHP Code:
    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 == || 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 == || 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 && 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.