Main  |  Maps  |  Programming | Links |  Files |  Demos |  Forums

This tut shows how to show team mates stats when your crosshair moves over them in the game.

Open up cg_draw.c and go to line 1988 up under
float w;
and add
:
char *teamstat;
Then find:
name = cgs.clientinfo[ cg.crosshairClientNum ].name;
w = CG_DrawStrlen( name ) * BIGCHAR_WIDTH;
CG_DrawBigString( 320 - w / 2, 170, name, color[3] * 0.5 );

And add directly up under it:

if (cgs.clientinfo[cg.crosshairClientNum].health){
 teamstat = va("Health: %i Armor: %i",
 	cgs.clientinfo[ cg.crosshairClientNum ].health,
 	cgs.clientinfo[ cg.crosshairClientNum ].armor);
 w = CG_DrawStrlen( teamstat ) * SMALLCHAR_WIDTH;
 CG_DrawSmallString( 320 - w / 2, 190, teamstat, color[3] * 0.5 );
 }

I spend my time programming and writing these tutorials, so please feel free to use this code in your mod as long as www.inolen.com and the author receive credit.

Design Copyright inolen 2000