Created 13 years ago2011-09-03 21:33:51 UTC by gameaddict117o7
PRECACHE_MODEL("models/v_crowbar.mdl");
PRECACHE_MODEL("models/w_crowbar.mdl");
PRECACHE_MODEL("models/p_crowbar.mdl");
PRECACHE_SOUND("weapons/cbar_hit1.wav");
PRECACHE_SOUND("weapons/cbar_hit2.wav");
PRECACHE_SOUND("weapons/cbar_hitbod1.wav");
PRECACHE_SOUND("weapons/cbar_hitbod2.wav");
PRECACHE_SOUND("weapons/cbar_hitbod3.wav");
PRECACHE_SOUND("weapons/cbar_miss.wav");
PRECACHE_SOUND("weapons/cbar_miss2.wav");
PRECACHE_SOUND("weapons/cbar_miss3.wav");
[b]PRECACHE_SOUND("weapons/cbar_miss.wav");
PRECACHE_SOUND("weapons/cbar_miss2.wav");
PRECACHE_SOUND("weapons/cbar_miss3.wav");[/b]
void CCrowbar::PrimaryAttack()if (! Swing( 1 ))
{
SetThink( &CCrowbar::SwingAgain );
pev->nextthink = gpGlobals->time + 0.1;
[b]// play whoosh sound
switch( RANDOM_LONG(0,2) )
{
case 0:
EMIT_SOUND(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/cbar_miss.wav", 1, ATTN_NORM); break;
case 1:
EMIT_SOUND(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/cbar_miss2.wav", 1, ATTN_NORM); break;
case 2:
EMIT_SOUND(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/cbar_miss3.wav", 1, ATTN_NORM); break;
}
}
}[/b]