Difference between revisions of "UTIL HudHintText"

From Valve Developer Community
Jump to: navigation, search
(Created Page)
 
m (Examples: Jeeps are not Airboats valve, don't copy/paste the comment and not fix it!)
Line 34: Line 34:
  
 
<source lang=cpp>
 
<source lang=cpp>
// The first few time we get into the jeep, print the jeep help
+
// The first few time we get into the airboat, print the airboat help
 
if ( m_iNumberOfEntries < hud_airboathint_numentries.GetInt() && !m_bExitAnimOn )
 
if ( m_iNumberOfEntries < hud_airboathint_numentries.GetInt() && !m_bExitAnimOn )
 
{
 
{

Revision as of 21:10, 10 April 2011

Template:Wrongtitle UTIL_ScreenFade 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++;
}