Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement