Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- C_BaseEntity *aimlock = 0;
- ConVar aimbot_on("aimbot_on", "0", FCVAR_CHEAT);
- ConVar trgbot_on("trgbot_on", "0", FCVAR_CHEAT);
- ConVar esp_on("esp_on", "0", FCVAR_CHEAT);
- ConVar nospread_on("nospread_on", "0", FCVAR_CHEAT);
- // If we're firing multiple shots, and the first shot has to be bang on target, ignore spread
- if ( iShot == 0 && info.m_iShots > 1 && (info.m_nFlags & FIRE_BULLETS_FIRST_SHOT_ACCURATE) )
- {
- vecDir = Manipulator.GetShotDirection();
- }
- else if (!nospread_on.GetBool())
- {
- // Don't run the biasing code for the player at the moment.
- vecDir = Manipulator.ApplySpread( info.m_vecSpread );
- }
- if (aimbot_on.GetBool())
- {
- C_BasePlayer *lp = UTIL_PlayerByIndex(1);
- float radius = 2048.0f;
- C_BaseEntity *ents[256];
- int ent_count = UTIL_EntitiesInSphere(ents, 256, lp->GetAbsOrigin(), radius, 0);
- int i = 0;
- for (i = 0; i < ent_count; i++)
- {
- if (aimlock == 0 && (ents[i] != NULL)
- && ents[i]->IsAlive() && ents[i]->IsNPC()
- && (ents[i]->GetMoveType() != MOVETYPE_NONE)
- && (ents[i]->GetMoveType() != MOVETYPE_OBSERVER))
- {
- aimlock = ents[i];
- break;
- }
- else if (aimlock != 0)
- {
- if ((ents[i] == NULL)
- || !ents[i]->IsAlive() || !ents[i]->IsNPC()
- || (ents[i]->GetMoveType() == MOVETYPE_NONE)
- || (ents[i]->GetMoveType() == MOVETYPE_OBSERVER))
- {
- aimlock = 0;
- break;
- }
- }
- }
- if (aimlock != 0)
- {
- Vector aimpos; aimpos.Init();
- QAngle aimang; aimang.Init();
- C_BasePlayer *enemy = (C_BasePlayer*)aimlock;
- Vector epos = enemy->GetAbsOrigin();
- epos.z += enemy->BoundingRadius();
- Vector lpos = lp->GetAbsOrigin();
- lpos.z += (lp->BoundingRadius()>40)?64:28;
- QAngle aang;
- int atch = ents[i]->LookupAttachment("ValveBiped.Bip01_Head1");
- if (atch != 0) ents[i]->GetAttachment(atch, epos, aang);
- aimpos = epos - lpos;
- VectorAngles(aimpos, aimang);
- pCmd->viewangles = aimang;
- if (trgbot_on.GetBool())
- {
- if (pCmd->buttons & IN_ATTACK)
- pCmd->buttons &= ~IN_ATTACK;
- else pCmd->buttons &= IN_ATTACK;
- }
- }
- }
- if (esp_on.GetBool())
- {
- float radius = 4096.0f;
- C_BaseEntity *ents[256];
- int ent_count = UTIL_EntitiesInSphere(ents, 256,
- UTIL_PlayerByIndex(1)->GetAbsOrigin(), radius, 0);
- int i = 0;
- for (i = 0; i < ent_count; i++)
- {
- if ((ents[i] != NULL)
- && ents[i]->IsAlive() && ents[i]->IsNPC()
- && (ents[i]->GetMoveType() != MOVETYPE_NONE)
- && (ents[i]->GetMoveType() != MOVETYPE_OBSERVER))
- {
- CCollisionProperty *pCollide = ents[i]->CollisionProp();
- debugoverlay->AddBoxOverlay(ents[i]->GetAbsOrigin(),
- pCollide->OBBMins(), pCollide->OBBMaxs(),
- ents[i]->GetAbsAngles(), 255, 0, 0, 10, 0.1f);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement