SA-MP Forums Archive
Help - 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: Help (/showthread.php?tid=214709)



Help - marinov - 21.01.2011

pawn Код:
new MembersPrisioners[MAX_PLAYERS];

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(Team[playerid] == 1)
    {
        MembersPrisioners++; // This line is wrong, how would u do it ?
    }
    return 1;
}

I want it to count the players in that team, so later I can do a team balancer.


Re: Help - Vince - 21.01.2011

If it just counts the members in that specific team then you don't need the array (MAX_PLAYERS).


Re: Help - marinov - 21.01.2011

pawn Код:
new MembersPrisioners;

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(Team[playerid] == 1)
    {
        MembersPrisioners++; // Like this ?
    }
    return 1;
}



Re: Help - _Tommy - 22.01.2011

Quote:
Originally Posted by marinov
Посмотреть сообщение
pawn Код:
new MembersPrisioners;

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(Team[playerid] == 1)
    {
        MembersPrisioners++; // Like this ?
    }
    return 1;
}
[MAX_PLAYERS] used to create a var for each player on the server. Just use the function marinov posted.


Re: Help - -Rebel Son- - 22.01.2011

Correct tommy, As he posted. MAX_PLAYERS is creating a variable for each player everytime its called, for a team balancer use like he posted.