Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CWeaponLavaGun::ToggleSpray(bool bState)
- {
- if( bState )
- {
- if (!pParticle)
- {
- pParticle = (CParticleSystem *)CreateEntityByName("info_particle_system");
- if (!pParticle)
- {
- CBaseAnimating *pViewmodel = ToBasePlayer(GetOwner())->GetViewModel();
- Vector vOrigin;
- QAngle vAngle;
- pViewmodel->GetAttachment(0, vOrigin, vAngle);
- pParticle->SetAbsOrigin(vOrigin);
- pParticle->SetAbsAngles(vAngle);
- pParticle->KeyValue("start_active", "1");
- pParticle->KeyValue("effect_name", "lava_spray");
- DispatchSpawn(pParticle);
- pParticle->Activate();
- pParticle->SetParent(pViewmodel, 0);
- }
- DevMsg("weapon_lavagun: On!\n");
- }
- }
- else
- {
- UTIL_Remove(pParticle);
- pParticle = NULL;
- DevMsg("weapon_lavagun: Off!\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement