Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool __stdcall CreateMoveClient_Hooked( float frametime, CUserCmd* pCmd)
- {
- if (!pCmd->command_number)
- return true;
- if (Interfaces::Engine->IsConnected() && Interfaces::Engine->IsInGame())
- {
- PVOID pebp;
- __asm mov pebp, ebp;
- bool* pbSendPacket = (bool*)(*(DWORD*)pebp - 0x1C);
- bool& bSendPacket = *pbSendPacket;
- Vector origView = pCmd->viewangles;
- Vector viewforward, viewright, viewup, aimforward, aimright, aimup;
- Vector qAimAngles;
- qAimAngles.Init(0.0f, pCmd->viewangles.y, 0.0f);
- AngleVectors(qAimAngles, &viewforward, &viewright, &viewup);
- IClientEntity* pEntity;
- IClientEntity *pLocal = Interfaces::EntList->GetClientEntity(Interfaces::Engine->GetLocalPlayer());
- if (Interfaces::Engine->IsConnected() && Interfaces::Engine->IsInGame() && pLocal && pLocal->IsAlive())
- {
- Hacks::MoveHacks(pCmd, bSendPacket);
- ResolverSetup::GetInst().CM(pEntity);
- }
- if (Menu::Window.MiscTab.FakeLagEnable.GetState())
- {
- static int ticks = 0;
- static int ticks1 = 0;
- static int iTick = 0;
- static int iTick1 = 0;
- static int iTick2 = 0;
- int ticksMax = 16;
- int value = Menu::Window.MiscTab.FakeLagChoke.GetValue();
- if (Menu::Window.MiscTab.FakeLagEnable.GetState() && value > 0 && Menu::Window.MiscTab.FakeLagTyp.GetIndex() == 2)
- {
- if (ticks >= ticksMax)
- {
- bSendPacket = true;
- ticks = 0;
- }
- else
- {
- int packetsToChoke;
- if (pLocal->GetVelocity().Length() > 0.f)
- {
- packetsToChoke = (int)((128.f / Interfaces::Globals->interval_per_tick) / pLocal->GetVelocity().Length()) + 1;
- if (packetsToChoke >= 15)
- packetsToChoke = 14;
- if (packetsToChoke < value)
- packetsToChoke = value;
- }
- else
- packetsToChoke = 0;
- bSendPacket = ticks < 18 - packetsToChoke;;
- }
- ticks++;
- }
- if (Menu::Window.MiscTab.FakeLagEnable.GetState() && value > 0 && Menu::Window.MiscTab.FakeLagTyp.GetIndex() == 4)
- {
- if (!(pLocal->GetFlags() & FL_ONGROUND))
- {
- if (ticks1 >= ticksMax)
- {
- bSendPacket = true;
- ticks1 = 0;
- }
- else
- {
- int packetsToChoke;
- if (pLocal->GetVelocity().Length() > 0.f)
- {
- packetsToChoke = (int)((128.f / Interfaces::Globals->interval_per_tick) / pLocal->GetVelocity().Length()) + 1;
- if (packetsToChoke >= 15)
- packetsToChoke = 14;
- if (packetsToChoke < value)
- packetsToChoke = value;
- }
- else
- packetsToChoke = 0;
- bSendPacket = ticks1 < 18 - packetsToChoke;;
- }
- ticks1++;
- }
- }
- if (Menu::Window.MiscTab.FakeLagEnable.GetState() && value > 0 && Menu::Window.MiscTab.FakeLagTyp.GetIndex() == 1)
- {
- if (iTick < value) {
- bSendPacket = false;
- iTick++;
- }
- else {
- bSendPacket = true;
- iTick = 0;
- }
- }
- if (Menu::Window.MiscTab.FakeLagEnable.GetState() && value > 0 && Menu::Window.MiscTab.FakeLagTyp.GetIndex() == 3)
- {
- if (!(pLocal->GetFlags() & FL_ONGROUND))
- {
- if (iTick1 < value) {
- bSendPacket = false;
- iTick1++;
- }
- else {
- bSendPacket = true;
- iTick1 = 0;
- }
- }
- }
- if (Menu::Window.MiscTab.FakeLagEnable.GetState() && value > 0 && Menu::Window.MiscTab.FakeLagTyp.GetIndex() == 5)
- {
- value = LagCompBreak();
- if (iTick2 < value) {
- bSendPacket = false;
- iTick2++;
- }
- else {
- bSendPacket = true;
- iTick2 = 0;
- }
- }
- }
- if (Interfaces::Engine->IsInGame() && Interfaces::Engine->IsConnected())
- {
- static auto SetClanTag = reinterpret_cast<void(__fastcall*)(const char*, const char*)>(((DWORD)(Utilities::Memory::FindPatternV2("engine.dll", "53 56 57 8B DA 8B F9 FF 15"))));
- if (Menu::Window.MiscTab.ClanTag.GetState())
- {
- static size_t lastTime = 0;
- if (GetTickCount() > lastTime)
- {
- kek++;
- if (kek > 10)
- {
- autism = autism + 1;
- if (autism >= 19) // number of clantaganimation
- autism = 0;
- char random[255];
- SetClanTag(clantaganimation[autism], clantaganimation[autism]);
- lastTime = GetTickCount() + 500;
- }
- if (kek > 10)
- kek = 0;
- }
- }
- else
- SetClanTag("", "");
- }
- static bool abc = false;
- if (Menu::Window.VisualsTab.NightMode.GetState())
- {
- if (!abc)
- {
- ConVar* staticdrop = Interfaces::CVar->FindVar("r_DrawSpecificStaticProp");
- SpoofedConvar* staticdrop_spoofed = new SpoofedConvar(staticdrop);
- staticdrop_spoofed->SetInt(0);
- {
- for (MaterialHandle_t i = Interfaces::MaterialSystem->FirstMaterial(); i != Interfaces::MaterialSystem->InvalidMaterial(); i = Interfaces::MaterialSystem->NextMaterial(i))
- {
- IMaterial *pMaterial = Interfaces::MaterialSystem->GetMaterial(i);
- if (!pMaterial)
- continue;
- if (!strcmp(pMaterial->GetTextureGroupName(), "World textures"))
- {
- pMaterial->ColorModulation(0.1f, 0.1f, 0.1f);
- }
- if (!strcmp(pMaterial->GetTextureGroupName(), "StaticProp textures"))
- {
- pMaterial->ColorModulation(0.3f, 0.3f, 0.3f);
- }
- }
- }
- }
- abc = true;
- }
- else
- {
- abc = false;
- }
- static bool nosmoke;
- if (Menu::Window.VisualsTab.OtherNoSmoke.GetState())
- {
- if (!nosmoke) {
- ConVar* particles = Interfaces::CVar->FindVar("r_drawparticles");
- SpoofedConvar* particles_spoofed = new SpoofedConvar(particles);
- particles_spoofed->SetInt(0);
- ConVar* fog = Interfaces::CVar->FindVar("fog_enable");
- SpoofedConvar* fog_spoofed = new SpoofedConvar(fog);
- fog_spoofed->SetInt(0);
- nosmoke = true;
- }
- }
- else if (!Menu::Window.VisualsTab.OtherNoSmoke.GetState())
- {
- if (nosmoke)
- {
- ConVar* particles = Interfaces::CVar->FindVar("r_drawparticles");
- SpoofedConvar* particles_spoofed = new SpoofedConvar(particles);
- particles_spoofed->SetInt(1);
- ConVar* fog = Interfaces::CVar->FindVar("fog_enable");
- SpoofedConvar* fog_spoofed = new SpoofedConvar(fog);
- fog_spoofed->SetInt(1);
- nosmoke = false;
- }
- }
- if (Menu::Window.VisualsTab.NightSky.GetState())
- {
- ConVar* sky = Interfaces::CVar->FindVar("sv_skyname");
- SpoofedConvar* sky_spoofed = new SpoofedConvar(sky);
- sky_spoofed->SetString("sky_csgo_night02b");
- }
- qAimAngles.Init(0.0f, GetAutostrafeView().y, 0.0f);
- AngleVectors(qAimAngles, &viewforward, &viewright, &viewup);
- qAimAngles.Init(0.0f, pCmd->viewangles.y, 0.0f);
- AngleVectors(qAimAngles, &aimforward, &aimright, &aimup);
- Vector vForwardNorm; Normalize(viewforward, vForwardNorm);
- Vector vRightNorm; Normalize(viewright, vRightNorm);
- Vector vUpNorm; Normalize(viewup, vUpNorm);
- float forward = pCmd->forwardmove;
- float right = pCmd->sidemove;
- float up = pCmd->upmove;
- if (forward > 450) forward = 450;
- if (right > 450) right = 450;
- if (up > 450) up = 450;
- if (forward < -450) forward = -450;
- if (right < -450) right = -450;
- if (up < -450) up = -450;
- pCmd->forwardmove = DotProduct(forward * vForwardNorm, aimforward) + DotProduct(right * vRightNorm, aimforward) + DotProduct(up * vUpNorm, aimforward);
- pCmd->sidemove = DotProduct(forward * vForwardNorm, aimright) + DotProduct(right * vRightNorm, aimright) + DotProduct(up * vUpNorm, aimright);
- pCmd->upmove = DotProduct(forward * vForwardNorm, aimup) + DotProduct(right * vRightNorm, aimup) + DotProduct(up * vUpNorm, aimup);
- if (Menu::Window.MiscTab.OtherSafeMode.GetState())
- {
- GameUtils::NormaliseViewAngle(pCmd->viewangles);
- if (pCmd->viewangles.z != 0.0f)
- {
- pCmd->viewangles.z = 0.00;
- }
- if (pCmd->viewangles.x < -89 || pCmd->viewangles.x > 89 || pCmd->viewangles.y < -180 || pCmd->viewangles.y > 180)
- {
- Utilities::Log("Having to re-normalise!");
- GameUtils::NormaliseViewAngle(pCmd->viewangles);
- Beep(750, 800);
- if (pCmd->viewangles.x < -89 || pCmd->viewangles.x > 89 || pCmd->viewangles.y < -180 || pCmd->viewangles.y > 180)
- {
- pCmd->viewangles = origView;
- pCmd->sidemove = right;
- pCmd->forwardmove = forward;
- }
- }
- }
- if (pCmd->viewangles.x > 90)
- {
- pCmd->forwardmove = -pCmd->forwardmove;
- }
- if (pCmd->viewangles.x < -90)
- {
- pCmd->forwardmove = -pCmd->forwardmove;
- }
- if (bSendPacket)
- LastAngleAA = pCmd->viewangles;
- }
- return false;
- int circlekey = Menu::Window.MiscTab.OtherCircle.GetKey();
- int circle = Menu::Window.MiscTab.CircleAmount.GetValue();
- static float CurYaw = 0.f;
- if (circlekey > 0 && GUI.GetKeyState(circlekey))
- {
- pCmd->forwardmove = -450.f;
- pCmd->sidemove = 0.f;
- static float CurYaw = 0.f;
- float Vel2D = hackManager.pLocal()->GetVelocity().Length2D();
- if (Vel2D >= 0)
- {
- float TurnRate = clip((Vel2D / 90.f), circle, 1.25f);
- CurYaw += TurnRate;
- pCmd->viewangles.y = CurYaw;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement