ну помогите
C++:
void misc::RenderSpectatorList() {
if (!vars::spectatorList || !entity::entity_system.local_player)
return;
entity::player_t local_player = entity::entity_system.get_local_player_pawn();
if (!local_player.is_valid() || !local_player.is_alive())
return;
auto draw_list = ImGui::GetBackgroundDrawList();
if (!draw_list) return;
std::vector<std::string> spectator_names;
std::vector<ImU32> spectator_colors;
for (int i = 1; i < 64; ++i) {
uintptr_t ctrl = entity::entity_system.get_entity_from_list(i);
if (!ctrl) continue;
entity::player_t player(0, ctrl);
if (!player.is_valid())
continue;
uint32_t pawn_handle = memory::ReadUInt32(ctrl + cbaseplayercontroller::m_hpawn);
if (!pawn_handle)
continue;
uintptr_t pawn = entity::entity_system.get_entity_from_list(pawn_handle & 0x7FFF);
if (!pawn)
continue;
uintptr_t obs_services = memory::Read<uintptr_t>(pawn + c_baseplayerpawn::m_pobserverservices);
if (!obs_services)
continue;
uint32_t obs_target_handle = memory::ReadUInt32(obs_services + cplayer_observerservices::m_hobservertarget);
if (!obs_target_handle)
continue;
uintptr_t obs_target_pawn = entity::entity_system.get_entity_from_list(obs_target_handle & 0x7FFF);
if (obs_target_pawn != entity::entity_system.local_player)
continue;
std::string name = player.get_name();
if (name.empty())
continue;
spectator_names.push_back(name);
int team = player.get_team();
if (team == entity::entity_system.local_team) {
spectator_colors.push_back(IM_COL32(50, 200, 50, 255));
}
else {
spectator_colors.push_back(IM_COL32(255, 50, 50, 255));
}
}
if (spectator_names.empty())
return;
vec2_t screen_size = utils::get_screen_size();
float x_pos = screen_size.x - 200.0f;
float y_pos = 50.0f;
float line_height = 20.0f;
for (size_t i = 0; i < spectator_names.size(); ++i) {
std::string text = spectator_names[i];
ImVec2 text_size = ImGui::CalcTextSize(text.c_str());
ImVec2 text_pos = ImVec2(x_pos - text_size.x, y_pos + (i * line_height));
draw_list->AddText(text_pos, spectator_colors[i], text.c_str());
}
}