[Problema] Cambio de map
#1

Bueno, tengo un problema en el sistema de map change, veamos:

- Cuando los kills del equipo uno son iguales que los kills del equipo dos (Team1Kills == Team2Kills), al acabar la cuenta atrбs el mapa se cambia correctamente.

El problema es cuando los kills de un equipo son mayor que los de otro. Ocurre que al cambiar de mapa el jugador se queda 'bugeado' en una posiciуn determinada y no pasa al siguiente mapa.

Aquн los codes:

Код:
public TimeChange()
    {
	new seconds = CountDownTime % 60;
	new minutes = (CountDownTime - seconds) / 60;
	
	if(CountDownTime > 0)
	{
	    new string[64];
	    format(string, sizeof(string), "~y~%02d : %02d", minutes, seconds);
	    TextDrawSetString(Countdown, string);
	    CountDownTime--;
	}
	
	else if(CountDownTime == 0)
	{
	    if(Team1Kills > Team2Kills)
		{
			for(new i=0;i<MAX_PLAYERS;i++)
			{
 				if(gTeam[i] == TEAM1)
   				{
		        	GameTextForPlayer(i, "~b~SWATS ~n~~w~WINS THE GAME", 4000, 3);
					GivePlayerMoney(i, 2000);
					SendClientMessage(i, -1, "You get 2000$ for winning the round.");
					ApplyAnimation(i,"DANCING","dnce_M_e",4.0,1,0,0,0,-1);
					ApplyAnimation(i,"DANCING","dnce_M_e",4.0,1,0,0,0,-1);
					SetTimer("NewMapTimer",6000, false);

				}
				else
				{
			    	GameTextForPlayer(i, "~r~YOU LOST ~n~THE GAME", 4000, 3);
			    	ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
			    	ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
			    	SetTimer("NewMapTimer",6000,false);

				}
			}
		}
		
		else if(Team2Kills > Team1Kills)
		{
			for(new i=0;i<MAX_PLAYERS;i++)
			{
		    	if(gTeam[i] == TEAM2)
		    	{
		        	GameTextForPlayer(i, "~r~TERRORISTS ~n~~w~WINS THE GAME", 4000, 3);
		        	GivePlayerMoney(i, 2000);
		        	SendClientMessage(i, -1, "You get 2000$ for winning the round.");
		        	ApplyAnimation(i,"DANCING","dnce_M_e",4.0,1,0,0,0,-1);
		        	ApplyAnimation(i,"DANCING","dnce_M_e",4.0,1,0,0,0,-1);
		        	SetTimer("NewMapTimer",6000, false);

				}
				else
				{
			    	GameTextForPlayer(i, "~r~YOU LOST ~n~THE GAME", 4000, 3);
			    	ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
			    	ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
			    	SetTimer("NewMapTimer",6000, false);

				}
			}
		}
		
		else if(Team1Kills == Team2Kills)
		{
			GameTextForAll("Round Draw", 4000, 3);
			SetTimer("NewMapTimer",6000, false);
		}
		
		TextDrawSetString(Countdown, "~y~00 : 00");
		SetTimer("RestartCDTimer", 4000, false);
	    KillTimer(CDChange);
	}
	return 1;
    }
Ese public llama a los siguientes public:

Код:
public NewMapTimer()
    {
    for(new i=0;i<MAX_PLAYERS;i++)
	{
	    TogglePlayerControllable(i, 0);
	}
	MapChange++;
    GameTextForAll("~b~Loading New Map. Prepare to new round.", 4000, 3);
	SetTimer("StartedNewRound", 2000, false);
    return 1;
    }
Код:
public RestartCDTimer()
    {
	CountDownTime = 300;
	Team1Kills = 0;
	Team2Kills = 0;
	CDChange = SetTimer("TimeChange", 1000, true);
	return 1;
    }
Y tambiйn en public 'NewMapTimer' llama a йste:

Код:
public StartedNewRound()
    {
	for(new i=0;i<MAX_PLAYERS;++i)
	{
	    SpawnPlayer(i);
	    TogglePlayerControllable(i, 0);
	    GameTextForAll("Loading Objects", 3000, 3);
	    SetTimer("Unfreeze", 3000, false);
	 }
	return 1;
    }
їAlguna idea de quй puede ser?
Reply


Messages In This Thread
[Problema] Cambio de map - by Loox - 25.01.2013, 22:26
Respuesta: [Problema] Cambio de map - by Loox - 26.01.2013, 13:03
Re: [Problema] Cambio de map - by OneBlaack - 26.01.2013, 13:46
Re: [Problema] Cambio de map - by Daniel-92 - 26.01.2013, 14:13
Respuesta: Re: [Problema] Cambio de map - by Loox - 26.01.2013, 14:23
Respuesta: [Problema] Cambio de map - by Loox - 26.01.2013, 15:26
Respuesta: [Problema] Cambio de map - by OTACON - 26.01.2013, 15:35
Respuesta: [Problema] Cambio de map - by Loox - 26.01.2013, 15:39

Forum Jump:


Users browsing this thread: 1 Guest(s)