Simple Auto Defuse

Posts 1–7 of 7 · Page 1 of 1
Simple Auto Defuse
I'm pretty gay so here's something I coded in 5 minutes, for external users you can simulate a keypress instead.

Code:
void AutoDefuse(CBaseEntity* pLocal, CInput::CUserCmd* pCmd)
{
	// Abort if you are not a counter-terrorist //
	if (!(pLocal->GetTeam() == 3))
		return;

	// Loop through entities in the world //
	for (int i = 1; i < CInterfaces::g_pEntList->GetHighestEntityIndex(); i++)
	{
		// Saving the entity for use //
		CBaseEntity* pEntity = CInterfaces::g_pEntList->GetClientEntity(i);
		// Continue if the entity exists //
		if (!pEntity)
			continue;
		// Pretty self-explanatory //
		if (pEntity->IsDormant())
			continue;
		// Filter entities to get the planted bomb //
		if (pEntity->GetClientClass()->GetClassID() != CPlantedC4)
			continue;
		// Making sure that the bomb is not already defused //
		if (pEntity->IsBombDefused())
			continue;

		// Retrieve the distance from you to the bomb //
		float fDistance = g_pMath.GetDistance(pLocal->GetAbsOrigin(), pEntity->GetAbsOrigin());

		// Continue if you are within a reasonable distance & field of view //
		if (fDistance <= 6.5f)
		{
			// Defuse the bomb derp //
			pCmd->buttons |= IN_USE;
		}
	}
}
Thanks man !
You know sometimes pressing E is way too hard.
Quote Originally Posted by 4nuoFZf9aE View Post
You know sometimes pressing E is way too hard.
sometimes it can save you 0.1 seconds and win the round
Good little feature to add to your hack
Why would you even do that, pretty useless tbh
Quote Originally Posted by kxhashimoto View Post
Why would you even do that, pretty useless tbh
Defuses instantly at closest range possible so it could save you some time
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us