Checkpoint problem
#5

oops, stupid me. the Mcheck[] can get assigned any value, the case needs a constant... so by adding these
Код:
#define CheckpointOrder0 0
#define CheckpointOrder1 1
.. and adding one more line for the order, stored per player:
Код:
new Mcheck[2];
new McheckOrder[MAX_PLAYERS];
when you create your checkpoint, the McheckOrder[playerid] will automatically be set to 0, or CheckpointOrder0, as initial value btw..
use it like this:
Код:
	new NewVehicleID = GetPlayerVehicleID(playerid);
	switch(McheckOrder[playerid])
	{
		case CheckpointOrder1:
		{
			if(OldVehicleID[playerid] != NewVehicleID) return SendClientMessage(playerid,COLOR_RED,"This vehicle does not contain a passenger!");
			// stop previous CP
			DestroyDynamicCP(Mcheck[0]);
			Mcheck[1] = CreateDynamicCP(mInfo[playerid][Del_x], mInfo[playerid][Del_y], mInfo[playerid][Del_z], 2.0, -1, -1, playerid, 400000.0);
			McheckOrder[playerid]=CheckpointOrder1;
		}
		case CheckpointOrder1:
		{
			SendClientMessage(playerid,COLOR_RED,"completed the mission");
			McheckOrder[playerid]=CheckpointOrder0;// or simply 0;
		}
	}
did i forget anything?
edit: the refreshing didnt work for some minutes here. weird.. first CP needs to be 0 indeed ^^
case CheckpointOrder0:
edit: sig removed. 1 is ok for a page lol
Reply


Messages In This Thread
Checkpoint problem - by knackworst - 08.10.2011, 21:31
Re: Checkpoint problem - by =WoR=G4M3Ov3r - 08.10.2011, 22:19
Re: Checkpoint problem - by Babul - 08.10.2011, 22:33
Re: Checkpoint problem - by knackworst - 08.10.2011, 22:36
Re: Checkpoint problem - by Babul - 08.10.2011, 22:56
Re: Checkpoint problem - by knackworst - 08.10.2011, 23:05
Re: Checkpoint problem - by Babul - 08.10.2011, 23:13
Re: Checkpoint problem - by knackworst - 08.10.2011, 23:17
Re: Checkpoint problem - by Babul - 09.10.2011, 20:02

Forum Jump:


Users browsing this thread: 1 Guest(s)