Message showing two times
#1

Code:
forward duelstart();
public duelstart()
{
	DuelCountdown --;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(InDuel[i] == true)
            {
				if(DuelCountdown == 5)
				{
				    GameTextForPlayer(i, "~r~5", 1000, 3);
				    PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
				}
				if(DuelCountdown == 4)
				{
				    GameTextForPlayer(i, "~r~4", 1000, 3);
				    PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
				}
				if(DuelCountdown == 3)
				{
				    GameTextForPlayer(i, "~r~3", 1000, 3);
				    PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
				}
				if(DuelCountdown == 2)
				{
				    GameTextForPlayer(i, "~r~2", 1000, 3);
				    PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
				}
				if(DuelCountdown == 1)
				{
				    GameTextForPlayer(i, "~r~1", 1000, 3);
				    PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
				}
				if(DuelCountdown == 0)
				{
					KillTimer(dueltimer);
					Duel = true;
	                new string[128];
	                format(string, sizeof(string), "Boxing duel between %s and %s started!", Dueler1, Dueler2);
	                SendClientMessageToAll(DUEL, string);
	                TogglePlayerControllable(i, 1);
	                GameTextForPlayer(i, "~g~BOX YOURSELF!", 2000, 3);
	                PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
				}
			}
		}
	}
	return 1;
}
I have this function in timer, it is 1000ms timer (1 second). The problem is, that when the DuelCountdown gets to 0, it like starts the duel twice (writes the Boxing duel between message twice). Do you guys have any reason why this could occur?
Reply


Messages In This Thread
Message showing two times - by _GHT_MarK445 - 05.05.2020, 06:59
Re: Message showing two times - by SyS - 05.05.2020, 07:15
Re: Message showing two times - by _GHT_MarK445 - 06.05.2020, 14:38

Forum Jump:


Users browsing this thread: 2 Guest(s)