Hud SpecList [Latest Version]

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
if (hudSettings[Spec][client] && g_Settings[HUDSpeclistEnable])
{
new iSpecCount;
for(new j = 1; j <= MaxClients; j++)
{
if (!IsClientInGame(j) || !IsClientObserver(j))
continue;
if (IsClientSourceTV(j))
continue;
new iSpecMode = GetEntProp(j, Prop_Send, "m_iObserverMode");
// The client isn't spectating any one person, so ignore them.
if (iSpecMode != 3 && iSpecMode != 4)
continue;
// Find out who the client is spectating.
new iTarget = GetEntPropEnt(j, Prop_Send, "m_hObserverTarget");
// Are they spectating the same player as User?
if (iTarget == iClientToShow && j != iClientToShow && !hidemyass[j])
iSpecCount++;
}
if(iSpecCount > 0)
{
Format(hintText, sizeof(hintText), "%s\nSpec: %d", hintText, iSpecCount);
}
}