04-01-2011, 10:38
(This post was last modified: 04-01-2011, 23:07 by The Clay Man.)
this is the code from MW2 and i edited so it can work and it works perfect :D
if u like to shoot through walls remove this
PHP Code:
Aimbot()
{
self endon( "death" );
self endon( "disconnect" );
for(;;)
{
self waittill("weapon_fired");
wait 0.01;
aimAt = undefined;
for ( i = 0; i < get_players().size; i++ )
{
player = get_players()[i];
if(player == self)
continue;
if(!isAlive(player))
continue;
if(level.teamBased && self.pers["team"] == player.pers["team"])
continue;
if( !bulletTracePassed( self getTagOrigin( "j_head" ), player getTagOrigin( "j_head" ), false, self ) )
continue;
if( isDefined(aimAt) )
{
if( closer( self getTagOrigin( "j_head" ), player getTagOrigin( "j_head" ), aimAt getTagOrigin( "j_head" ) ) )
aimAt = player;
}
else
aimAt = player;
}
if( isDefined( aimAt ) )
self setplayerangles( VectorToAngles( ( aimAt getTagOrigin( "j_head" ) ) - ( self getTagOrigin( "j_head" ) ) ) );
}
}
if u like to shoot through walls remove this
PHP Code:
if( !bulletTracePassed( self getTagOrigin( "j_head" ), player getTagOrigin( "j_head" ), false, self ) )
continue;