08.10.2011, 23:13
hm. after thinking for 10 seconds more, the #defines are not needed. the checkpoints will get created in order i bet
Код:
const MaxCheckpoints=4; new Mcheck[MaxCheckpoints]; new McheckOrder[MAX_PLAYERS];
Код:
new NewVehicleID = GetPlayerVehicleID(playerid); switch(McheckOrder[playerid]) { case 0: { 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]=1; } case 1: { SendClientMessage(playerid,COLOR_RED,"completed 1/2 of the mission"); DestroyDynamicCP(Mcheck[1]); Mcheck[2] = CreateDynamicCP(mInfo[playerid][Del_x], mInfo[playerid][Del_y], mInfo[playerid][Del_z], 2.0, -1, -1, playerid, 400000.0); McheckOrder[playerid]=2; } case 2: { SendClientMessage(playerid,COLOR_RED,"completed 3/4 of the mission"); DestroyDynamicCP(Mcheck[2]); Mcheck[3] = CreateDynamicCP(mInfo[playerid][Del_x], mInfo[playerid][Del_y], mInfo[playerid][Del_z], 2.0, -1, -1, playerid, 400000.0); McheckOrder[playerid]=3; } case 3: { SendClientMessage(playerid,COLOR_RED,"completed the mission"); DestroyDynamicCP(Mcheck[3]); McheckOrder[playerid]=0; } }