Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Resolver.h"
- #include "Player.h"
- #include "Misc.h"
- int NextRes[64], OldHit[64], ResolverNew[64], Miss[64];
- Resolver_ Resolver;
- void Resolver_::LBYResolver(Vector3* &Angel, CPlayer* Ent) {
- if (!Ent)
- return;
- if (!Angel)
- return;
- Angel->y = Ent->GetLowerBody();
- }
- void Resolver_::LBYFixResolver(Vector3* &Angel, CPlayer* Ent) {
- if (!Ent)
- return;
- if (!Angel)
- return;
- float LBY = Ent->GetLowerBody();
- static float OldLBY, delta;
- if (LBY != OldLBY)
- {
- Angel->y = OldLBY;
- OldLBY = LBY;
- }
- }
- bool bullettime() {
- CPlayer* Loc = Interfaces.EntList->GetClientEntity<CPlayer>(Interfaces.Engine->GetLocalPlayer());
- if (!Loc)
- return 0;
- CBaseWeapon* Weapon = Loc->GetWeap();
- if (!Weapon)
- return false;
- float flServerTime = Hack.Misc->GetServerTime();
- float flNextPrimaryAttack = Weapon->NextPrimaryAttack();
- bool BulletTime = true;
- if (flNextPrimaryAttack > flServerTime)
- BulletTime = false;
- return BulletTime;
- }
- void Resolver_::ShotsCounter() {
- static bool bulletcounter = 0;
- if (true) {
- bool bulletfired = bullettime();
- static bool firsttick = true;
- if (!bulletfired) {
- if (firsttick) {
- Shots++;
- firsttick = false;
- }
- bulletcounter++;
- if (bulletcounter > 20) {
- bulletcounter = 0;
- firsttick = true;
- }
- }
- else {
- firsttick = true;
- bulletcounter = 0;
- }
- }
- }
- void Resolver_::AddaptiveResolverT2(Vector3* &Angle, CPlayer* Ent)
- {
- if (!Angle)
- return;
- if (!Ent)
- return;
- ShotsCounter();
- int Testdata = 2;
- float LowerBody = Ent->GetLowerBody();
- static float OldLBY, delta;
- if (LowerBody != OldLBY)
- {
- delta = OldLBY - LowerBody;
- OldLBY = LowerBody;
- }
- if (Ent->GetVelocity().Length2D() > 30 && Ent->GetFlags() & FL_ONGROUND)
- Angle->y = LowerBody;
- else
- {
- if (Settings.PList.ItsLBYAA[Ent->GetIndex()])
- Angle->y = LowerBody + delta;
- else if (Settings.PList.ItsShuffle[Ent->GetIndex()])
- Angle->y = LowerBody + 180;
- else {
- if (NextRes[Ent->GetIndex()] <= Shots)
- {
- NextRes[Ent->GetIndex()] = Shots + 1;
- if (OldHit[Ent->GetIndex()] == Hit)
- Miss[Ent->GetIndex()]++;
- OldHit[Ent->GetIndex()] = Hit;
- }
- if (Miss[Ent->GetIndex()] >= Testdata) {
- ResolverNew[Ent->GetIndex()]++;
- Miss[Ent->GetIndex()] = 0;
- }
- switch (ResolverNew[Ent->GetIndex()] % 4)
- {
- case 0: {
- Angle->y = LowerBody;
- }
- break;
- case 1: {
- Angle->y = LowerBody + delta;
- if (NextRes[Ent->GetIndex()] < Shots)
- Settings.PList.ItsLBYAA[Ent->GetIndex()] = true;
- }
- break;
- case 2: {
- Angle->y = LowerBody + 180;
- if (NextRes[Ent->GetIndex()] < Shots)
- Settings.PList.ItsShuffle[Ent->GetIndex()] = true;
- }
- break;
- case 3:
- Angle->y = OldLBY;
- break;
- }
- }
- }
- }
- void Resolver_::Resolver() {
- CPlayer* Loc = Interfaces.EntList->GetClientEntity<CPlayer>(Interfaces.Engine->GetLocalPlayer());
- if (Loc && Loc->GetHealth() > 0) {
- CPlayer* Ent;
- int ResolverType = Settings.GuzGuiMenu.RageTab.ResolverType.returnvalue;
- for (int i = 0; i < Interfaces.Engine->GetMaxClients(); i++) {
- Ent = Interfaces.EntList->GetClientEntity<CPlayer>(i);
- if (!Ent)
- continue;
- if (Ent->IsDormant()
- || (Ent->GetHealth() == 0)
- || !Ent->IsAlive()
- || (Ent == Loc)
- || (Ent->GetTeam() == Loc->GetTeam())
- || Ent->HasGunGameImmunity())
- continue;
- Vector3* Angls = Ent->GetEyeAnglesPointer();
- if(!Angls)
- continue;
- float OrirAngleY = Ent->GetEyeAngles().y;
- if (Settings.PList.XFix[i].returnvalue > 0)
- {
- switch (Settings.PList.XFix[i].returnvalue)
- {
- case 1:
- Angls->x = -89;
- break;
- case 2:
- Angls->x = 89;
- break;
- case 3:
- Angls->x = Settings.PList.CustomXFix[i];
- break;
- }
- }
- if (Settings.PList.YFix[i].returnvalue > 0)
- {
- switch (Settings.PList.YFix[i].returnvalue)
- {
- case 1:
- Angls->y = OrirAngleY + 180;
- break;
- case 2:
- LBYResolver(Angls, Ent);
- break;
- case 3:
- LBYFixResolver(Angls, Ent);
- break;
- case 4:
- Angls->y = Settings.PList.CustomYFix[i];
- break;
- }
- }
- if (Settings.PList.YFix[i].returnvalue == 0)
- {
- switch (ResolverType) {
- case 0:
- //Пуста
- break;
- case 1:
- LBYResolver(Angls, Ent);
- break;
- case 2:
- LBYFixResolver(Angls, Ent);
- break;
- case 3:
- AddaptiveResolverT2(Angls, Ent);
- break;
- }
- }
- }
- }
- }
- void Resolver_::ResolverFunc(ClientFrameStage_t curStage) {
- if (!Hack.Local)
- return;
- if (!Hack.Weapon)
- return;
- if (!Hack.Local->IsValid())
- return;
- if (curStage == FRAME_NET_UPDATE_POSTDATAUPDATE_START)
- Resolver();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement