[Support] can't get last cooldown to work in game?
-
I have a working last cooldown if needed
-
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; } }
-
@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
-
Matrix ahaha yessir it does look familiar doesnt it
-
@MrDucxy still doesn't work. should i be calling it through onplayerspawned still?
-
you call the thread when they do damage
-
treyful call it through onplayerconnect
-
This post is deleted!
-
This post is deleted!
-
treyful did you ever get it to work. I'm struggling...
-
This post is deleted!
-
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" ); } }