[Ajuda] Checkpoint
#4

Eu faria assim:
Code:
new playerJobCheckpoint[MAX_PLAYERS] = -1; //  Cria uma variбvel que tem valor padrгo de -1, ela й usada para checar qual o prуximo checkpoint sera setado

CMD:trabalhar(playerid){ //  Um exemplo de comando para setar o primeiro checkpoint para o player

	if(playerJob[playerid] == 0){ //  Se for motorista de фnibus

		playerJobCheckpoint[playerid] = 0; //  Usamos a variбvel
		SetPlayerCheckpoint(playerid, X, Y, Z, 3.0); //  Coordenadas do primeiro checkpoint
	}
}

public OnPlayerEnterCheckpoint(playerid){ //  Quando o player entra em um checkpoint

	switch(playerJobCheckpoint[playerid]){ // Vamos checar qual й o valor da variбvel que criamos

		case 0:{ //  Se for 0, mostra o primeiro checkpoint para o player

			playerJobCheckpoint[playerid] = 1; //  Ele entrou no primeiro checkpoint, entгo falamos que o prуximo й o 1
			SetPlayerCheckpoint(playerid, 1547.3561, -2284.1187, 13.4841, 3.0); //  Setamos o checkpoint
			GameTextForPlayer(playerid, "Aguarde passageiros...", 3000, 3);
		    TogglePlayerControllable(playerid, 0);
		    SetTimerEx("Linhas", 3000, false, "i", playerid);
		}

		case 1:{ // Quandpo ele entrar no prуximo checkpoint, vai ser chamado este case aqui, pois o valor da variavel й 1 agora

			playerJobCheckpoint[playerid] = 2;
			SetPlayerCheckpoint(playerid, 1400.5472, -2284.7380, 13.4667, 3.0);
		}

		case 2:{ // E assim por diante...

			playerJobCheckpoint[playerid] = 2;
			SetPlayerCheckpoint(playerid, 1368.4954, -2173.5496, 13.4840, 3.0);
			
		}
	}

	return DisablePlayerCheckpoint(playerid); //  Toda vez que o player entrar num checkpoint, ele serб desabilitado. Mas isso aqui й opicional
}
Reply


Messages In This Thread
Checkpoint - by iWiNeR - 11.05.2018, 23:10
Re: Checkpoint - by Ermanhaut - 12.05.2018, 00:09
Re: Checkpoint - by iWiNeR - 12.05.2018, 00:24
Re: Checkpoint - by Ermanhaut - 12.05.2018, 00:55
Re: Checkpoint - by iWiNeR - 12.05.2018, 01:48
Re: Checkpoint - by FerrariL - 12.05.2018, 01:54
Re: Checkpoint - by iWiNeR - 12.05.2018, 02:10
Re: Checkpoint - by FerrariL - 12.05.2018, 02:22
Re: Checkpoint - by iWiNeR - 12.05.2018, 02:27
Re: Checkpoint - by Minerva - 12.05.2018, 02:34
Re: Checkpoint - by iWiNeR - 12.05.2018, 02:47
Re: Checkpoint - by Ermanhaut - 12.05.2018, 13:58
Re: Checkpoint - by iWiNeR - 12.05.2018, 14:30
Re: Checkpoint - by iWiNeR - 12.05.2018, 17:36
Re: Checkpoint - by Ermanhaut - 12.05.2018, 17:46
Re: Checkpoint - by iWiNeR - 12.05.2018, 19:08
Re: Checkpoint - by iWiNeR - 13.05.2018, 23:08

Forum Jump:


Users browsing this thread: 3 Guest(s)