SA-MP Forums Archive
Would this code work?? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Would this code work?? (/showthread.php?tid=217683)



Would this code work?? - BlackWolf120 - 28.01.2011

hi,
sorry for this question but i just dont have the possibility to test this code with more than 2 players.
Would this code work?
This code shall prevent one team to get overbalanced.
pawn Код:
new Count1, Count2;
        for(new p = 0; p < GetMaxPlayers(); p++)
    {
        if (GetPlayerTeam(p) == TEAM_POLICE) Count1++;
        else if (GetPlayerTeam(p) == TEAM_TERRORISTS) Count2++;
    }
        if ((Count1 > Count2) && GetPlayerTeam(playerid) == TEAM_TERRORISTS)
    {
        GameTextForPlayer(playerid, "~r~This team is full!", 600, 5);
        return 0;
    }
        else if ((Count2 > Count1) && GetPlayerTeam(playerid) == TEAM_POLICE)
    {
        GameTextForPlayer(playerid, "~r~This team is full!", 600, 5);
        return 0;
    }



Re: Would this code work?? - Criss_Angel - 28.01.2011

Give me the IP, I'd be happy to test it for you


Re: Would this code work?? - BlackWolf120 - 28.01.2011

thx for ur offer but my server is not hosted yet and i dont want to port forward now....
Can someone tell me if this code is going to work pls?


Re: Would this code work?? - wolfcock - 28.01.2011

should work


Re: Would this code work?? - BlackWolf120 - 28.01.2011

ok thx.
I hope ure right