In player.h:
class CBasePlayer : public CBaseMonster
{
public:
CBaseEntity *pAlexisEntity;
void AlexisEntityInfo(void);
...
}
In player.cpp:
void CBasePlayer::AlexisEntityInfo(void) {
//Give me the classname and targetname of this entity.
pAlexisEntity = FindEntityForward( this );
if ( pAlexisEntity && pAlexisEntity->IsAlive() && pAlexisEntity->pev->flags & FL_MONSTER)
{
ALERT ( at_console, "Classname: %s", STRING( pAlexisEntity->pev->classname ) );
if ( !FStringNull ( pAlexisEntity->pev->targetname ) )
{
ALERT ( at_console, " - Targetname: %s\n", STRING( pAlexisEntity->pev->targetname ) );
}
else
{
ALERT ( at_console, " - TargetName: No Targetname\n" );
}
ALERT ( at_console, "Model: %s\n", STRING( pAlexisEntity->pev->model ) );
if ( pAlexisEntity->pev->globalname )
ALERT ( at_console, "Globalname: %s\n", STRING( pAlexisEntity->pev->globalname ) );
}
}
In player.cpp CBasePlayer::UpdateClientData()
void CBasePlayer :: UpdateClientData( void )
{
AlexisEntityInfo();
...
}
From here, you'll need to pull the entity's health information and classname, then send them in messages to the client DLL. Take a look at the LinkUserMessages function in player.cpp, the player's health message variable gmsgHealth, and its associated message in the same UpdateClientData function as a guide:
MESSAGE_BEGIN( MSG_ONE, gmsgHealth, NULL, pev );
WRITE_BYTE( iHealth );
MESSAGE_END();
EDIT: Forgot to mention, this doesn't cover getting the message on the client DLL and printing the information. I'll let someone with more experience with the client chime in.