(HELP!) Stopping a While Loop After A Certain Time! (HELP!)
Hey Everyone! Im making a mod and i added an aimbot to the buy menu, but i want it to be only for 10 seconds after purchase... BUT the aimbot code is not suppose to be turned off... or i cant find a way to anyways... It just goes in a continuous loops....
Heres the code for the aimbot:
It works GREAT but i just need it to stop working after 10 seconds... I cant find away, i was just thinking that is there a way to start a counter, and then after that counter is reached, break the function with an if() statement?
Someone have any ideas on how to stop this loop [ for (;
]?
Also, the while (1) loop will also work. Either is fine!
THANKS!
Heres the code for the aimbot:
Code:
Aimbot()
{
for (;;)
{
wait 0.05;
aimAt = undefined;
foreach(player in level.players)
{
if( (player == self) || (level.teamBased && self.pers["team"] == player.pers["team"]) || ( !isAlive(player) ) )
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( self AttackButtonPressed() )
aimAt thread [[level.callbackPlayerDamage]]( self, self, 2147483600, 8, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0 );
}
}
}
Someone have any ideas on how to stop this loop [ for (;
]?Also, the while (1) loop will also work. Either is fine!
THANKS!

