/auspacken Befehl Was mach ich falsch?

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
  • Also ich habe mich als Spediteur gemacht bin in Dienst gegangen und bin dann zum Autohaus gefahren ( im den Fall Wang Car)
    Mein Befehl ist:
    if(strcmp(cmd, "/auspacken", true)==0 && gTeam[playerid] == TEAM_SPEDITION){
    if(IsPlayerInAnyVehicle(playerid)){
    new Float:x,Float:y,Float:z,Float:a,model,vehicleid,color1,color2;
    new tmp[256];
    new TID = GetVehicleTrailer(GetPlayerVehicleID(playerid));
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehiclePos(vehicleid,x,y,z);
    GetVehicleZAngle(vehicleid,a);
    format(string, sizeof(string), "/vehicle_%d.sav", TID); // Put the location of the file inside the (" ").
    if (dini_Int(string,"eingepackt")==1) {
    dini_IntSet(string,"eingepackt",0);
    dini_FloatSet(string,"x",x);
    dini_FloatSet(string,"y",y);
    dini_FloatSet(string,"z",z);
    dini_FloatSet(string,"a",a);
    tmp = dini_Get(string,"model");
    model = strval(tmp);
    tmp = dini_Get(string,"x");
    x = strval(tmp);
    tmp = dini_Get(string,"y");
    y = strval(tmp);
    tmp = dini_Get(string,"z");
    z = strval(tmp);
    tmp = dini_Get(string,"a");
    a = strval(tmp);
    tmp = dini_Get(string,"color1");
    color1 = strval(tmp);
    tmp = dini_Get(string,"color2");
    color2 = strval(tmp);
    DestroyVehicle(TID);
    SendClientMessage(playerid,COLOR_RED,"Auto ausgepackt!");
    CreateVehicle(model,x,y,z,a,color1,color2,300000);
    GivePlayerMoney(playerid,1500);
    }
    }
    return 1;
    }


    Es wird niemals so viel gelogen wie vor der Wahl, während des Krieges und nach der Jagd.

    - Otto von Bismarck
    -

  • 'Ah nun^^
    Mach immer tmp1, tmp2 etc
    Also für jedes ding ein eigenes tmp, weil du ja sonst jedes mal das tmp überschreibst

    Kalcor: "... it makes the game look like it's not GTA. This mod is called San Andreas Multiplayer. It's not a custom game engine which you can script..."

  • So meint er das glaube ich:

    if(strcmp(cmd, "/auspacken", true)==0 && gTeam[playerid] == TEAM_SPEDITION){
    if(IsPlayerInAnyVehicle(playerid)){
    new Float:x,Float:y,Float:z,Float:a,model,vehicleid,color1,color2;
    new tmp[256], tmp2[256], tmp3[256], tmp4[256], tmp5[256], tmp6[256], tmp7[256], tmp8[256];
    new TID = GetVehicleTrailer(GetPlayerVehicleID(playerid));
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehiclePos(vehicleid,x,y,z);
    GetVehicleZAngle(vehicleid,a);
    format(string, sizeof(string), "/vehicle_%d.sav", TID); // Put the location of the file inside the (" ").
    if (dini_Int(string,"eingepackt")==1) {
    dini_IntSet(string,"eingepackt",0);
    dini_FloatSet(string,"x",x);
    dini_FloatSet(string,"y",y);
    dini_FloatSet(string,"z",z);
    dini_FloatSet(string,"a",a);
    tmp2 = dini_Get(string,"model");
    model = strval(tmp);
    tmp3 = dini_Get(string,"x");
    x = strval(tmp);
    tmp4 = dini_Get(string,"y");
    y = strval(tmp);
    tmp5 = dini_Get(string,"z");
    z = strval(tmp);
    tmp6 = dini_Get(string,"a");
    a = strval(tmp);
    tmp7 = dini_Get(string,"color1");
    color1 = strval(tmp);
    tmp8 = dini_Get(string,"color2");
    color2 = strval(tmp);
    DestroyVehicle(TID);
    SendClientMessage(playerid,COLOR_RED,"Auto ausgepackt!");
    CreateVehicle(model,x,y,z,a,color1,color2,300000);
    GivePlayerMoney(playerid,1500);
    }
    }
    return 1;
    }

  • 'Ah nun^^
    Mach immer tmp1, tmp2 etc
    Also für jedes ding ein eigenes tmp, weil du ja sonst jedes mal das tmp überschreibst


    LOL
    Also noch Resourenschonender gehts nicht -.-


    Naja es liegt nicht an dem (das weiß ich).


    Probiers mal so:



    if(strcmp(cmd, "/auspacken", true)==0 && gTeam[playerid] == TEAM_SPEDITION){
    if(IsPlayerInAnyVehicle(playerid)){
    new Float:x,Float:y,Float:z,Float:a,model,vehicleid,color1,color2;
    new string[256];
    new tmp[256];
    new TID = GetVehicleTrailer(GetPlayerVehicleID(playerid));
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehiclePos(vehicleid,x,y,z);
    GetVehicleZAngle(vehicleid,a);
    format(string, sizeof(string), "vehicle_%d.sav", TID); // Put the location of the file inside the (" ").
    if (dini_Int(string,"eingepackt")==1) {
    dini_IntSet(string,"eingepackt",0);
    dini_FloatSet(string,"x",x);
    dini_FloatSet(string,"y",y);
    dini_FloatSet(string,"z",z);
    dini_FloatSet(string,"a",a);
    tmp = dini_Get(string,"model");
    model = strval(tmp);
    tmp = dini_Get(string,"x");
    x = strval(tmp);
    tmp = dini_Get(string,"y");
    y = strval(tmp);
    tmp = dini_Get(string,"z");
    z = strval(tmp);
    tmp = dini_Get(string,"a");
    a = strval(tmp);
    tmp = dini_Get(string,"color1");
    color1 = strval(tmp);
    tmp = dini_Get(string,"color2");
    color2 = strval(tmp);
    DestroyVehicle(TID);
    SendClientMessage(playerid,COLOR_RED,"Auto ausgepackt!");
    CreateVehicle(model,x,y,z,a,color1,color2,300000);
    GivePlayerMoney(playerid,500);


    }
    }
    return 1;
    }


    Das müsste gehen da es aus meiner neuesten Scriptversion war :P

  • Geht immer noch nit liegts vll daran:
    new Float:checkCoords[MAX_POINTS][4] = {
    {2098.1316,901.7380,2137.7456,963.0146},
    {2617.5967,1062.8710,2656.6526,1142.5109},
    {501.7475,1626.7821,653.2095,1774.1093},
    {-1351.2833,2638.8943,-1265.1661,2738.6450},
    {-2450.3767,949.5080,-2400.8530,1069.8329},
    {-1715.5112,349.5567,-1658.8451,458.3686},
    {-2265.3027,-2586.3762,-2219.1868,-2558.2539},
    {-1657.4102,-2763.3518,-1501.5303,-2666.7454},
    {1903.7450,-1795.7990,1955.5667,-1759.5187},
    {-135.2077,-1199.8291,-43.7008,-1134.7999},
    {1336.7378,454.7961,1430.0760,483.9776},
    {648.2494,-592.9003,670.9278,-540.8264},
    {-1494.2593,1854.1290,-1449.4076,1885.2032},
    {2097.0452,2708.1218,2172.7161,2762.7495},
    {2187.6587,2462.8057,2215.5042,2495.0332},
    {1577.7729,2182.5112,1616.5842,2242.3628},
    {-2032.8051,151.5835,-2025.9789,161.0666},//REP
    {209.0048,22.1355,214.5006,26.9955},//Auspacken
    {-2670.8076,1265.9419,-2664.5745,1285.0740},//Maut Gant-Bridge 1
    {-2680.2283,1265.3031,-2674.1848,1283.6689},//Maut Gant-Bridge 2
    {-2689.0056,1265.6200,-2683.4087,1284.8154},//Maut Gant-Bridge 3
    {-2697.9836,1266.0608,-2692.3513,1284.0071}//Maut Gant-Bridge 4
    };



    new Float:checkpoints[MAX_POINTS][4] = {
    {2109.2126,917.5845,10.8203,5.0},
    {2640.1831,1103.9224,10.8203,5.0},
    {611.8934,1694.7921,6.7193,5.0},
    {-1327.5398,2682.9771,49.7896,5.0},
    {-2413.7427,975.9317,45.0031,5.0},
    {-1672.3597,414.2950,6.8866,5.0},
    {-2244.1365,-2560.6294,31.6276,5.0},
    {-1603.0166,-2709.3589,48.2419,5.0},
    {1939.3275,-1767.6813,13.2787,5.0},
    {-94.7651,-1174.8079,1.9979,5.0},
    {1381.6699,462.6467,19.8540,5.0},
    {657.8167,-559.6507,16.0630,5.0},
    {-1478.2916,1862.8318,32.3617,5.0},
    {2147.3054,2744.9377,10.5263,5.0},
    {2204.9602,2480.3494,10.5278,5.0},
    {1590.9493,2202.2637,10.5247,5.0},
    {96.4225,-153.4339,2.5748,5.0},//REP
    {-2029.9232,156.9431,28.8359,5.0},//Auspacken
    {-2667.9875,1275.6462,55.4297,5.0},//Maut Gant-Bridge 1
    {-2677.0127,1275.9338,55.4297,5.0},//Maut Gant-Bridge 2
    {-2685.9631,1274.7479,55.4297,5.0},//Maut Gant-Bridge 3
    {-2694.6104,1274.1815,55.4297,5.0}//Maut Gant-Bridge 4
    };


    Es wird niemals so viel gelogen wie vor der Wahl, während des Krieges und nach der Jagd.

    - Otto von Bismarck
    -