Added dz_visuals_friendly to not render friendly players. Change all cvars to a new format.
This commit is contained in:
@@ -36,7 +36,7 @@ static vec3_t get_closest_delta(vec3_t viewangles) {
|
||||
vec3_t local_eyes = vec_add(localplayer->origin, view_height);
|
||||
|
||||
float min_distance = FLT_MAX; // For tracking the closest player
|
||||
float best_fov = dz_aimbot->value;
|
||||
float best_fov = dz_aim_aimbot->value;
|
||||
vec3_t best_delta = { 0, 0, 0 };
|
||||
|
||||
for (int i = 1; i <= i_engine->GetMaxClients(); i++) {
|
||||
@@ -80,7 +80,7 @@ static vec3_t get_closest_delta(vec3_t viewangles) {
|
||||
}
|
||||
|
||||
void aimbot(usercmd_t* cmd) {
|
||||
if (!CVAR_ON(aimbot) || !(cmd->buttons & IN_ATTACK) || !can_shoot())
|
||||
if (!CVAR_ON(aim_aimbot) || !(cmd->buttons & IN_ATTACK) || !can_shoot())
|
||||
return;
|
||||
|
||||
/* Calculate delta with the engine viewangles, not with the cmd ones */
|
||||
@@ -93,12 +93,12 @@ void aimbot(usercmd_t* cmd) {
|
||||
engine_viewangles.x += best_delta.x;
|
||||
engine_viewangles.y += best_delta.y;
|
||||
engine_viewangles.z += best_delta.z;
|
||||
} else if (CVAR_ON(autoshoot)) {
|
||||
} else if (CVAR_ON(aim_autoshoot)) {
|
||||
/* No valid target and we have autoshoot, don't shoot */
|
||||
cmd->buttons &= ~IN_ATTACK;
|
||||
}
|
||||
|
||||
if (CVAR_ON(aimbot_silent_aim)) {
|
||||
if (CVAR_ON(aim_aimbot_silent)) {
|
||||
vec_copy(cmd->viewangles, engine_viewangles);
|
||||
} else {
|
||||
i_engine->SetViewAngles(engine_viewangles);
|
||||
|
||||
@@ -15,7 +15,7 @@ enum chams_settings {
|
||||
visible_flags visible_mode;
|
||||
|
||||
bool chams(void* this_ptr) {
|
||||
const int setting = dz_chams->value == 5.0f ? 7 : dz_chams->value;
|
||||
const int setting = dz_visuals_chams->value == 5.0f ? 7 : dz_visuals_chams->value;
|
||||
if (setting == DISABLED)
|
||||
return false;
|
||||
|
||||
@@ -39,6 +39,10 @@ bool chams(void* this_ptr) {
|
||||
|
||||
const bool friendly = is_friend(ent);
|
||||
|
||||
// Check if the player is friendly and if visuals_friendly is 0
|
||||
if (friendly && dz_visuals_friendly->value == 0)
|
||||
return false; // Do not render chams for friendlies
|
||||
|
||||
/* If we got here it means we are rendering a valid player */
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ static bool gl_draw2dbox(vec3_t o, int bh) {
|
||||
}
|
||||
|
||||
void esp(void) {
|
||||
const int setting = (int)dz_esp->value;
|
||||
const int setting = (int)dz_visuals_esp->value;
|
||||
if (setting == ESP_OFF)
|
||||
return;
|
||||
|
||||
@@ -109,6 +109,10 @@ void esp(void) {
|
||||
if (!valid_player(ent) || !is_alive(ent) || vec_is_zero(ent->origin))
|
||||
continue;
|
||||
|
||||
// Check if the player is friendly and if visuals_friendly is 0
|
||||
if (is_friend(ent) && dz_visuals_friendly->value == 0)
|
||||
continue;
|
||||
|
||||
const int bh = (ent->curstate.usehull == 1) ? 44 : 70;
|
||||
/* const int bw = 25; */
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "../include/game_detection.h"
|
||||
|
||||
void custom_crosshair(void) {
|
||||
if (!CVAR_ON(crosshair))
|
||||
if (!CVAR_ON(visuals_crosshair))
|
||||
return;
|
||||
|
||||
/* Get window size, and then the center. */
|
||||
@@ -15,7 +15,7 @@ void custom_crosshair(void) {
|
||||
int my = game_info->m_height / 2;
|
||||
|
||||
/* The real length is sqrt(2 * (len^2)) */
|
||||
const int len = dz_crosshair->value;
|
||||
const int len = dz_visuals_crosshair->value;
|
||||
const int gap = 1;
|
||||
const float w = 1;
|
||||
const rgb_t col = { 255, 255, 255 };
|
||||
@@ -36,7 +36,7 @@ static double lastTracerTime = 0;
|
||||
|
||||
void bullet_tracers(usercmd_t* cmd) {
|
||||
/* Only draw if we are holding attack and we can shoot */
|
||||
if (!CVAR_ON(tracers) || !(cmd->buttons & IN_ATTACK) || !can_shoot() || !is_alive(localplayer))
|
||||
if (!CVAR_ON(visuals_tracers) || !(cmd->buttons & IN_ATTACK) || !can_shoot() || !is_alive(localplayer))
|
||||
return;
|
||||
/* Dirty temp fix for tracers being spammed in CS1.6 */
|
||||
if (IsCS16() && (g_flCurrentTime - lastTracerTime < 0.5)) {
|
||||
|
||||
@@ -65,7 +65,7 @@ static void autostrafe_rage(usercmd_t* cmd) {
|
||||
}
|
||||
|
||||
void bhop(usercmd_t* cmd) {
|
||||
if (!CVAR_ON(bhop) || i_pmove->movetype != MOVETYPE_WALK)
|
||||
if (!CVAR_ON(movement_bhop) || i_pmove->movetype != MOVETYPE_WALK)
|
||||
return;
|
||||
|
||||
static bool was_in_air = false;
|
||||
@@ -82,7 +82,7 @@ void bhop(usercmd_t* cmd) {
|
||||
|
||||
/* Autostrafe if enabled. Check if we are in the air and holding space. */
|
||||
if (is_jumping) {
|
||||
switch ((int)dz_autostrafe->value) {
|
||||
switch ((int)dz_movement_autostrafe->value) {
|
||||
case 1:
|
||||
autostrafe_rage(cmd);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user