Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Support] can't get last cooldown to work in game?

[Support] can't get last cooldown to work in game?

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
gscblack ops 2
17 Posts 7 Posters 533 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Jaxundefined Offline
    Jaxundefined Offline
    Jax Contributor
    wrote on last edited by
    #5

    the last cool down thread

    1 Reply Last reply
    0
    • Ducxyundefined Offline
      Ducxyundefined Offline
      Ducxy
      wrote on last edited by
      #6

      I have a working last cooldown if needed

      1 Reply Last reply
      0
      • Ducxyundefined Offline
        Ducxyundefined Offline
        Ducxy
        wrote on last edited by
        #7
        onLastReached() {
            self endon( "disconnect" );
            self endon( "cooldownSet" );
           
            self.lastCooldown = true;
               
            for(;;) {
                if( self.lastCooldown && ((level.scorelimit - self.pers["kills"]) == 1) ) {
                    self.lastCooldown = false;
                    self freezeControls( true );
                    self enableInvulnerability();
                    self iPrintlnBold("^4YOU'RE ON LAST!");
                    wait 1.25;
                    self freezeControls( false );
                    self disableInvulnerability();
                    self notify( "cooldownSet" );
                }
               
                wait 0.25;
            }
        }
        
        Matrixundefined treyfulundefined 2 Replies Last reply
        0
        • Matrixundefined Offline
          Matrixundefined Offline
          Matrix Plutonium Staff
          replied to Ducxy on last edited by
          #8

          @MrDucxy said in can't get last cooldown to work in game?:

          onLastReached() {
              self endon( "disconnect" );
              self endon( "cooldownSet" );
             
              self.lastCooldown = true;
                 
              for(;;) {
                  if( self.lastCooldown && ((level.scorelimit - self.pers["kills"]) == 1) ) {
                      self.lastCooldown = false;
                      self freezeControls( true );
                      self enableInvulnerability();
                      self iPrintlnBold("^4YOU'RE ON LAST!");
                      wait 1.25;
                      self freezeControls( false );
                      self disableInvulnerability();
                      self notify( "cooldownSet" );
                  }
                 
                  wait 0.25;
              }
          }
          

          looks familiar 😛

          Ducxyundefined 1 Reply Last reply
          0
          • Ducxyundefined Offline
            Ducxyundefined Offline
            Ducxy
            replied to Matrix on last edited by
            #9

            Matrix ahaha 😛 yessir it does look familiar doesnt it

            1 Reply Last reply
            0
            • treyfulundefined Offline
              treyfulundefined Offline
              treyful
              replied to Ducxy on last edited by
              #10

              @MrDucxy still doesn't work. should i be calling it through onplayerspawned still?

              Jaxundefined Ducxyundefined 2 Replies Last reply
              0
              • Jaxundefined Offline
                Jaxundefined Offline
                Jax Contributor
                replied to treyful on last edited by
                #11

                treyful

                you call the thread when they do damage

                1 Reply Last reply
                0
                • Ducxyundefined Offline
                  Ducxyundefined Offline
                  Ducxy
                  replied to treyful on last edited by Ducxy
                  #12

                  treyful call it through onplayerconnect

                  1 Reply Last reply
                  0
                  • mikzyundefined Offline
                    mikzyundefined Offline
                    mikzy Banned
                    replied to Jax on last edited by
                    #13
                    This post is deleted!
                    1 Reply Last reply
                    0
                    • mikzyundefined Offline
                      mikzyundefined Offline
                      mikzy Banned
                      wrote on last edited by mikzy
                      #14
                      This post is deleted!
                      1 Reply Last reply
                      0
                      • Zedkaysundefined Offline
                        Zedkaysundefined Offline
                        Zedkays
                        replied to treyful on last edited by
                        #15

                        treyful did you ever get it to work. I'm struggling...

                        mikzyundefined 2 Replies Last reply
                        0
                        • mikzyundefined Offline
                          mikzyundefined Offline
                          mikzy Banned
                          replied to Zedkays on last edited by
                          #16
                          This post is deleted!
                          1 Reply Last reply
                          0
                          • mikzyundefined Offline
                            mikzyundefined Offline
                            mikzy Banned
                            replied to Zedkays on last edited by mikzy
                            #17

                            Zedkays Dont mind messy code but here's how you would do barrel stuff protection, snipers only, and Last Cooldown.

                            On your init, put level.onPlayerDamage = ::onPlayerDamage;

                            Then, somewhere in your script, put this.

                            onplayerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime )
                            {
                            	weaponClass = self getWeaponClass( sweapon );
                            	if(weaponClass == "weapon_sniper")
                            	{
                            		if((int(distance(self.origin, eattacker.origin)*0.0254) < 20 ) && eattacker.pers["kills"] == 9 ) // barrel stuff protection
                            		{
                            			iDamage = 0; // barrel stuff protection ON and last = true
                            		}
                            		else
                            		{
                            			self.health = 1;
                            			
                            			/* ^^ It's a Barrel Stuff but since Person isn't on last,
                            			we are going to make the Victim's health still 1 so they
                            			can get to last. */
                            			
                            			if (smeansofdeath != "MOD_SUICIDE" && smeansofdeath != "MOD_TRIGGER_HURT" && ((level.scorelimit - eattacker.pers["kills"]) == 2) )
                            			{
                            				eattacker thread onLastReached();
                            			}
                            			
                            			/* ^^ If Suicide or Trigger_Hurt, the Last Reached thread
                            			will not be called. But, if not Suicide or Trigger_Hurt and
                            			Person is 1 kill away from last, lets thread the onlastreach
                            			(Last Cooldown) to let them know they are at last. */
                            			
                            		}
                            	}
                            	return iDamage;
                            }
                            
                            onLastReached() 
                            {
                                self endon( "disconnect" );
                                self endon( "cooldownSet" );
                                   
                                for(;;) 
                            	{
                            	self freezeControls( true );
                            	self iprintlnbold("Last ^2Cooldown");
                                    wait 1.5;
                                    self freezeControls( false );
                                    self notify( "cooldownSet" );
                            	}
                            }
                            
                            1 Reply Last reply
                            0

                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Donate