new Text:BTSTxd;
new Text:RTSTxd;
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawShowForPlayer(i, BTSTxd);
TextDrawShowForPlayer(i, RTSTxd);
}
}
BTSTxd = TextDrawCreate(505.000000, 303.000000, "Blue Team:");
TextDrawBackgroundColor(BTSTxd, 255);
TextDrawFont(BTSTxd, 2);
TextDrawLetterSize(BTSTxd, 0.350000, 1.200000);
TextDrawColor(BTSTxd, 1097465770);
TextDrawSetOutline(BTSTxd, 1);
TextDrawSetProportional(BTSTxd, 1);
RTSTxd = TextDrawCreate(505.000000, 324.000000, "Red Team:");
TextDrawBackgroundColor(RTSTxd, 255);
TextDrawFont(RTSTxd, 2);
TextDrawLetterSize(RTSTxd, 0.350000, 1.200000);
TextDrawColor(RTSTxd, -16776961);
TextDrawSetOutline(RTSTxd, 1);
TextDrawSetProportional(RTSTxd, 1);
TextDrawShowForPlayer(playerid, BTSTxd);
TextDrawShowForPlayer(playerid, RTSTxd);
forward TeamScore(playerid);
ScoreTimer = SetTimer("TeamScore",1000,1);
public TeamScore()
{
new BlueTeamScore[100];
format(BlueTeamScore,sizeof(BlueTeamScore),"Blue Team: %d",TeamBlueScore);
TextDrawSetString(BTSTxd,BlueTeamScore);
new RedTeamScore[100];
format(RedTeamScore,sizeof(RedTeamScore),"Red Team: %d",TeamRedScore);
TextDrawSetString(RTSTxd,RedTeamScore);
return 1;
}
if(GetPlayerTeam(killerid) == TEAM_BLUE)
{
TeamBlueScore ++;
}
if(GetPlayerTeam(killerid) == TEAM_RED)
{
TeamRedScore ++;
}
printf("True values: %d:%d", TeamBlueScore, TeamRedScore);
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawShowForPlayer(i, BTSTxd);
TextDrawShowForPlayer(i, RTSTxd);
}
}
|
Put this in TeamScore, and kill someone
pawn Код:
We need to be sure that scores are updated correctly |
|
I am not sure but I think you need to show players textdraw after you set string.
add this at the end of the public TeamScore() Код:
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawShowForPlayer(i, BTSTxd);
TextDrawShowForPlayer(i, RTSTxd);
}
}
|