Kann mal jemand drüberschauen? /auspacken

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
  • //-------------------------------------------------("Transport Service")-------------------------------------------------
    if(strcmp(cmd, "/auspacken", true)==0 && gTeam[playerid] == TEAM_SPEDITION){
    if(IsPlayerInAnyVehicle(playerid)){
    if(PlayerToPoint(5.0, playerid, -1928.7926,277.4234,41.0469)){
    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,500);


    }
    }
    }
    return 1;
    }

    Der Befehl /auspacken funktioniert leider nicht. Woran kann das liegen?

  • wenn du die warnings oder errors hin tust kann dir bestimmt jemand sagn ^^ und die zeilen :thumbup:

  • Hab den Fehler evtl.


    Du sitzt doch im Auto ....


    if(IsPlayerInRangeOfPoint(playerid,5.0,-1928.7926,277.4234,41.0469))

  • if(strcmp(cmd, "/auspacken", true)==0)
    {
    if(gTeam[playerid] == TEAM_SPEDITION)
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    if(PlayerToPoint(5.0, playerid, -1928.7926,277.4234,41.0469))
    {
    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,500);
    }
    }
    }
    }
    else
    }
    SendClientMessage(playerid,COLOR,RED,"Du bist kein Kraftfahrer");
    }
    return 1;
    }


    Vlt gehts so ? Musst mal schauen ob du auch Kraftfahrer bist vom Script her..


    Lg

  • Hallo Danke an euch beiden doch bei beiden Vorschlägen die ihr gemacht habt stürtzt der Compieler ab!

  • if(strcmp(cmd, "/auspacken", true)==0)
    {
    if(gTeam[playerid] == TEAM_SPEDITION)
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    if(PlayerToPoint(5.0, playerid, -1928.7926,277.4234,41.0469))
    {
    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,500);
    }
    }
    }
    }
    else
    {
    SendClientMessage(playerid,COLOR,RED,"Du bist kein Kraftfahrer");
    }
    return 1;
    }


    So müsste es gehen Sorry^^

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen