Results 1 to 10 of 24

Thread: COD2 MP: adding killing spree messages

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    try
    PHP Code:
    CodeCallback_PlayerKilled(eInflictoreAttackeriDamagesMeansOfDeathsWeaponvDirsHitLoctimeOffsetdeathAnimDuration)
    {
        
    self endon("disconnect");
        
        [[
    level.callbackPlayerKilled]](eInflictoreAttackeriDamagesMeansOfDeathsWeaponvDirsHitLoctimeOffsetdeathAnimDuration); // 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;
            }
        }

    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  2. The Following User Says Thank You to maxdamage99 For This Useful Post:

    michelboonstra74 (27th July 2021)

  3. #2
    Private
    Join Date
    Mar 2021
    Location
    Netherlands
    Posts
    13
    Thanks
    4
    Thanked 1 Time in 1 Post
    Quote Originally Posted by maxdamage99 View Post
    try
    PHP Code:
    CodeCallback_PlayerKilled(eInflictoreAttackeriDamagesMeansOfDeathsWeaponvDirsHitLoctimeOffsetdeathAnimDuration)
    {
        
    self endon("disconnect");
        
        [[
    level.callbackPlayerKilled]](eInflictoreAttackeriDamagesMeansOfDeathsWeaponvDirsHitLoctimeOffsetdeathAnimDuration); // 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..

  4. #3
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    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
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •