Skip to content

Commit 309bfbe

Browse files
committed
added speedhack
1 parent 6f0e8d6 commit 309bfbe

File tree

7 files changed

+42
-0
lines changed

7 files changed

+42
-0
lines changed

AssaultCube-Multihack.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216
<ClCompile Include="src\hacks\ESP_Box.cpp" />
217217
<ClCompile Include="src\hacks\ESP_Snaplines.cpp" />
218218
<ClCompile Include="src\hacks\NoRecoil.cpp" />
219+
<ClCompile Include="src\hacks\Speedhack.cpp" />
219220
<ClCompile Include="src\hacks\Teleport.cpp" />
220221
<ClCompile Include="src\hooks\attackphysics.cpp" />
221222
<ClCompile Include="src\hooks\c2sinfo.cpp" />

AssaultCube-Multihack.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@
9393
<ClCompile Include="src\hacks\NoRecoil.cpp">
9494
<Filter>Source Files</Filter>
9595
</ClCompile>
96+
<ClCompile Include="src\hacks\Speedhack.cpp">
97+
<Filter>Source Files</Filter>
98+
</ClCompile>
9699
</ItemGroup>
97100
<ItemGroup>
98101
<ClInclude Include="src\pch.h">

src/base.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ bool Base::Data::Settings::TeleportForce[3] = { false, false, false };
7777

7878
bool Base::Data::Settings::EnableNoRecoil = false;
7979

80+
bool Base::Data::Settings::EnableSpeedhack = false;
81+
float Base::Data::Settings::SpeedhackValue = 0.5f;
82+
8083
DWORD WINAPI ExitThread(LPVOID lpReserved);
8184

8285
void Base::Init(HMODULE hMod)

src/base.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ namespace Base
9696
extern bool TeleportForce[3];
9797

9898
extern bool EnableNoRecoil;
99+
100+
extern bool EnableSpeedhack;
101+
extern float SpeedhackValue;
99102
}
100103

101104
namespace Keys
@@ -112,6 +115,7 @@ namespace Base
112115
void ESP_Snaplines(playerinfo_t* p_info);
113116
void ESP_Box(playerinfo_t* p_info);
114117
void NoRecoil();
118+
void Speedhack();
115119
}
116120

117121
namespace Hooks

src/hacks/Speedhack.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include <pch.h>
2+
#include <base.h>
3+
4+
void Base::Hacks::Speedhack()
5+
{
6+
if (Data::Settings::EnableSpeedhack)
7+
{
8+
float speed_val = Data::game.player1->maxspeed * Data::Settings::SpeedhackValue;
9+
10+
if (!(Data::game.player1->k_up && Data::game.player1->k_down))
11+
{
12+
if (Data::game.player1->k_up)
13+
Data::game.player1->move = speed_val;
14+
if (Data::game.player1->k_down)
15+
Data::game.player1->move = -speed_val;
16+
}
17+
18+
if (!(Data::game.player1->k_left && Data::game.player1->k_right))
19+
{
20+
if (Data::game.player1->k_left)
21+
Data::game.player1->strafe = speed_val;
22+
if (Data::game.player1->k_right)
23+
Data::game.player1->strafe = -speed_val;
24+
}
25+
}
26+
}

src/hooks/SwapBuffers.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ BOOL __stdcall Base::Hooks::SwapBuffers(_In_ HDC hdc)
5656
ImGui::Begin("ImGui Window");
5757
ImGui::Text("Test ImGUI Window");
5858

59+
ImGui::Checkbox("Speedhack", &Data::Settings::EnableSpeedhack);
60+
if (Data::Settings::EnableSpeedhack)
61+
ImGui::SliderFloat("Speedhack Value", &Data::Settings::SpeedhackValue, 0.1f, 1.0f, "%.1f");
62+
5963
ImGui::Checkbox("No Recoil", &Data::Settings::EnableNoRecoil);
6064

6165
ImGui::Checkbox("Enable ESP Box", &Data::Settings::EnableEspBox);

src/hooks/c2sinfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
void Base::Hooks::c2sinfo(playerent* d)
55
{
66
Hacks::Teleport();
7+
Hacks::Speedhack();
78
return Data::o_c2sinfo(d);
89
}

0 commit comments

Comments
 (0)