SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void CWeaponLavaGun::Equip(CBaseCombatCharacter *pOwner)
  2. {
  3.     BaseClass::Equip(pOwner);
  4.     pParticle = (CParticleSystem *)CreateEntityByName("info_particle_system");
  5.  
  6.     pParticle->SetAbsOrigin(pOwner->Weapon_ShootPosition());
  7.     pParticle->SetAbsAngles(pOwner->GetAbsAngles());
  8.  
  9. //  pParticle->KeyValue("start_active", "0");
  10.     pParticle->KeyValue("effect_name", PARTICLE_NAME);
  11.  
  12.     pParticle->Spawn();
  13.  
  14.     pParticle->StopParticleSystem();
  15. }
  16.  
  17. void CWeaponLavaGun::ToggleSpray(bool bState)
  18. {
  19.     if (bState)
  20.     {
  21.         pParticle->StartParticleSystem();
  22.         DevMsg("weapon_lavagun: On!\n");
  23.         SendWeaponAnim(ACT_VM_PULLBACK);
  24.         /*if (!pParticle)
  25.         {
  26.             pParticle = (CParticleSystem *)CreateEntityByName("info_particle_system");
  27.             if (pParticle)
  28.             {
  29.             //  CBaseAnimating *pViewmodel = ToBasePlayer(GetOwner())->GetViewModel();
  30.  
  31.             //  Vector vOrigin;
  32.             //  QAngle vAngle;
  33.  
  34.  
  35.             //  pViewmodel->GetAttachment(0, vOrigin, vAngle);
  36.             //  vOrigin.z += 64.0f;
  37.                 CBasePlayer *pPlayer = ToBasePlayer(GetOwner());
  38.  
  39.                 //pParticle->SetAbsOrigin(pPlayer->Weapon_ShootPosition());
  40.                 Vector vecForward;
  41.                 pPlayer->EyeVectors(&vecForward, NULL, NULL);
  42.                 Vector vecFinalPos = pPlayer->EyePosition() + vecForward * 64.0f;
  43.                 pParticle->SetAbsOrigin(vecFinalPos);
  44.                 pParticle->SetAbsAngles(pPlayer->GetAbsAngles());
  45.  
  46.                 pParticle->KeyValue("start_active", "1");
  47.                 pParticle->KeyValue("effect_name", PARTICLE_NAME);
  48.  
  49.                 DispatchSpawn(pParticle);
  50.             //  pParticle->SetParent(pPlayer);
  51.                 SendWeaponAnim(ACT_VM_PULLBACK);
  52.                 DevMsg("weapon_lavagun: On!\n");
  53.             }
  54.         }*/
  55.     }
  56.     else
  57.     {
  58.         pParticle->StopParticleSystem();
  59.         DevMsg("weapon_lavagun: On!\n");
  60.         SendWeaponAnim(ACT_VM_IDLE);
  61.         m_flLastFireTime = gpGlobals->curtime;
  62.         /*if (pParticle)
  63.         {
  64.             UTIL_Remove(pParticle);
  65.             pParticle = NULL;
  66.             SendWeaponAnim(ACT_VM_IDLE);
  67.             DevMsg("weapon_lavagun: Off!\n");
  68.  
  69.             m_flLastFireTime = gpGlobals->curtime;
  70.         }*/
  71.     }
  72. }
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