예제 #1
0
파일: main.cpp 프로젝트: TSM-Dev/nh21
void CreateMove(CUserCmd* cmd)
{
	sendPacket = 1;

	CBaseEntity* me	= LocalPlayer();
	CBaseEntity* w	= me->GetActiveWeapon();

	Vector qrv = cmd->viewangles;
	
	globals->cur_time = (float)me->GetTickBase() * ReadPtr<float>(me, m_flLaggedMovementValue) * globals->interval_per_tick;
	
	aimbot::Update();
	aimbot::PerformPrediction(cmd);
	
	bool aim = 0;
	if (MENU_AIMBOTEN && (!MENU_AIMBOTKB || util::IsKeyDown(MENU_AIMBOTKB)) && !aimbot::dummy)
		aim = aimbot::Think(cmd);

	if (!MENU_FAKEVIEW && aim)
		engine->SetViewAngles(cmd->viewangles);
	
	nospread::HandleCmd(cmd, w);


	if (MENU_NORECOIL && !aimbot::dummy)
	{
		nospread::FixRecoil(cmd);
		NormalizeAngles(cmd->viewangles);
	}

	if (MENU_SEMIFULL && !aimbot::dummy && !aimbot::bullet)
		del(cmd->buttons, IN_ATTACK);

	if (tf2() && MENU_AUTOSTAB && w && !strcmp(w->GetClientClass()->m_pNetworkName, "CTFKnife") &&
			!me->TF2_IsCloaked() && ReadPtr<bool>(w, m_bReadyToBackstab))

		add(cmd->buttons, IN_ATTACK);


	if (MENU_AUTORELD && w && !w->IsMelee() && !w->GetClip1() && !w->IsReloading())
	{
		add(cmd->buttons, IN_RELOAD);
		del(cmd->buttons, IN_ATTACK);
	}


	if (aim)
	{
		if (chk(cmd->buttons, IN_ATTACK) && aimbot::bullet)
			aimbot::next_shot = aimbot::target_id;
	}
	else
		aimbot::next_shot = 0;



	if (gmod() && MENU_PROPKILL && w && !strcmp(w->GetClientClass()->m_pNetworkName, "CWeaponPhysGun"))
	{
		static int hold = 0, punt = 0;

		if (chk(cmd->buttons, IN_ATTACK))
		{
			float latency = engine->GetNetChannel()->GetPing();

			hold = (int)((1.0f / globals->interval_per_tick) * (latency + 0.05f));
			punt = (int)((1.0f / globals->interval_per_tick) * (latency + 0.2f));
		}
		else
		{
			if (hold > 0)
			{
				add(cmd->buttons, IN_ATTACK);
				hold--;
			}

			if (punt > 0)
			{
				*cmd->mousewheel() = 0x7F;
				punt--;
			}
		}
	}

	if (MENU_FAKEDUCK && css() && me->IsAlive() && me->IsOnGround() && chk(cmd->buttons, IN_DUCK) && (cmd->tick_count % 2))
	{
		del(cmd->buttons, IN_DUCK);
		del(cmd->buttons, IN_ATTACK);

		sendPacket = 0;
	}

	if (MENU_SMACAIMB)
	{
		static Vector old = cmd->viewangles;
		Vector snap = (cmd->viewangles - old);

		NormalizeAngles(snap);

		const float smac = 42.f;
		if (snap.Normalize() > smac)
		{
			cmd->viewangles = old + snap * smac;
			NormalizeAngles(cmd->viewangles);

			if (aimbot::bullet)
				del(cmd->buttons, IN_ATTACK);
		}

		old = cmd->viewangles;
	}

	if (me->IsAlive())
	{
		//if (MENU_ANTIAIMB)
		//	antiaim::Think(cmd, &sendPacket);



		static float move = 400.f; // move = max(move, (abs(cmd->move.x) + abs(cmd->move.y)) * 0.5f);
		float s_move = move * 0.5065f;

		if (MENU_AUTOSTRF)
		{
			if ((chk(cmd->buttons, IN_JUMP) || !me->IsOnGround()) && me->GetWaterLevel() < 2)
			{
				cmd->move.x = move * 0.015f;
				cmd->move.y += (float)(((cmd->tick_count % 2) * 2) - 1) * s_move;
				
				if (cmd->mousex)
					cmd->move.y = (float)clamp(cmd->mousex, -1, 1) * s_move;

				static float strafe	= cmd->viewangles.y;

				float rt = cmd->viewangles.y, rotation;
				rotation = strafe - rt;

				if (rotation < FloatNegate(globals->interval_per_tick))
					cmd->move.y = -s_move;

				if (rotation > globals->interval_per_tick)
					cmd->move.y = s_move;

				strafe = rt;
			}
		}



		/*
		if (MENU_WALKBOST && !chk(cmd->buttons, IN_JUMP) && me->IsOnGround())
		{
			if ((chk(cmd->buttons, IN_FORWARD) && chk(cmd->buttons, IN_MOVELEFT)) || (chk(cmd->buttons, IN_BACK) && chk(cmd->buttons, IN_MOVERIGHT)))
			if (even)
			{
				cmd->move.y += s_move;
				cmd->move.x += s_move;
			}
			else
			{
				cmd->move.y -= s_move;
				cmd->move.x -= s_move;
			}
			else if ((chk(cmd->buttons, IN_FORWARD) && chk(cmd->buttons, IN_MOVERIGHT)) || (chk(cmd->buttons, IN_BACK) && chk(cmd->buttons, IN_MOVELEFT)))
			if (even)
			{
				cmd->move.y += s_move;
				cmd->move.x -= s_move;
			}
			else
			{
				cmd->move.y -= s_move;
				cmd->move.x += s_move;
			}
			else if (chk(cmd->buttons, IN_FORWARD) || chk(cmd->buttons, IN_BACK))
				if (even)	cmd->move.y += s_move;
				else		cmd->move.y -= s_move;
			else if (chk(cmd->buttons, IN_MOVELEFT) || chk(cmd->buttons, IN_MOVERIGHT))
				if (even)	cmd->move.x += s_move;
				else		cmd->move.x -= s_move;
		}
		*/

		Vector qmove, fixed_va = cmd->viewangles;
		float speed = cmd->move.Length2D();
		
		VectorAngles(cmd->move, qmove);
		NormalizeAngles(fixed_va);

		

		float yaw = Deg2Rad(fixed_va.y - qrv.y + qmove.y);
		float nyaw = FloatNegate(yaw);

		if (cmd->viewangles.x < -90.f || cmd->viewangles.x > 90.f)
		{
			cmd->move.x = FloatNegate(sin(nyaw) * speed);
			cmd->move.y = FloatNegate(cos(nyaw) * speed);
		}
		else
		{
			cmd->move.x = cos(yaw) * speed;
			cmd->move.y = sin(yaw) * speed;
		}

		if (MENU_BUNNYHOP)
		{
			static bool firstjump = 0, fakejmp;

			if (chk(cmd->buttons, IN_JUMP) && me->GetWaterLevel() < 2)
				if (!firstjump)
					firstjump = fakejmp = 1;
				else if (!me->IsOnGround())
					if (MENU_BHOPSAFE && fakejmp && me->GetVelocity().z < 0.0f)
						fakejmp = 0;
					else
						del(cmd->buttons, IN_JUMP);
				else
					fakejmp = 1;
			else
				firstjump = 0;
		}
	}




	if (MENU_FAKELAGB)
	{
		static int q = 0;

		if (q > 0 && !((MENU_FAKELAGA && LocalPlayer()->GetVelocity().Length() < 100.f) ||
			MENU_FAKELAGS && !aimbot::dummy && aimbot::bullet && chk(cmd->buttons, IN_ATTACK)))
		{
			q--;
			sendPacket = 0;
		}
		else
			q = MENU_FAKELAGN;
	}

	if (MENU_CHATSPAM && !(cmd->tick_count % (int)(0.2f / globals->interval_per_tick)))
	{
		char disrupt[] =
		{
			0x7F,
			10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
			10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
			10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
			10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
			10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
			10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
			10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
			10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
			10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
			10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
			0
		};

		util::SendStringCmd("say %s", disrupt);
	}
	
	if (MENU_NAMESTLR)
		namestealer::Think();
}
예제 #2
-1
파일: aimbot.cpp 프로젝트: TSM-Dev/nh21
void aimbot::Update()
{
	lp		= LocalPlayer();
	dummy	= 1;

	if (ragebot && (!ents->GetClientEntity(ragebot) || ragebot > globals->max_clients))
		ragebot = 0;

	if (dod() && !lp->IsOnGround())
		return;
	
	CBaseEntity* w = lp->GetActiveWeapon();

	if (!w || !w->GetClip1() || w->IsReloading() || w->IsMelee())
		return;

	bullet	= !(w->GetNextPrimaryFire() > globals->cur_time);
	dummy	= 0;
}