20.07.2013, 17:53
I'm trying to start a mission at the nearest checkpoint from the player instead of just a random one. Anybody know the code for that?
Код:
else if(TypeFlight[playerid] == 4) // dodo
{
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 passenger.", 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];
}


