Add auto insta cap

This commit is contained in:
BenCat07 2018-02-07 11:56:30 +01:00 committed by GitHub
parent 8b830a13db
commit 8149cf7de5
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");
@ -138,6 +139,42 @@ 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++)
{
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;
const char *model_name = g_IModelInfo->GetModelName(model);
if (strstr("models/props_gameplay/cap_point_base.mdl", model_name))
{
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(44, 44, 44);
const Vector &min2 =
c->OBBMins() + pEnt->m_vecOrigin - Vector(44, 44, 44);
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;