From 52139cd0e9817354ca58b081ff02f6717ea6ce70 Mon Sep 17 00:00:00 2001 From: ineedbots Date: Mon, 6 Sep 2021 16:52:05 -0600 Subject: [PATCH] allocation fix --- .../mp/max_allocation_fix_source-compiled.gsc | Bin 0 -> 838 bytes raw/scripts/mp/max_allocation_fix_source.gsc | 33 ++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 raw/scripts/mp/max_allocation_fix_source-compiled.gsc create mode 100644 raw/scripts/mp/max_allocation_fix_source.gsc diff --git a/raw/scripts/mp/max_allocation_fix_source-compiled.gsc b/raw/scripts/mp/max_allocation_fix_source-compiled.gsc new file mode 100644 index 0000000000000000000000000000000000000000..9a69d0767f6e785031a566533414b079998ab96b GIT binary patch literal 838 zcmZ8fO=}ZT6g_Veg9M}9Xp>F*5H(qtP@xnwU|K5LQjmbOh?{YoJey}GGwI9(6T6Y( zUcnzAN)T850WP|9;lhO#7o`YYb|ZG{CZ0DVR(){ioO{o?ckX;Vy>(}?kVg(Y_XY69 zN^y_4#PAq5GieylJWe5llZGaz>kMqi^8(k2b>Q0%^}vpTe&{M_U&mmn=Q%?a+HT|3Zb5S61upzpwOD2HSEqFQVaT}@dZFh0X0kg|*>+ko4gz-j zL#bocjimNv+*Uf2$$m9-wA(Sa;Q$>Ex$XlM;!<^D*1Ra2F^5U9iL9ujf;=`bv3da) zt0l}(+hSa;7r->}KR5oy=P@vu8DSf{$ds*0$;#%J>M!WB&dgwkp0cP+OYC#r0jjJW zvX;jY3UW*=h?2OSoH8mLT|<%Ic&;Q05@Rga=joXe)AIlRa?U+eWjDisOMw}vA^puI`h`#_~Zn5wH literal 0 HcmV?d00001 diff --git a/raw/scripts/mp/max_allocation_fix_source.gsc b/raw/scripts/mp/max_allocation_fix_source.gsc new file mode 100644 index 0000000..96e4d03 --- /dev/null +++ b/raw/scripts/mp/max_allocation_fix_source.gsc @@ -0,0 +1,33 @@ +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() +{ + 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() ); + break; + } + } +} \ No newline at end of file