desync & lby indicator for xy0

Focutza111

Newbie
Newbie
Newbie
Newbie
Status
Offline
Joined
Dec 16, 2019
Messages
3
Reaction score
3
Code:
Title says it all


        if (c_config::get().someindicators)
        {
            if (Globals::LocalPlayer->IsAlive())
            {
                float desyncAmt = g_AntiAim.MaxDelta(Globals::LocalPlayer);
                float diffrence = (Globals::RealAngle.y - Globals::LocalPlayer->GetLowerBodyYaw());
                float Velocity = Globals::LocalPlayer->GetVelocity().Length2D();
                int offset = 40;
                Color fake = desyncAmt <= 29 ? Color(255, 0, 0) : (desyncAmt >= 55 ? Color(132, 195, 16) : Color(255 - (desyncAmt * 2.55), desyncAmt * 2.55, 0));
                std::string choke;
                auto NetChannel = g_pEngine->GetNetChannel();
                static int iWidth, iHeight;
                g_pEngine->GetScreenSize(iWidth, iHeight);

                if (!NetChannel)
                    return;

                choke += "choke: " + std::to_string(NetChannel->m_nChokedPackets);
                g_pSurface->DrawT(20, (iHeight - offset - 90), Color(255, 255, 255), Globals::Indicators, false, choke.c_str());
                
                
                if (diffrence > 35 && Velocity < 0.1f)
                    g_pSurface->DrawT(20, (iHeight - offset - 60), Color(132, 195, 16), Globals::Indicators, false, "LBY");
                else
                    g_pSurface->DrawT(20, (iHeight - offset - 60), Color(255, 0, 0), Globals::Indicators, false, "LBY");

                if (!(desyncAmt < 29))
                    g_pSurface->DrawT(20, (iHeight - offset - 30), fake, Globals::Indicators, false, "FAKE");
            }
        }

NOTE : i did it for xy0 in notepad so might need some fixes idk
NOTE 2 : paste this in antiaim.cpp if you dont have it

float AntiAim::MaxDelta(C_BaseEntity* pEnt) {
auto animstate = uintptr_t(pEnt->AnimState());
float duckammount = *(float*)(animstate + 0xA4);
float speedfraction = max(0, min(*reinterpret_cast<float*>(animstate + 0xF8), 1));
float speedfactor = max(0, min(1, *reinterpret_cast<float*> (animstate + 0xFC)));
float unk1 = ((*reinterpret_cast<float*> (animstate + 0x11C) * -0.30000001f) - 0.19999999f) * speedfraction;
float unk2 = unk1 + 1.f;
float unk3;
if (duckammount > 0) {
unk2 += ((duckammount * speedfactor) * (0.5f - unk2));
}
unk3 = *(float*)(animstate + 0x334) * unk2;
return unk3;
}

EDIT : this goes into antiaim.h ( if you dont have it ofc )


float MaxDelta(C_BaseEntity* pEnt);
 

memory

User
User
User
User
Status
Offline
Joined
Jun 25, 2019
Messages
55
Reaction score
25
thats not desync, that just calculates the max delta of a player
 

advc3d

Newbie
Newbie
Newbie
Newbie
Status
Offline
Joined
Aug 19, 2019
Messages
18
Reaction score
23
this is how you get the proper value

const auto desync_value = static_cast<int>(std::clamp(fabs(animations.fake_delta), 0.f, 58.f) / 58.f * 255.f);

to get fake_delta you need to maintain a seperate animstate and updating the animstates yaw with ur eyeangles and store you goalfeetyaw from that animstate on bsendpacket, then u want to do something like fake_delta = thatgoalfeetyawyoustored - fake_state->goalfeetyaw

good luck
 

memory

User
User
User
User
Status
Offline
Joined
Jun 25, 2019
Messages
55
Reaction score
25
this is how you get the proper value

const auto desync_value = static_cast<int>(std::clamp(fabs(animations.fake_delta), 0.f, 58.f) / 58.f * 255.f);

to get fake_delta you need to maintain a seperate animstate and updating the animstates yaw with ur eyeangles and store you goalfeetyaw from that animstate on bsendpacket, then u want to do something like fake_delta = thatgoalfeetyawyoustored - fake_state->goalfeetyaw

good luck
i know how to use it but ty anyway
 
Top