Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Resolver.h"
- #define SETANGLE 180
- int Globals::Shots = 0;
- bool Globals::change;
- CUserCmd* Globals::UserCmd;
- int Globals::TargetID;
- IClientEntity* Globals::Target;
- bool Globals::AutoBody = false;
- bool Globals::DrawLBY = false;
- bool Globals::LBYUpdated = false;
- static float oldlowerbodyyaw [65];
- int shots[65];
- float get_average_lby_standing_update_delta(IClientEntity* player) {
- static float last_update_time[64];
- static float second_laste_update_time[64];
- static float oldlowerbody[64];
- float lby = static_cast<int>(fabs(player->EyeAnglesPointer()->y - player->GetLowerBodyYaw()));
- if (lby != oldlowerbody[player->GetIndex()]) {
- second_laste_update_time[player->GetIndex()] = last_update_time[player->GetIndex()];
- last_update_time[player->GetIndex()] = Interfaces::Globals->curtime;
- oldlowerbody[player->GetIndex()] = lby;
- }
- return last_update_time[player->GetIndex()] - second_laste_update_time[player->GetIndex()];
- }
- bool lby_keeps_updating() {
- return get_average_lby_standing_update_delta;
- }
- bool IsMovingOnGround(IClientEntity* pEntity) {
- //Check if player has a velocity greater than 0 (moving) and if they are onground.
- return pEntity->GetVelocity().Length2D() > 0.1f && *pEntity->GetFlags() & FL_ONGROUND;
- }
- //Used to tell if a player is fake walking
- bool IsFakeWalking(IClientEntity* pEntity) {
- //Check if a player is moving, but at below a velocity of 36
- return IsMovingOnGround(pEntity) && pEntity->GetVelocity().Length2D() < 35.0f;
- }
- void LuigiKMS::Resolve()
- {
- IClientEntity *pLocal = Interfaces::EntList->GetClientEntity(Interfaces::Engine->GetLocalPlayer());
- DWORD eyeangles = NetVar.GetNetVar(0xBFEA4E7B);
- for (int i = 0; i < Interfaces::Engine->GetMaxClients(); ++i)
- {
- IClientEntity *pEntity = Interfaces::EntList->GetClientEntity(i);
- if (!pEntity || pEntity->IsDormant() || !pEntity->IsAlive())
- continue;
- player_info_t pTemp;
- if (!Interfaces::Engine->GetPlayerInfo(i, &pTemp))
- continue;
- int index = pEntity->GetIndex();
- Vector* eyeAngles = pEntity->EyeAnglesPointer();
- if (Menu::Window.RageBotTab.AccuracyResolveYaw.GetState() == 1)
- {
- // InterpolationList = InterpolationFix kinda weird
- //static auto InterpolationList = *(uintptr_t*)(Utilities::Memory::FindPattern("client.dll", ((PBYTE)"\x39\x9F\xB6"), "xxx") + 0xA);
- //if (InterpolationList)
- //{
- // *reinterpret_cast<uintptr_t*>(static_cast<uintptr_t>(InterpolationList) + 18) = 0;
- // *reinterpret_cast<uintptr_t*>(static_cast<uintptr_t>(InterpolationList) + 12) = 0xFFFF;
- //}
- static float last_moving_lby[64];
- float interpellslationrationz = Interfaces::CVar->FindVar(XorStr("cl_interp_ratio"))->fValue;
- float updaterlaterrater = Interfaces::CVar->FindVar(XorStr("cl_updaterate"))->fValue;
- int skeet = interpellslationrationz / updaterlaterrater;
- const bool is_moving = pEntity->GetVelocity().Length2D() > 0.1;
- float ismoving = pEntity->GetVelocity().Length2D() > 0.1f;
- float isstanding = pEntity->GetVelocity().Length2D() <= 0.0f;
- static float lastlby[65];
- static float last_moving_time[65];
- float servercalc = Interfaces::Globals->curtime * Interfaces::Globals->tickcount;
- float bodyeyedelta = eyeAngles->y - pEntity->GetLowerBodyYaw();
- float lby = pEntity->GetLowerBodyYaw();
- Vector attarget = (pLocal->GetEyePos(), pLocal->GetEyePos());
- if (ismoving) {
- eyeAngles->y = lby;
- }
- if (IsFakeWalking) {
- eyeAngles->y - lby >= lby + 180;
- }
- else if (is_moving && !IsFakeWalking)
- {
- last_moving_lby[pEntity->GetIndex()] = pEntity->GetLowerBodyYaw();
- lastlby[pEntity->GetIndex()] = last_moving_lby[pEntity->GetIndex()];
- last_moving_time[pEntity->GetIndex()] = Interfaces::Globals->curtime;
- *(float*)((DWORD)pEntity + eyeangles) = pEntity->GetLowerBodyYaw();
- }
- else if (isstanding)
- {
- if (lby_keeps_updating() < 35) {
- switch (shots[Globals::TargetID] % 2) {
- case 0:
- pEntity->GetAbsOrigin(), pLocal->GetAbsOrigin().y + 35;
- break;
- case 1:
- pEntity->GetAbsOrigin(), pLocal->GetAbsOrigin().y - 170;
- break;
- }
- }
- else if (lby_keeps_updating() > 35) {
- switch (shots[Globals::TargetID] % 2) {
- case 0:
- pEntity->GetAbsOrigin(), lby;
- break;
- case 1:
- pEntity->GetAbsOrigin(), pLocal->GetAbsOrigin().y - rand() % 35;
- break;
- }
- }
- else if (lby_keeps_updating() > 2.2f) {
- static_cast<DWORD>(eyeAngles->y = eyeAngles->y + 180);
- }
- }
- //test
- else if (skeet) {
- if (lby_keeps_updating() >= 35) {
- eyeAngles->y - lby >= lby + 180;
- }
- }
- else
- {
- switch (Globals::Shots % 3)
- {
- case 0: *(float*)((DWORD)pEntity + eyeangles) = last_moving_lby[pEntity->GetIndex()] + 90; break;
- case 1: *(float*)((DWORD)pEntity + eyeangles) = last_moving_lby[pEntity->GetIndex()] - 90; break;
- case 2: *(float*)((DWORD)pEntity + eyeangles) = last_moving_lby[pEntity->GetIndex()] + 180; break;
- }
- }
- }
- }
- }
- void LuigiKMS::FSN(IClientEntity* pEntity, ClientFrameStage_t stage)
- {
- if (stage == ClientFrameStage_t::FRAME_NET_UPDATE_POSTDATAUPDATE_START)
- {
- for (int i = 1; i < Interfaces::Engine->GetMaxClients(); i++)
- {
- pEntity = (IClientEntity*)Interfaces::EntList->GetClientEntity(i);
- if (!pEntity || pEntity == hackManager.pLocal() || pEntity->IsDormant() || !pEntity->IsAlive())
- continue;
- LuigiKMS::Resolve();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement