Compare commits
69 Commits
bone_posit
...
main
Author | SHA1 | Date |
---|---|---|
Wizzard | e53e7c5d37 | |
Wizzard | 184e52dcbc | |
Wizzard | 3738e6cd7c | |
Wizzard | 543c00e294 | |
Wizzard | 21d9cac264 | |
Wizzard | 8a5b96505b | |
Wizzard | 72dc42006f | |
Wizzard | 1c4bc57713 | |
Wizzard | d9339d0d5a | |
Wizzard | 44e5dc34c0 | |
Wizzard | 17b4e4e3a3 | |
Wizzard | 0b0664e4cf | |
Wizzard | d3b6c64003 | |
Wizzard | f93a21ce16 | |
Wizzard | 87208744e1 | |
Wizzard | f7fc075c4a | |
Wizzard | f26da3e84f | |
Wizzard | e440b15a9d | |
Wizzard | 1d99e0758a | |
Wizzard | 9a109b3882 | |
Wizzard | 36459f0d6a | |
Wizzard | 3bd0fe52da | |
Wizzard | 88bdad24b1 | |
Wizzard | a898563249 | |
Wizzard | 2401ecf71e | |
Wizzard | 4b54871340 | |
Wizzard | a09d80fbfa | |
Wizzard | 7fc0a14ae6 | |
Wizzard | 7239d610a8 | |
Wizzard | 3aaf7c8346 | |
Wizzard | a5234c16a3 | |
Wizzard | f38678d727 | |
Wizzard | e43cea56f8 | |
Wizzard | c5e985bc42 | |
Wizzard | c1ff555e17 | |
Wizzard | b7bac66484 | |
Wizzard | a688d94e9d | |
Wizzard | deccfca8e3 | |
Wizzard | b29f71e597 | |
Wizzard | c7ee48dfa6 | |
Wizzard | a7b30ca7f8 | |
Wizzard | 1f3e531610 | |
Wizzard | 0e7f955c7d | |
Wizzard | f0485a3f36 | |
Wizzard | 02888c1158 | |
Wizzard | b9851de177 | |
Wizzard | 56f8ae79d7 | |
8dcc | f9db9ff1b6 | |
8dcc | 29a40f63da | |
8dcc | b7c6e74dd4 | |
8dcc | 510243c46d | |
8dcc | fb6ed02dd4 | |
8dcc | 42a7961142 | |
8dcc | da6cf86910 | |
8dcc | 3414d131f4 | |
8dcc | 83278b9983 | |
8dcc | 4bb21a4ca6 | |
8dcc | 51c302f492 | |
8dcc | 865a02a8cd | |
8dcc | d09fdf66b5 | |
8dcc | 87e6b34eee | |
8dcc | cd3fde56a3 | |
8dcc | 3d3ebd7c5a | |
8dcc | 7cf0b30495 | |
8dcc | 70a69c1fc8 | |
8dcc | e26d5639c2 | |
8dcc | 0625638e31 | |
8dcc | 56fa55a751 | |
8dcc | bb6c9efc50 |
2
Makefile
2
Makefile
|
@ -5,7 +5,7 @@ INCLUDES=-Isrc/include/sdk/common -Isrc/include/sdk/public -Isrc/include/sdk/pm_
|
|||
CFLAGS=-Wall -Wextra -Wno-write-strings -m32 -fPIC $(INCLUDES)
|
||||
LDFLAGS=-lm
|
||||
|
||||
OBJS=obj/main.c.o obj/globals.c.o obj/cvars.c.o obj/hooks.c.o obj/detour.c.o obj/util.c.o obj/features/movement.c.o obj/features/esp.c.o obj/features/chams.c.o obj/features/aim.c.o obj/features/misc.c.o
|
||||
OBJS=obj/main.c.o obj/globals.c.o obj/cvars.c.o obj/hooks.c.o obj/detour.c.o obj/util.c.o obj/features/movement.c.o obj/features/anti_aim.c.o obj/features/fov.c.o obj/features/namechanger.c.o obj/features/esp.c.o obj/features/chams.c.o obj/features/aim.c.o obj/features/misc.c.o obj/game_detection.c.o
|
||||
BIN=libhlcheat.so
|
||||
|
||||
.PHONY: clean all inject
|
||||
|
|
59
README.org
59
README.org
|
@ -1,14 +1,21 @@
|
|||
#+title: Half-Life cheat
|
||||
#+title: Half-Life cheat (Original author: [[https://github.com/8dcc/][8dcc]])
|
||||
#+options: toc:nil
|
||||
#+startup: showeverything
|
||||
#+author: 8dcc
|
||||
#+author: Wizzard
|
||||
|
||||
*Linux cheat for Half-Life 1 (and goldsrc).*
|
||||
*Linux cheat for goldsrc games.*
|
||||
|
||||
#+TOC: headlines 2
|
||||
|
||||
* Description
|
||||
Simple linux cheat for Half-Life 1 (and most /goldsrc/ games) made in C.
|
||||
Simple linux cheat for most goldsrc games, made in C.
|
||||
|
||||
Supported games:
|
||||
- [[https://store.steampowered.com/app/70/HalfLife/][Half-Life 1]]
|
||||
- [[https://store.steampowered.com/app/10/CounterStrike/][Counter-Strike 1.6]]
|
||||
- [[https://store.steampowered.com/app/20/Team_Fortress_Classic/][Team Fortress Classic]]
|
||||
- [[https://store.steampowered.com/app/30/Day_of_Defeat/][Day of Defeat]]
|
||||
- [[https://store.steampowered.com/app/40/Deathmatch_Classic/][Deathmatch Classic]]
|
||||
|
||||
This project was heavily inspired by [[https://github.com/UnkwUsr/hlhax][UnkwUsr/hlhax]], and would not have been
|
||||
possible without his help. Make sure to check out his repo too.
|
||||
|
@ -17,30 +24,46 @@ Also make sure to check out [[https://github.com/deboogerxyz/ahc][deboogerxyz/ah
|
|||
|
||||
* Features
|
||||
|
||||
| Feature | Command | Values (0..n) |
|
||||
|------------+---------------+------------------------|
|
||||
| Bhop | =cv_bhop= | off/on |
|
||||
| Autostrafe | =cv_autostrafe= | off/rage/legit |
|
||||
| Aimbot | =cv_aimbot= | off/fov* |
|
||||
| ESP | =cv_esp= | off/3d-box/name/all |
|
||||
| Chams | =cv_chams= | off/players/hands/all* |
|
||||
| Crosshair | =cv_crosshair= | off/length |
|
||||
|
||||
| Feature | Command | Values |
|
||||
|------------|------------------------|-----------------------|
|
||||
| Bhop | =dz_movement_bhop= | off/on |
|
||||
| Autostrafe | =dz_movement_autostrafe= | off/rage/legit |
|
||||
| Aimbot | =dz_aim_aimbot= | off/fov |
|
||||
| Autoshoot | =dz_aim_autoshoot= | off/on |
|
||||
| ESP | =dz_visuals_esp= | off/3d-box/name/all |
|
||||
| Chams | =dz_visuals_chams= | off/players/hands/all |
|
||||
| Crosshair | =dz_visuals_crosshair= | off/length |
|
||||
| Tracers | =dz_visuals_tracers= | off/on |
|
||||
| Namechanger| =dz_misc_namechanger= | off/team/enemy/all |
|
||||
|
||||
#+begin_quote
|
||||
*Note:* Aimbot FOV goes from 0 (off) to 180 (all enemies)
|
||||
#+end_quote
|
||||
|
||||
#+begin_quote
|
||||
*Note:* If =dz_autoshoot= is enabled, and =dz_aimbot= is enabled, it will stop
|
||||
attacking if there is no visible target.
|
||||
#+end_quote
|
||||
|
||||
#+begin_quote
|
||||
*Note:* Chams color can be changed from the =h_glColor4f()= function inside
|
||||
[[https://github.com/8dcc/hl-cheat/blob/main/src/hooks.c][src/hooks.c]]. Since this cheat is not hard to compile, I rather have less
|
||||
[[https://git.deadzone.lol/Wizzard/goldsrc-cheat/src/branch/main/src/hooks.c][src/hooks.c]]. Since this cheat is not hard to compile, I rather have less
|
||||
console variables than more customization at runtime.
|
||||
#+end_quote
|
||||
|
||||
#+begin_quote
|
||||
*Note:* Bullet tracer color, width and time can be changed at the bottom of the
|
||||
=bullet_tracers()= function inside [[https://git.deadzone.lol/Wizzard/goldsrc-cheat/src/branch/main/src/features/misc.c][src/features/misc.c]]. See previous chams note.
|
||||
#+end_quote
|
||||
|
||||
#+begin_quote
|
||||
*Note:* You can disable the watermark with dz_watermark 0
|
||||
#+end_quote
|
||||
|
||||
* Building
|
||||
#+begin_src console
|
||||
$ git clone --recurse-submodules https://github.com/8dcc/hl-cheat
|
||||
$ cd hl-cheat
|
||||
$ git clone --recurse-submodules https://git.deadzone.lol/Wizzard/goldsrc-cheat
|
||||
$ cd goldsource-cheat
|
||||
$ make
|
||||
...
|
||||
#+end_src
|
||||
|
@ -49,7 +72,7 @@ Note that you will need to clone with =--recurse-submodules= for the sdk. If you
|
|||
have already cloned it, you can just:
|
||||
|
||||
#+begin_src console
|
||||
$ cd hl-cheat
|
||||
$ cd goldsource-cheat
|
||||
$ git submodule update --init --recursive
|
||||
#+end_src
|
||||
|
||||
|
@ -62,5 +85,5 @@ $ ./injector.sh
|
|||
|
||||
...
|
||||
|
||||
hl-cheat loaded!
|
||||
goldsource-cheat loaded!
|
||||
#+end_src
|
||||
|
|
|
@ -30,7 +30,7 @@ if [ "$1" == "unload" ]; then
|
|||
fi
|
||||
|
||||
if grep -q "$libpath" "/proc/$pid/maps"; then
|
||||
echo -e "hl-cheat already loaded. Reloading...\n";
|
||||
echo -e "goldsource-cheat already loaded. Reloading...\n";
|
||||
|
||||
# 0x2 -> RTLD_NOW
|
||||
# 0x6 -> RTLD_LAZY | RTLD_NOLOAD
|
||||
|
|
59
src/cvars.c
59
src/cvars.c
|
@ -2,23 +2,52 @@
|
|||
#include "include/cvars.h"
|
||||
#include "include/sdk.h"
|
||||
#include "include/globals.h"
|
||||
#include "include/game_detection.h"
|
||||
|
||||
DECL_CVAR(movement_bhop);
|
||||
DECL_CVAR(movement_autostrafe);
|
||||
DECL_CVAR(aim_aimbot);
|
||||
DECL_CVAR(aim_autoshoot);
|
||||
DECL_CVAR(visuals_esp);
|
||||
DECL_CVAR(visuals_chams);
|
||||
DECL_CVAR(visuals_crosshair);
|
||||
DECL_CVAR(visuals_tracers);
|
||||
DECL_CVAR(movement_clmove);
|
||||
DECL_CVAR(watermark);
|
||||
DECL_CVAR(watermark_rainbow);
|
||||
DECL_CVAR(aim_aimbot_silent);
|
||||
DECL_CVAR(visuals_friendly);
|
||||
DECL_CVAR(movement_antiaim);
|
||||
DECL_CVAR(movement_antiaim_view);
|
||||
DECL_CVAR(movement_fakeduck);
|
||||
DECL_CVAR(misc_namechanger);
|
||||
DECL_CVAR(misc_namechanger_speed);
|
||||
DECL_CVAR(visuals_fov);
|
||||
|
||||
DECL_CVAR(bhop);
|
||||
DECL_CVAR(autostrafe);
|
||||
DECL_CVAR(aimbot);
|
||||
DECL_CVAR(esp);
|
||||
DECL_CVAR(chams);
|
||||
DECL_CVAR(crosshair);
|
||||
DECL_CVAR(clmove);
|
||||
|
||||
bool cvars_init(void) {
|
||||
REGISTER_CVAR(bhop, 1);
|
||||
REGISTER_CVAR(autostrafe, 0);
|
||||
REGISTER_CVAR(aimbot, 0);
|
||||
REGISTER_CVAR(esp, 3);
|
||||
REGISTER_CVAR(chams, 1);
|
||||
REGISTER_CVAR(crosshair, 0);
|
||||
REGISTER_CVAR(clmove, 0);
|
||||
|
||||
REGISTER_CVAR(movement_bhop, 1);
|
||||
REGISTER_CVAR(movement_autostrafe, 1);
|
||||
REGISTER_CVAR(aim_aimbot, 0);
|
||||
REGISTER_CVAR(aim_autoshoot, 0); /* Only works with aimbot enabled */
|
||||
REGISTER_CVAR(visuals_esp, 3);
|
||||
REGISTER_CVAR(visuals_chams, 1);
|
||||
REGISTER_CVAR(visuals_crosshair, 0);
|
||||
REGISTER_CVAR(movement_clmove, 0);
|
||||
REGISTER_CVAR(watermark, 1);
|
||||
REGISTER_CVAR(watermark_rainbow, 1);
|
||||
REGISTER_CVAR(aim_aimbot_silent, 1);
|
||||
REGISTER_CVAR(visuals_friendly, 0);
|
||||
REGISTER_CVAR(movement_antiaim, 0);
|
||||
REGISTER_CVAR(movement_antiaim_view, 0);
|
||||
REGISTER_CVAR(movement_fakeduck, 0);
|
||||
REGISTER_CVAR(misc_namechanger, 0);
|
||||
REGISTER_CVAR(misc_namechanger_speed, 10);
|
||||
REGISTER_CVAR(visuals_fov, 90);
|
||||
if (IsCS16()) {
|
||||
REGISTER_CVAR(visuals_tracers, 0);
|
||||
} else {
|
||||
REGISTER_CVAR(visuals_tracers, 1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,48 +1,93 @@
|
|||
|
||||
#include <math.h>
|
||||
#include <cfloat>
|
||||
|
||||
#include "features.h"
|
||||
#include "../include/sdk.h"
|
||||
#include "../include/cvars.h"
|
||||
#include "../include/util.h"
|
||||
#include "../include/game_detection.h"
|
||||
|
||||
/* Game units to add to the entity origin to get the head */
|
||||
#define HEAD_OFFSET 0.8f
|
||||
#define HL1_HEAD_OFFSET 25.f
|
||||
#define CS16_HEAD_OFFSET 22.f
|
||||
#define CS16_HORIZONTAL_OFFSET 8.0f
|
||||
#define DOD_HEAD_OFFSET 22.f
|
||||
#define DOD_HORIZONTAL_OFFSET 8.0f
|
||||
|
||||
/* Scale factor for aim punch */
|
||||
#define AIM_PUNCH_MULT 2
|
||||
|
||||
static float vec_length(vec3_t v) {
|
||||
return sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
|
||||
}
|
||||
|
||||
|
||||
static bool is_visible(vec3_t start, vec3_t end) {
|
||||
pmtrace_t* tr = i_engine->PM_TraceLine(start, end, PM_TRACELINE_PHYSENTSONLY, 2, -1);
|
||||
if (tr->ent <= 0) return false;
|
||||
const int ent_idx = i_pmove->physents[tr->ent].info;
|
||||
return get_player(ent_idx) != NULL;
|
||||
}
|
||||
|
||||
static vec3_t get_closest_delta(vec3_t viewangles) {
|
||||
// Compensate for aim punch
|
||||
viewangles.x += g_punchAngles.x * AIM_PUNCH_MULT;
|
||||
viewangles.y += g_punchAngles.y * AIM_PUNCH_MULT;
|
||||
viewangles.z += g_punchAngles.z * AIM_PUNCH_MULT;
|
||||
|
||||
vec3_t view_height;
|
||||
i_engine->pEventAPI->EV_LocalPlayerViewheight(view_height);
|
||||
vec3_t local_eyes = vec_add(localplayer->origin, view_height);
|
||||
/* TODO: Compensate aim punch */
|
||||
|
||||
/* These 2 vars are used to store the best target across iterations.
|
||||
* NOTE: The default value of best_fov will be the aimbot fov */
|
||||
float best_fov = cv_aimbot->value;
|
||||
float min_distance = FLT_MAX; // For tracking the closest player
|
||||
float best_fov = dz_aim_aimbot->value;
|
||||
vec3_t best_delta = { 0, 0, 0 };
|
||||
|
||||
for (int i = 1; i <= i_engine->GetMaxClients(); i++) {
|
||||
cl_entity_t* ent = get_player(i);
|
||||
|
||||
if (!is_alive(ent) || is_friend(ent))
|
||||
continue;
|
||||
if (!is_alive(ent) || is_friend(ent)) {
|
||||
continue; // Skip if not alive or is a friend
|
||||
}
|
||||
|
||||
vec3_t head_pos = ent->origin;
|
||||
|
||||
if (ent->curstate.usehull != 1) { // Not crouched
|
||||
if (IsCS16()) {
|
||||
head_pos.z += CS16_HEAD_OFFSET;
|
||||
head_pos.x += CS16_HORIZONTAL_OFFSET;
|
||||
} else if (IsDayOfDefeat()) {
|
||||
head_pos.z += DOD_HEAD_OFFSET;
|
||||
head_pos.x += DOD_HORIZONTAL_OFFSET;
|
||||
} else {
|
||||
head_pos.z += HL1_HEAD_OFFSET;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
float distance = vec_length(vec_sub(ent->origin, local_eyes));
|
||||
if (distance > min_distance) {
|
||||
continue; // Skip players that are further than the current closest target
|
||||
}
|
||||
|
||||
/* TODO: Get bones origin instead of calculating from ent origin */
|
||||
const vec3_t head_pos = vec_add(ent->origin, vec3(0, 0, HEAD_OFFSET));
|
||||
const vec3_t enemy_angle = vec_to_ang(vec_sub(head_pos, local_eyes));
|
||||
|
||||
const vec3_t delta = vec_sub(enemy_angle, viewangles);
|
||||
vec_norm(delta);
|
||||
|
||||
float fov = hypotf(delta.x, delta.y);
|
||||
if (fov > 360.0f) {
|
||||
fov = remainderf(fov, 360.0f);
|
||||
if (fov > 180.0f)
|
||||
fov = 360.0f - fov;
|
||||
}
|
||||
if (fov > 180.0f) {
|
||||
fov = 360.0f - fov;
|
||||
}
|
||||
|
||||
if (fov < best_fov) {
|
||||
// Only check visibility for potential targets
|
||||
if (fov < best_fov && is_visible(local_eyes, head_pos)) {
|
||||
best_fov = fov;
|
||||
vec_copy(best_delta, delta);
|
||||
min_distance = distance; // Update the closest target's distance
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,25 +95,48 @@ static vec3_t get_closest_delta(vec3_t viewangles) {
|
|||
}
|
||||
|
||||
void aimbot(usercmd_t* cmd) {
|
||||
if (!CVAR_ON(aimbot) || !(cmd->buttons & IN_ATTACK))
|
||||
static bool shouldShootNextFrame = false; // If you're not using this variable, you can remove it.
|
||||
static bool hasAdjustedView = false;
|
||||
|
||||
if (!CVAR_ON(aim_aimbot) || !can_shoot())
|
||||
return;
|
||||
|
||||
/* Calculate delta with the engine viewangles, not with the cmd ones */
|
||||
vec3_t engine_viewangles;
|
||||
i_engine->GetViewAngles(engine_viewangles);
|
||||
|
||||
/* TODO: Add setting for lowest health */
|
||||
vec3_t best_delta = get_closest_delta(engine_viewangles);
|
||||
if (!vec_is_zero(best_delta)) {
|
||||
/* NOTE: We can divide the best delta here to add smoothing */
|
||||
|
||||
if (!vec_is_zero(best_delta)) {
|
||||
/*
|
||||
if (!lastShotHit) {
|
||||
// If the last shot missed, adjust the angle slightly
|
||||
// This is a simple approach and might need further tweaking
|
||||
best_delta.y += 0.5f; // Adjust yaw slightly
|
||||
}
|
||||
*/
|
||||
engine_viewangles.x += best_delta.x;
|
||||
engine_viewangles.y += best_delta.y;
|
||||
engine_viewangles.z += best_delta.z;
|
||||
|
||||
if (CVAR_ON(aim_aimbot_silent)) {
|
||||
vec_copy(cmd->viewangles, engine_viewangles);
|
||||
if (cmd->buttons & IN_ATTACK) {
|
||||
cmd->buttons |= IN_ATTACK;
|
||||
}
|
||||
} else {
|
||||
if (cmd->buttons & IN_ATTACK) {
|
||||
if (hasAdjustedView) {
|
||||
hasAdjustedView = false; // Reset flag
|
||||
} else {
|
||||
i_engine->SetViewAngles(engine_viewangles);
|
||||
hasAdjustedView = true;
|
||||
cmd->buttons &= ~IN_ATTACK; // Defer the shot to the next frame
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (CVAR_ON(aim_autoshoot) && (cmd->buttons & IN_ATTACK)) {
|
||||
cmd->buttons &= ~IN_ATTACK;
|
||||
}
|
||||
|
||||
vec_copy(cmd->viewangles, engine_viewangles);
|
||||
|
||||
/* NOTE: Uncomment to disable silent aim */
|
||||
/* i_engine->SetViewAngles(engine_viewangles); */
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#include "features.h"
|
||||
#include "../include/sdk.h"
|
||||
#include "../include/cvars.h"
|
||||
#include "../include/util.h"
|
||||
|
||||
float random_float(float min, float max) {
|
||||
return (max - min) * ((float)rand() / (float)RAND_MAX) + min;
|
||||
}
|
||||
|
||||
bool isSpacebarPressed() {
|
||||
Display* display = XOpenDisplay(NULL);
|
||||
if (!display) {
|
||||
return false; // Could not open the display, assume not pressed
|
||||
}
|
||||
|
||||
char keys_return[32];
|
||||
XQueryKeymap(display, keys_return);
|
||||
KeyCode kc = XKeysymToKeycode(display, XK_space);
|
||||
bool pressed = (keys_return[kc >> 3] & (1 << (kc & 7))) != 0;
|
||||
|
||||
XCloseDisplay(display);
|
||||
return pressed;
|
||||
}
|
||||
|
||||
void anti_aim(usercmd_t* cmd) {
|
||||
if (cmd->buttons & IN_ATTACK || cmd->buttons & IN_USE) {
|
||||
if (cmd->buttons & IN_ATTACK) {
|
||||
i_engine->pfnClientCmd("echo \"Attack detected. Spinbot stopped.\"");
|
||||
} else if (cmd->buttons & IN_USE) {
|
||||
i_engine->pfnClientCmd("echo \"Use key detected. Spinbot stopped.\"");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CVAR_ON(movement_antiaim)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_alive(localplayer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
vec3_t view_angles;
|
||||
i_engine->GetViewAngles(view_angles);
|
||||
|
||||
static bool lbyBreak = false;
|
||||
if (lbyBreak) {
|
||||
view_angles.y += 120.0f;
|
||||
}
|
||||
lbyBreak = !lbyBreak;
|
||||
|
||||
static bool flipPitch = false;
|
||||
if (flipPitch) {
|
||||
view_angles.x = 89.0f;
|
||||
} else {
|
||||
view_angles.x = -89.0f;
|
||||
}
|
||||
flipPitch = !flipPitch;
|
||||
|
||||
view_angles.y += 30.0f;
|
||||
|
||||
bool isBunnyHopping = cmd->buttons & IN_JUMP;
|
||||
bool isStationary = (cmd->forwardmove == 0.0f && cmd->sidemove == 0.0f);
|
||||
|
||||
// This shit busted right now
|
||||
if (CVAR_ON(movement_fakeduck) && (isStationary || isBunnyHopping || isSpacebarPressed())) {
|
||||
static int duckCounter = 0;
|
||||
if (duckCounter < 2) {
|
||||
cmd->buttons |= IN_DUCK;
|
||||
} else if (duckCounter < 4) {
|
||||
cmd->buttons &= ~IN_DUCK;
|
||||
} else {
|
||||
duckCounter = 0;
|
||||
}
|
||||
duckCounter++;
|
||||
}
|
||||
|
||||
if (view_angles.y > 180.0f) view_angles.y -= 360.0f;
|
||||
if (view_angles.y < -180.0f) view_angles.y += 360.0f;
|
||||
|
||||
if (CVAR_ON(movement_antiaim_view)) {
|
||||
i_engine->SetViewAngles(view_angles);
|
||||
i_engine->pfnClientCmd("echo \"Set view angles directly using movement_antiaim_view.\"");
|
||||
} else {
|
||||
vec_copy(cmd->viewangles, view_angles);
|
||||
i_engine->pfnClientCmd("echo \"Set view angles silently.\"");
|
||||
}
|
||||
|
||||
static float last_log_time = 0.0f;
|
||||
if (cmd->msec - last_log_time >= 5000.0f) {
|
||||
i_engine->pfnClientCmd("echo \"Advanced Anti-Aim has adjusted view angles.\"");
|
||||
last_log_time = cmd->msec;
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ enum chams_settings {
|
|||
visible_flags visible_mode;
|
||||
|
||||
bool chams(void* this_ptr) {
|
||||
const int setting = cv_chams->value == 5.0f ? 7 : cv_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);
|
||||
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
#include "../include/globals.h"
|
||||
#include "../include/cvars.h"
|
||||
#include "../include/util.h"
|
||||
#include "../include/game_detection.h"
|
||||
|
||||
/* For cv_esp */
|
||||
/* For dz_esp */
|
||||
enum esp_values {
|
||||
ESP_OFF = 0,
|
||||
ESP_BOX = 1,
|
||||
|
@ -98,38 +99,36 @@ static bool gl_draw2dbox(vec3_t o, int bh) {
|
|||
}
|
||||
|
||||
void esp(void) {
|
||||
const int setting = (int)cv_esp->value;
|
||||
const int setting = (int)dz_visuals_esp->value;
|
||||
if (setting == ESP_OFF)
|
||||
return;
|
||||
|
||||
/* Iterate all clients */
|
||||
for (int i = 1; i <= i_engine->GetMaxClients(); i++) {
|
||||
cl_entity_t* ent = get_player(i);
|
||||
|
||||
if (!valid_player(ent) || !is_alive(ent) || vec_is_zero(ent->origin))
|
||||
continue;
|
||||
|
||||
const int bh = (ent->curstate.usehull == 1) ? 44 : 70;
|
||||
/* const int bw = 25; */
|
||||
if (is_friend(ent) && dz_visuals_friendly->value == 0)
|
||||
continue;
|
||||
|
||||
int bh = 70;
|
||||
if (IsDayOfDefeat()) {
|
||||
bh = 76;
|
||||
} else if (ent->curstate.usehull == 1) {
|
||||
bh = 44;
|
||||
}
|
||||
|
||||
/* If ESP_BOX is enabled, draw it. If it returns false, continue */
|
||||
if (setting & ESP_BOX && !gl_draw2dbox(ent->origin, bh))
|
||||
continue;
|
||||
|
||||
/* Rest of the loop is for name esp, if var is not enabled, continue */
|
||||
if (!(setting & ESP_NAME))
|
||||
continue;
|
||||
|
||||
/* Draw name on top of the player. */
|
||||
vec3_t top = vec3(ent->origin.x, ent->origin.y, ent->origin.z + bh);
|
||||
vec2_t s_top;
|
||||
|
||||
if (!world_to_screen(top, s_top))
|
||||
continue;
|
||||
|
||||
/* TODO: Instead of -5px, center the player name to the player origin.
|
||||
* I don't know how to get the text size before rendering. */
|
||||
engine_draw_text(s_top[0] - 5, s_top[1] - 2, get_name(ent->index),
|
||||
(rgb_t){ 255, 255, 255 });
|
||||
vec3_t name_pos = vec3(ent->origin.x, ent->origin.y, ent->origin.z + bh + 5);
|
||||
vec2_t s_name_pos;
|
||||
if (world_to_screen(name_pos, s_name_pos)) {
|
||||
engine_draw_text(s_name_pos[0] - 5, s_name_pos[1] - 2, get_name(ent->index), (rgb_t){ 255, 255, 255 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,5 +31,15 @@ void aimbot(usercmd_t* cmd);
|
|||
|
||||
/* src/features/misc.c */
|
||||
void custom_crosshair(void);
|
||||
void bullet_tracers(usercmd_t* cmd);
|
||||
|
||||
/* src/features/namechanger.c */
|
||||
void check_namechanger_mode_and_execute(usercmd_t* cmd);
|
||||
|
||||
/* src/features/anti_aim.c */
|
||||
void anti_aim(usercmd_t* cmd);
|
||||
|
||||
/* src/features/fov.c */
|
||||
void fov_adjust(usercmd_t* cmd);
|
||||
|
||||
#endif /* FEATURES_H_ */
|
|
@ -0,0 +1,19 @@
|
|||
#include <stdio.h>
|
||||
#include "../include/globals.h"
|
||||
#include "../include/sdk.h"
|
||||
#include "../include/util.h"
|
||||
#include "features.h"
|
||||
|
||||
extern cvar_t* dz_visuals_fov;
|
||||
extern float* scr_fov_value;
|
||||
|
||||
void fov_adjust(usercmd_t* cmd) {
|
||||
if (!scr_fov_value) {
|
||||
printf("FOV ERROR: Check globals.c missing scr_fov_value.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (dz_visuals_fov->value) {
|
||||
*scr_fov_value = dz_visuals_fov->value;
|
||||
}
|
||||
}
|
|
@ -4,9 +4,10 @@
|
|||
#include "../include/globals.h"
|
||||
#include "../include/cvars.h"
|
||||
#include "../include/util.h"
|
||||
#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. */
|
||||
|
@ -14,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 = cv_crosshair->value;
|
||||
const int len = dz_visuals_crosshair->value;
|
||||
const int gap = 1;
|
||||
const float w = 1;
|
||||
const rgb_t col = { 255, 255, 255 };
|
||||
|
@ -29,3 +30,53 @@ void custom_crosshair(void) {
|
|||
gl_drawline(mx - gap, my + gap, mx - gap - len, my + gap + len, w, col);
|
||||
gl_drawline(mx + gap, my + gap, mx + gap + len, my + gap + len, w, col);
|
||||
}
|
||||
|
||||
weapon_data_t g_currentWeapon;
|
||||
static double lastTracerTime = 0;
|
||||
|
||||
static bool attackReleased = true;
|
||||
|
||||
void bullet_tracers(usercmd_t* cmd) {
|
||||
if (!CVAR_ON(visuals_tracers) || !is_alive(localplayer))
|
||||
return;
|
||||
|
||||
if (IsCS16()) {
|
||||
if (cmd->buttons & IN_ATTACK) {
|
||||
if (!attackReleased) {
|
||||
return;
|
||||
}
|
||||
attackReleased = false;
|
||||
} else {
|
||||
attackReleased = true;
|
||||
return;
|
||||
}
|
||||
if (!can_shoot()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!(cmd->buttons & IN_ATTACK) || !can_shoot()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get player eye pos, start of tracer */
|
||||
vec3_t view_height;
|
||||
i_engine->pEventAPI->EV_LocalPlayerViewheight(view_height);
|
||||
vec3_t local_eyes = vec_add(localplayer->origin, view_height);
|
||||
|
||||
/* Get forward vector from viewangles */
|
||||
vec3_t fwd;
|
||||
i_engine->pfnAngleVectors(cmd->viewangles, fwd, NULL, NULL);
|
||||
|
||||
const int tracer_len = 3000;
|
||||
vec3_t end;
|
||||
end.x = local_eyes.x + fwd.x * tracer_len;
|
||||
end.y = local_eyes.y + fwd.y * tracer_len;
|
||||
end.z = local_eyes.z + fwd.z * tracer_len;
|
||||
|
||||
/* NOTE: Change tracer settings here */
|
||||
const float w = 0.8;
|
||||
const float time = 2;
|
||||
draw_tracer(local_eyes, end, (rgb_t){ 66, 165, 245 }, 1, w, time);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,8 @@ static void autostrafe_legit(usercmd_t* cmd) {
|
|||
* https://github.com/deboogerxyz/ahc/blob/0492646e28dd7234a8cd431d37b152dc18a21b04/ahc.c#L201
|
||||
* https://github.com/NullHooks/NullHooks/blob/535351569ca599cadd21a286d88098b6dc057a46/src/core/features/movement/bhop.cpp#L73
|
||||
*/
|
||||
static const float DEG2RAD_CACHED = M_PI / 180.0f;
|
||||
|
||||
static void autostrafe_rage(usercmd_t* cmd) {
|
||||
if (i_pmove->movetype != MOVETYPE_WALK)
|
||||
return;
|
||||
|
@ -31,7 +33,7 @@ static void autostrafe_rage(usercmd_t* cmd) {
|
|||
/* TODO: Get at runtime */
|
||||
const float sv_airaccelerate = 10.0f;
|
||||
const float sv_maxspeed = 320.0f;
|
||||
const float cl_forwardspeed = 400.0f;
|
||||
const float cl_forwardspeed = 425.0f;
|
||||
const float cl_sidespeed = 400.0f;
|
||||
|
||||
float speed = vec_len2d(i_pmove->velocity);
|
||||
|
@ -48,24 +50,22 @@ static void autostrafe_rage(usercmd_t* cmd) {
|
|||
|
||||
float best_delta = acosf(term);
|
||||
|
||||
/* Use engine viewangles in case we do something nasty with cmd's angles */
|
||||
vec3_t viewangles;
|
||||
i_engine->GetViewAngles(viewangles);
|
||||
|
||||
/* Get our desired angles and delta */
|
||||
float yaw = DEG2RAD(viewangles.y);
|
||||
float vel_dir = atan2f(i_pmove->velocity.y, i_pmove->velocity.x) - yaw;
|
||||
float yaw = viewangles.y * DEG2RAD_CACHED;
|
||||
float vel_dir = atan2f(i_pmove->velocity.y, i_pmove->velocity.x) - yaw;
|
||||
float target_ang = atan2f(-cmd->sidemove, cmd->forwardmove);
|
||||
float delta = angle_delta_rad(vel_dir, target_ang);
|
||||
float delta = angle_delta_rad(vel_dir, target_ang);
|
||||
|
||||
float movedir = delta < 0 ? vel_dir + best_delta : vel_dir - best_delta;
|
||||
|
||||
cmd->forwardmove = cosf(movedir) * cl_forwardspeed;
|
||||
cmd->sidemove = -sinf(movedir) * cl_sidespeed;
|
||||
cmd->sidemove = -sinf(movedir) * cl_sidespeed;
|
||||
}
|
||||
|
||||
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)cv_autostrafe->value) {
|
||||
switch ((int)dz_movement_autostrafe->value) {
|
||||
case 1:
|
||||
autostrafe_rage(cmd);
|
||||
break;
|
||||
|
@ -101,18 +101,15 @@ void bhop(usercmd_t* cmd) {
|
|||
* https://github.com/deboogerxyz/ahc/blob/0492646e28dd7234a8cd431d37b152dc18a21b04/ahc.c#L377
|
||||
*/
|
||||
void correct_movement(usercmd_t* cmd, vec3_t old_angles) {
|
||||
float old_y = old_angles.y + (old_angles.y < 0 ? 360 : 0);
|
||||
float new_y = cmd->viewangles.y + (cmd->viewangles.y < 0 ? 360 : 0);
|
||||
float delta = (new_y < old_y) ? fabsf(new_y - old_y)
|
||||
: 360 - fabsf(new_y - old_y);
|
||||
float delta_y = fmodf(cmd->viewangles.y - old_angles.y + 540.0f, 360.0f) - 180.0f; // Normalized delta in [-180, 180)
|
||||
|
||||
delta = 360 - delta;
|
||||
float delta_rad = delta_y * DEG2RAD_CACHED;
|
||||
float delta_cos = cosf(delta_rad);
|
||||
float delta_sin = sinf(delta_rad);
|
||||
|
||||
float forward = cmd->forwardmove;
|
||||
float side = cmd->sidemove;
|
||||
float side = cmd->sidemove;
|
||||
|
||||
cmd->forwardmove =
|
||||
cos(DEG2RAD(delta)) * forward + cos(DEG2RAD(delta + 90)) * side;
|
||||
cmd->sidemove =
|
||||
sin(DEG2RAD(delta)) * forward + sin(DEG2RAD(delta + 90)) * side;
|
||||
cmd->forwardmove = delta_cos * forward - delta_sin * side;
|
||||
cmd->sidemove = delta_sin * forward + delta_cos * side;
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
#include <stdint.h>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include "features.h"
|
||||
#include "../include/globals.h"
|
||||
#include "../include/cvars.h"
|
||||
#include "../include/util.h"
|
||||
#include "../include/game_detection.h"
|
||||
|
||||
static int change_counter = 0;
|
||||
#define NAME_CHANGE_INTERVAL 10
|
||||
|
||||
static int last_name_idx = -1;
|
||||
|
||||
void change_name(const char* new_name) {
|
||||
if (!new_name) return;
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "name \"%s\u0315 \"", new_name);
|
||||
i_engine->pfnClientCmd(command);
|
||||
}
|
||||
|
||||
std::vector<char*> get_valid_names(bool (*filter)(cl_entity_t*)) {
|
||||
int max_players = 32;
|
||||
std::vector<char*> valid_names;
|
||||
|
||||
for (int i = 0; i < max_players; i++) {
|
||||
cl_entity_t* ent = get_player(i);
|
||||
if (!ent) continue;
|
||||
|
||||
if (!filter || filter(ent)) {
|
||||
valid_names.push_back(get_name(i));
|
||||
}
|
||||
}
|
||||
|
||||
return valid_names;
|
||||
}
|
||||
|
||||
void change_name_from_list(std::vector<char*>& names) {
|
||||
if (names.empty()) return;
|
||||
|
||||
last_name_idx = (last_name_idx + 1) % names.size();
|
||||
|
||||
char* name = names[last_name_idx];
|
||||
if (name) {
|
||||
change_name(name);
|
||||
printf("Changing name to: %s\n", name);
|
||||
}
|
||||
}
|
||||
|
||||
void change_name_teammates() {
|
||||
auto names = get_valid_names(is_friend);
|
||||
std::random_shuffle(names.begin(), names.end());
|
||||
change_name_from_list(names);
|
||||
}
|
||||
|
||||
void change_name_enemies() {
|
||||
auto names = get_valid_names([](cl_entity_t* ent) -> bool {
|
||||
return !is_friend(ent);
|
||||
});
|
||||
std::random_shuffle(names.begin(), names.end());
|
||||
change_name_from_list(names);
|
||||
}
|
||||
|
||||
void change_name_all_players() {
|
||||
auto names = get_valid_names(nullptr);
|
||||
std::random_shuffle(names.begin(), names.end());
|
||||
change_name_from_list(names);
|
||||
}
|
||||
|
||||
void change_name_based_on_mode(usercmd_t* cmd) {
|
||||
if (!CVAR_ON(misc_namechanger)) return;
|
||||
|
||||
if (++change_counter < dz_misc_namechanger_speed->value) {
|
||||
return;
|
||||
}
|
||||
change_counter = 0;
|
||||
|
||||
switch ((int)dz_misc_namechanger->value) {
|
||||
case 1:
|
||||
change_name_teammates();
|
||||
break;
|
||||
case 2:
|
||||
change_name_enemies();
|
||||
break;
|
||||
case 3:
|
||||
change_name_all_players();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void check_namechanger_mode_and_execute(usercmd_t* cmd) {
|
||||
if (!CVAR_ON(misc_namechanger)) return;
|
||||
|
||||
change_name_based_on_mode(cmd);
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
#include "include/game_detection.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static GameType current_game = GAME_UNKNOWN;
|
||||
|
||||
GameType get_current_game(void) {
|
||||
if (current_game != GAME_UNKNOWN) {
|
||||
return current_game;
|
||||
}
|
||||
|
||||
FILE *fp = fopen("/proc/self/cmdline", "r");
|
||||
if (fp) {
|
||||
char buf[1024];
|
||||
size_t size = fread(buf, sizeof(char), sizeof(buf) - 1, fp);
|
||||
fclose(fp);
|
||||
|
||||
if (size > 0) {
|
||||
buf[size] = '\0';
|
||||
|
||||
char *gameTypeToken = NULL;
|
||||
char *steamToken = NULL;
|
||||
|
||||
int tokensFound = 0;
|
||||
|
||||
for (char *token = buf; token < buf + size; token += strlen(token) + 1) {
|
||||
tokensFound++;
|
||||
|
||||
if (strcmp(token, "-game") == 0) {
|
||||
gameTypeToken = token + strlen(token) + 1;
|
||||
} else if (strcmp(token, "-steam") == 0) {
|
||||
steamToken = token;
|
||||
}
|
||||
}
|
||||
|
||||
if (gameTypeToken) {
|
||||
if (strcmp(gameTypeToken, "cstrike") == 0) {
|
||||
current_game = GAME_CS16;
|
||||
} else if (strcmp(gameTypeToken, "dod") == 0) {
|
||||
current_game = GAME_DAY_OF_DEFEAT;
|
||||
} else if (strcmp(gameTypeToken, "dmc") == 0) {
|
||||
current_game = GAME_DMC;
|
||||
} else if (strcmp(gameTypeToken, "tfc") == 0) {
|
||||
current_game = GAME_TFC;
|
||||
} else if (strcmp(gameTypeToken, "SpaceLife") == 0) {
|
||||
current_game = GAME_SL;
|
||||
}
|
||||
} else if (steamToken && tokensFound == 2) {
|
||||
// If only `-steam` is found and no `-game`, with only two tokens, assume it's Half-Life 1
|
||||
current_game = GAME_HALFLIFE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return current_game;
|
||||
}
|
||||
|
||||
int IsCS16(void) {
|
||||
return get_current_game() == GAME_CS16;
|
||||
}
|
||||
|
||||
int IsHalfLife(void) {
|
||||
return get_current_game() == GAME_HALFLIFE;
|
||||
}
|
||||
|
||||
int IsDayOfDefeat(void) {
|
||||
return get_current_game() == GAME_DAY_OF_DEFEAT;
|
||||
}
|
||||
|
||||
int IsTFC(void) {
|
||||
return get_current_game() == GAME_TFC;
|
||||
}
|
||||
|
||||
int IsDeathmatchClassic(void) {
|
||||
return get_current_game() == GAME_DMC;
|
||||
}
|
||||
|
||||
int IsSpaceLife(void) {
|
||||
return get_current_game() == GAME_SL;
|
||||
}
|
|
@ -8,10 +8,15 @@
|
|||
#include "include/sdk.h"
|
||||
#include "include/util.h"
|
||||
|
||||
enum game_id this_game_id = HL;
|
||||
game_id this_game_id = HL;
|
||||
vec3_t g_punchAngles = { 0, 0, 0 };
|
||||
|
||||
/* Weapon info */
|
||||
float g_flNextAttack = 0.f, g_flNextPrimaryAttack = 0.f;
|
||||
int g_iClip = 0;
|
||||
|
||||
double g_flCurrentTime = 0.0;
|
||||
|
||||
/* Bone origins of each player, updated in studiorendermodel */
|
||||
vec3_t g_bones[64][128];
|
||||
|
||||
void* hw;
|
||||
void** h_client;
|
||||
|
@ -30,6 +35,8 @@ void* player_extra_info;
|
|||
/* Updated in CL_CreateMove hook */
|
||||
cl_entity_t* localplayer = NULL;
|
||||
|
||||
float* scr_fov_value = NULL;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
bool globals_init(void) {
|
||||
|
@ -40,13 +47,13 @@ bool globals_init(void) {
|
|||
*/
|
||||
hw = dlopen("hw.so", RTLD_LAZY | RTLD_NOLOAD);
|
||||
if (!hw) {
|
||||
printf("hl-cheat: globals_init: can't open hw.so\n");
|
||||
printf("goldsource-cheat: globals_init: can't open hw.so\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
h_client = (void**)dlsym(hw, "hClientDLL");
|
||||
if (!h_client) {
|
||||
printf("hl-cheat: globals_init: can't find hClientDLL\n");
|
||||
printf("goldsource-cheat: globals_init: can't find hClientDLL\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -63,14 +70,16 @@ bool globals_init(void) {
|
|||
|
||||
game_info = *(game_t**)dlsym(hw, "game");
|
||||
|
||||
scr_fov_value = (float*)dlsym(hw, "scr_fov_value");
|
||||
|
||||
if (!i_engine || !i_client || !i_pmove || !i_enginestudio ||
|
||||
!i_studiomodelrenderer || !game_info) {
|
||||
printf("hl-cheat: globals_init: couldn't load some symbols\n");
|
||||
printf("goldsource-cheat: globals_init: couldn't load some symbols\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!protect_addr(i_studiomodelrenderer, PROT_READ | PROT_WRITE)) {
|
||||
printf("hl-cheat: globals_init: couldn't unprotect address of SMR\n");
|
||||
printf("goldsource-cheat: globals_init: couldn't unprotect address of SMR\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
71
src/hooks.c
71
src/hooks.c
|
@ -11,6 +11,8 @@
|
|||
DECL_HOOK(CL_CreateMove);
|
||||
DECL_HOOK(HUD_Redraw);
|
||||
DECL_HOOK(StudioRenderModel);
|
||||
DECL_HOOK(CalcRefdef);
|
||||
DECL_HOOK(HUD_PostRunCmd);
|
||||
|
||||
/* OpenGL hooks */
|
||||
DECL_HOOK(glColor4f);
|
||||
|
@ -27,6 +29,8 @@ bool hooks_init(void) {
|
|||
HOOK(i_client, CL_CreateMove);
|
||||
HOOK(i_client, HUD_Redraw);
|
||||
HOOK(i_studiomodelrenderer, StudioRenderModel);
|
||||
HOOK(i_client, CalcRefdef);
|
||||
HOOK(i_client, HUD_PostRunCmd);
|
||||
|
||||
/* OpenGL hooks */
|
||||
GL_HOOK(glColor4f);
|
||||
|
@ -59,6 +63,10 @@ void h_CL_CreateMove(float frametime, usercmd_t* cmd, int active) {
|
|||
|
||||
bhop(cmd);
|
||||
aimbot(cmd);
|
||||
bullet_tracers(cmd);
|
||||
anti_aim(cmd);
|
||||
check_namechanger_mode_and_execute(cmd);
|
||||
fov_adjust(cmd);
|
||||
|
||||
correct_movement(cmd, old_angles);
|
||||
vec_clamp(cmd->viewangles);
|
||||
|
@ -66,11 +74,31 @@ void h_CL_CreateMove(float frametime, usercmd_t* cmd, int active) {
|
|||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
rgb_t rainbow_color(float time) {
|
||||
const float frequency = 0.1f;
|
||||
|
||||
unsigned char r = (sin(frequency * time + 0) * 127.5f + 127.5f);
|
||||
unsigned char g = (sin(frequency * time + 2.0f) * 127.5f + 127.5f);
|
||||
unsigned char b = (sin(frequency * time + 4.0f) * 127.5f + 127.5f);
|
||||
|
||||
return (rgb_t){ r, g, b };
|
||||
}
|
||||
|
||||
int h_HUD_Redraw(float time, int intermission) {
|
||||
int ret = ORIGINAL(HUD_Redraw, time, intermission);
|
||||
|
||||
/* Watermark */
|
||||
engine_draw_text(5, 5, "8dcc/hl-cheat", (rgb_t){ 255, 255, 255 });
|
||||
if (dz_watermark->value) {
|
||||
/* Determine the color for the watermark */
|
||||
rgb_t color;
|
||||
|
||||
if (dz_watermark_rainbow->value) {
|
||||
color = rainbow_color(time);
|
||||
} else {
|
||||
color = (rgb_t){ 0, 255, 255 }; // default color
|
||||
}
|
||||
/* Watermark */
|
||||
engine_draw_text(5, 5, "https://git.deadzone.lol/Wizzard/goldsrc-cheat", color);
|
||||
}
|
||||
|
||||
esp();
|
||||
custom_crosshair();
|
||||
|
@ -81,20 +109,39 @@ int h_HUD_Redraw(float time, int intermission) {
|
|||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
void h_StudioRenderModel(void* this_ptr) {
|
||||
/* Update bones array */
|
||||
cl_entity_t* ent = i_enginestudio->GetCurrentEntity();
|
||||
bone_matrix* mat = (bone_matrix*)i_enginestudio->StudioGetBoneTransform();
|
||||
for (int i = 0; i < 128; i++) {
|
||||
const vec3_t bone_orig = matrix_3x4_origin((*mat)[i]);
|
||||
vec_copy(g_bones[ent->index][i], bone_orig);
|
||||
}
|
||||
|
||||
if (!chams(this_ptr))
|
||||
ORIGINAL(StudioRenderModel, this_ptr);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
void h_CalcRefdef(ref_params_t* params) {
|
||||
/* Store punch angles for CreateMove */
|
||||
vec_copy(g_punchAngles, params->punchangle);
|
||||
|
||||
ORIGINAL(CalcRefdef, params);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
void h_HUD_PostRunCmd(struct local_state_s* from, struct local_state_s* to,
|
||||
struct usercmd_s* cmd, int runfuncs, double time,
|
||||
unsigned int random_seed) {
|
||||
ORIGINAL(HUD_PostRunCmd, from, to, cmd, runfuncs, time, random_seed);
|
||||
|
||||
g_flCurrentTime = time;
|
||||
|
||||
/* Store attack information to check if we can shoot */
|
||||
if (runfuncs) {
|
||||
g_flNextAttack = to->client.m_flNextAttack;
|
||||
g_flNextPrimaryAttack =
|
||||
to->weapondata[to->client.m_iId].m_flNextPrimaryAttack;
|
||||
g_iClip = to->weapondata[to->client.m_iId].m_iClip;
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
void h_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
|
||||
/* This visible_mode variable is changed inside the chams() function, which
|
||||
* is called from the StudioRenderModel hook.
|
||||
|
@ -140,8 +187,8 @@ void h_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
|
|||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
void h_CL_Move() {
|
||||
if (cv_clmove->value != 0) {
|
||||
for (int i = 0; i < (int)cv_clmove->value; i++)
|
||||
if (dz_movement_clmove->value != 0) {
|
||||
for (int i = 0; i < (int)dz_movement_clmove->value; i++)
|
||||
CALL_ORIGINAL(detour_data_clmove, clmove_type);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "sdk.h"
|
||||
#include "globals.h"
|
||||
|
||||
#define CVAR_PREFIX "cv_"
|
||||
#define CVAR_PREFIX "dz_"
|
||||
#define CVAR_HACK_ID 0x4000 /* (1<<14) One that is not in use by the game */
|
||||
|
||||
/*
|
||||
|
@ -16,27 +16,39 @@
|
|||
*
|
||||
* prefix | meaning
|
||||
* -------+-------------------------------
|
||||
* cv_* | cvar variable
|
||||
* dz_* | cvar variable
|
||||
*/
|
||||
#define DECL_CVAR(name) cvar_t* cv_##name = NULL;
|
||||
#define DECL_CVAR(name) cvar_t* dz_##name = NULL;
|
||||
|
||||
#define DECL_CVAR_EXTERN(name) extern cvar_t* cv_##name;
|
||||
#define DECL_CVAR_EXTERN(name) extern cvar_t* dz_##name;
|
||||
|
||||
#define REGISTER_CVAR(name, value) \
|
||||
cv_##name = \
|
||||
dz_##name = \
|
||||
i_engine->pfnRegisterVariable(CVAR_PREFIX #name, #value, CVAR_HACK_ID);
|
||||
|
||||
#define CVAR_ON(name) (cv_##name->value != 0.0f)
|
||||
#define CVAR_ON(name) (dz_##name->value != 0.0f)
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
DECL_CVAR_EXTERN(bhop);
|
||||
DECL_CVAR_EXTERN(autostrafe);
|
||||
DECL_CVAR_EXTERN(aimbot);
|
||||
DECL_CVAR_EXTERN(esp);
|
||||
DECL_CVAR_EXTERN(chams);
|
||||
DECL_CVAR_EXTERN(crosshair);
|
||||
DECL_CVAR_EXTERN(clmove);
|
||||
DECL_CVAR_EXTERN(movement_bhop);
|
||||
DECL_CVAR_EXTERN(movement_autostrafe);
|
||||
DECL_CVAR_EXTERN(aim_aimbot);
|
||||
DECL_CVAR_EXTERN(aim_autoshoot);
|
||||
DECL_CVAR_EXTERN(visuals_esp);
|
||||
DECL_CVAR_EXTERN(visuals_chams);
|
||||
DECL_CVAR_EXTERN(visuals_crosshair);
|
||||
DECL_CVAR_EXTERN(visuals_tracers);
|
||||
DECL_CVAR_EXTERN(movement_clmove);
|
||||
DECL_CVAR_EXTERN(watermark);
|
||||
DECL_CVAR_EXTERN(watermark_rainbow);
|
||||
DECL_CVAR_EXTERN(aim_aimbot_silent);
|
||||
DECL_CVAR_EXTERN(visuals_friendly);
|
||||
DECL_CVAR_EXTERN(movement_antiaim);
|
||||
DECL_CVAR_EXTERN(movement_antiaim_view);
|
||||
DECL_CVAR_EXTERN(movement_fakeduck);
|
||||
DECL_CVAR_EXTERN(misc_namechanger)
|
||||
DECL_CVAR_EXTERN(misc_namechanger_speed)
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef _GAME_DETECT_H_
|
||||
#define _GAME_DETECT_H_
|
||||
|
||||
typedef enum {
|
||||
GAME_UNKNOWN = 0,
|
||||
GAME_HALFLIFE,
|
||||
GAME_CS16,
|
||||
GAME_TFC,
|
||||
GAME_DAY_OF_DEFEAT,
|
||||
GAME_DMC,
|
||||
GAME_SL
|
||||
} GameType;
|
||||
|
||||
GameType get_current_game(void);
|
||||
int IsCS16(void);
|
||||
int IsHalfLife(void);
|
||||
int IsDayOfDefeat(void);
|
||||
int IsTFC(void);
|
||||
int IsDeathmatchClassic(void);
|
||||
int IsSpaceLife(void);
|
||||
|
||||
#endif
|
|
@ -9,6 +9,7 @@ enum game_id {
|
|||
CS = 1, /* Counter-Strike 1.6 */
|
||||
TF = 2, /* Team Fortress Classic */
|
||||
DOD = 3, /* Day of Defeat */
|
||||
SL = 4, /* Space Life: Finleys Revenge */
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
@ -34,7 +35,11 @@ enum game_id {
|
|||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
extern game_id this_game_id;
|
||||
extern vec3_t g_bones[64][128];
|
||||
extern vec3_t g_punchAngles;
|
||||
extern float g_flNextAttack, g_flNextPrimaryAttack;
|
||||
extern float* scr_fov_value;
|
||||
extern int g_iClip;
|
||||
extern double g_flCurrentTime;
|
||||
|
||||
extern void* hw;
|
||||
extern void** h_client; /* hClientDLL hander */
|
||||
|
|
|
@ -95,6 +95,10 @@ void hooks_restore(void);
|
|||
DECL_HOOK_EXTERN(void, CL_CreateMove, float, usercmd_t*, int);
|
||||
DECL_HOOK_EXTERN(int, HUD_Redraw, float, int);
|
||||
DECL_HOOK_EXTERN(void, StudioRenderModel, void*);
|
||||
DECL_HOOK_EXTERN(void, CalcRefdef, ref_params_t*);
|
||||
DECL_HOOK_EXTERN(void, HUD_PostRunCmd, struct local_state_s*,
|
||||
struct local_state_s*, struct usercmd_s*, int, double,
|
||||
unsigned int);
|
||||
|
||||
/* OpenGL hooks */
|
||||
DECL_HOOK_EXTERN(void, glColor4f, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#define MAIN_H_
|
||||
|
||||
void load(void);
|
||||
void unload(void);
|
||||
void self_unload(void);
|
||||
|
||||
#endif /* MAIN_H_ */
|
||||
|
|
|
@ -62,7 +62,7 @@ typedef struct cl_clientfuncs_s {
|
|||
void (*CL_CameraOffset)(float* ofs);
|
||||
struct kbutton_s* (*KB_Find)(const char* name);
|
||||
void (*CAM_Think)(void);
|
||||
void (*V_CalcRefdef)(struct ref_params_s* pparams);
|
||||
void (*CalcRefdef)(struct ref_params_s* pparams);
|
||||
int (*HUD_AddEntity)(int type, struct cl_entity_s* ent,
|
||||
const char* modelname);
|
||||
|
||||
|
|
|
@ -22,10 +22,11 @@ typedef struct {
|
|||
#define gl_drawline_points(p0, p1, w, col) \
|
||||
gl_drawline(p0[0], p0[1], p1[0], p1[1], w, col);
|
||||
|
||||
/* Use indexes so it works for float[] as well as vec3_t */
|
||||
#define vec_copy(dst, src) \
|
||||
dst.x = src.x; \
|
||||
dst.y = src.y; \
|
||||
dst.z = src.z;
|
||||
dst[0] = src[0]; \
|
||||
dst[1] = src[1]; \
|
||||
dst[2] = src[2];
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -33,8 +34,8 @@ cl_entity_t* get_player(int ent_idx);
|
|||
bool is_alive(cl_entity_t* ent);
|
||||
bool valid_player(cl_entity_t* ent);
|
||||
bool is_friend(cl_entity_t* ent);
|
||||
bool can_shoot(void);
|
||||
char* get_name(int ent_idx);
|
||||
game_id get_cur_game(void);
|
||||
vec3_t vec3(float x, float y, float z);
|
||||
vec3_t vec_add(vec3_t a, vec3_t b);
|
||||
vec3_t vec_sub(vec3_t a, vec3_t b);
|
||||
|
@ -47,6 +48,7 @@ vec3_t vec_to_ang(vec3_t v);
|
|||
vec3_t matrix_3x4_origin(matrix_3x4 m);
|
||||
bool world_to_screen(vec3_t vec, vec2_t screen);
|
||||
void engine_draw_text(int x, int y, char* s, rgb_t c);
|
||||
void draw_tracer(vec3_t start, vec3_t end, rgb_t c, float a, float w, float t);
|
||||
void gl_drawbox(int x, int y, int w, int h, rgb_t c);
|
||||
void gl_drawline(int x0, int y0, int x1, int y1, float w, rgb_t col);
|
||||
bool protect_addr(void* ptr, int new_flags);
|
||||
|
|
67
src/main.c
67
src/main.c
|
@ -1,4 +1,5 @@
|
|||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
|
@ -8,44 +9,94 @@
|
|||
#include "include/cvars.h"
|
||||
#include "include/hooks.h"
|
||||
#include "include/util.h"
|
||||
#include "include/game_detection.h"
|
||||
|
||||
static bool loaded = false;
|
||||
|
||||
__attribute__((constructor)) /* Entry point when injected */
|
||||
void load(void) {
|
||||
printf("hl-cheat injected!\n");
|
||||
printf("goldsource-cheat injected!\n");
|
||||
|
||||
/* Initialize globals/interfaces */
|
||||
if (!globals_init()) {
|
||||
fprintf(stderr, "hl-cheat: load: error loading globals, aborting\n");
|
||||
fprintf(stderr, "goldsource-cheat: load: error loading globals, aborting\n");
|
||||
self_unload();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Create cvars for settings */
|
||||
if (!cvars_init()) {
|
||||
fprintf(stderr, "hl-cheat: load: error creating cvars, aborting\n");
|
||||
fprintf(stderr, "goldsource-cheat: load: error creating cvars, aborting\n");
|
||||
self_unload();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Hook functions */
|
||||
if (!hooks_init()) {
|
||||
fprintf(stderr, "hl-cheat: load: error hooking functions, aborting\n");
|
||||
fprintf(stderr, "goldsource-cheat: load: error hooking functions, aborting\n");
|
||||
self_unload();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get game version after injecting */
|
||||
this_game_id = get_cur_game();
|
||||
|
||||
i_engine->pfnClientCmd("echo \"hl-cheat loaded successfully!\"");
|
||||
if (IsCS16()) {
|
||||
i_engine->pfnClientCmd("play 'sound/radio/go.wav'");
|
||||
}
|
||||
else if (IsDayOfDefeat()) {
|
||||
i_engine->pfnClientCmd("play 'sound/player/gersniper.wav'");
|
||||
}
|
||||
else if (IsTFC()) {
|
||||
i_engine->pfnClientCmd("play 'sound/misc/party2.wav'");
|
||||
}
|
||||
else if (IsDeathmatchClassic()) {
|
||||
i_engine->pfnClientCmd("play 'sound/items/suit.wav'");
|
||||
}
|
||||
else if (IsSpaceLife()) {
|
||||
i_engine->pfnClientCmd("play 'sound/finley/soccer_ball.wav'");
|
||||
}
|
||||
else
|
||||
{
|
||||
i_engine->pfnClientCmd("play 'valve/sound/vox/suit.wav'");
|
||||
}
|
||||
|
||||
i_engine->pfnClientCmd("echo \"goldsource-cheat loaded successfully!\"");
|
||||
i_engine->pfnClientCmd("echo \"Deadzone rulez!\"");
|
||||
i_engine->pfnClientCmd("echo \"https://git.deadzone.lol/Wizzard/goldsrc-cheat\"");
|
||||
|
||||
|
||||
GameType game = get_current_game();
|
||||
switch(game) {
|
||||
case GAME_HALFLIFE:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Half-Life 1\"");
|
||||
break;
|
||||
case GAME_CS16:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Counter-Strike 1.6\"");
|
||||
break;
|
||||
case GAME_DAY_OF_DEFEAT:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Day of Defeat\"");
|
||||
break;
|
||||
case GAME_TFC:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Team Fortress Classic\"");
|
||||
break;
|
||||
case GAME_DMC:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Deathmatch Classic\"");
|
||||
break;
|
||||
case GAME_SL:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Space Life: Finley's Revenge\"");
|
||||
break;
|
||||
default:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Unknown Game\"");
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
__attribute__((destructor)) /* Entry point when unloaded */
|
||||
void unload() {
|
||||
void unload(void) {
|
||||
if (loaded) {
|
||||
/* TODO: Remove our cvars */
|
||||
|
||||
|
@ -55,7 +106,7 @@ void unload() {
|
|||
GL_UNHOOK(glColor4f); /* Manually restore OpenGL hooks here */
|
||||
}
|
||||
|
||||
printf("hl-cheat unloaded.\n\n");
|
||||
printf("goldsource-cheat unloaded.\n\n");
|
||||
}
|
||||
|
||||
void self_unload(void) {
|
||||
|
|
80
src/util.c
80
src/util.c
|
@ -9,6 +9,7 @@
|
|||
#include "include/util.h"
|
||||
#include "include/sdk.h"
|
||||
#include "include/globals.h"
|
||||
#include "include/game_detection.h"
|
||||
|
||||
cl_entity_t* get_player(int ent_idx) {
|
||||
if (ent_idx < 0 || ent_idx > 32)
|
||||
|
@ -35,34 +36,33 @@ bool is_friend(cl_entity_t* ent) {
|
|||
if (!ent)
|
||||
return false;
|
||||
|
||||
/* Check the current game because this method only works for some games */
|
||||
switch (this_game_id) {
|
||||
case TF: {
|
||||
GameType game = get_current_game();
|
||||
|
||||
switch (game) {
|
||||
case GAME_TFC: {
|
||||
extra_player_info_t* info = (extra_player_info_t*)player_extra_info;
|
||||
|
||||
return info[ent->index].teamnumber ==
|
||||
info[localplayer->index].teamnumber;
|
||||
return info[ent->index].teamnumber == info[localplayer->index].teamnumber;
|
||||
}
|
||||
case CS: {
|
||||
extra_player_info_cs_t* info =
|
||||
(extra_player_info_cs_t*)player_extra_info;
|
||||
|
||||
return info[ent->index].teamnumber ==
|
||||
info[localplayer->index].teamnumber;
|
||||
case GAME_CS16: {
|
||||
extra_player_info_cs_t* info = (extra_player_info_cs_t*)player_extra_info;
|
||||
return info[ent->index].teamnumber == info[localplayer->index].teamnumber;
|
||||
}
|
||||
case DOD: {
|
||||
extra_player_info_dod_t* info =
|
||||
(extra_player_info_dod_t*)player_extra_info;
|
||||
|
||||
return info[ent->index].teamnumber ==
|
||||
info[localplayer->index].teamnumber;
|
||||
case GAME_DAY_OF_DEFEAT: {
|
||||
extra_player_info_dod_t* info = (extra_player_info_dod_t*)player_extra_info;
|
||||
return info[ent->index].teamnumber == info[localplayer->index].teamnumber;
|
||||
}
|
||||
case HL:
|
||||
case GAME_HALFLIFE:
|
||||
case GAME_DMC:
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool can_shoot(void) {
|
||||
return g_iClip > 0 && g_flNextAttack <= 0.0f &&
|
||||
g_flNextPrimaryAttack <= 0.0f;
|
||||
}
|
||||
|
||||
char* get_name(int ent_idx) {
|
||||
hud_player_info_t info;
|
||||
i_engine->pfnGetPlayerInfo(ent_idx, &info);
|
||||
|
@ -70,26 +70,6 @@ char* get_name(int ent_idx) {
|
|||
return info.name;
|
||||
}
|
||||
|
||||
game_id get_cur_game(void) {
|
||||
typedef void (*COM_ParseDirectoryFromCmd_t)(const char*, char*, int,
|
||||
const char*);
|
||||
COM_ParseDirectoryFromCmd_t COM_ParseDirectoryFromCmd =
|
||||
(COM_ParseDirectoryFromCmd_t)dlsym(hw, "COM_ParseDirectoryFromCmd");
|
||||
|
||||
char game[FILENAME_MAX];
|
||||
COM_ParseDirectoryFromCmd("-game", game, sizeof(game), "valve");
|
||||
|
||||
/* Get the current game we are playing */
|
||||
if (game[0] == 'c' && game[1] == 's') /* cstrike */
|
||||
return CS;
|
||||
else if (*game == 'd') /* dod */
|
||||
return DOD;
|
||||
else if (*game == 't') /* tfc */
|
||||
return TF;
|
||||
else
|
||||
return HL;
|
||||
}
|
||||
|
||||
vec3_t vec3(float x, float y, float z) {
|
||||
vec3_t ret;
|
||||
|
||||
|
@ -183,10 +163,15 @@ bool world_to_screen(vec3_t vec, vec2_t screen) {
|
|||
scr_inf.iSize = sizeof(SCREENINFO);
|
||||
i_engine->pfnGetScreenInfo(&scr_inf);
|
||||
|
||||
/* If within bounds, transform to screen scale */
|
||||
if (screen[0] < 1 && screen[1] < 1 && screen[0] > -1 && screen[1] > -1) {
|
||||
if (IsDayOfDefeat()) {
|
||||
printf("Before transformation: %f, %f, Depth: %f\n", screen[0], screen[1], screen[2]);
|
||||
screen[0] = ((screen[0] + 1) * 0.5) * scr_inf.iWidth;
|
||||
screen[1] = ((1 - screen[1]) * 0.5) * scr_inf.iHeight;
|
||||
} else {
|
||||
screen[0] = screen[0] * (scr_inf.iWidth / 2) + (scr_inf.iWidth / 2);
|
||||
screen[1] = -screen[1] * (scr_inf.iHeight / 2) + (scr_inf.iHeight / 2);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -204,6 +189,19 @@ void engine_draw_text(int x, int y, char* s, rgb_t c) {
|
|||
i_engine->pfnDrawConsoleString(x, y, s);
|
||||
}
|
||||
|
||||
void draw_tracer(vec3_t start, vec3_t end, rgb_t c, float a, float w,
|
||||
float time) {
|
||||
static const char* MDL_STR = "sprites/laserbeam.spr";
|
||||
static int beam_idx = i_engine->pEventAPI->EV_FindModelIndex(MDL_STR);
|
||||
|
||||
float r = c.r / 255.f;
|
||||
float g = c.g / 255.f;
|
||||
float b = c.b / 255.f;
|
||||
|
||||
i_engine->pEfxAPI->R_BeamPoints(start, end, beam_idx, time, w, 0, a, 0, 0,
|
||||
0, r, g, b);
|
||||
}
|
||||
|
||||
void gl_drawbox(int x, int y, int w, int h, rgb_t c) {
|
||||
/* Line width */
|
||||
const int lw = 1;
|
||||
|
@ -253,7 +251,7 @@ bool protect_addr(void* ptr, int new_flags) {
|
|||
int pgsz = getpagesize();
|
||||
|
||||
if (mprotect(p, pgsz, new_flags) == -1) {
|
||||
printf("hl-cheat: error protecting %p\n", ptr);
|
||||
printf("goldsource-cheat: error protecting %p\n", ptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue