01.07.2011, 01:43
So I'm just curious, I have this.
How can this be simplified? I'm trying to prevent using too many timers, I want the Textdraw to disappear after a couple of seconds. Can you help me?
pawn Код:
public RemoveTextDraw()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(gTeam[i] == TEAM_GREEN)
{
TextDrawHideForPlayer(i, SpawnObj_G);
}
if(gTeam[i] == TEAM_BLUE)
{
TextDrawHideForPlayer(i, SpawnObj_B);
}
}
}
}
pawn Код:
SetPlayerToTeamColor(playerid);
PlaySoundForAll(1186, 0.0, 0.0, 0.0); // Stops the music
if(gTeam[playerid] == TEAM_GREEN)
{
TextDrawShowForPlayer(playerid, SpawnObj_G);
SetTimer("RemoveTextDraw", 7000, 0);
}
else if(gTeam[playerid] == TEAM_BLUE)
{
TextDrawShowForPlayer(playerid, SpawnObj_B);
SetTimer("RemoveTextDraw", 7000, 0);
}