Added spectator count

pull/38/head
MisterY52 8 months ago
parent b6b81969f2
commit 54f54122ec

@ -7,17 +7,24 @@ float smooth = 12.0f;
bool aim_no_recoil = true;
int bone = 2;
bool Entity::Observing(uint64_t entitylist)
// https://github.com/Gerosity/zap-client/blob/master/Core/Player.hpp#L161
bool Entity::Observing(uint64_t localptr)
{
/*uint64_t index = *(uint64_t*)(buffer + OFFSET_OBSERVING_TARGET);
index &= ENT_ENTRY_MASK;
if (index > 0)
{
uint64_t centity2 = apex_mem.Read<uint64_t>(entitylist + ((uint64_t)index << 5));
return centity2;
}
return 0;*/
return *(bool*)(buffer + OFFSET_OBSERVER_MODE);
uint64_t SpectatorList;
apex_mem.Read<uint64_t>(apex_mem.get_proc_baseaddr() + OFFSET_OBSERVER_LIST, SpectatorList);
int PlayerData;
apex_mem.Read<int>(ptr + 0x38, PlayerData);
int SpecIndex;
apex_mem.Read<int>(SpectatorList + PlayerData * 8 + 0x964, SpecIndex);
uint64_t SpectatorAddr;
apex_mem.Read<uint64_t>(apex_mem.get_proc_baseaddr() + OFFSET_ENTITYLIST + ((SpecIndex & 0xFFFF) << 5), SpectatorAddr);
if (SpectatorAddr == localptr)
return true;
return false;
}
//https://github.com/CasualX/apexbot/blob/master/src/state.cpp#L104

@ -45,7 +45,7 @@ public:
void SetViewAngles(QAngle& angles);
Vector getBonePosition(int id);
Vector getBonePositionByHitbox(int id);
bool Observing(uint64_t entitylist);
bool Observing(uint64_t local);
void get_name(uint64_t g_Base, uint64_t index, char* name);
};

@ -81,12 +81,9 @@ void ProcessPlayer(Entity& LPlayer, Entity& target, uint64_t entitylist, int ind
if (!target.isAlive())
{
float localyaw = LPlayer.GetYaw();
float targetyaw = target.GetYaw();
if(localyaw==targetyaw)
if(target.Observing(LPlayer.ptr))
{
if(LPlayer.getTeamId() == entity_team)
if (LPlayer.getTeamId() == entity_team)
tmp_all_spec++;
else
tmp_spec++;
@ -141,7 +138,6 @@ void DoActions()
std::this_thread::sleep_for(std::chrono::milliseconds(1));
bool tmp_thirdperson = false;
bool tmp_chargerifle = false;
uint32_t counter = 0;
while (g_Base!=0 && c_Base!=0)
{
@ -254,22 +250,8 @@ void DoActions()
}
}
if(!spectators && !allied_spectators)
{
spectators = tmp_spec;
allied_spectators = tmp_all_spec;
}
else
{
//refresh spectators count every ~2 seconds
counter++;
if(counter==70)
{
spectators = tmp_spec;
allied_spectators = tmp_all_spec;
counter = 0;
}
}
spectators = tmp_spec;
allied_spectators = tmp_all_spec;
if(!lock)
aimentity = tmp_aimentity;

@ -34,6 +34,7 @@
#define OFFSET_BREATH_ANGLES OFFSET_VIEWANGLES - 0x10
#define OFFSET_OBSERVER_MODE 0x34a4 //m_iObserverMode
#define OFFSET_OBSERVING_TARGET 0x34b0 //m_hObserverTarget
#define OFFSET_OBSERVER_LIST 0x1EADD28
#define OFFSET_MATRIX 0x11a350
#define OFFSET_RENDER 0x74dd028

Loading…
Cancel
Save