08.01.2012, 21:16
Ok ive created a simple balancer for teams so you automaticly get set to which team is lowest on players when you spawn..
Please note: My teams are team 1 and team 2 thats why i have a +1 on the random so there cant be a 0
But it doesent work any clues why?
This is stopping my whole script working so please please help!
Please note: My teams are team 1 and team 2 thats why i have a +1 on the random so there cant be a 0
Код:
stock BalanceTeams(playerid)
{
if(ServerGameMode == 1)
{
if(TeamOp == TeamSpet)
{
PlayerInfo[playerid][pTeam] = random(2)+1;
if(PlayerInfo[playerid][pTeam] == 1)
{
TeamOp ++;
}
if(PlayerInfo[playerid][pTeam] == 2)
{
TeamSpet ++;
}
}
if(TeamOp > TeamSpet)
{
PlayerInfo[playerid][pTeam] = 2;
TeamOp ++;
}
if(TeamSpet > TeamOp)
{
PlayerInfo[playerid][pTeam] = 1;
TeamSpet ++;
}
return 1;
}
return 1;
}
This is stopping my whole script working so please please help!


