daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void CWeaponLavaGun::ToggleSpray(bool bState)
  2. {
  3.     if( bState )
  4.     {
  5.         if (!pParticle)
  6.         {
  7.             pParticle = (CParticleSystem *)CreateEntityByName("info_particle_system");
  8.             if (!pParticle)
  9.             {
  10.                 CBaseAnimating *pViewmodel = ToBasePlayer(GetOwner())->GetViewModel();
  11.  
  12.                 Vector vOrigin;
  13.                 QAngle vAngle;
  14.  
  15.                 pViewmodel->GetAttachment(0, vOrigin, vAngle);
  16.                 pParticle->SetAbsOrigin(vOrigin);
  17.                 pParticle->SetAbsAngles(vAngle);
  18.  
  19.                 pParticle->KeyValue("start_active", "1");
  20.                 pParticle->KeyValue("effect_name", "lava_spray");
  21.  
  22.                 DispatchSpawn(pParticle);
  23.                 pParticle->Activate();
  24.                 pParticle->SetParent(pViewmodel, 0);
  25.             }
  26.             DevMsg("weapon_lavagun: On!\n");
  27.         }
  28.     }
  29.     else
  30.     {
  31.         UTIL_Remove(pParticle);
  32.         pParticle = NULL;
  33.         DevMsg("weapon_lavagun: Off!\n");
  34.     }
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top