25.09.2012, 05:16
how i can get nearest airport??
Код:
if(strcmp(cmdtext, "/work", true) == 0) { if (GetPVarInt(playerid, "Flight") == 1) { return SendClientMessage(playerid, COLOR_RED, "You are already in a flight!"); } if (GetPVarInt(playerid, "Work") > 0) { return SendClientMessage(playerid, COLOR_RED, "You are already in a work!"); } new IslandName[48], szString[128]; SetPVarInt(playerid, "Work", 1); MissionVehicle[playerid] = GetPlayerVehicleID(playerid); switch (random(12)) { case 0: { Island[PopCorn_Island][playerid]=SetPlayerFlightCheckpoint(playerid, 3364.3716,187.7556,3.7580, 10.0); IslandName="PopCorn Island"; } case 1: { Island[Las_Venturas][playerid]=SetPlayerFlightCheckpoint(playerid, 1476.5433,1465.9758,10.8281, 10.0); IslandName="Las Venturas"; } case 2: { Island[Island_1][playerid] = SetPlayerFlightCheckpoint(playerid, -3573.7981,-313.6209,12.8887, 10.0); IslandName="Island 1"; } case 3: { Island[Los_Santos][playerid] = SetPlayerFlightCheckpoint(playerid, 1869.8599,-2493.2256,13.5547, 10.0); IslandName="Los Santos"; } case 4: { Island[San_Fierro][playerid] = SetPlayerFlightCheckpoint(playerid, -1437.0648,48.4609,14.1484, 10.0); IslandName="San Fierro"; } case 5: { Island[Verdant_Meadows][playerid] = SetPlayerFlightCheckpoint(playerid, 270.4283,2507.4309,16.4944, 10.0); IslandName="Verdant Meadows"; } case 6: { Island[Pilot_Island][playerid] = SetPlayerFlightCheckpoint(playerid, -84.6720,3357.0527,4.2387, 10.0); IslandName="Pilots Island"; } case 7: { Island[Admin_Island][playerid] = SetPlayerFlightCheckpoint(playerid, 818.3096,-4558.7163,1.2266, 10.0); IslandName="Admin Island"; } case 8: { Island[PopCorn_Mansion][playerid] = SetPlayerFlightCheckpoint(playerid, 3275.1458,-1819.7595,2.0000, 10.0); IslandName="PopCorn Island"; } case 9: { Island[Rock_Island][playerid] = SetPlayerFlightCheckpoint(playerid, 3428.0107,-683.0929,4.4299, 10.0); IslandName="Rock Island"; } case 10: { Island[Bubbles_Island][playerid] = SetPlayerFlightCheckpoint(playerid, 5798.8726,-1556.8759,4.9581, 10.0); IslandName="Bubbles Island"; } case 11: { Island[Communist_AP][playerid] = SetPlayerFlightCheckpoint(playerid, -1481.1166,3129.1453,19.3932, 10.0); IslandName="Communist Airport"; } } FirstAPName[playerid] = IslandName; format(szString, 128, "Go to %s to pick up the passengers!", IslandName); WorkTimer[playerid] = SetTimerEx("WorkingMinutes", 60000, true, "i", playerid); SendClientMessage(playerid, COLOR_LIGHTGREEN, szString); return 1; }