kan
03-11-2005, 01:45 PM
*Edited*
Could someone please convert this:
void DrawBox( int x, int y, int r, int g, int b, int alpha, int radius=1, int thickness=0)
{
int radius2 = radius<<1;
gEngfuncs.pfnFillRGBA(x-radius+thickness, y-radius, radius2-2, thickness, r, g, b, alpha);
gEngfuncs.pfnFillRGBA(x-radius, y-radius, thickness, radius2, r, g, b, alpha);
gEngfuncs.pfnFillRGBA(x-radius, y+radius, radius2, thickness, r, g, b, alpha);
gEngfuncs.pfnFillRGBA(x+radius, y-radius, thickness, radius2+thickness, r, g, b, alpha);
}
void BoxEsp()
{
float drawhere[2];
int espr, espg, espb;
char nbuf[6];
cl_entity_t *pLocal = pEngfuncs->GetLocalPlayer();
cl_entity_t *ent = pEngfuncs->GetLocalPlayer();
hud_player_info_t pinfo;
for(int i = 0; i < 33; i++)
{
cl_entity_s *ent = pEngfuncs->GetEntityByIndex(i);
if(i == pLocal->index) continue;
pEngfuncs->pfnGetPlayerInfo(i, &pinfo);
if(ent != NULL && isValidEnt(ent))
{
sprintf(nbuf,"%s",pinfo.name);
int namelen;
namelen = strlen(nbuf);
if( strstr( pinfo.model, "arctic" ) || strstr( pinfo.model, "guerilla" ) || strstr( pinfo.model, "leet" ) || strstr( pinfo.model, "terror" ) || strstr( pinfo.model, "spetsnaz" )) {
espr = 255, espg = 0, espb = 0;
}
else if( strstr( pinfo.model, "gign" ) || strstr( pinfo.model, "gsg9" ) || strstr( pinfo.model, "sas" ) || strstr( pinfo.model, "urban" ) || strstr( pinfo.model, "vip" ) || strstr( pinfo.model, "militia" ) ) {
espr = 0, espg = 0, espb = 255;
}
if(CalcScreen(ent->origin, drawhere))
DrawBox(drawhere[0], drawhere[1], espr, espg, espb, 200, 8, 2);
DrawBox(drawhere[0], drawhere[1], espr, espg, espb, 200, 8, 2);
DrawBox(drawhere[0], drawhere[1], espr, espg, espb, 200, 8, 2);
DrawBox(drawhere[0], drawhere[1], espr, espg, espb, 200, 8, 2);
}
}
}
}[HTML]void DrawBox( int x, int y, int r, int g, int b, int alpha, int radius=1, int thickness=0)
in to Delphi
Could someone please convert this:
void DrawBox( int x, int y, int r, int g, int b, int alpha, int radius=1, int thickness=0)
{
int radius2 = radius<<1;
gEngfuncs.pfnFillRGBA(x-radius+thickness, y-radius, radius2-2, thickness, r, g, b, alpha);
gEngfuncs.pfnFillRGBA(x-radius, y-radius, thickness, radius2, r, g, b, alpha);
gEngfuncs.pfnFillRGBA(x-radius, y+radius, radius2, thickness, r, g, b, alpha);
gEngfuncs.pfnFillRGBA(x+radius, y-radius, thickness, radius2+thickness, r, g, b, alpha);
}
void BoxEsp()
{
float drawhere[2];
int espr, espg, espb;
char nbuf[6];
cl_entity_t *pLocal = pEngfuncs->GetLocalPlayer();
cl_entity_t *ent = pEngfuncs->GetLocalPlayer();
hud_player_info_t pinfo;
for(int i = 0; i < 33; i++)
{
cl_entity_s *ent = pEngfuncs->GetEntityByIndex(i);
if(i == pLocal->index) continue;
pEngfuncs->pfnGetPlayerInfo(i, &pinfo);
if(ent != NULL && isValidEnt(ent))
{
sprintf(nbuf,"%s",pinfo.name);
int namelen;
namelen = strlen(nbuf);
if( strstr( pinfo.model, "arctic" ) || strstr( pinfo.model, "guerilla" ) || strstr( pinfo.model, "leet" ) || strstr( pinfo.model, "terror" ) || strstr( pinfo.model, "spetsnaz" )) {
espr = 255, espg = 0, espb = 0;
}
else if( strstr( pinfo.model, "gign" ) || strstr( pinfo.model, "gsg9" ) || strstr( pinfo.model, "sas" ) || strstr( pinfo.model, "urban" ) || strstr( pinfo.model, "vip" ) || strstr( pinfo.model, "militia" ) ) {
espr = 0, espg = 0, espb = 255;
}
if(CalcScreen(ent->origin, drawhere))
DrawBox(drawhere[0], drawhere[1], espr, espg, espb, 200, 8, 2);
DrawBox(drawhere[0], drawhere[1], espr, espg, espb, 200, 8, 2);
DrawBox(drawhere[0], drawhere[1], espr, espg, espb, 200, 8, 2);
DrawBox(drawhere[0], drawhere[1], espr, espg, espb, 200, 8, 2);
}
}
}
}[HTML]void DrawBox( int x, int y, int r, int g, int b, int alpha, int radius=1, int thickness=0)
in to Delphi