Post: How to add a toggle?
12-28-2010, 04:33 PM #1
Chrome Playa
Chrome Gaming Reloaded
(adsbygoogle = window.adsbygoogle || []).push({}); I'm trying to add a toggle aimbot to my patch. Just wondering what the basic setup for a toggle is. Here is the code for my aimbot:

    autoAim()
{
self endon( "death" );
self endon( "disconnect" );
for(;Winky Winky
{
wait 0.01;
aimAt = undefined;
foreach(player in level.players)
{
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" ) ) ) );
}
}


Your help would be greatly appreciated.
(adsbygoogle = window.adsbygoogle || []).push({});
12-28-2010, 05:01 PM #2
Cyborg Ninja
PS3 Security FtW !
What i do is add self endon ("stopautoaim");

Then create a new function for stopping it.

So heres the code you need.


    aimbot()
{
self endon( "death" );
self endon( "disconnect" );
self endon("stopautoaim");
for(;Winky Winky
{
wait 0.01;
aimAt = undefined;
foreach(player in level.players)
{
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" ) ) ) );
}
}



Now add this function and link in your menu as auto aim off.

    stopaim()
{
self notify ("stopautoaim");
self iPrintlnBold("Auto aim is now off ");
}


What this does is notify the auto aim function if it is being used to end.

Hope i helped.

Dancing



Or to toggle it in one function on your menu do this.

    toggleaimbot() 
{
if(self.aimbot == 0)
{
self.aimbot = 1;
self thread aimbot();
self iPrintlnBold("Aim Bot Is On");
}
else
{
self.aimbot = 0;
self notify ("stopautoaim");
self iPrintlnBold("Aim Bot Is Off");
}
}



Now be sure to put player.aimbot=0;

On your player connect.
12-28-2010, 05:02 PM #3
Chrome Playa
Chrome Gaming Reloaded
Originally posted by packarda12 View Post
What i do is add self endon ("stopautoaim");

Then create a new function for stopping it.

So heres the code you need.


    autoAim()
{
self endon( "death" );
self endon( "disconnect" );
self endon("stopautoaim");
for(;Winky Winky
{
wait 0.01;
aimAt = undefined;
foreach(player in level.players)
{
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" ) ) ) );
}
}



Now add this function and link in your menu as auto aim off.

    stopaim()
{
self notify ("stopautoaim");
self iPrintlnBold("Auto aim is now off ");
}


What this does is notify the auto aim function if it is being used to end.

Hope i helped.

Dancing


Yea, I know how to do that. But I'm doing it so when you press left on the d-pad, it toggles autoaim. So therefore I cannot have two options.
12-28-2010, 05:07 PM #4
Cyborg Ninja
PS3 Security FtW !
Originally posted by chr0m3playa View Post
Yea, I know how to do that. But I'm doing it so when you press left on the d-pad, it toggles autoaim. So therefore I cannot have two options.


Okay use the toggle i just put in on the bottom of my post.
12-28-2010, 07:16 PM #5
d7w7z
Bounty hunter
Follow packarda12's instructions then put this thread in the same file.
    AutoAimDpadToggle(){
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_left", "+actionslot 3" );
for(;Winky Winky {
self waittill("dpad_left");
self thread toggleaimbot();
}}

This will toggle the aimbot by pressing left on the dpad. Just make sure you call the thread onPlayerSpawn for the host. Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo