Player Count
#1

How do I get the script to identify how many players are in team blue and in team red? How can I get the server to detect how many players are in each team so when I play who ever has no more players left they lose?

pawn Код:
dcmd_add(playerid, params[])
{
    if(isclanwarstarted == 1)
    {
        if(sscanf(params, "u", params[0]))
        {
            if(gTeam[params[0]] == TEAM_HOME || gTeam[params[0]] == TEAM_AWAY)
            {
                iDM[params[0]] = 0;
                First[params[0]] = 0;
                ResetPlayerWeapons(params[0]);
                SetPlayerInterior(params[0], 10);
                GivePlayerWeapon(params[0], 31, 9999);
                GivePlayerWeapon(params[0], 27, 9999);
                GivePlayerWeapon(params[0], 24, 9999);
                SetPlayerHealth(params[0], 100);
                SetPlayerArmour(params[0], 100);
                TogglePlayerControllable(params[0],0);
                if(gTeam[params[0]] == TEAM_HOME)
                {
                    SetPlayerPos(params[0], -1131.9910,1057.6470,1346.4126);
                    SetPlayerFacingAngle(params[0], 270);
                    bluecount++;
                    FormMessageForAll(playerid,COLOR_MESSAGE, "** An Administrator has added %s to the current round!", PlayerName2(params[0]);
                }
                else if(gTeam[params[0]] == TEAM_AWAY)
                {
                    SetPlayerPos(params[0], -973.9210,1061.2968,1345.6729);
                    SetPlayerFacingAngle(params[0], 90);
                    redcount++;
                    FormMessageForAll(playerid,COLOR_MESSAGE, "** An Administrator has added %s to the current round!", PlayerName2(params[0]);
                }
            }
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_ERROR, "ERROR: There is currently an inactive round!");
        PlayerPlaySound(playerid, 1053, 0.0, 0.0, 0.0);
    }
    return 1;
}
That is an example. Whenever they spawn on blue team i do : bluecount++ and red team redcount++;
Reply


Messages In This Thread
Player Count - by (_AcE_) - 29.09.2012, 03:15
Re: Player Count - by Glint - 29.09.2012, 05:27
Re: Player Count - by (_AcE_) - 30.09.2012, 00:51
AW: Player Count - by Nero_3D - 30.09.2012, 01:10

Forum Jump:


Users browsing this thread: 1 Guest(s)