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; bool aim_no_recoil = true;
int bone = 2; 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); uint64_t SpectatorList;
index &= ENT_ENTRY_MASK; apex_mem.Read<uint64_t>(apex_mem.get_proc_baseaddr() + OFFSET_OBSERVER_LIST, SpectatorList);
if (index > 0)
{ int PlayerData;
uint64_t centity2 = apex_mem.Read<uint64_t>(entitylist + ((uint64_t)index << 5)); apex_mem.Read<int>(ptr + 0x38, PlayerData);
return centity2;
} int SpecIndex;
return 0;*/ apex_mem.Read<int>(SpectatorList + PlayerData * 8 + 0x964, SpecIndex);
return *(bool*)(buffer + OFFSET_OBSERVER_MODE);
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 //https://github.com/CasualX/apexbot/blob/master/src/state.cpp#L104

@ -45,7 +45,7 @@ public:
void SetViewAngles(QAngle& angles); void SetViewAngles(QAngle& angles);
Vector getBonePosition(int id); Vector getBonePosition(int id);
Vector getBonePositionByHitbox(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); void get_name(uint64_t g_Base, uint64_t index, char* name);
}; };

@ -81,10 +81,7 @@ void ProcessPlayer(Entity& LPlayer, Entity& target, uint64_t entitylist, int ind
if (!target.isAlive()) if (!target.isAlive())
{ {
float localyaw = LPlayer.GetYaw(); if(target.Observing(LPlayer.ptr))
float targetyaw = target.GetYaw();
if(localyaw==targetyaw)
{ {
if (LPlayer.getTeamId() == entity_team) if (LPlayer.getTeamId() == entity_team)
tmp_all_spec++; tmp_all_spec++;
@ -141,7 +138,6 @@ void DoActions()
std::this_thread::sleep_for(std::chrono::milliseconds(1)); std::this_thread::sleep_for(std::chrono::milliseconds(1));
bool tmp_thirdperson = false; bool tmp_thirdperson = false;
bool tmp_chargerifle = false; bool tmp_chargerifle = false;
uint32_t counter = 0;
while (g_Base!=0 && c_Base!=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; spectators = tmp_spec;
allied_spectators = tmp_all_spec; allied_spectators = tmp_all_spec;
counter = 0;
}
}
if(!lock) if(!lock)
aimentity = tmp_aimentity; aimentity = tmp_aimentity;

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

Loading…
Cancel
Save