SA-MP Forums Archive
Need some help with team balancer - 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 some help with team balancer (/showthread.php?tid=539969)



Need some help with team balancer - LocMax - 01.10.2014

My brain froze, basically I need to get IDs of teams which WERE NOT chosen.
The code I made will just make the notclicked to the latest team ID, and I want to store all team IDs which weren't chosen.
Any ideas, suggestions?

I know there's a way, I just can't think of it..
pawn Код:
new notclicked;
    for(new x=0; x < MAX_TEAMS; x++)
    {
        if(clickedid != Teams[x]) notclicked = x;
        if(clickedid == Teams[x])
        {
            if(TeamCount[x] > TeamCount[notclicked]) return SendClientMessage(playerid, RED, "This team is full."), 1;
            SetPlayerTeam(playerid, x);



Re: Need some help with team balancer - LocMax - 04.10.2014

anyone..?


Re: Need some help with team balancer - YanLanger - 04.10.2014

Before u post check on ******.

EDIT: check dis https://sampforum.blast.hk/showthread.php?tid=273362


Re: Need some help with team balancer - MasonSFW - 04.10.2014

pawn Код:
public OnPlayerRequestClass(playerid, classid)    
{
    new notclicked;
    for(new x=0; x < MAX_TEAMS; x++)
    {
        if(clickedid != Teams[x]) notclicked = x;
        if(clickedid == Teams[x])
        {
            if(TeamCount[x] > TeamCount[notclicked]) return SendClientMessage(playerid, RED, "This team is full.");
            SetPlayerTeam(playerid, x);
            return 0;
         }
        return 1;
}/
try this


Re: Need some help with team balancer - LocMax - 04.10.2014

I use clickable textdraws, I only need to somehow store the -not- clicked teams into a variable/array and then compare it's playercount with playercount of team which was chosen.