SpecList Count In Chat

 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
new String:SpecNames[MaxClients / 2 + 1][33];
decl String:name1[33];
decl String:name2[33];
new namecount = 0;
for (new cl = 1; cl <= MaxClients; cl++) {
if (IsClientInGame(cl) && IsClientObserver(cl)) {
if (namecount % 2 == 0) {
GetClientName(cl, name1, sizeof(name1));
}
else {
GetClientName(cl, name2, sizeof(name2));
ReplyToCommand(client, "%s, %s", name1, name2);
}
namecount++;
}
}
if (namecount % 2 == 1) {
ReplyToCommand(client, "%s", name1);
}
ReplyToCommand(client, "\x01Number of Spectators: \x04%i", namecount);
return Plugin_Handled;