mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-05-12 15:34:51 +00:00
Specator inactive kcik
This commit is contained in:
parent
658c5fd368
commit
6514d34041
@ -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
|
||||
|
43
userraw/scripts/spectatorKick.gsc
Normal file
43
userraw/scripts/spectatorKick.gsc
Normal 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" );
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user