UTIL HudMessage: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{ | {{DISPLAYTITLE:UTIL_HudMessage}} | ||
'''UTIL_HudMessage''' is a [[UTIL]] provided to send a message to a specific player. It is only used for [[debugging]] purposes. | '''UTIL_HudMessage''' is a [[UTIL]] provided to send a message to a specific player. It is only used for [[debugging]] purposes. | ||
Revision as of 00:28, 5 December 2011
UTIL_HudMessage is a UTIL provided to send a message to a specific player. It is only used for debugging purposes.
See Also: UTIL_HudMessageAll
Usage
//-----------------------------------------------------------------------------
// Purpose: Calls UTIL_HudMessage for every player
// Input : pToPlayer - CBasePlayer that will be used as a filter for CRecipientFilter.
// Input : hudtextparmas_t - Text Parameters, size, location, color, etc.
// Input : pMessage - Message to send
// Output :
//-----------------------------------------------------------------------------
void UTIL_HudMessage( CBasePlayer *pToPlayer, const hudtextparms_t &textparms, const char *pMessage )
Examples
// If we're in singleplayer, show the message to the player.
if ( gpGlobals->maxClients == 1 )
{
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
UTIL_HudMessage( pPlayer, m_textParms, MessageGet() );
}
//Show the message to the player that triggered us.
else if ( pActivator && pActivator->IsNetClient() )
{
UTIL_HudMessage( ToBasePlayer( pActivator ), m_textParms, MessageGet() );
}