本文整理汇总了C++中C_BaseCombatWeapon::GetItemDefinitionIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ C_BaseCombatWeapon::GetItemDefinitionIndex方法的具体用法?C++ C_BaseCombatWeapon::GetItemDefinitionIndex怎么用?C++ C_BaseCombatWeapon::GetItemDefinitionIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_BaseCombatWeapon
的用法示例。
在下文中一共展示了C_BaseCombatWeapon::GetItemDefinitionIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateValues
void Aimbot::UpdateValues()
{
C_BasePlayer* localplayer = (C_BasePlayer*) entityList->GetClientEntity(engine->GetLocalPlayer());
if (!localplayer || !localplayer->GetAlive())
return;
C_BaseCombatWeapon* activeWeapon = (C_BaseCombatWeapon*) entityList->GetClientEntityFromHandle(localplayer->GetActiveWeapon());
if (!activeWeapon)
return;
ItemDefinitionIndex index = ItemDefinitionIndex::INVALID;
if (Settings::Aimbot::weapons.find(*activeWeapon->GetItemDefinitionIndex()) != Settings::Aimbot::weapons.end())
index = *activeWeapon->GetItemDefinitionIndex();
const AimbotWeapon_t& currentWeaponSetting = Settings::Aimbot::weapons.at(index);
Settings::Aimbot::enabled = currentWeaponSetting.enabled;
Settings::Aimbot::silent = currentWeaponSetting.silent;
Settings::Aimbot::friendly = currentWeaponSetting.friendly;
Settings::Aimbot::bone = currentWeaponSetting.bone;
Settings::Aimbot::aimkey = currentWeaponSetting.aimkey;
Settings::Aimbot::aimkeyOnly = currentWeaponSetting.aimkeyOnly;
Settings::Aimbot::Smooth::enabled = currentWeaponSetting.smoothEnabled;
Settings::Aimbot::Smooth::value = currentWeaponSetting.smoothAmount;
Settings::Aimbot::Smooth::type = currentWeaponSetting.smoothType;
Settings::Aimbot::ErrorMargin::enabled = currentWeaponSetting.errorMarginEnabled;
Settings::Aimbot::ErrorMargin::value = currentWeaponSetting.errorMarginValue;
Settings::Aimbot::AutoAim::enabled = currentWeaponSetting.autoAimEnabled;
Settings::Aimbot::AutoAim::fov = currentWeaponSetting.autoAimFov;
Settings::Aimbot::AimStep::enabled = currentWeaponSetting.aimStepEnabled;
Settings::Aimbot::AimStep::value = currentWeaponSetting.aimStepValue;
Settings::Aimbot::AutoPistol::enabled = currentWeaponSetting.autoPistolEnabled;
Settings::Aimbot::AutoShoot::enabled = currentWeaponSetting.autoShootEnabled;
Settings::Aimbot::AutoShoot::autoscope = currentWeaponSetting.autoScopeEnabled;
Settings::Aimbot::RCS::enabled = currentWeaponSetting.rcsEnabled;
Settings::Aimbot::RCS::always_on = currentWeaponSetting.rcsAlwaysOn;
Settings::Aimbot::RCS::valueX = currentWeaponSetting.rcsAmountX;
Settings::Aimbot::RCS::valueY = currentWeaponSetting.rcsAmountY;
Settings::Aimbot::NoShoot::enabled = currentWeaponSetting.noShootEnabled;
Settings::Aimbot::IgnoreJump::enabled = currentWeaponSetting.ignoreJumpEnabled;
Settings::Aimbot::Smooth::Salting::enabled = currentWeaponSetting.smoothSaltEnabled;
Settings::Aimbot::Smooth::Salting::multiplier = currentWeaponSetting.smoothSaltMultiplier;
Settings::Aimbot::SmokeCheck::enabled = currentWeaponSetting.smokeCheck;
Settings::Aimbot::FlashCheck::enabled = currentWeaponSetting.flashCheck;
Settings::Aimbot::AutoWall::enabled = currentWeaponSetting.autoWallEnabled;
Settings::Aimbot::AutoWall::value = currentWeaponSetting.autoWallValue;
Settings::Aimbot::AutoSlow::enabled = currentWeaponSetting.autoSlow;
Settings::Aimbot::AutoSlow::minDamage = currentWeaponSetting.autoSlowMinDamage;
for (int i = (int) Hitbox::HITBOX_HEAD; i <= (int) Hitbox::HITBOX_ARMS; i++)
Settings::Aimbot::AutoWall::bones[i] = currentWeaponSetting.autoWallBones[i];
Settings::Aimbot::AutoAim::realDistance = currentWeaponSetting.autoAimRealDistance;
}
示例2: CreateMove
//.........这里部分代码省略.........
else
{
Ray_t ray;
ray.Init(traceStart, traceEnd);
CTraceFilter traceFilter;
traceFilter.pSkip = localplayer;
trace->TraceRay(ray, 0x46004003, &traceFilter, &tr);
}
oldTimeStamp = timeStamp;
timeStamp = currentTime_ms;
C_BasePlayer* player = (C_BasePlayer*) tr.m_pEntityHit;
if (!player)
return;
if (player->GetClientClass()->m_ClassID != EClassIds::CCSPlayer)
return;
if (player == localplayer
|| player->GetDormant()
|| !player->GetAlive()
|| player->GetImmune())
return;
if (player->GetTeam() != localplayer->GetTeam() && !Settings::Triggerbot::Filters::enemies)
return;
if (player->GetTeam() == localplayer->GetTeam() && !Settings::Triggerbot::Filters::allies)
return;
bool filter;
switch (tr.hitgroup)
{
case HitGroups::HITGROUP_HEAD:
filter = Settings::Triggerbot::Filters::head;
break;
case HitGroups::HITGROUP_CHEST:
filter = Settings::Triggerbot::Filters::chest;
break;
case HitGroups::HITGROUP_STOMACH:
filter = Settings::Triggerbot::Filters::stomach;
break;
case HitGroups::HITGROUP_LEFTARM:
case HitGroups::HITGROUP_RIGHTARM:
filter = Settings::Triggerbot::Filters::arms;
break;
case HitGroups::HITGROUP_LEFTLEG:
case HitGroups::HITGROUP_RIGHTLEG:
filter = Settings::Triggerbot::Filters::legs;
break;
default:
filter = false;
}
if (!filter)
return;
if (Settings::Triggerbot::Filters::smokeCheck && LineGoesThroughSmoke(tr.startpos, tr.endpos, 1))
return;
C_BaseCombatWeapon* activeWeapon = (C_BaseCombatWeapon*) entityList->GetClientEntityFromHandle(localplayer->GetActiveWeapon());
if (!activeWeapon || activeWeapon->GetAmmo() == 0)
return;
ItemDefinitionIndex itemDefinitionIndex = *activeWeapon->GetItemDefinitionIndex();
if (itemDefinitionIndex == ItemDefinitionIndex::WEAPON_KNIFE || itemDefinitionIndex >= ItemDefinitionIndex::WEAPON_KNIFE_BAYONET)
return;
CSWeaponType weaponType = activeWeapon->GetCSWpnData()->GetWeaponType();
if (weaponType == CSWeaponType::WEAPONTYPE_C4 || weaponType == CSWeaponType::WEAPONTYPE_GRENADE)
return;
if (activeWeapon->GetNextPrimaryAttack() > globalVars->curtime)
{
if (*activeWeapon->GetItemDefinitionIndex() == ItemDefinitionIndex::WEAPON_REVOLVER)
cmd->buttons &= ~IN_ATTACK2;
else
cmd->buttons &= ~IN_ATTACK;
}
else
{
if (Settings::Triggerbot::RandomDelay::enabled && currentTime_ms - oldTimeStamp < randomDelay)
{
timeStamp = oldTimeStamp;
return;
}
if (*activeWeapon->GetItemDefinitionIndex() == ItemDefinitionIndex::WEAPON_REVOLVER)
cmd->buttons |= IN_ATTACK2;
else
cmd->buttons |= IN_ATTACK;
if(Settings::Triggerbot::RandomDelay::enabled)
Settings::Triggerbot::RandomDelay::lastRoll = randomDelay;
randomDelay = localMin + rand() % (localMax - localMin);
}
timeStamp = currentTime_ms;
}