27.03.2016, 08:26
Try this:
Код:
public OnPlayerEnterCheckpoint(playerid) { switch(MissionStage[playerid]) { case STAGE_IDLE: {} // do not remove case STAGE_UNLOAD: { new string[64] ; //FreezePlayer(playerid, 3000);//i disable that for test DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, "~g~Passengers UnLoading !", 2000, 4); //SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); SetPVarInt(playerid, "PVarScore", 1); //GivePlayerMoney(playerid, 4000 + random(4000)); SetPVarInt(playerid, "PVarMoney", 4000 + random(4000)); GetPlayerName(playerid, string, MAX_PLAYER_NAME); strcat(string, " Completed a Flight!"); SendClientMessageToAll(COLOR_ORANGE, string); if(GetVehicleModel(vehicleid) == 519) // 411 is the Infernus model else return 0; SendClientMessage(playerid, COLOR_GREY, "All Passengers had Been UnBoarded!"); MissionStage[playerid] = STAGE_IDLE; } default: { // STAGE_LOAD new rand = random(sizeof gAirports - 1) ; if(rand == (MissionStage[playerid] - STAGE_LOAD)) { rand++; } //FreezePlayer(playerid, 3000); // disable that for test DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, "~g~Passengers Boarding !", 2000, 4); SetPlayerCheckpoint(playerid, gAirports[rand][0], gAirports[rand][1], gAirports[rand][2], 10.0); SendClientMessage(playerid, COLOR_GREY, "All Passengers has Been Boarded and Fastened Their Seat Belts!"); MissionStage[playerid] = STAGE_UNLOAD; } } return false; }