-
Автор темы
- #1
Попробовал спастить сало аим с помощью соседних тем на форуме и сурса друга, в итоге когда появляются противники чит начинает стрелять в пол.
Код:
while (IEntity* pEntity = pEntityIt->Next())
{
if (!pEntity) continue;
if (!pRules->LegendSiftingOutMyTeam(pClient->LegendGetEntityId(), pActor->LegendGetEntityId()))
{
pWeapon->SetFiringPos(pEntity->GetBonePositionByName(pEntity, skCrypt("Bip01 Head")));
}
else
{
pWeapon->SetFiringPos(Vec3{ 0,0,0 });
}
}
Код:
int GetBoneId(IEntity* pIEntity, string BoneName)
{
if (!pIEntity) return { ZERO };
ICharacterInstance* pICharacterInstance = pIEntity->GetCharacter(0); if (!pICharacterInstance) return { ZERO };
ISkeletonPose* pISkeletonPose = pICharacterInstance->GetISkeletonPose(); if (!pISkeletonPose) return { ZERO };
return pISkeletonPose->GetJointIdByName(BoneName);
}
Vec3 GetBonePositionByName(IEntity* pIEntity, string BoneName)
{
Vec3 result = ZERO;
ICharacterInstance* pICharacterInstance = pIEntity->GetCharacter(0); if (!pICharacterInstance) return { ZERO };
ISkeletonPose* pISkeletonPose = pICharacterInstance->GetISkeletonPose(); if (!pISkeletonPose) return { ZERO };
if (GetBoneId(pIEntity, BoneName) != -1)
{
Matrix34 mOut = pIEntity->GetEntityWorldTM() * Matrix34(pISkeletonPose->GetAbsJointByID(GetBoneId(pIEntity, BoneName)));
result = mOut.GetTranslation();
}
return result;
}