UTIL_HudHintText

From Valve Developer Community
Jump to: navigation, search

UTIL_HudHintText is a UTIL provided to trigger Instructional hud-hints.

Usage

//-----------------------------------------------------------------------------
// Purpose: Display instructional hud-hints to the specified entity (player)
// Input  : *pEntity - Entity to tell to send the hud-hint to
// Input  : pMessage - HudHint message to Send
// Output : 
//-----------------------------------------------------------------------------
void UTIL_HudHintText( CBaseEntity *pEntity, const char *pMessage )

Examples

//-----------------------------------------------------------------------------
// Purpose: Show people how to drive!
//-----------------------------------------------------------------------------
void CPropJeep::InputShowHudHint( inputdata_t &inputdata )
{
	CBaseServerVehicle *pServerVehicle = dynamic_cast<CBaseServerVehicle *>(GetServerVehicle());
	if ( pServerVehicle )
	{
		if( pServerVehicle->GetPassenger( VEHICLE_ROLE_DRIVER ) )
		{
			UTIL_HudHintText( m_hPlayer, "#Valve_Hint_JeepKeys" );
			m_iNumberOfEntries++;
		}
	}
}
// The first few time we get into the airboat, print the airboat help
if ( m_iNumberOfEntries < hud_airboathint_numentries.GetInt() && !m_bExitAnimOn )
{
	UTIL_HudHintText( m_hPlayer, "#Valve_Hint_BoatKeys" );
	m_iNumberOfEntries++;
}