mirror of
https://github.com/ineedbots/t6_bot_warfare.git
synced 2025-06-30 16:21:52 +00:00
team balance and kick spectators
https://github.com/efinst0rm/PlutoBO2-Autobalance/blob/master/maps/mp/teams/_teams.gsc
This commit is contained in:
BIN
raw/scripts/mp/spectatorKick-compiled.gsc
Normal file
BIN
raw/scripts/mp/spectatorKick-compiled.gsc
Normal file
Binary file not shown.
35
raw/scripts/mp/spectatorKick.gsc
Normal file
35
raw/scripts/mp/spectatorKick.gsc
Normal file
@ -0,0 +1,35 @@
|
||||
init()
|
||||
{
|
||||
if ( getDvar( "g_inactivitySpectator" ) == "" )
|
||||
setDvar( "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 ( isDefined( player ) && !player.hasSpawned )
|
||||
{
|
||||
if ( !isDefined( player.specTime ) )
|
||||
player.specTime = theTime;
|
||||
else if ( ( theTime - player.specTime ) >= level.inactivitySpectator )
|
||||
kick( player getEntityNumber() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user