PDA

View Full Version : Mission checkpoint issue


Coz
20/07/2013, 05:53 PM
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];
}

morocco
20/07/2013, 05:54 PM
What is wrong ?

Coz
20/07/2013, 05:58 PM
What is wrong ?

When u start a mission, it picks a random checkpoint for you to fly to and load the package on ur plane...well I'd like to change that so when you type /work, it'll direct you to the NEAREST checkpoint (which should be the last place you dropped off the package), so it'll save the player time. Right now my autowork isn't working for some reason and this is the best solution until I can figure it out. Right now it's set to a random starting point.