当前位置: 首页>>代码示例>>C++>>正文


C++ CBaseEntity::GetOrigin方法代码示例

本文整理汇总了C++中CBaseEntity::GetOrigin方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseEntity::GetOrigin方法的具体用法?C++ CBaseEntity::GetOrigin怎么用?C++ CBaseEntity::GetOrigin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBaseEntity的用法示例。


在下文中一共展示了CBaseEntity::GetOrigin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Think

bool aimbot::Think(CUserCmd* cmd)
{
	float best = std::numeric_limits<float>::quiet_NaN();

	if (css())
	{
		if (!GetMaterialParameters)
			GetMaterialParameters = (void (__cdecl*)(int, float&, float&))util::FindPattern("client", "\x55\x8B\xEC\x8B\x45\x08\x83\xC0\xBD");

		if (!GetBulletTypeParameters)
			GetBulletTypeParameters = (void (__stdcall*)(int, float&, float&))util::FindPattern("client",
				"\x55\x8B\xEC\x56\x8B\x75\x08\x68????\x56\xE8????\x83\xC4\x08\x84\xC0"
			);
	}

	if (!bf)
		bf = new BulletFilter();

	target_id = 0;
	bf->hSelf = lp;

	Vector sp = lp->GetShootPos();
	Vector tp = Vector();

	CBaseEntity* w = lp->GetActiveWeapon();

	if (gmod() && MENU_SPAWPROT == 3 && ALPHA(lp->GetMDLColor()) == 200)
		return 0;

	int lteam = lp->GetTeam();
	int maxcl = (MENU_NPCAIMBT ? ents->GetHighestEntityIndex() : globals->max_clients);

	for (int i = 1; i <= maxcl; ++i)
		if (CBaseEntity* pl = ents->GetClientEntity(i))
		{
			if (pl == lp)
				continue;

			//if (pl->IsDormant())
			//	continue;

			if (!pl->GetModel())
				continue;

			bool npc = i > globals->max_clients;
			bool lowp = 1;

			if (npc)
			{
				const char* cclass = pl->GetClientClass()->m_pNetworkName;

				if (gmod())
				{
					RecvTable* p = pl->GetClientClass()->m_pRecvTable->m_pProps[0].m_pDataTable;

					if ((strcmp(cclass, "CAI_BaseNPC") && (!p || strcmp(p->m_pNetTableName, "DT_AI_BaseNPC"))) || !pl->IsAlive())
						continue;
				}

				if (tf2())
				{
					if (
						lowp = (
							strcmp(cclass, "CObjectSentrygun") ||
							ReadPtr<bool>(pl, m_bHasSapper)
						) &&
						(
							strcmp(cclass, "CTFGrenadePipebombProjectile") ||
							!ReadPtr<int>(pl, m_iType) ||
							!ReadPtr<bool>(pl, m_bTouched) ||
							!pl->IsDummyProjectile() ||
							sp.DistTo(lp->GetAbsOrigin()) > 768.f
						)
					)
						continue;

					if (pl->GetTeam() == lteam)
						continue;
				}
			}
			else if (!DoStateCheck(pl))
				continue;

			if (!pl->UpdateBones())
				continue;
			
			float rate = Rate(lp, pl, npc);
			if (!lowp)
				rate *= 0.1f;

			if (rate > best)
				continue;

			if (css() && pl->GetOrigin().DistTo(sp) > 8192.f)
				continue;

			int aim = GetAimBone(pl);
			bool doscan = 1;

			if (pl->GetHitbox(aim))
//.........这里部分代码省略.........
开发者ID:TSM-Dev,项目名称:nh21,代码行数:101,代码来源:aimbot.cpp


注:本文中的CBaseEntity::GetOrigin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。