This repository has been archived by the owner on Apr 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMisc.cpp
135 lines (103 loc) · 2.8 KB
/
Misc.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
#include "Gamehooking.hpp"
#include "Misc.hpp"
RevealRanksFn RevealRanks;
IsRdyFn IsRdy;
int promene = -1;
void Misc::bhop(UserCMD *userCMD)
{
DWORD eng = csFuncs->getEngine();
if (!Global::locPlayer)
return;
bool locPlyrLifeSt = Global::locPlayer->getLifeState();
int locPlyrCon = csFuncs->getLocPlyrConnect(eng);
if (Global::locPlayer && !locPlyrLifeSt && locPlyrLifeSt == 0 && locPlyrCon == 6)
{
if ((userCMD->buttons & IN_JUMP) && !(Global::locPlayer->getFlags() & FL_ONGROUND))
{
userCMD->buttons &= ~IN_JUMP;
if (mVars.bEnableAS)
{
bool backwards = false;
if (userCMD->mousedx < 0)
userCMD->sidemove = backwards ? 650.f : -650.f;
if (userCMD->mousedx > 0)
userCMD->sidemove = backwards ? -650.f : 650.f;
}
}
}
}
void Misc::revealRanks()
{
static float fArr[3] = {0.f, 0.f, 0.f};
RevealRanks = (RevealRanksFn)(offs.revealAllRank);
RevealRanks(fArr);
}
void Misc::isRdy()
{
IsRdy = (IsRdyFn)(offs.isRdy);
IsRdy();
FLASHWINFO flash;
flash.cbSize = sizeof(FLASHWINFO);
flash.hwnd = prozor;
flash.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
flash.uCount = 0;
flash.dwTimeout = 0;
FlashWindowEx(&flash);
}
void Misc::fakeLag(char *bSendPacket)
{
DWORD eng = csFuncs->getEngine();
if (!Global::locPlayer)
return;
bool locPlyrLifeSt = Global::locPlayer->getLifeState();
int locPlyrCon = csFuncs->getLocPlyrConnect(eng);
if (Global::locPlayer && !locPlyrLifeSt && locPlyrLifeSt == 0 && locPlyrCon == 6)
{
int tickLimit = realFakeLagChoke[mVars.fakeLagChoke - 1] + realFakeLagSend[mVars.fakeLagSend - 1];
if (tickLimit >= 15)
tickLimit = 14;
if (iFakeLag > tickLimit)
iFakeLag = 1;
else
iFakeLag = iFakeLag + 1;
if (4 >= iFakeLag)
*bSendPacket = TRUE;
else
*bSendPacket = FALSE;
}
}
void Misc::nameChanger()
{
if (!p_Engine->isIG())
return;
if (promene == -1)
return;
long curTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
static long timestamp = curTime;
if ((curTime - timestamp) < 150)
return;
timestamp = curTime;
++promene;
if (promene >= 5)
{
std::string name = "\n";
char chars[3] = {'\n', '\0', '\t'};
for (int i = 0; i < 127; i++)
name += chars[rand() % 2];
changeName(name.c_str());
promene = -1;
return;
}
changeName(setStrRight("Gladiatorcheatz", strlen("Gladiatorcheatz") + promene));
}
void Misc::changeName(const char *name)
{
ConVar *cv = p_Console->FindVar("name");
*(int *)((DWORD)&cv->fnChangeCallback + 0xC) = 0;
cv->SetValue(name);
}
const char *Misc::setStrRight(std::string txt, unsigned int val)
{
txt.insert(txt.length(), val - txt.length(), ' ');
return txt.c_str();
}