Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CWeaponLavaGun::Equip(CBaseCombatCharacter *pOwner)
- {
- BaseClass::Equip(pOwner);
- pParticle = (CParticleSystem *)CreateEntityByName("info_particle_system");
- pParticle->SetAbsOrigin(pOwner->Weapon_ShootPosition());
- pParticle->SetAbsAngles(pOwner->GetAbsAngles());
- // pParticle->KeyValue("start_active", "0");
- pParticle->KeyValue("effect_name", PARTICLE_NAME);
- pParticle->Spawn();
- pParticle->StopParticleSystem();
- }
- void CWeaponLavaGun::ToggleSpray(bool bState)
- {
- if (bState)
- {
- pParticle->StartParticleSystem();
- DevMsg("weapon_lavagun: On!\n");
- SendWeaponAnim(ACT_VM_PULLBACK);
- /*if (!pParticle)
- {
- pParticle = (CParticleSystem *)CreateEntityByName("info_particle_system");
- if (pParticle)
- {
- // CBaseAnimating *pViewmodel = ToBasePlayer(GetOwner())->GetViewModel();
- // Vector vOrigin;
- // QAngle vAngle;
- // pViewmodel->GetAttachment(0, vOrigin, vAngle);
- // vOrigin.z += 64.0f;
- CBasePlayer *pPlayer = ToBasePlayer(GetOwner());
- //pParticle->SetAbsOrigin(pPlayer->Weapon_ShootPosition());
- Vector vecForward;
- pPlayer->EyeVectors(&vecForward, NULL, NULL);
- Vector vecFinalPos = pPlayer->EyePosition() + vecForward * 64.0f;
- pParticle->SetAbsOrigin(vecFinalPos);
- pParticle->SetAbsAngles(pPlayer->GetAbsAngles());
- pParticle->KeyValue("start_active", "1");
- pParticle->KeyValue("effect_name", PARTICLE_NAME);
- DispatchSpawn(pParticle);
- // pParticle->SetParent(pPlayer);
- SendWeaponAnim(ACT_VM_PULLBACK);
- DevMsg("weapon_lavagun: On!\n");
- }
- }*/
- }
- else
- {
- pParticle->StopParticleSystem();
- DevMsg("weapon_lavagun: On!\n");
- SendWeaponAnim(ACT_VM_IDLE);
- m_flLastFireTime = gpGlobals->curtime;
- /*if (pParticle)
- {
- UTIL_Remove(pParticle);
- pParticle = NULL;
- SendWeaponAnim(ACT_VM_IDLE);
- DevMsg("weapon_lavagun: Off!\n");
- m_flLastFireTime = gpGlobals->curtime;
- }*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement