Newest Mission from player not functioning
#1

i have this nearest to check point mission for player but it used to work but now it don't i dont understand why
any way here is the code
pawn Код:
stock GetNearestCoordsForPlayer(playerid)
{
        new
        Float:DefDist = 999999999.9,
        Float:CurDist,
        id = -1
    ;
    for(new d = 0; d < sizeof(ALocations); d++)
    {
        CurDist = GetPlayerDistanceFromPoint(playerid, ALocations[d][LocX], ALocations[d][LocY], ALocations[d][LocZ]);
        if(CurDist < DefDist)
        {
            DefDist = CurDist;
            id = d;
        }
   }
   return id;
}
public StartMission(playerid)
{
    if(TypeFlight[playerid] == 1) // Andromada
    {
        StartedMission[playerid] = 1;
        new rand = random(sizeof(ALocations));
        new string2[65], message[128];
        SetPlayerCheckpoint(playerid, ALocations[rand][LocX],ALocations[rand][LocY],ALocations[rand][LocZ], 15.0);
        format(string2, sizeof(string2), "%s", ALocations[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 {FF9900}%s {FFFFFF}and pick up the cargo goods.", ALocations[rand][LocationName]);
        SendClientMessage(playerid, COLOR_WHITE, message);
        GameTextForPlayer(playerid, "~w~Andromada ~r~Mission Started", 4000, 3);
        TypeFlight[playerid] = 1;
        MissionStage[playerid] = 1;
        WantsRecording[playerid] = 1;
        Pos1[playerid] = ALocations[rand][LocX];
        Pos2[playerid] = ALocations[rand][LocY];
        Pos3[playerid] = ALocations[rand][LocZ];
    }
hope you can help thanks!
Reply
#2

Sorry, but I can't understand you. Do you mean that when the player is in the range of the checkpoint nothing happens ? if yes, what is supposed to occur ?
Reply
#3

Okay when player starts a mission it just gives a random check point dont matter were you are
i add that top thing which is;
pawn Код:
stock GetNearestCoordsForPlayer(playerid)
{
        new
        Float:DefDist = 999999999.9,
        Float:CurDist,
        id = -1
    ;
    for(new d = 0; d < sizeof(ALocations); d++)
    {
        CurDist = GetPlayerDistanceFromPoint(playerid, ALocations[d][LocX], ALocations[d][LocY], ALocations[d][LocZ]);
        if(CurDist < DefDist)
        {
            DefDist = CurDist;
            id = d;
        }
   }
   return id;
}
This thing was spose to give you the nearst mission so if i was in LV Airport i start a mission so i get the mission from LV Airport instead of a random one. it used to work but now it dont understand me a little better now?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)