本文整理汇总了C++中C_TFPlayer::EmitSound方法的典型用法代码示例。如果您正苦于以下问题:C++ C_TFPlayer::EmitSound方法的具体用法?C++ C_TFPlayer::EmitSound怎么用?C++ C_TFPlayer::EmitSound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_TFPlayer
的用法示例。
在下文中一共展示了C_TFPlayer::EmitSound方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendDestroyMessage
bool CHudMenuEngyBuild::SendDestroyMessage( int iSlot )
{
C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer();
if ( !pLocalPlayer )
return false;
bool bSuccess = false;
int iBuilding = GetBuildingIDFromSlot( iSlot );
C_BaseObject *pObj = pLocalPlayer->GetObjectOfType( iBuilding );
if ( pObj != NULL )
{
char szCmd[128];
Q_snprintf( szCmd, sizeof(szCmd), "destroy %d", iBuilding );
engine->ClientCmd( szCmd );
bSuccess = true;
}
else
{
pLocalPlayer->EmitSound( "Player.DenyWeaponSelection" );
}
return bSuccess;
}
示例2: OnTick
void CHudBuildingStatusContainer::OnTick( void )
{
if ( m_AlertLevel >= BUILDING_HUD_ALERT_VERY_LOW_AMMO &&
gpGlobals->curtime >= m_flNextBeep &&
m_iNumBeepsToBeep > 0 )
{
C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer();
if ( !pLocalPlayer )
return;
pLocalPlayer->EmitSound( "Hud.Warning" );
switch( m_AlertLevel )
{
case BUILDING_HUD_ALERT_VERY_LOW_AMMO:
case BUILDING_HUD_ALERT_VERY_LOW_HEALTH:
m_flNextBeep = gpGlobals->curtime + 2.0f;
m_iNumBeepsToBeep--;
break;
case BUILDING_HUD_ALERT_SAPPER:
m_flNextBeep = gpGlobals->curtime + 1.0f;
// don't decrement beeps, we want them to go on forever
break;
}
}
}
示例3: SendBuildMessage
void CHudMenuEngyBuild::SendBuildMessage( int iSlot )
{
C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer();
if ( !pLocalPlayer )
return;
int iBuilding = GetBuildingIDFromSlot( iSlot );
C_BaseObject *pObj = pLocalPlayer->GetObjectOfType( iBuilding );
int iCost = GetObjectInfo( iBuilding )->m_Cost;
if ( pObj == NULL && pLocalPlayer->GetAmmoCount( TF_AMMO_METAL ) >= iCost )
{
char szCmd[128];
Q_snprintf( szCmd, sizeof(szCmd), "build %d", iBuilding );
engine->ClientCmd( szCmd );
}
else
{
pLocalPlayer->EmitSound( "Player.DenyWeaponSelection" );
}
}