Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: COD2 MP: adding killing spree messages

  1. #1
    Private
    Join Date
    Mar 2021
    Location
    Netherlands
    Posts
    13
    Thanks
    4
    Thanked 1 Time in 1 Post

    COD2 MP: adding killing spree messages

    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.

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Be more specific how you add it to teams.gsc.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. #3
    Private
    Join Date
    Mar 2021
    Location
    Netherlands
    Posts
    13
    Thanks
    4
    Thanked 1 Time in 1 Post
    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)

  4. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by michelboonstra74 View Post
    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?
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  5. #5
    Private
    Join Date
    Mar 2021
    Location
    Netherlands
    Posts
    13
    Thanks
    4
    Thanked 1 Time in 1 Post
    Thanks for the reply. Clearly I have little knowledge of scripting.. 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.

  6. #6
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by michelboonstra74 View Post
    Thanks for the reply. Clearly I have little knowledge of scripting.. 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.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  7. #7
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    try
    PHP Code:
    if( isplayer(attacker) && isAlive(attacker))
    {
        if (!
    isDefined(attacker.killspree))
            
    attacker.killspree 0;
        
        if ( (
    attacker != self) && (getcvar("g_gametype") != "dm") && (attacker.team != self.team) )
          &nb