Code:
playerIsVisible(player)
{
cpi = 3.141592654 * 2 / 360;
angle = self.angles[1] * cpi;
sy = sin(angle);
cy = cos(angle);
angle = self.angles[0] * cpi;
sp = sin(angle);
cp = cos(angle);
forward = (cp*cy, cp*sy, sp*-1);
return BulletTracePassed(self getTagOrigin("j_head"), player getTagOrigin("j_head"), false, self) && vectordot(player.origin-self.origin, forward) >= 0.01;
}
Combine this with some aimbot code and profit? (it's not 360 degrees so it looks more realistic but you probably got to figure out the smooth aiming yourself) Note that this is an actual snippet of code you might see in a real aimbot hack.
Pseudo-code:
Code:
if(self playerIsVisible(somePlayer))
{
//Do something
}
A casual conversation between barata and I about Nukem.