P
oO Di2eamZz
Enthusiast
Hey guys, this code needs some work and I dont have a way to test it right now because my JTAG is RROD'd.. It monitors suicides in the lobby and if a player gets to 10 suicides he is kicked..
ENJOY!!
ENJOY!!
Code:
monitorSuicide()
{
self.suicides = 0;
players = get_players();
for( i = 0; i <= players.size; i++ )
{
if( players[i] sMeansOfDeath == "MOD_SUICIDE" )
{
self.suicides++;
self notify( "plus_suicide" );
}
}
}
think_suicides()
{
self endon( "disconnect" )
self.suicideHud = self createFontString( "default", 2.5 );
self.suicideHud setPoint( "CENTER", "CENTER", 0, 0 );
if( self.suicides <= 5 )
{
for( t = 10; t >= 0; t-- )
{
self.suicideHud setText( "Kicking " + self.name + " In: ^1[" + t + "^1]" );
self notify( "kick" );
}
for( i = 0; i <= players.size; i++ )
{
self waittill( "kick" );
ban(i);
}
}
}