|
|
|
@ -70,6 +70,9 @@ void CWorldItem::Spawn( void )
@@ -70,6 +70,9 @@ void CWorldItem::Spawn( void )
|
|
|
|
|
case 45: // ITEM_SUIT:
|
|
|
|
|
pEntity = CBaseEntity::Create( "item_suit", pev->origin, pev->angles ); |
|
|
|
|
break; |
|
|
|
|
case 46: // ITEM_FLASHLIGHT:
|
|
|
|
|
pEntity = CBaseEntity::Create( "item_flashlight", pev->origin, pev->angles ); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if( !pEntity ) |
|
|
|
@ -366,6 +369,33 @@ class CItemSecurity : public CItem
@@ -366,6 +369,33 @@ class CItemSecurity : public CItem
|
|
|
|
|
|
|
|
|
|
LINK_ENTITY_TO_CLASS( item_security, CItemSecurity ) |
|
|
|
|
|
|
|
|
|
class CItemFlashlight : public CItem |
|
|
|
|
{ |
|
|
|
|
void Spawn( void ) |
|
|
|
|
{ |
|
|
|
|
Precache(); |
|
|
|
|
SET_MODEL( ENT( pev ), "models/w_flashlight.mdl" ); |
|
|
|
|
CItem::Spawn(); |
|
|
|
|
} |
|
|
|
|
void Precache( void ) |
|
|
|
|
{ |
|
|
|
|
PRECACHE_MODEL( "models/w_flashlight.mdl" ); |
|
|
|
|
PRECACHE_SOUND( "items/gunpickup2.wav" ); |
|
|
|
|
} |
|
|
|
|
BOOL MyTouch( CBasePlayer *pPlayer ) |
|
|
|
|
{ |
|
|
|
|
if( pPlayer->pev->weapons & ( 1 << WEAPON_FLASHLIGHT ) ) |
|
|
|
|
return FALSE; |
|
|
|
|
|
|
|
|
|
EMIT_SOUND( pPlayer->edict(), CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM ); |
|
|
|
|
|
|
|
|
|
pPlayer->pev->weapons |= ( 1 << WEAPON_FLASHLIGHT ); |
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
LINK_ENTITY_TO_CLASS( item_flashlight, CItemFlashlight ) |
|
|
|
|
|
|
|
|
|
class CItemLongJump : public CItem |
|
|
|
|
{ |
|
|
|
|
void Spawn( void ) |
|
|
|
|