02.01.2016, 23:05
So whenever the player spawns as team 1 or team 2 , it adds the count to team 1 ALWAYS.
Code:
new Text:AliveInfo;
Whats the problem here?
Code:
new Text:AliveInfo;
Код:
AliveInfo = TextDrawCreate(23.000000, 169.000000, "team 1 ALIVE: 0~n~team2 ALIVE: 0~n~~r~~W~");
TextDrawBackgroundColor(AliveInfo, 255);
TextDrawFont(AliveInfo, 1);
TextDrawLetterSize(AliveInfo, 0.200000, 1.400000);
TextDrawColor(AliveInfo, -1);
TextDrawSetOutline(AliveInfo, 0);
TextDrawSetProportional(AliveInfo, 1);
TextDrawSetShadow(AliveInfo, 1);
function OnServerUpdate()
{
UpdateAliveInfo();
return 1;
}
stock UpdateAliveInfo()
{
new string[128];
format(string,sizeof(string),"~r~Team1: %d~n~~g~Team2: %d~n~~p~FORUMS: WWW.xwy",GetTeamPlayersAlive(TEAM_ZOMBIE),GetTeamPlayersAlive(TEAM_HUMAN));
TextDrawSetString(AliveInfo,string);
return 1;
}
public OnPlayerSpawn(playerid)
{
playersAliveCount++;
// rest of code dont want to publish.
public OnPlayerDeath(playerid)
{
playersAliveCount--;
//rest of code
GetTeamPlayersAlive(teamid)
{
new count;
for(new i; i < playersAliveCount; i++)
{
if(IsPlayerConnected(i) && team[i] == teamid) count++;
}
return count;
}


