Hopefully someone can make sense of this. From what I understand, referring to AddToFullPack, the "ent" parameter is the entity that we're reading or changing, and it's being displayed to the "host" parameter.
So theoretically:
if ent = your teammate, and host = you, ES_RenderMode should always be something that means "yes, it's rendering"
if ent = your enemy, and host = you, ES_RenderMode should be "on" if he's in range, "off" if he's not in range. Perhaps there is a specific mode that automatically does this.
This is the test code I've come up with:
Code:
public fw_addtofullpack( es_handle, e, ent, host, hostflags, player, pSet ) {
if( !player ) return FMRES_IGNORED;
if( ent == get_pcvar_num(pEnt) )
{
new read_rendermode = get_es( es_handle, ES_RenderMode );
new read_renderamt = get_es( es_handle, ES_RenderAmt );
new szEcho[512];
format( szEcho, 511, "[Ent:%i] [Read-Mode:%i] [Read-Amt:%i]", ent, read_rendermode, read_renderamt );
new set_rendermode = get_pcvar_num( pRenderMode );
new set_renderamt = get_pcvar_num( pRenderAmt );
if( set_rendermode > -1 )
{
set_es( es_handle, ES_RenderMode, set_rendermode );
format( szEcho, 511, "%s [Set-Mode:%i]", szEcho, set_rendermode );
}
if( set_renderamt > -1 )
{
set_es( es_handle, ES_RenderAmt, set_renderamt );
format( szEcho, 511, "%s [Set-Amt:%i]", szEcho, set_renderamt );
}
console_print( host, szEcho );
}
return FMRES_IGNORED;
}
Basically what happens is when I alter the CVARs, it has no affect on the the player showing up on the minimap. I am able to make him invisible by doing this, however, but minimap is not affected at all.
This leads me to believe there is a different way that Rendering is handled. Does this ring a bell to
anyone?
EDIT: I've hooked AddToFullPack both regularly and post.
__________________