SA-MP Forums Archive
Need help! +rep+++ - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help! +rep+++ (/showthread.php?tid=372888)



Need help! +rep+++ - Nirzor - 28.08.2012

i searched and found some team balance but i could not understand them!so i need some-one to help me! i have

2 teams Grove and Balla can some-one make me team balancer with these 2 teams? ill +rep HIM!


Re: Need help! +rep+++ - Jarnu - 28.08.2012

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    new team1count, team2count;
    for(new i, m = GetMaxPlayers(); i < m; i++)
    {
        if (IsPlayerConnected(i))
        {
            if (gTeam[i] == TEAM_GROVE) team1count++;
            else if (gTeam[i] == TEAM_BALA) team2count++;
        }
    }
    if (gTeam[playerid] == TEAM_GROVE)
    {
        if (team1count > (team2count+1)){
                SendClientMessage(playerid, COLOR_YELLOW, "This team is full, please choose the other one.");
            return 0;
        }

    }
    else if (gTeam[playerid] == TEAM_BALA)
    {
        if ((team1count+1) < team2count){
            SendClientMessage(playerid, COLOR_YELLOW, "This team is full, please choose the other one.");
            return 0;
        }
    }
    return 1;
}
it works perfect for me.. +rep it will work.


Re: Need help! +rep+++ - Nirzor - 28.08.2012

Thanks jarnu and i really miss u bro add me back in fb request sent +REP! ill rep u when i can it says i need to

spread more but thanks!