void PlayerLightEsp()
{
float drawhere[2];
vec3_t vecScreen;
//cl_entity_s *getcurent;
int espr,espg,espb; // For teh Weapon
espr = 255;
espg = 0;
espb = 0;
char nbuf[1024];
dlight_t *dl = gEngfuncs.pEfxAPI->CL_AllocDlight(0);
cl_entity_t *ent, *pLocal = pEngfuncs->GetLocalPlayer();
hud_player_info_t pinfo;
// Lets begin a loop
for(int i = 0; i < 33; i++)
{
if(i == pLocal->index) continue;
cl_entity_s *ent = pEngfuncs->GetEntityByIndex(i);
// float distance = GetDist(pLocal->origin, ent->origin) / 22.0f;
pEngfuncs->pfnGetPlayerInfo(i, &pinfo);
if(ent != NULL && isValidEnt(ent)/*Credits to tabris*/)
{
if(CalcScreen(ent->origin,vecScreen))
// sprintf(nbuf,"%s",pinfo.name);
float drawhere[2];
CalcScreen(ent->origin, drawhere);
{
sprintf(nbuf,"%s",pinfo.name);
CalcScreen(ent->origin, drawhere);
int namelen;
namelen = strlen(nbuf);
if( strstr( pinfo.model, "arctic" ) || strstr( pinfo.model, "guerilla" ) || strstr( pinfo.model, "leet" ) || strstr( pinfo.model, "militia" ) || strstr( pinfo.model, "terror" ) ) {
espr = 255;
espg = 40;
espb = 40;
}
else if( strstr( pinfo.model, "gign" ) || strstr( pinfo.model, "gsg9" ) || strstr( pinfo.model, "sas" ) || strstr( pinfo.model, "urban" ) || strstr( pinfo.model, "spetsnaz" ) || strstr( pinfo.model, "vip" )) {
espr = 40;
espg = 80;
espb = 255;
}
dl->origin = ent->origin,pLocal->origin;
if (isValidEnt(ent)==true)
{
dl->color.r = espr;
dl->color.g = espg;
dl->color.b = espb;
dl->radius = 160;
dl->die = gEngfuncs.GetClientTime() + 0.1;
}
// DrawHudString(drawhere[0] - namelen * 2, drawhere[1] - 14, /*er*/255, /*eg*/255, /*eb*/255, nbuf);
}
}
}
}