above this
clinet.h->playerinfo
enum { MAX_HITPOINTS = 10 };
below this
clinet.h->playerinfo
hitpoints = MAX_HITPOINTS;
health = 0;
// for estimated health
int hitpoints;
int health;
------------------------
clinet.cpp-> pres_dynmaicsound
at top somewhere
string theMessage;
string theMessage2;
string theMessage3;
string theMessage4;
string theMessage5;
string theMessage6;
string theMessage7;
string theMessage8;
string theMessage9;
string theMessage10;
size_t length5;
size_t length6;
size_t length7;
size_t length8;
size_t length9;
size_t length10;
size_t length11;
int length;
if(b>0 && b<=36)
{
theMessage = vPlayers.entinfo.name; //vPlayers.entinfo.name;
theMessage2 = vPlayers.entinfo.name; //vPlayers.entinfo.name;
theMessage3 = vPlayers.entinfo.name; //vPlayers.entinfo.name;
theMessage4 = vPlayers.entinfo.name;
theMessage5 = vPlayers.entinfo.name;
theMessage6 = vPlayers.entinfo.name;
theMessage7 = vPlayers.entinfo.name;
theMessage8 = vPlayers.entinfo.name;
theMessage9 = vPlayers.entinfo.name;
theMessage10 = vPlayers.entinfo.name;
length5 = theMessage4.length();
length6 = theMessage5.length();
length7 = theMessage6.length();
length8 = theMessage7.length();
length9 = theMessage8.length();
length10 = theMessage9.length();
length11 = theMessage10.length();
ref.team = vPlayers.team;
}
if(cvar.health_esp)
{
int damage = getPoints(sample);
vPlayers.hitpoints-=damage;
if(damage)
vPlayers.kevlar=2-damage;
if(vPlayers.hitpoints<=0)
vPlayers.hitpoints=1;
}
-------------------
above..."bridge"
if(sample[0]=='p' && sample[3]=='y' && sample[6]=='/') // "player/pl_step1.wav"
{
if(!passesSoundFilter(origin,b)) return;
const char* pos = sample+7;
if(pos[0]=='p' && pos[2]=='_') // pl_xx
{
if(pos[3]=='s' && pos[4]=='h' && pos[5]=='e' && pos[6]=='l' ) return; // pl_shell#
pos+=3;
if(cvar.colorstep)
ref.color = colorList.get(41+ref.team);
else
ref.color = colorList.get(30); // "snd_step"
ref.priority = 0;
} else if( pos[0]=='b'&& pos[1]=='h' && pos[2]=='i' ) { // "bhit_..."
vPlayers.hitpoints-=getPoints(sample);
if(vPlayers.hitpoints<=0)
vPlayers.hitpoints=1;
pos+=5;
ref.color = colorList.get(32); // "snd_hit"
ref.priority = 2;
} else if( pos[3]=='s' && pos[7]=='t' ) { // "pl_shot1.wav"
vPlayers.hitpoints--;
if(vPlayers.hitpoints<=0)
vPlayers.hitpoints=1;
}
strcpy_x(ref.description,pos);
}
else
if( sample[0]=='w' && sample[1]=='e' && sample[7]=='/' ) // weapons/ric1.wav
{
const char* pos = sample+8;
if( (pos[0]=='r' && pos[1]=='i') // ricxxx
||(pos[0]=='b' && pos[1]=='u') ) // bullet-hit...
{
return;
}
if(!passesSoundFilter(origin,b)) return;
ref.priority = 1;
ref.color = colorList.get(41+ref.team); // snd_weapon
strcpy_x2(ref.description,pos);
for(char *pos1=ref.description;*pos1;++pos1){ *pos1 = toupper(*pos1); }// uppercase
}
----------------
in playeresp
if (cvar.health_esp==2 && vPlayers[ax].getAlive())
{
int numBars = ceil(vPlayers[ax].hitpoints/2.0);
ColorEntry* bar = colorList.get(43 + numBars);
int offset = 10;
for(int i=0;i<5;i++)
{
if(i<numBars)
gFillBoxAtScreenXY(x+(i*4)-offset,y,bar->r,bar->g,bar->b,bar->a * cvar.esp_trans,3);
else
gFillBoxAtScreenXY(x+(i*4)-offset,y,0,0,0,bar->a * cvar.esp_trans,3);
}
bar = colorList.get(40);
if(vPlayers[ax].kevlar)
gFillBoxAtScreenXY(x+(i*4)-offset,y,bar->r,bar->g,bar->b,bar->a * cvar.esp_trans,3);
else
gFillBoxAtScreenXY(x+(i*4)-offset,y,0,0,0,bar->a * cvar.esp_trans,3);
}
else if (cvar.health_esp==1)
{
int numBars = ceil(vPlayers[ax].hitpoints/2.0);
ColorEntry* bar = colorList.get(43 + numBars);
DrawHudStringCenter(x,y,bar->r,bar->g,bar->b,"%i hp",(short int)vPlayers[ax].hitpoints*10);
}
--------------
at roundstart
for(int ax=0;ax<vPlayers.size();ax++)
{
vPlayers[ax].hitpoints=MAX_HITPOINTS;
if(vPlayers[ax].team)
vPlayers[ax].health = 100;
else
vPlayers[ax].health = 0;
}
----------------
playercolor >tglow
above tglow
if((!vPlayers[ax].getAlive() && vPlayers[ax].health == 0) && vPlayers[ax].team)
return colorList.get(48+vPlayers[ax].team);
------------------
at top of client.cppp
// get points
int getPoints(const char* hittype)
{
double damage = 0;
if(strstr(hittype,"headshot"))
damage = 4;
if(strstr(hittype,"helmet"))
damage = 3;
if(strstr(hittype,"kevlar"))
damage = 1;
if(strstr(hittype,"flesh"))
damage = 2;
return damage;
}
the rest of the crap needed is in bomb location.txt