I thing have found a little bug.
in function ChangeTeams()
Code:
new maxplayers = GetClientCount(true)
must change in
Code:
new maxplayers = MaxClients
because if a player have a higher clientnumber as player online than he will not be swaped.
also I had add a new thing, you can choose after how many rounds the plugin swap the team.
add this points and change one function
Code:
new g_rounds
.
.
.
public PlayerRoundWinEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
g_rounds+=1;
new plugin_rounds=GetConVarInt(g_Cvar_Swapteams);
if(plugin_rounds != 0)
{
if (plugin_rounds==g_rounds)
{
new Float:delay = float(GetConVarInt(g_Cvar_BonusRound))
PrintToChatAll("\x01\x04[SM] Teams will be swapped in %i seconds", GetConVarInt(g_Cvar_BonusRound))
g_rounds=0;
if (delay > 0)
{
CreateTimer(delay, DelayedSwitch, 0, 0)
}
else
{
ChangeTeams()
}
}
else
{
PrintToChatAll("\x01\x04[SM] Teams will be swapped in %i round(s)", plugin_rounds-g_rounds)
}
}
}
public OnMapStart ()
{
g_rounds=0;
}
And now you can set round over the cvar sv_dod_swapteams.
sv_dod_swapteams 0 // no swap
sv_dod_swapteams X // swap after X rounds - > X is a Integer