A team player count textdraw error
#1

I've got this:
pawn Код:
new count;
GetTeamPlayersAlive(teamid)
{
    for(new i; i>playersAliveCount; i++)
    {
        if(gTeam[i] == teamid) count++;
        if(i == playersAliveCount) {
            return count;
        }
    }
}
UpdateTeamCountTextdraws()
{
    new string[128];
    format(string, sizeof(string), "Ballas left: %d", GetTeamPlayersAlive(TEAM_BALLA));
    if(strcmp("Ballas left: 0", string, true, 14) == 0)
    {
        TextDrawSetString(ballasleft, "No Ballas left!");
    } else {
        TextDrawSetString(ballasleft, string);
    }
    format(string, sizeof(string), "Groves left: %d", GetTeamPlayersAlive(TEAM_GROVE));
    if(strcmp("Groves left: 0", string, true, 14) == 0)
    {
        TextDrawSetString(grovesleft, "No Groves left!");
    } else {
        TextDrawSetString(grovesleft, string);
    }
}
And this:
pawn Код:
if(strcmp(cmdtext, "/update", true) == 0)
    {
        UpdateTeamCountTextdraws();
        return 1;
    }
But for some reason, I go on the Grove team and type /update, and both textdraws say "No Groves left!" and "No Ballas left!"
Reply
#2

pawn Код:
GetTeamPlayersAlive(teamid)
{
    new count;
    for(new i; i < playersAliveCount; i++)
    {
        if(IsPlayerConnected(i) && gTeam[i] == teamid) count++;
    }
    return count;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)