This commit is contained in:
nullifiedcat 2017-02-12 08:22:48 +03:00
parent 36f8f276e6
commit 96c515a805
15 changed files with 206 additions and 57 deletions

View File

@ -20,6 +20,7 @@ DS esp slow
menu reorder
AutoDetonator
ProjPredOrigin
MAX -> MIN priority
Crit Hack
Radar

View File

@ -43,7 +43,7 @@ void GlobalSettings::Init() {
this->bDebugLog = new CatVar(CV_SWITCH, "log", "1", "Debug Log", NULL, "Disable this if you don't need cathook messages in your console");
this->bThirdperson->m_pConVar->InstallChangeCallback(ThirdpersonCallback);
this->bFastOutline = new CatVar(CV_SWITCH, "fastoutline", "0", "Low quality outline", NULL, "Might increase performance when there is a lot of ESP text to draw");
//this->bRollSpeedhack = new CatVar(CV_SWITCH, "rollspeedhack", "0", "Roll Speedhack", NULL, "Roll speedhack - works in TF2C!!");
this->kRollSpeedhack = new CatVar(CV_KEY, "rollspeedhack", "0", "Roll Speedhack", NULL, "Roll speedhack key");
bInvalid = true;
}

View File

@ -41,7 +41,7 @@ public:
CatVar* bDebugLog;
Vector last_angles;
CatVar* bFastOutline;
CatVar* bRollSpeedhack;
CatVar* kRollSpeedhack;
bool bInvalid;
};

View File

@ -145,6 +145,7 @@ void CMenuWindow::AddElements() {
ADDCVAR(g_Settings.flForceFOVZoomed);
ADDCVAR(g_Settings.flForceFOV);
ADDCVAR(g_Settings.sDisconnectMsg);
if (TF2C) ADDCVAR(g_Settings.kRollSpeedhack);
ADDCVAR(g_phMisc->v_bCleanChat);
if (TF2) {
CBaseButton* but = new CBaseButton("schema", tab, "Load Custom Schema", [this](CBaseButton*) {

View File

@ -346,7 +346,9 @@ int Aimbot::ShouldTarget(CachedEntity* entity) {
if (g_Settings.bIgnoreTaunting->GetBool() && HasCondition(entity, TFCond_Taunting)) return 1;
if (IsPlayerInvulnerable(entity)) return 4;
if (v_bRespectCloak->GetBool() && IsPlayerInvisible(entity)) return 6;
if (HasCondition(entity, TFCond_UberBulletResist)) return 10;
weaponmode mode = GetWeaponMode(LOCAL_E);
if (mode == weaponmode::weapon_hitscan || LOCAL_W->m_iClassID == g_pClassID->CTFCompoundBow)
if (HasCondition(entity, TFCond_UberBulletResist)) return 10;
}
#if NO_DEVIGNORE != true

View File

@ -33,3 +33,11 @@ void Airstuck::ProcessUserCmd(CUserCmd* cmd) {
}
return;
}
void Airstuck::OnLevelInit() {
v_bStuck->SetValue(false);
}
void Airstuck::OnLevelShutdown() {
v_bStuck->SetValue(false);
}

View File

@ -15,6 +15,8 @@ public:
Airstuck();
virtual void ProcessUserCmd(CUserCmd*) override;
virtual void OnLevelInit() override;
virtual void OnLevelShutdown() override;
ConVar* v_bStuck;
};

View File

@ -26,6 +26,10 @@ AntiAim::AntiAim() {
float yaw = -180;
float pitch = -89;
void AntiAim::AddSafeTicks(int ticks) {
m_iSafeTicks += ticks;
}
void AntiAim::ProcessUserCmd(CUserCmd* cmd) {
if (!this->v_bEnabled->GetBool()) return;
if (cmd->buttons & IN_USE) {
@ -36,8 +40,10 @@ void AntiAim::ProcessUserCmd(CUserCmd* cmd) {
}
if ((cmd->buttons & IN_ATTACK2) && g_pLocalPlayer->weapon()->m_iClassID == g_pClassID->CTFLunchBox) return;
if (g_pLocalPlayer->bAttackLastTick) return;
if (GetWeaponMode(g_pLocalPlayer->entity) == weaponmode::weapon_melee ||
GetWeaponMode(g_pLocalPlayer->entity) == weaponmode::weapon_throwable) return;
float p = cmd->viewangles.x;
float y = cmd->viewangles.y;
switch (this->v_YawMode->GetInt()) {
@ -65,6 +71,8 @@ void AntiAim::ProcessUserCmd(CUserCmd* cmd) {
Vector angl = Vector(p, y, 0);
if (!v_bNoClamping->GetBool()) fClampAngle(angl);
if (v_flRoll->GetBool()) angl.z = v_flRoll->GetFloat();
cmd->viewangles = angl;
g_pLocalPlayer->bUseSilentAngles = true;
if (!m_iSafeTicks) {
cmd->viewangles = angl;
g_pLocalPlayer->bUseSilentAngles = true;
} else m_iSafeTicks--;
}

View File

@ -16,6 +16,9 @@ public:
virtual void ProcessUserCmd(CUserCmd*) override;
void AddSafeTicks(int ticks);
int m_iSafeTicks;
CatVar* v_bEnabled;
CatVar* v_flSpinSpeed;
CatVar* v_flYaw;

View File

@ -15,6 +15,9 @@
#include <pwd.h>
#include <fcntl.h>
#include <link.h>
#include "../sharedobj.h"
#include "../hack.h"
#include "../common.h"
#include <checksum_md5.h>
@ -123,6 +126,35 @@ void LockConCommand(const char* name, bool lock) {
}
}
void CC_SaveConVars(const CCommand& args) {
std::string filename("lastcfg");
if (args.ArgC() > 1) {
filename = std::string(args.Arg(1));
}
char* path = strfmt("%scfg/cat_%s.cfg", g_pszTFPath, filename.c_str());
logging::Info("Saving settings to %s", path);
FILE* file = fopen(path, "w");
if (!file) {
logging::Info("Couldn't open the file!");
return;
}
for (auto i : g_ConVars) {
if (i) {
if (strcmp(i->GetString(), i->GetDefault())) {
//logging::Info("Saving %s", i->GetName());
//logging::Info("Value: %s", i->GetString());
fprintf(file, "%s \"%s\"\n", i->GetName(), i->GetString());
}
}
}
fclose(file);
}
void CC_Unrestricted(const CCommand& args) {
logging::Info("executing '%s'", args.ArgS());
interfaces::engineClient->ClientCmd_Unrestricted(args.ArgS());
}
void LockConCommands(bool lock) {
LockConCommand("sv_cheats", lock);
}
@ -130,6 +162,15 @@ void LockConCommands(bool lock) {
ConCommandBase* teamname = 0;
void CC_SetName(const CCommand& args) {
if (args.ArgC() < 2) {
logging::Info("Set a name, silly");
return;
}
if (g_Settings.bInvalid) {
logging::Info("Only works ingame!");
return;
}
char* name = new char[32];
snprintf(name, 32, "%s", args.Arg(1));
if (args.ArgC() > 1 && atoi(args.Arg(2))) {
@ -140,10 +181,12 @@ void CC_SetName(const CCommand& args) {
NET_SetConVar setname("name", (const char*)name);
//logging::Info("Created!");
INetChannel* ch = (INetChannel*)interfaces::engineClient->GetNetChannelInfo();
setname.SetNetChannel(ch);
setname.SetReliable(false);
//logging::Info("Sending!");
ch->SendNetMsg(setname, false);
if (ch) {
setname.SetNetChannel(ch);
setname.SetReliable(false);
//logging::Info("Sending!");
ch->SendNetMsg(setname, false);
}
delete [] name;
}
@ -299,12 +342,12 @@ Misc::Misc() {
v_bFastCrouch = CreateConVar(CON_PREFIX "fakecrouch", "0", "Fast crouch");
v_bFlashlightSpam = new CatVar(CV_SWITCH, "flashlight_spam", "0", "Flashlight Spam", NULL, "Quickly turns flashlight on and off");
v_iFakeLag = new CatVar(CV_INT, "fakelag", "0", "Fakelag", NULL, "# of packets jammed", true, 25.0f);
c_Unrestricted = CreateConCommand(CON_PREFIX "cmd", CC_Unrestricted, "Execute a ConCommand");
c_SaveSettings = CreateConCommand(CON_PREFIX "save", CC_SaveConVars, CON_PREFIX "save [file]\nSave settings to cfg/cat_[file].cfg, file is lastcfg by default\n");
//v_bDumpEventInfo = CreateConVar(CON_PREFIX "debug_event_info", "0", "Show event info");
CreateConCommand(CON_PREFIX "set", CC_SetValue, "Set ConVar value (if third argument is 1 the ^'s will be converted into newlines)");
if (TF2C) {
v_bTauntSlide = new CatVar(CV_SWITCH, "tauntslide", "0", "Taunt Slide", NULL, "Works only in TF2 Classic!");
v_bCritHack = new CatVar(CV_SWITCH, "crits", "0", "Crit Hack", NULL, "Works only in TF2 Classic!");
}
if (TF2C) v_bTauntSlide = new CatVar(CV_SWITCH, "tauntslide", "0", "Taunt Slide", NULL, "Works only in TF2 Classic!");
if (TF) v_bCritHack = new CatVar(CV_SWITCH, "crits", "0", "Crit Hack", NULL, "Works only in TF2 Classic!");
//v_bDebugCrits = new CatVar(CV_SWITCH, "debug_crits", "0", "Debug Crits", NULL, "???");
v_bCleanChat = new CatVar(CV_SWITCH, "clean_chat", "1", "Remove newlines from messages", NULL, "Removes newlines from messages, at least it should do that. Might be broken.");
if (TF2) c_Schema = CreateConCommand(CON_PREFIX "schema", CC_Misc_Schema, "Load item schema");
@ -362,35 +405,95 @@ void Misc::ProcessUserCmd(CUserCmd* cmd) {
}
}
*/
if (v_bTauntSlide->GetBool())
if (TF2C && v_bTauntSlide->GetBool())
RemoveCondition(LOCAL_E, TFCond_Taunting);
if (TF2C && v_bCritHack->GetBool() && CE_GOOD(LOCAL_W)) {
static uintptr_t CalcIsAttackCritical_s = gSignatures.GetClientSignature("55 89 E5 56 53 83 EC 10 8B 5D 08 89 1C 24 E8 ? ? ? ? 85 C0 89 C6 74 59 8B 00 89 34 24 FF 90 E0 02 00 00 84 C0 74 4A A1 ? ? ? ? 8B 40 04 3B 83 A8 09 00 00 74 3A");
typedef void(*CalcIsAttackCritical_t)(IClientEntity*);
CalcIsAttackCritical_t CIACFn = (CalcIsAttackCritical_t)(CalcIsAttackCritical_s);
if (cmd->buttons & IN_ATTACK) {
int tries = 0;
RandomSeed(MD5_PseudoRandom(cmd->command_number) & 0x7fffffff);
CIACFn(RAW_ENT(LOCAL_W));
bool crit = *(bool*)((uintptr_t)RAW_ENT(LOCAL_W) + 2454ul);
if (!crit) cmd->buttons &= ~IN_ATTACK;
/*while (!crit && tries < 50) {
tries++;
//crit = (vfunc<bool(*)(IClientEntity*)>(RAW_ENT(LOCAL_W), 1764 / 4, 0))(RAW_ENT(LOCAL_W));
}*/
static ConVar* criticals = interfaces::cvar->FindVar("tf_weapon_criticals");
if (CE_GOOD(LOCAL_W) && TF && v_bCritHack->GetBool() && criticals->GetBool()) {
IClientEntity* weapon = RAW_ENT(LOCAL_W);
if (TF2C) {
if (vfunc<bool(*)(IClientEntity*)>(weapon, 1824 / 4, 0)(weapon)) {
static uintptr_t CalcIsAttackCritical_s = gSignatures.GetClientSignature("55 89 E5 56 53 83 EC 10 8B 5D 08 89 1C 24 E8 ? ? ? ? 85 C0 89 C6 74 59 8B 00 89 34 24 FF 90 E0 02 00 00 84 C0 74 4A A1 ? ? ? ? 8B 40 04 3B 83 A8 09 00 00 74 3A");
typedef void(*CalcIsAttackCritical_t)(IClientEntity*);
CalcIsAttackCritical_t CIACFn = (CalcIsAttackCritical_t)(CalcIsAttackCritical_s);
if (cmd->buttons & IN_ATTACK) {
*(float*)((uintptr_t)weapon + 2468ul) = 0.0f;
int tries = 0;
static int lcmdn = 0;
bool crit = *(bool*)((uintptr_t)RAW_ENT(LOCAL_W) + 2454ul);
static int& seed = *(int*)(sharedobj::client->lmap->l_addr + 0x00D53F68ul);
bool cmds = false;
seed = MD5_PseudoRandom(cmd->command_number) & 0x7fffffff;
RandomSeed(seed);
CIACFn(RAW_ENT(LOCAL_W));
crit = *(bool*)((uintptr_t)RAW_ENT(LOCAL_W) + 2454ul);
/*while (!crit && (tries < 200)) {
*(int*)(weapon + 2472) = 0;
seed = MD5_PseudoRandom(++lcmdn) & 0x7fffffff;
tries++;
RandomSeed(seed);
CIACFn(RAW_ENT(LOCAL_W));
crit = *(bool*)((uintptr_t)RAW_ENT(LOCAL_W) + 2454ul);
cmds = true;
}*/
if (!crit) cmd->buttons &= ~IN_ATTACK;
else {
/*logging::Info("Got crit at CMD # %i", lcmdn);
if (cmds) {
cmd->command_number = lcmdn;
cmd->random_seed = MD5_PseudoRandom(lcmdn) & 0x7fffffff;
}*/
}
//logging::Info("Seed: %i", seed);
/*while (!crit && tries < 50) {
tries++;
//crit = (vfunc<bool(*)(IClientEntity*)>(RAW_ENT(LOCAL_W), 1764 / 4, 0))(RAW_ENT(LOCAL_W));
}*/
}
}
} else if (TF2) {
if (vfunc<bool(*)(IClientEntity*)>(weapon, 1944 / 4, 0)(weapon)) {
static uintptr_t CalcIsAttackCritical_s = gSignatures.GetClientSignature("55 89 E5 83 EC 28 89 5D F4 8B 5D 08 89 75 F8 89 7D FC 89 1C 24 E8 ? ? ? ? 85 C0 89 C6 74 60 8B 00 89 34 24 FF 90 E0 02 00 00 84 C0 74 51 A1 ? ? ? ? 8B 40 04");
typedef void(*CalcIsAttackCritical_t)(IClientEntity*);
CalcIsAttackCritical_t CIACFn = (CalcIsAttackCritical_t)(CalcIsAttackCritical_s);
if (cmd->buttons & IN_ATTACK) {
//*(float*)((uintptr_t)weapon + 2468ul) = 0.0f;
//bool crit = *(bool*)((uintptr_t)RAW_ENT(LOCAL_W) + 2830ul);
*(float*)(weapon + 2612ul) = 1000.0f;
int md5seed = MD5_PseudoRandom(cmd->command_number) & 0x7fffffff;
int rseed = md5seed;
int a = *(int*)((uintptr_t)(sharedobj::client->lmap->l_addr) + 0x1F6D4A8);
int b = vfunc<int(*)(IClientEntity*)>(RAW_ENT(LOCAL_E), 316 / 4, 0)(RAW_ENT(LOCAL_E));
int c = vfunc<int(*)(IClientEntity*)>(weapon, 316 / 4, 0)(weapon) << 8;
rseed = a ^ (b | c);
RandomSeed(rseed);
//static int tries = 0;
//if (tries > 20) tries = 0;
//for (int i = 0; i < tries; i++) RandomInt(0, 10);
CIACFn(weapon);
//logging::Info("%i", *(unsigned char*)(weapon + 2830));
//tries++;
unsigned char crit = *(unsigned char*)(weapon + 2830);
if (crit == 0) cmd->buttons &= ~IN_ATTACK;
else {
//logging::Info("Try: %i");
}
}
}
}
}
if (TF && v_bDebugCrits->GetBool() && CE_GOOD(LOCAL_W)) {
/*f (TF && v_bDebugCrits->GetBool() && CE_GOOD(LOCAL_W)) {
//static uintptr_t helper = gSignatures.GetClientSignature("55 89 E5 81 EC 88 00 00 00 89 5D F4 8B 5D 08 89 75 F8 89 7D FC 31 FF 89 1C 24 E8 ? ? ? ? 85 C0 89 C6 74 0F 8B 00 89 34 24 FF 90 E0 02 00 00 84 C0 75 14 89 F8 8B 5D F4 8B 75 F8 8B 7D FC 89 EC 5D C3");
/*if (interfaces::gvars->curtime - lastcheck >= 1.0f) {
RandomSeed(cmd->random_seed);
ciac_s = vfunc<int(*)(IClientEntity*)>(RAW_ENT(LOCAL_W), 458, 0)(RAW_ENT(LOCAL_W));
if (ciac_s) cmd->buttons |= IN_ATTACK;
lastcheck = interfaces::gvars->curtime;
}*/
}
if (TF2) {
static uintptr_t critsig = gSignatures.GetClientSignature("55 89 E5 83 EC 28 89 5D F4 8B 5D 08 89 75 F8 89 7D FC 89 1C 24 E8 ? ? ? ? 85 C0 89 C6 74 60 8B 00 89 34 24 FF 90 E0 02 00 00 84 C0 74 51 A1 14 C8 F6 01 8B 40 04 3B 83 30 0B 00 00 74 41 89 83 30 0B 00 00 A1 ? ? ? ? C6 83 0F 0B 00 00 00 83 78 30 05 74 59");
static uintptr_t critsig = gSignatures.GetClientSignature("55 89 E5 83 EC 28 89 5D F4 8B 5D 08 89 75 F8 89 7D FC 89 1C 24 E8 ? ? ? ? 85 C0 89 C6 74 60 8B 00 89 34 24 FF 90 E0 02 00 00 84 C0 74 51 A1 ? ? ? ? 8B 40 04");
typedef void(*C_TFWeaponBase__CalcIsAttackCritical_t)(IClientEntity*);
static C_TFWeaponBase__CalcIsAttackCritical_t ciac = (C_TFWeaponBase__CalcIsAttackCritical_t)critsig;
if (interfaces::gvars->curtime - lastcheck >= 1.0f) {
@ -407,11 +510,8 @@ void Misc::ProcessUserCmd(CUserCmd* cmd) {
AddCenterString(colors::red, "Crit!");
}
}
} else if (TF2C) {
}
}
}*/
g_Settings.bSendPackets->SetValue(true);
if (v_iFakeLag->GetInt()) {
static int fakelag = 0;
@ -528,14 +628,11 @@ void Misc::Draw() {
GetProjectileData(g_pLocalPlayer->weapon(), speed, gravity);
AddSideString(colors::white, "Speed: %f", speed);
AddSideString(colors::white, "Gravity: %f", gravity);
AddSideString(colors::white, "CIAC: %i", ciac_s);
AddSideString(colors::white, "CIAC: %i", *(bool*)(RAW_ENT(LOCAL_W) + 2380));
if (TF2) AddSideString(colors::white, "Melee: %i", vfunc<bool(*)(IClientEntity*)>(RAW_ENT(LOCAL_W), 1860 / 4, 0)(RAW_ENT(LOCAL_W)));
if (TF2) AddSideString(colors::white, "Last CIAC: %.2f", lastcheck);
if (TF2) AddSideString(colors::white, "Bucket: %.2f", *(float*)((uintptr_t)RAW_ENT(LOCAL_W) + 2612u));
bool ciac = *(bool*)((uintptr_t)RAW_ENT(LOCAL_W) + 2454ul);
static bool ciacl = false;
if (ciac != ciacl && ciac) logging::Info("!!!");
ciacl = ciac;
if (TF2C) AddSideString(colors::white, "CAAC: %i", ciac);
//if (TF2C) AddSideString(colors::white, "Seed: %i", *(int*)(sharedobj::client->lmap->l_addr + 0x00D53F68ul));
//AddSideString(colors::white, "IsZoomed: %i", g_pLocalPlayer->bZoomed);
//AddSideString(colors::white, "CanHeadshot: %i", CanHeadshot());
//AddSideString(colors::white, "IsThirdPerson: %i", interfaces::iinput->CAM_IsThirdPerson());

View File

@ -34,6 +34,8 @@ public:
CatVar* v_bCritHack;
CatVar* v_bTauntSlide;
//ConVar* v_bDumpEventInfo;
ConCommand* c_SaveSettings;
ConCommand* c_Unrestricted;
ConCommand* c_DumpItemAttributes;
ConCommand* c_SayLine;
ConCommand* c_Shutdown;

View File

@ -12,15 +12,22 @@
#include <pwd.h>
#include <sys/mman.h>
std::vector<ConVar*> g_ConVars;
FILE* hConVarsFile = 0;
void BeginConVars() {
hConVarsFile = fopen(strfmt("%scfg/cat_defaults.cfg", g_pszTFPath), "w");
FILE* hAutoexec = fopen(strfmt("%scfg/cat_autoexec.cfg", g_pszTFPath), "r+");
if (!hAutoexec) {
hAutoexec = fopen(strfmt("%scfg/cat_autoexec.cfg", g_pszTFPath), "w");
fprintf(hAutoexec, "// Put your custom cathook settings in this file\n");
fprintf(hAutoexec, "// Put your custom cathook settings in this file\n// This script will be executed EACH TIME YOU INJECT CATHOOK\n");
fclose(hAutoexec);
}
} else fclose(hAutoexec);
FILE* hMatchexec = fopen(strfmt("%scfg/cat_matchexec.cfg", g_pszTFPath), "r+");
if (!hMatchexec) {
hMatchexec = fopen(strfmt("%scfg/cat_matchexec.cfg", g_pszTFPath), "w");
fprintf(hMatchexec, "// Put your custom cathook settings in this file\n// This script will be executed EACH TIME YOU JOIN A MATCH\n");
fclose(hMatchexec);
} else fclose(hMatchexec);
fprintf(hConVarsFile, "// THIS FILE IS AUTO-GENERATED BY CATHOOK\n// DO NOT EDIT IT, ALL CHANGES WILL BE UNDONE!\n// If you want to change default settings, add changed convars to cat_autoexec.cfg\n");
SetCVarInterface(interfaces::cvar);
}
@ -82,6 +89,7 @@ ConVar* CreateConVar(std::string name, std::string value, std::string help) {
if (hConVarsFile)
fprintf(hConVarsFile, "%s %s\n", name.c_str(), value.c_str());
interfaces::cvar->RegisterConCommand(ret);
g_ConVars.push_back(ret);
return ret;
}

View File

@ -26,6 +26,7 @@ class Vector;
#include "beforecheaders.h"
#include <string>
#include <sstream>
#include <vector>
#include "aftercheaders.h"
#include "fixsdk.h"
@ -36,6 +37,7 @@ class Vector;
// TODO split this shit
extern std::vector<ConVar*> g_ConVars;
extern FILE* hConVarsFile;
void BeginConVars();
void EndConVars();

View File

@ -118,9 +118,20 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
if (g_pChatStack)
g_pChatStack->OnCreateMove();
if (CE_GOOD(g_pLocalPlayer->entity)) {
/*if (g_Settings.bRollSpeedhack->GetBool()) {
Vector vecMove( cmd->forwardmove, 0.0f, 0.0f );
bool speedapplied = false;
if (g_Settings.kRollSpeedhack->GetBool() && g_pGUI->m_bPressedState[g_Settings.kRollSpeedhack->GetInt()] && !(cmd->buttons & IN_ATTACK)) {
float speed = cmd->forwardmove;
if (fabs(speed) > 0.0f) {
cmd->forwardmove = -speed;
cmd->sidemove = 0.0f;
cmd->viewangles.y = g_pLocalPlayer->v_OrigViewangles.y;
cmd->viewangles.y -= 180.0f;
if (cmd->viewangles.y < -180.0f) cmd->viewangles.y += 360.0f;
cmd->viewangles.z = 90.0f;
g_pLocalPlayer->bUseSilentAngles = true;
speedapplied = true;
}
/*Vector vecMove( cmd->forwardmove, 0.0f, 0.0f );
float flLength = vecMove.Length();
if( flLength > 0.0f && !(cmd->buttons & IN_ATTACK) )
{
@ -136,21 +147,24 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
if (cmd->viewangles.y > 180.0f) cmd->viewangles.y -= 360.0f;
cmd->viewangles.z = 89.0f; // OMFG SUPER 1337 SPEEDHAQ METHODS 8)
g_pLocalPlayer->bUseSilentAngles = true;
}
}*/
}*/
}
if (g_pLocalPlayer->bUseSilentAngles) {
Vector vsilent(cmd->forwardmove, cmd->sidemove, cmd->upmove);
float speed = sqrt(vsilent.x * vsilent.x + vsilent.y * vsilent.y);
Vector ang;
VectorAngles(vsilent, ang);
float yaw = DEG2RAD(ang.y - g_pLocalPlayer->v_OrigViewangles.y + cmd->viewangles.y);
cmd->forwardmove = cos(yaw) * speed;
cmd->sidemove = sin(yaw) * speed;
if (!speedapplied) {
Vector vsilent(cmd->forwardmove, cmd->sidemove, cmd->upmove);
float speed = sqrt(vsilent.x * vsilent.x + vsilent.y * vsilent.y);
Vector ang;
VectorAngles(vsilent, ang);
float yaw = DEG2RAD(ang.y - g_pLocalPlayer->v_OrigViewangles.y + cmd->viewangles.y);
cmd->forwardmove = cos(yaw) * speed;
cmd->sidemove = sin(yaw) * speed;
}
ret = false;
}
if (cmd)
g_Settings.last_angles = cmd->viewangles;
g_Settings.last_angles = cmd->viewangles;
}

View File

@ -32,7 +32,7 @@ bool SendNetMsg_hook(void* thisptr, INetMessage& msg, bool bForceReliable = fals
SEGV_BEGIN;
//logging::Info("Sending NetMsg! %i", msg.GetType());
if (g_phAirstuck->v_bStuck->GetBool() && g_Settings.bHackEnabled->GetBool()) {
if (g_phAirstuck->v_bStuck->GetBool() && g_Settings.bHackEnabled->GetBool() && !g_Settings.bInvalid) {
switch (msg.GetType()) {
case net_NOP:
case net_SignonState:
@ -133,6 +133,7 @@ bool DispatchUserMessage_hook(void* thisptr, int type, bf_read& buf) {
void LevelInit_hook(void* thisptr, const char* newmap) {
((LevelInit_t*) hooks::hkClientMode->GetMethod(hooks::offLevelInit))(thisptr, newmap);
interfaces::engineClient->ExecuteClientCmd("exec cat_matchexec");
DRM_ENFORCE;
LEVEL_INIT(Aimbot);
LEVEL_INIT(Airstuck);