Specator inactive kcik

This commit is contained in:
INeedBots 2020-09-25 18:11:57 -06:00
parent 658c5fd368
commit 6514d34041
2 changed files with 45 additions and 2 deletions

View File

@ -49,8 +49,8 @@ set rcon_password "qazqaz" // Access to your server to change stuff remot
set sv_securityLevel "23" // Configures the servers security level.
set sv_customTextColor "" // custom color for ^;
set g_password "" // Password Protected Server. Leave blank if you want players to join
set g_inactivity "380" // Enable auto kick feature for idle/AFK players
set g_inactivitySpectator "380" // Time in seconds before a spectator gets kicked
set g_inactivity "180" // Enable auto kick feature for idle/AFK players
set g_inactivitySpectator "180" // Time in seconds before a spectator gets kicked
set g_logSync "1" // 1 always flush games_mp.log, 0 only flush on game end
set g_log "logs/games_mp.log" // Gamelog filename. If you edit this..make sure you change B3.xml if you have bigbrotherbot.
set sv_allowClientConsole "1" // Enable or Disable players ability to access server commands

View File

@ -0,0 +1,43 @@
#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" );
}
}
}