mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-21 13:35:44 +00:00
44 lines
790 B
Plaintext
44 lines
790 B
Plaintext
#include common_scripts\utility;
|
|
#include maps\mp\_utility;
|
|
#include maps\mp\gametypes\_hud_util;
|
|
|
|
init()
|
|
{
|
|
setDvarIfUninitialized( "g_inactivitySpectator", 0.0 );
|
|
level.inactivitySpectator = getDvarFloat("g_inactivitySpectator") * 1000;
|
|
|
|
if (level.inactivitySpectator <= 0)
|
|
return;
|
|
|
|
thread watchPlayers();
|
|
}
|
|
|
|
watchPlayers()
|
|
{
|
|
for(;;)
|
|
{
|
|
wait 1.5;
|
|
|
|
theTime = getTime();
|
|
|
|
for (i = 0; i < level.players.size; i++)
|
|
{
|
|
player = level.players[i];
|
|
|
|
if (player.hasSpawned)
|
|
continue;
|
|
|
|
if (!isDefined(player.specTime))
|
|
{
|
|
player.specTime = theTime;
|
|
continue;
|
|
}
|
|
|
|
if ((theTime - player.specTime) < level.inactivitySpectator)
|
|
continue;
|
|
|
|
kick( player getEntityNumber(), "EXE_PLAYERKICKED_INACTIVE" );
|
|
}
|
|
}
|
|
}
|