Caseproblem

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Aufgrund von Anfrage in PM:


    Zeig uns doch mal, wie du Bplanes, Hplanes und Splanes (etc?) definiert hast.
    Und zudem zeig uns bitte, wie du MAX_FLUGHAFEN (oder sowas in der Art) definiert hast.


    //at400,andro
    new Float:Bplanes[3][Check] = {
    {"Las Venturas Airport Gate B",1576.9788,1391.3984,10.8483, 10.0},//lva,0
    {"Los Santos Airport Gate B",-1364.0537,-215.1572,14.1484, 10.0},//sfa,1
    {"San Fierro Airport Gate B ",-760.1149,1994.4023,5.4734,10.0}//sherman,2



    };
    //Dodo,Beagle,Shamal
    new Float:Splanes[8][Check] = {
    {"Las Venturas Airport Gate A",1576.9788,1391.3984,10.8483, 10.0},//lva,0
    {"San Fierro Airport Gate A",-1364.0537,-215.1572,14.1484, 10.0},//sfa,1
    {"Sherman Damm Airport Gate A",-760.1149,1994.4023,5.4734,10.0},//sherman,2
    {"Los Santos Airport Gate A",1726.6909,-2407.4905,13.5547,10.0},//ls,3
    {"Rockshore Airport Gate A",2866.5273,1870.2122,14.1785,10.0},//rockshore,4
    {"Dillimore Airport Gate A",734.4788,-416.9675,20.7770,10.0},//Dillimore5
    {"Rocky Airport Gate A",3481.3003,-734.1611,4.4475,10.0},//rocky6
    {"Palomino Creek Airport Gate A",1920.6709,-475.8198,26.3133,10.0}


    };
    //helis
    new Float:Hplanes[4][Check] = {
    {"Las Venturas Airport Helipad",1292.2067,1619.8085,19.8637,10.0},
    {"San Fierro Airport Helipad",-1186.6300,24.9960,14.1484,10.0},
    {"Los Santos Airport Helipad",1471.4916,-2435.9031,13.5547,10.0},
    {"Dillimore Airport Helipad",673.0464,-406.6922,19.0978,10.0}
    };
    Habe nicht sowas wie max Flughäfen.

  • stock GetNearestAirport(playerid)
    {
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 511 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 519 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 593)//Beagle+Dodo+Shamal
    {
    new Float:maxx = 1000000.0;
    new id = -1;
    for(new i=0; i<5; i++)
    {
    new Float:dis = GetPlayerDistanceFromPoint(playerid, Splanes[i][x],Splanes[i][y],Splanes[i][z]);
    if(dis < maxx)
    {
    maxx = dis;
    id = i;
    }
    }


    return id;
    }
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 488 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 497 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 548 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 563)//helis
    {
    new Float:maxx = 1000000.0;
    new id = -1;
    for(new i=0; i<5; i++)
    {
    new Float:dis = GetPlayerDistanceFromPoint(playerid, Hplanes[i][x],Hplanes[i][y],Hplanes[i][z]);
    if(dis < maxx)
    {
    maxx = dis;
    id = i;
    }
    }


    return id;
    }
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 417 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 425 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 447 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 469 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 487)
    {
    new Float:maxx = 1000000.0;
    new id = -1;
    for(new i=0; i<5; i++)
    {
    new Float:dis = GetPlayerDistanceFromPoint(playerid, Hplanes[i][x],Hplanes[i][y],Hplanes[i][z]);
    if(dis < maxx)
    {
    maxx = dis;
    id = i;
    }
    }


    return id;
    }
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 592 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 577)
    {
    new Float:maxx = 1000000.0;
    new id = -1;
    for(new i=0; i<5; i++)
    {
    new Float:dis = GetPlayerDistanceFromPoint(playerid, Bplanes[i][x],Bplanes[i][y],Bplanes[i][z]);
    if(dis < maxx)
    {
    maxx = dis;
    id = i;
    }
    }


    return id;
    }


    return 1;
    }