Начинающий
-
Автор темы
- #1
C++:
void Visuals::Spectators()
{
if (g_EngineClient-> IsConnected ()) {
int wa, ha;
g_EngineClient-> GetScreenSize (wa, ha);
int pos_x = 10;
int pos_y = ha / 2 + 20;
int loop = 0;
for (int i = 0; i <= 64; i ++) {
C_BasePlayer * e = (C_BasePlayer *) g_EntityList-> GetClientEntity (i);
player_info_t pinfo;
if (e && e! = g_LocalPlayer &&! e-> IsDormant ()) {
g_EngineClient-> GetPlayerInfo (i, & pinfo);
auto obs = e-> m_hObserverTarget ();
if (! obs) continue;
C_BasePlayer * spec = (C_BasePlayer *) g_EntityList-> GetClientEntityFromHandle (obs);
if (spec == nullptr) continue;
player_info_t spec_info;
g_EngineClient-> GetPlayerInfo (i, & spec_info);
char buf [255]; sprintf_s (buf, "% s", pinfo.szName);
if (strstr (pinfo.szName, "GOTV"))
continue;
if (spec-> EntIndex () == g_LocalPlayer-> EntIndex ()) {
Render :: Get (). RenderText (buf, ImVec2 (pos_x + 2, (pos_y + (14 * loop)) + 26), 13.f, Color (255, 255, 255));
// g_VGuiSurface-> DrawSetColor (Color (61, 135, 255));
// g_VGuiSurface-> DrawFilledRect (pos_x, pos_y + 20, pos_x + 77, pos_y + (14 * loop) + 44);
// g_VGuiSurface-> DrawSetColor (Color (0, 0, 0));
// g_VGuiSurface-> DrawOutlinedRect (pos_x, pos_y + 20, pos_x + 77, pos_y + (14 * loop) + 44);
loop ++;
}
}
}
char loop_str [24];
g_VGuiSurface-> DrawSetColor (Color (61, 135, 255));
g_VGuiSurface-> DrawFilledRect (pos_x, pos_y + 20, pos_x + 77, pos_y + 24);
g_VGuiSurface-> DrawSetColor (Color (0, 0, 0));
g_VGuiSurface-> DrawOutlinedRect (pos_x, pos_y + 20, pos_x + 77, pos_y + 24);
Render::Get().RenderText("Spectators", ImVec2 (pos_x, pos_y + 4), 16.f, Color (255, 255, 255));
}
}
Вложения
-
4.3 KB Просмотры: 23