Начинающий
-
Автор темы
- #1
хэй, короче, при включении триггера крашит, продебажил, оишбку показывает тут
forward *= G::LocalPlayer->GetWeapon()->GetCSWpnData()->m_flRange;
сам же weaponinfo_t
сурс триггера
forward *= G::LocalPlayer->GetWeapon()->GetCSWpnData()->m_flRange;
сам же weaponinfo_t
class WeaponInfo_t {
public:
char _0x0000[20];
__int32 iMaxClip1; //0x0014
char _0x0018[12];
__int32 max_reserved_ammo; //0x0024
char _0x0028[96];
char* hud_name; //0x0088
char* weapon_name; //0x008C
char _0x0090[60];
__int32 type; //0x00CC
__int32 price; //0x00D0
__int32 reward; //0x00D4
char _0x00D8[20];
char full_auto; //0x00EC
char _0x00ED[3];
__int32 m_iDamage; //0x00F0
float m_flArmorRatio; //0x00F4
__int32 iBullets; //0x00F8
float m_flPenetration; // 0x00F8
char _0x0100[8];
float m_flRange; // 0x0104
float m_flRangeModifier; // 0x0108
float flThrowVelocity;
char _0x0110[12];
char silencer; //0x0120
char _0x0121[15];
float max_speed; //0x0130
float max_speed_alt; //0x0134
char _0x0138[76];
__int32 recoil_seed; //0x0184
char _0x0188[32];
};
public:
char _0x0000[20];
__int32 iMaxClip1; //0x0014
char _0x0018[12];
__int32 max_reserved_ammo; //0x0024
char _0x0028[96];
char* hud_name; //0x0088
char* weapon_name; //0x008C
char _0x0090[60];
__int32 type; //0x00CC
__int32 price; //0x00D0
__int32 reward; //0x00D4
char _0x00D8[20];
char full_auto; //0x00EC
char _0x00ED[3];
__int32 m_iDamage; //0x00F0
float m_flArmorRatio; //0x00F4
__int32 iBullets; //0x00F8
float m_flPenetration; // 0x00F8
char _0x0100[8];
float m_flRange; // 0x0104
float m_flRangeModifier; // 0x0108
float flThrowVelocity;
char _0x0110[12];
char silencer; //0x0120
char _0x0121[15];
float max_speed; //0x0130
float max_speed_alt; //0x0134
char _0x0138[76];
__int32 recoil_seed; //0x0184
char _0x0188[32];
};
сурс триггера
void CLegitBot::Triggerbot()
{
Vector src, dst, forward;
trace_t tr;
Ray_t ray;
CTraceFilter filter;
QAngle viewangle = G::UserCmd->viewangles;
viewangle += G::LocalPlayer->GetPunch() * 2.f;
M::AngleVectors(viewangle, &forward);
forward *= G::LocalPlayer->GetWeapon()->GetCSWpnData()->m_flRange;
filter.pSkip = G::LocalPlayer;
src = G::LocalPlayer->GetEyePosition();
dst = src + forward;
ray.Init(src, dst);
I::EngineTrace->TraceRay(ray, 0x46004003, &filter, &tr);
if (!tr.m_pEnt)
return;
int hitgroup = tr.hitgroup;
bool didHit = false;
if (U::LineGoesThroughSmoke(tr.startpos, tr.endpos))
return;
if (Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Head && hitgroup == HITGROUP_HEAD)
didHit = true;
if (Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Chest && hitgroup == HITGROUP_CHEST)
didHit = true;
if (Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Stomach && hitgroup == HITGROUP_STOMACH)
didHit = true;
if (Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Arms && (hitgroup == HITGROUP_LEFTARM || hitgroup == HITGROUP_RIGHTARM))
didHit = true;
if (Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Legs && (hitgroup == HITGROUP_LEFTLEG || hitgroup == HITGROUP_RIGHTLEG))
didHit = true;
if ((Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Friendly || tr.m_pEnt->GetTeam() != G::LocalPlayer->GetTeam()) && tr.m_pEnt->GetHealth() > 0 && !tr.m_pEnt->GetImmune())
{
float hitchance = 75.f + (Vars.Legitbot[G::ActiveWeapon].Triggerbot.HitChanceAmt / 4);
if (didHit && (!Vars.Legitbot[G::ActiveWeapon].Triggerbot.HitChance || (1.0f - G::LocalPlayer->GetWeapon()->GetAccuracyPenalty()) * 100.f >= hitchance))
G::UserCmd->buttons |= IN_ATTACK;
}
}
вроде всё верно, не понимаю почему идёт краш
{
Vector src, dst, forward;
trace_t tr;
Ray_t ray;
CTraceFilter filter;
QAngle viewangle = G::UserCmd->viewangles;
viewangle += G::LocalPlayer->GetPunch() * 2.f;
M::AngleVectors(viewangle, &forward);
forward *= G::LocalPlayer->GetWeapon()->GetCSWpnData()->m_flRange;
filter.pSkip = G::LocalPlayer;
src = G::LocalPlayer->GetEyePosition();
dst = src + forward;
ray.Init(src, dst);
I::EngineTrace->TraceRay(ray, 0x46004003, &filter, &tr);
if (!tr.m_pEnt)
return;
int hitgroup = tr.hitgroup;
bool didHit = false;
if (U::LineGoesThroughSmoke(tr.startpos, tr.endpos))
return;
if (Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Head && hitgroup == HITGROUP_HEAD)
didHit = true;
if (Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Chest && hitgroup == HITGROUP_CHEST)
didHit = true;
if (Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Stomach && hitgroup == HITGROUP_STOMACH)
didHit = true;
if (Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Arms && (hitgroup == HITGROUP_LEFTARM || hitgroup == HITGROUP_RIGHTARM))
didHit = true;
if (Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Legs && (hitgroup == HITGROUP_LEFTLEG || hitgroup == HITGROUP_RIGHTLEG))
didHit = true;
if ((Vars.Legitbot[G::ActiveWeapon].Triggerbot.Filter.Friendly || tr.m_pEnt->GetTeam() != G::LocalPlayer->GetTeam()) && tr.m_pEnt->GetHealth() > 0 && !tr.m_pEnt->GetImmune())
{
float hitchance = 75.f + (Vars.Legitbot[G::ActiveWeapon].Triggerbot.HitChanceAmt / 4);
if (didHit && (!Vars.Legitbot[G::ActiveWeapon].Triggerbot.HitChance || (1.0f - G::LocalPlayer->GetWeapon()->GetAccuracyPenalty()) * 100.f >= hitchance))
G::UserCmd->buttons |= IN_ATTACK;
}
}
вроде всё верно, не понимаю почему идёт краш