void CGameText::Display( CBaseEntity *pActivator )
{
	if ( !CanFireForActivator( pActivator ) )
		return;

	char fontbuf[48];
	FontGet(fontbuf);

	if ( MessageToAll() )
	{
		UTIL_HudMessageAll( m_textParms, MessageGet(), fontbuf );
	}
	else
	{
		// 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(), fontbuf );
		}
		// Otherwise show the message to the player that triggered us.
		else if ( pActivator && pActivator->IsNetClient() )
		{
			UTIL_HudMessage( ToBasePlayer( pActivator ), m_textParms, MessageGet(), fontbuf );
		}
	}
}
Exemple #2
0
void CGameText::Display( CBaseEntity *pActivator )
{
	if ( !CanFireForActivator( pActivator ) )
		return;

	#ifdef SecobMod__Enable_Fixed_Multiplayer_AI
		// also send to all if we haven't got a specific activator player to send to 
		if ( MessageToAll() || !pActivator || !pActivator->IsPlayer() ) 
	#else
		if ( MessageToAll() )
	#endif //SecobMod__Enable_Fixed_Multiplayer_AI

	if ( MessageToAll() )
	{
		UTIL_HudMessageAll( m_textParms, MessageGet() );
	}
	else
	{
	#ifdef SecobMod__Enable_Fixed_Multiplayer_AI
			UTIL_HudMessage( ToBasePlayer( pActivator ), m_textParms, MessageGet() );
	#else
	// 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() );
			}
			// Otherwise show the message to the player that triggered us.
			else if ( pActivator && pActivator->IsNetClient() )
			{
				UTIL_HudMessage( ToBasePlayer( pActivator ), m_textParms, MessageGet() );
			}
	#endif //SecobMod__Enable_Fixed_Multiplayer_AI
	}
}
Exemple #3
0
void UTIL_HudMessageAll( const hudtextparms_t &textparms, const char *pMessage )
{
	int			i;

	for ( i = 1; i <= gpGlobals->maxClients; i++ )
	{
		CBaseEntity *pPlayer = UTIL_PlayerByIndex( i );
		if ( pPlayer )
			UTIL_HudMessage( pPlayer, textparms, pMessage );
	}
}
Exemple #4
0
void CGameText::Display( CBaseEntity *pActivator )
{
	if ( !CanFireForActivator( pActivator ) )
		return;

	// also send to all if we haven't got a specific activator player to send to
	if ( MessageToAll() || !pActivator || !pActivator->IsPlayer() )
		UTIL_HudMessageAll( m_textParms, MessageGet() );
	else
		UTIL_HudMessage( ToBasePlayer( pActivator ), m_textParms, MessageGet() );
}
void CGameText::Display( CBaseEntity *pActivator )
{
	if ( !CanFireForActivator( pActivator ) )
		return;

	if (MessageToAll() || !pActivator || !pActivator->IsPlayer())
	{
		UTIL_HudMessageAll( m_textParms, MessageGet() );
	}
	else
	{
		UTIL_HudMessage(ToBasePlayer(pActivator), m_textParms, MessageGet());
	}
}
Exemple #6
0
void CGameText::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
	if (!CanFireForActivator(pActivator))
		return;

	if (MessageToAll())
	{
		UTIL_HudMessageAll(m_textParms, MessageGet());
	}
	else
	{
		if (pActivator->IsNetClient())
		{
			UTIL_HudMessage(pActivator, m_textParms, MessageGet());
		}
	}
}
Exemple #7
0
// Print a center-message, with text parameters and varargs.  Provides
// functionality to the above center_say interfaces.
void mutil_CenterSayVarargs(plid_t plid, hudtextparms_t tparms, 
		const char *fmt, va_list ap) 
{
	char buf[MAX_LOGMSG_LEN];
	int n;
	edict_t *pEntity;
	CBaseEntity *pPlayer;

	vsnprintf(buf, sizeof(buf), fmt, ap);

	mutil_LogMessage(plid, "(centersay) %s", buf);
	for(n=1; n <= gpGlobals->maxClients; n++) {
		pEntity=INDEXENT(n);
		if(FNullEnt(pEntity) || pEntity->free)
			continue;
		pPlayer=(CBaseEntity*)GET_PRIVATE(pEntity);
		UTIL_HudMessage(pPlayer, tparms, buf);
	}
}