t6_bot_warfare/raw/scripts/mp/max_allocation_fix_source.gsc
ineed bots 9bf7af7f3c update
2021-12-20 12:52:35 -06:00

36 lines
797 B
Plaintext

init()
{
level thread on_player_connect();
}
on_player_connect()
{
while ( true )
{
level waittill( "connected", player );
if ( !player istestclient() )
player thread check_player_classes();
}
}
check_player_classes()
{
self endon( "disconnect" );
for ( class_num = 0; class_num < 10; class_num++ )
{
allocationSpent = self GetLoadoutAllocation( class_num );
logline1 = self.name + " XUID: " + self getXUID() + " maxAllowed: " + level.maxAllocation + " current: " + allocationSpent;
print( logline1 );
if ( allocationSpent > level.maxAllocation )
{
logline1 = "Player: " + self.name + " XUID: " + self getXUID() + " had too many items in their class.";
print( logline1 );
kick( self getEntityNumber() );
return;
}
}
}