-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMiscHacks.cpp
183 lines (151 loc) · 3.81 KB
/
MiscHacks.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*
Syn's AyyWare Framework 2015
*/
#include "MiscHacks.h"
#include "Interfaces.h"
#include "RenderManager.h"
#include <time.h>
Vector AutoStrafeView;
void CMiscHacks::Init()
{
// Any init
}
void CMiscHacks::Draw()
{
// Any drawing
}
void CMiscHacks::Move(CUserCmd *pCmd)
{
// Any Move Stuff
// Bhop
if (Menu::Window.VisualsTab.OtherAutoJump.GetState())
AutoJump(pCmd);
// Strafe
Interfaces::Engine->GetViewAngles(AutoStrafeView);
if (Menu::Window.VisualsTab.OtherAutoStrafe.GetState())
AutoStrafe(pCmd);
// Spams
switch (Menu::Window.VisualsTab.OtherChatSpam.GetIndex())
{
case 0:
// No Chat Spam
break;
case 1:
// Round Say
break;
case 2:
// Regular
ChatSpamRegular();
break;
case 3:
// Report Spam
ChatSpamReports();
break;
}
}
void CMiscHacks::AutoJump(CUserCmd *pCmd)
{
if (pCmd->buttons & IN_JUMP && GUI.GetKeyState(VK_SPACE))
{
int iFlags = hackManager.pLocal()->GetFlags();
if (!(iFlags & FL_ONGROUND))
pCmd->buttons &= ~IN_JUMP;
if (hackManager.pLocal()->GetVelocity().Length() <= 50)
{
pCmd->forwardmove = 450.f;
}
}
}
void CMiscHacks::AutoStrafe(CUserCmd *pCmd)
{
IClientEntity* pLocal = hackManager.pLocal();
static bool bDirection = true;
bool bKeysPressed = true;
if (GUI.GetKeyState(0x41) || GUI.GetKeyState(0x57) || GUI.GetKeyState(0x53) || GUI.GetKeyState(0x44)) bKeysPressed = false;
if (pCmd->buttons & IN_ATTACK) bKeysPressed = false;
float flYawBhop = 0.f;
if (pLocal->GetVelocity().Length() > 50.f)
{
float x = 30.f, y = pLocal->GetVelocity().Length(), z = 0.f, a = 0.f;
z = x / y;
z = fabsf(z);
a = x * z;
flYawBhop = a;
}
if ((GetAsyncKeyState(VK_SPACE) && !(pLocal->GetFlags() & FL_ONGROUND)) && bKeysPressed)
{
if (bDirection)
{
AutoStrafeView -= flYawBhop;
GameUtils::NormaliseViewAngle(AutoStrafeView);
pCmd->sidemove = -400.f;
bDirection = false;
}
else
{
AutoStrafeView += flYawBhop;
GameUtils::NormaliseViewAngle(AutoStrafeView);
pCmd->sidemove = 400.f;
bDirection = true;
}
if (pCmd->mousedx < 0)
{
pCmd->sidemove = -450.f;
}
if (pCmd->mousedx > 0)
{
pCmd->sidemove = 450.f;
}
}
}
Vector GetAutostrafeView()
{
return AutoStrafeView;
}
void CMiscHacks::ChatSpamReports()
{
// Don't spam it too fast so you can still do stuff
static clock_t start_t = clock();
double timeSoFar = (double)(clock() - start_t) / CLOCKS_PER_SEC;
if (timeSoFar < 0.5)
return;
// Loop through all active entitys
std::vector < std::string > Names;
for (int i = 0; i < Interfaces::EntList->GetHighestEntityIndex(); i++)
{
// Get the entity
IClientEntity *entity = Interfaces::EntList->GetClientEntity(i);
player_info_t pInfo;
// If it's a valid entity and isn't the player
if (entity && hackManager.pLocal()->GetTeamNum() != entity->GetTeamNum())
{
ClientClass* cClass = (ClientClass*)entity->GetClientClass();
// If entity is a player
if (cClass->m_ClassID == (int)CSGOClassID::CCSPlayer)
{
if (Interfaces::Engine->GetPlayerInfo(i, &pInfo))
{
if (!strstr(pInfo.name, "GOTV"))
Names.push_back(pInfo.name);
}
}
}
}
int randomIndex = rand() % Names.size();
char buffer[128];
static unsigned long int meme = 3091961887844204720;
sprintf_s(buffer, "Report for %s submitted, report id %lu.", Names[randomIndex].c_str(), meme);
meme += 1;
SayInChat(buffer);
start_t = clock();
}
void CMiscHacks::ChatSpamRegular()
{
// Don't spam it too fast so you can still do stuff
static clock_t start_t = clock();
double timeSoFar = (double)(clock() - start_t) / CLOCKS_PER_SEC;
if (timeSoFar < 0.5)
return;
SayInChat("Aliens exist. #AliensInCSGOConfirmed");
start_t = clock();
}