PHP Code:
//-------- Dodo + Shamal Compatible --------------------------------------------
new DSLocations[][TLocation] =
{
// LocationName, LocationX, LocationY, LocationZ
{"Prickle Pine Airport Gate A", 1109.0206,2563.8406,10.9826},
{"Bayside Airport Gate C", -2454.9817,2540.1506,24.7591},
{"Palomino Creek Airport Gate C", 1919.4451,-483.7521,26.3312},
{"Palomino Creek Airport Gate D", 1885.7271,-502.4863,26.3312},
{"K.A.C.C Regional Gate C", 2799.7319,2767.1943,10.8687},
{"K.A.C.C Regional Gate D", 2815.5737,2757.7551,10.8687},
{"K.A.C.C Regional Gate F", 2831.6379,2749.2725,10.8687},
{"Montgomery Airport Gate D", 1277.0098,410.7339,20.3572},
{"Montgomery Airport Gate C", 1292.0890,431.3974,20.3372},
{"Angel Pine Airport Gate C", -1798.5845,-2992.4514,8.4916},
{"Angel Pine Airport Gate D", -1808.1495,-2987.5530,8.4916},
{"Blueberry Airport Gate C", 11.0526,-95.6858,4.2813},
{"Blueberry Airport Gate D", 9.1205,-118.0340,4.2433},
{"Shady Creek Airport Gate D", -1352.9548,-2176.4211,27.6743},
{"Shady Creek Airport Gate E", -1336.2051,-2182.0254,26.7054},
{"Shady Creek Airport Gate F", -1313.5453,-2185.2051,26.7054},
{"Santa Maria Airport Gate D", 43.1413,-1717.3152,4.8812},
{"Santa Maria Airport Gate F", 38.5412,-1703.2230,4.8205},
{"Indiana Airport Gate C", -694.9243,1272.1669,12.2733},
{"Indiana Airport Gate D", -681.6368,1270.1713,12.2733}
};
else if(TypeFlight[playerid] == 3) // Shamal
{
StartedMission[playerid] = 1;
new rand = random(sizeof(DSLocations));
new string2[65], message[128];
SetPlayerFlightCheckpoint(playerid, DSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", DSLocations[rand][LocationName]); //PASSWORD
strmid(FirstAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
//FirstAPName[playerid] = ALocations[rand][LocationName];
//FirstAPName[playerid] = AndroDName;
format(message,sizeof(message), "Head to {1B8AE4}%s {FFFFFF}and pick up the passengers.", DSLocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, message);
MissionStage[playerid] = 1;
WantsRecording[playerid] = 1;
Pos1[playerid] = DSLocations[rand][LocX];
Pos2[playerid] = DSLocations[rand][LocY];
Pos3[playerid] = DSLocations[rand][LocZ];
}
new closest_location, Float: tmp_cd, Float: closest_distance = GetPlayerDistanceFromPoint(playerid, ALocations[0][LocX], ALocations[0][LocY], ALocations[0][LocZ]);
for (new i = 1; i != sizeof ALocations; i++)
{
if ((tmp_cd = GetPlayerDistanceFromPoint(playerid, ALocations[i][LocX], ALocations[i][LocY], ALocations[i][LocZ])) < closest_distance)
{
closest_distance = tmp_cd;
closest_location = i;
}
}
// to set the position to the closest location use:
ALocations[closest_location][LocX], ALocations[closest_location][LocY], ALocations[closest_location][LocZ]
if(strcmp(cmd, "/work", true) == 0 || strcmp(cmd, "/w", true) == 0)
{
if(StartedMission[playerid] == 1)
{
SendClientMessage(playerid, COLOR_ERROR, "You are already on a mission! (/cancel to quit the mission)");
return 1;
}
if(IsTracingHouse[playerid] == 1)
{
SendClientMessage(playerid, COLOR_ERROR, "You are currently locating a house. Please complete it first.");
return 1;
}
if(IsLocatingVehicle[playerid] == 1)
{
SendClientMessage(playerid, COLOR_ERROR, "You are currently locating a vehicle. Please complete it first.");
return 1;
}
new vehid = GetPlayerVehicleID(playerid);
if(GetPlayerVehicleSeat(playerid) != 0)
{
SendClientMessage(playerid, COLOR_ERROR, "You must be the main driver of a vehicle to start working!");
return 1;
}
if(IsAirVehicle(vehid))
{
if(PInfo[playerid][TotalScore] == 0)
{
new msg[200];
format(msg,sizeof(msg),"Hey! It looks like you have not completed a flight yet! This is just to help you out:");
SendClientMessage(playerid, COLOR_GREEN, msg);
format(msg,sizeof(msg),"-When you do missions (/work), it will ask you to fly to a destination. Fly there and land, and it will give another checkpoint.");
SendClientMessage(playerid, COLOR_GREEN, msg);
format(msg,sizeof(msg),"-When you complete the mission, you gain money, in which you can purchase vehicle's, houses or even your own airline!");
SendClientMessage(playerid, COLOR_GREEN, msg);
format(msg,sizeof(msg),"-All of that information is just to help you understand the main features of the PoT, but there is ALOT more to come! - Have fun!");
SendClientMessage(playerid, COLOR_GREEN, msg);
}
new modelid = GetVehicleModel(vehid);
if(modelid == 592) //andromada
{
TypeFlight[playerid] = 1;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 577) // at-400
{
TypeFlight[playerid] = 2;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 519) // shamal
{
TypeFlight[playerid] = 3;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 593) // dodo
{
TypeFlight[playerid] = 4;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 553) // nevada
{
TypeFlight[playerid] = 5;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 487) // Maverick
{
TypeFlight[playerid] = 6;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 488) // News Maverick
{
TypeFlight[playerid] = 7;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 497) // Police Maverick
{
TypeFlight[playerid] = 8;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 417) // Leviathan
{
TypeFlight[playerid] = 9;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 447) // Seasparrow
{
TypeFlight[playerid] = 10;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 469) // Sparrow
{
TypeFlight[playerid] = 11;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 548) // Cargobob
{
TypeFlight[playerid] = 12;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 563) //Raindance
{
TypeFlight[playerid] = 13;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 425) //Hunter
{
TypeFlight[playerid] = 14;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 460) //Skimmer
{
TypeFlight[playerid] = 15;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 512) //Cropduster
{
TypeFlight[playerid] = 16;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 511) //Beagle
{
TypeFlight[playerid] = 17;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
else if(modelid == 520) //Hydra
{
TypeFlight[playerid] = 18;
MissionVehicle[playerid] = vehid;
StartMission(playerid);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_ERROR, "You must be in an plane/helicopter to start working !");
return 1;
}
}