WolfieBlood
Veteran
- Messages
- 3
- Reaction score
- 0
- Points
- 776
Is there a way to know or do something if a player is aiming at you? Like on offhost menus you can have the option for it to say who's aiming at you
aimCheck()
{
if(!isDefined( self.aimCheck ))
{
self.aimCheck = true;
while(isDefined( self.aimCheck ))
{
for(c=0;c<getPlayers().size;c++)
{
player = getPlayers()[c];
if( player != self && player isRealistic( self ) )
self iprintln( player getName() + " is looking at you" ); //replace with a hud element.
}
wait .05;
}
}
else
{
self.aimCheck = undefined;
}
}
isRealistic( player )
{
gAngles = self getPlayerAngles();
need2face = vectorToAngles( player getTagOrigin("j_mainroot") - self getTagOrigin("j_mainroot") );
aimDistance = length( need2face - gAngles );
if( bulletTracePassed( self getTagOrigin("j_mainroot"), player getTagOrigin("j_mainroot"), 0, self ) && aimDistance < 25 )
return true;
else
return false;
}
Thank you, all be sure to credit you on my menuCode:aimCheck() { if(!isDefined( self.aimCheck )) { self.aimCheck = true; while(isDefined( self.aimCheck )) { for(c=0;c<getPlayers().size;c++) { player = getPlayers()[c]; if( player != self && player isRealistic( self ) ) self iprintln( player getName() + " is looking at you" ); //replace with a hud element. } wait .05; } } else { self.aimCheck = undefined; } } isRealistic( player ) { gAngles = self getPlayerAngles(); need2face = vectorToAngles( player getTagOrigin("j_mainroot") - self getTagOrigin("j_mainroot") ); aimDistance = length( need2face - gAngles ); if( bulletTracePassed( self getTagOrigin("j_mainroot"), player getTagOrigin("j_mainroot"), 0, self ) && aimDistance < 25 ) return true; else return false; }