31.12.2010, 10:20
I've got this:
And this:
But for some reason, I go on the Grove team and type /update, and both textdraws say "No Groves left!" and "No Ballas left!"
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);
}
}
pawn Код:
if(strcmp(cmdtext, "/update", true) == 0)
{
UpdateTeamCountTextdraws();
return 1;
}