Merge pull request #344 from BenCat07/patch-9

Add auto insta cap
This commit is contained in:
nullifiedcat 2018-02-07 14:33:58 +03:00 committed by GitHub
commit 77f0575493
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ CatVar shoot(CV_SWITCH, "se_shoot", "0",
CatVar stickyspam(CV_SWITCH, "se_stickyspam", "0",
"Allows Spam of stickies simply by holding Mouse1.");
CatVar cloak(CV_SWITCH, "se_cloak", "0", "Instant decloak/cloak");
CatVar cap(CV_SWITCH, "se_cap", "0", "Auto instant cap");
CatVar instant_weapon_switch(CV_SWITCH, "se_switch", "0",
"Instant weapon switch");
CatVar key(CV_KEY, "se_key", "0", "Sequence exploit key");
@ -31,8 +32,8 @@ CatVar value(CV_INT, "se_value", "900", "Sequence exploit value",
CatCommand do_lagexploit("se_do", "Sequence exploit (for use in scripts)",
[]() { AddExploitTicks(6); });
int exticks = 0;
const model_t *point = nullptr;
void AddExploitTicks(int ticks)
{
exticks = std::max(ticks, exticks);
@ -57,7 +58,6 @@ static CatVar infinite_packs(CV_SWITCH, "infinite_packs", "0",
"Infinite Pickups",
"Activate sequence exploit when standing on "
"pickups while having not full HP/Ammo");
void CreateMove()
{
if (CE_BAD(LOCAL_E))
@ -138,6 +138,58 @@ void CreateMove()
static bool bWasHolding = false;
bool bIsHolding = ((g_pUserCmd->buttons & IN_ATTACK) ||
(g_pUserCmd->buttons & IN_ATTACK2));
if (cap)
{
for (int i = 1; i < HIGHEST_ENTITY; i++)
{
if (!point)
{
CachedEntity *pEnt = ENTITY(i);
if (!CE_GOOD(pEnt))
continue;
const model_t *model = RAW_ENT(pEnt)->GetModel();
if (!model)
continue;
const char *model_name = g_IModelInfo->GetModelName(model);
if (strstr("models/props_gameplay/cap_point_base.mdl",
model_name))
point = model;
else
continue;
}
CachedEntity *pEnt = ENTITY(i);
if (!CE_GOOD(pEnt))
continue;
if (pEnt->m_iTeam == LOCAL_E->m_iTeam)
continue;
const model_t *model = RAW_ENT(pEnt)->GetModel();
if (!model)
continue;
if (model == point)
{
if (!CE_GOOD(LOCAL_E))
continue;
ICollideable *c = RAW_ENT(pEnt)->GetCollideable();
ICollideable *p = RAW_ENT(LOCAL_E)->GetCollideable();
const Vector &max1 =
p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin();
const Vector &min1 =
p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin();
const Vector &max2 =
c->OBBMaxs() + pEnt->m_vecOrigin + Vector(200, 200, 200);
const Vector &min2 =
c->OBBMins() + pEnt->m_vecOrigin - Vector(200, 200, 200);
if ((min1.x <= max2.x && max1.x >= min2.x) &&
(min1.y <= max2.y && max1.y >= min2.y) &&
(min1.z <= max2.z && max1.z >= min2.z))
{
amount = (int) value;
}
}
}
}
if (instant_weapon_switch && not HasCondition<TFCond_Cloaked>(LOCAL_E))
{
static int lastweapon = 0;