Skip to content

Commit

Permalink
added speedhack
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbo committed Jan 13, 2021
1 parent 6f0e8d6 commit 309bfbe
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions AssaultCube-Multihack.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
<ClCompile Include="src\hacks\ESP_Box.cpp" />
<ClCompile Include="src\hacks\ESP_Snaplines.cpp" />
<ClCompile Include="src\hacks\NoRecoil.cpp" />
<ClCompile Include="src\hacks\Speedhack.cpp" />
<ClCompile Include="src\hacks\Teleport.cpp" />
<ClCompile Include="src\hooks\attackphysics.cpp" />
<ClCompile Include="src\hooks\c2sinfo.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions AssaultCube-Multihack.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
<ClCompile Include="src\hacks\NoRecoil.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\hacks\Speedhack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\pch.h">
Expand Down
3 changes: 3 additions & 0 deletions src/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ bool Base::Data::Settings::TeleportForce[3] = { false, false, false };

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

bool Base::Data::Settings::EnableSpeedhack = false;
float Base::Data::Settings::SpeedhackValue = 0.5f;

DWORD WINAPI ExitThread(LPVOID lpReserved);

void Base::Init(HMODULE hMod)
Expand Down
4 changes: 4 additions & 0 deletions src/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ namespace Base
extern bool TeleportForce[3];

extern bool EnableNoRecoil;

extern bool EnableSpeedhack;
extern float SpeedhackValue;
}

namespace Keys
Expand All @@ -112,6 +115,7 @@ namespace Base
void ESP_Snaplines(playerinfo_t* p_info);
void ESP_Box(playerinfo_t* p_info);
void NoRecoil();
void Speedhack();
}

namespace Hooks
Expand Down
26 changes: 26 additions & 0 deletions src/hacks/Speedhack.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <pch.h>
#include <base.h>

void Base::Hacks::Speedhack()
{
if (Data::Settings::EnableSpeedhack)
{
float speed_val = Data::game.player1->maxspeed * Data::Settings::SpeedhackValue;

if (!(Data::game.player1->k_up && Data::game.player1->k_down))
{
if (Data::game.player1->k_up)
Data::game.player1->move = speed_val;
if (Data::game.player1->k_down)
Data::game.player1->move = -speed_val;
}

if (!(Data::game.player1->k_left && Data::game.player1->k_right))
{
if (Data::game.player1->k_left)
Data::game.player1->strafe = speed_val;
if (Data::game.player1->k_right)
Data::game.player1->strafe = -speed_val;
}
}
}
4 changes: 4 additions & 0 deletions src/hooks/SwapBuffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ BOOL __stdcall Base::Hooks::SwapBuffers(_In_ HDC hdc)
ImGui::Begin("ImGui Window");
ImGui::Text("Test ImGUI Window");

ImGui::Checkbox("Speedhack", &Data::Settings::EnableSpeedhack);
if (Data::Settings::EnableSpeedhack)
ImGui::SliderFloat("Speedhack Value", &Data::Settings::SpeedhackValue, 0.1f, 1.0f, "%.1f");

ImGui::Checkbox("No Recoil", &Data::Settings::EnableNoRecoil);

ImGui::Checkbox("Enable ESP Box", &Data::Settings::EnableEspBox);
Expand Down
1 change: 1 addition & 0 deletions src/hooks/c2sinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
void Base::Hooks::c2sinfo(playerent* d)
{
Hacks::Teleport();
Hacks::Speedhack();
return Data::o_c2sinfo(d);
}

0 comments on commit 309bfbe

Please sign in to comment.