mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-13 04:09:09 +00:00
add csrike source code
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#include "cbase.h"
|
||||
#include "items.h"
|
||||
#include "cs_player.h"
|
||||
|
||||
|
||||
class CItemAssaultSuit : public CItem
|
||||
{
|
||||
void Spawn( void )
|
||||
{
|
||||
Precache( );
|
||||
CItem::Spawn( );
|
||||
}
|
||||
|
||||
void Precache( void )
|
||||
{
|
||||
PrecacheScriptSound( "BaseCombatCharacter.ItemPickup2" );
|
||||
}
|
||||
|
||||
bool MyTouch( CBasePlayer *pBasePlayer )
|
||||
{
|
||||
CCSPlayer *pPlayer = dynamic_cast< CCSPlayer* >( pBasePlayer );
|
||||
if ( !pPlayer )
|
||||
{
|
||||
Assert( false );
|
||||
return false;
|
||||
}
|
||||
|
||||
pPlayer->m_bHasHelmet = true;
|
||||
pPlayer->SetArmorValue( 100 );
|
||||
|
||||
if ( pPlayer->IsDead() == false )
|
||||
{
|
||||
CPASAttenuationFilter filter( pBasePlayer );
|
||||
EmitSound( filter, entindex(), "BaseCombatCharacter.ItemPickup2" );
|
||||
|
||||
CSingleUserRecipientFilter user( pPlayer );
|
||||
UserMessageBegin( user, "ItemPickup" );
|
||||
WRITE_STRING( "item_assaultsuit" );
|
||||
MessageEnd();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS( item_assaultsuit, CItemAssaultSuit );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user