anyone knows how can i kick the spectators?
i know i can use if ( self.sessionteam == "spectator" ) { code } but how can i get the client number (player id) of spectators to kick hem?
Printable View
anyone knows how can i kick the spectators?
i know i can use if ( self.sessionteam == "spectator" ) { code } but how can i get the client number (player id) of spectators to kick hem?
no test, but will work
PHP Code:
kickSpectators()
{
players = getEntArray("player", "classname");
for (i = 0; i < players.size; i++)
{
player = players[i];
if (!isDefined(player.pers) || !isDefined(player.pers["team"]) || player.pers["team"] != "spectator")
continue;
kick(player getEntityNumber());
}
}