08.10.2011, 22:56
(
Последний раз редактировалось Babul; 09.10.2011 в 20:03.
)
oops, stupid me. the Mcheck[] can get assigned any value, the case needs a constant... so by adding these
.. and adding one more line for the order, stored per player:
when you create your checkpoint, the McheckOrder[playerid] will automatically be set to 0, or CheckpointOrder0, as initial value btw..
use it like this:
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
Код:
#define CheckpointOrder0 0 #define CheckpointOrder1 1
Код:
new Mcheck[2]; new McheckOrder[MAX_PLAYERS];
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; } }
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