Add autoshoot

If this cvar is enabled (1), and the aimbot is enabled (fov>0), it will
stop attacking if there is no visible target.
This commit is contained in:
8dcc 2023-07-31 18:03:26 +02:00
parent 83278b9983
commit 3414d131f4
3 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,7 @@
DECL_CVAR(bhop); DECL_CVAR(bhop);
DECL_CVAR(autostrafe); DECL_CVAR(autostrafe);
DECL_CVAR(aimbot); DECL_CVAR(aimbot);
DECL_CVAR(autoshoot);
DECL_CVAR(esp); DECL_CVAR(esp);
DECL_CVAR(chams); DECL_CVAR(chams);
DECL_CVAR(crosshair); DECL_CVAR(crosshair);
@ -16,6 +17,7 @@ bool cvars_init(void) {
REGISTER_CVAR(bhop, 1); REGISTER_CVAR(bhop, 1);
REGISTER_CVAR(autostrafe, 0); REGISTER_CVAR(autostrafe, 0);
REGISTER_CVAR(aimbot, 0); REGISTER_CVAR(aimbot, 0);
REGISTER_CVAR(autoshoot, 0); /* Only works with aimbot enabled */
REGISTER_CVAR(esp, 3); REGISTER_CVAR(esp, 3);
REGISTER_CVAR(chams, 1); REGISTER_CVAR(chams, 1);
REGISTER_CVAR(crosshair, 0); REGISTER_CVAR(crosshair, 0);

View File

@ -94,6 +94,9 @@ void aimbot(usercmd_t* cmd) {
engine_viewangles.x += best_delta.x; engine_viewangles.x += best_delta.x;
engine_viewangles.y += best_delta.y; engine_viewangles.y += best_delta.y;
engine_viewangles.z += best_delta.z; engine_viewangles.z += best_delta.z;
} else if (CVAR_ON(autoshoot)) {
/* No valid target and we have autoshoot, don't shoot */
cmd->buttons &= ~IN_ATTACK;
} }
vec_copy(cmd->viewangles, engine_viewangles); vec_copy(cmd->viewangles, engine_viewangles);

View File

@ -33,6 +33,7 @@
DECL_CVAR_EXTERN(bhop); DECL_CVAR_EXTERN(bhop);
DECL_CVAR_EXTERN(autostrafe); DECL_CVAR_EXTERN(autostrafe);
DECL_CVAR_EXTERN(aimbot); DECL_CVAR_EXTERN(aimbot);
DECL_CVAR_EXTERN(autoshoot);
DECL_CVAR_EXTERN(esp); DECL_CVAR_EXTERN(esp);
DECL_CVAR_EXTERN(chams); DECL_CVAR_EXTERN(chams);
DECL_CVAR_EXTERN(crosshair); DECL_CVAR_EXTERN(crosshair);