mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-14 15:44:34 +00:00
Added more mechanisms to prevent double msgs
This commit is contained in:
parent
25247ee91f
commit
13dfaa0809
1 changed files with 20 additions and 16 deletions
|
|
@ -25,30 +25,34 @@ function TeamBalanceNotify( %game, %client, %respawn )
|
||||||
|
|
||||||
if( %Team1Difference >= 2 || %Team2Difference >= 2 )
|
if( %Team1Difference >= 2 || %Team2Difference >= 2 )
|
||||||
{
|
{
|
||||||
if( $UnbalancedMsgPlayed !$= 1 && %Team2Difference == 2 || %Team1Difference == 2 )
|
|
||||||
{
|
|
||||||
messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced.');
|
|
||||||
//Once per cycle.
|
|
||||||
$UnbalancedMsgPlayed = 1;
|
|
||||||
//Reset Stats.
|
|
||||||
$StatsMsgPlayed = 0;
|
|
||||||
}
|
|
||||||
//Stats Aspect. 3 or more difference gets a stats notify.
|
|
||||||
else if( $StatsMsgPlayed !$= 1)
|
|
||||||
{
|
|
||||||
messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced: \c0It is currently %1 vs %2 with %3 observers.', $PlayerCount[1], $PlayerCount[2], $PlayerCount[0] );
|
|
||||||
//Run once.
|
|
||||||
$StatsMsgPlayed = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( $StatsBalancedSoundPlayed !$= 1 )
|
if( $StatsBalancedSoundPlayed !$= 1 )
|
||||||
{
|
{
|
||||||
|
if( $UnbalancedMsgPlayed !$= 1 && %Team2Difference == 2 || %Team1Difference == 2 )
|
||||||
|
{
|
||||||
|
messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced.');
|
||||||
|
//Once per cycle.
|
||||||
|
$UnbalancedMsgPlayed = 1;
|
||||||
|
//Reset Stats.
|
||||||
|
$StatsMsgPlayed = 0;
|
||||||
|
}
|
||||||
|
//Stats Aspect. 3 or more difference gets a stats notify.
|
||||||
|
else if( $StatsMsgPlayed !$= 1)
|
||||||
|
{
|
||||||
|
messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced: \c0It is currently %1 vs %2 with %3 observers.', $PlayerCount[1], $PlayerCount[2], $PlayerCount[0] );
|
||||||
|
//Run once.
|
||||||
|
$StatsMsgPlayed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
//Called in 30 secs with sound
|
//Called in 30 secs with sound
|
||||||
schedule(30000, 0, "StatsUnbalanceSound");
|
schedule(30000, 0, "StatsUnbalanceSound");
|
||||||
//Once per cycle.
|
//Once per cycle.
|
||||||
$StatsBalancedSoundPlayed = 1;
|
$StatsBalancedSoundPlayed = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if( $PlayerCount[1] !$= $PlayerCount[2] )
|
||||||
|
{
|
||||||
|
$StatsBalancedSoundPlayed = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//If teams are balanced and teams dont equal 0.
|
//If teams are balanced and teams dont equal 0.
|
||||||
else if( $PlayerCount[1] == $PlayerCount[2] && $TotalTeamPlayerCount !$= 0 && $BalancedMsgPlayed !$= 1 )
|
else if( $PlayerCount[1] == $PlayerCount[2] && $TotalTeamPlayerCount !$= 0 && $BalancedMsgPlayed !$= 1 )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue