Fahrzeug tuning wird nicht richtig gespeichert

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
  • Hi,
    ich habe bei meinem Fahrzeug system gerade gemerkt das nicht alle tuning Teile gespeichert werden, bei meinem Jester waren zB alle Tuningteile weg ausser der paintjob und die farbe ...



    Hier sind einmal die Codes:

    //Enum ganz oben
    enum Car_System
    {
    cID,
    cModel,
    Float:cX,
    Float:cY,
    Float:cZ,
    Float:cR,
    tuning_0,
    tuning_1,
    tuning_2,
    tuning_3,
    tuning_4,
    tuning_5,
    tuning_6,
    tuning_7,
    tuning_8,
    tuning_9,
    tuning_10,
    tuning_11,
    tuning_12,
    tuning_13,
    color_1,
    color_2,
    paintjob,
    }
    new CarInfo[MAX_VEHICLES][Car_System];



    //Im OnGameModeInit zum laden
    for(new i = 1; i < MAX_VEHICLES; i++)//FAHRZEUGE
    {
    new string[32];
    format(string, sizeof(string), "/Vehicles/%d.car", i);
    if(dini_Int(string, "cID") > 0)
    {
    LadeFahrzeug(i);
    CreateVehicle(CarInfo[i][cModel], CarInfo[i][cX], CarInfo[i][cY], CarInfo[i][cZ], CarInfo[i][cR],0, 0, -1);

    new vehicleid = i;

    if(CarInfo[vehicleid][tuning_1] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_1]);


    } else if(CarInfo[vehicleid][tuning_2] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_2]);


    } else if(CarInfo[vehicleid][tuning_3] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_3]);


    } else if(CarInfo[vehicleid][tuning_4] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_4]);


    } else if(CarInfo[vehicleid][tuning_5] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_5]);


    } else if(CarInfo[vehicleid][tuning_6] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_6]);


    } else if(CarInfo[vehicleid][tuning_7] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_7]);


    } else if(CarInfo[vehicleid][tuning_8] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_8]);


    } else if(CarInfo[vehicleid][tuning_9] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_9]);


    } else if(CarInfo[vehicleid][tuning_10] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_10]);


    } else if(CarInfo[vehicleid][tuning_11] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_11]);


    } else if(CarInfo[vehicleid][tuning_12] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_12]);


    } else if(CarInfo[vehicleid][tuning_13] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_13]);


    }



    if(CarInfo[vehicleid][paintjob] > 0){
    ChangeVehiclePaintjob(vehicleid, CarInfo[vehicleid][paintjob]);
    }



    ChangeVehicleColor(vehicleid, CarInfo[vehicleid][color_1], CarInfo[vehicleid][color_1]);
    }
    }



    //OnGameModeExit zum speichern
    for(new i = 1; i < MAX_VEHICLES; i++)//FAHRZEUGE
    {
    SpeicherFahrzeug(i);
    }



    //OnVehicleSpawn
    SetVehiclePos(vehicleid, CarInfo[vehicleid][cX], CarInfo[vehicleid][cY], CarInfo[vehicleid][cZ]);
    SetVehicleZAngle(vehicleid, CarInfo[vehicleid][cR]);

    if(CarInfo[vehicleid][tuning_1] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_1]);

    } else if(CarInfo[vehicleid][tuning_2] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_2]);


    } else if(CarInfo[vehicleid][tuning_3] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_3]);


    } else if(CarInfo[vehicleid][tuning_4] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_4]);


    } else if(CarInfo[vehicleid][tuning_5] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_5]);


    } else if(CarInfo[vehicleid][tuning_6] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_6]);


    } else if(CarInfo[vehicleid][tuning_7] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_7]);


    } else if(CarInfo[vehicleid][tuning_8] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_8]);


    } else if(CarInfo[vehicleid][tuning_9] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_9]);


    } else if(CarInfo[vehicleid][tuning_10] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_10]);


    } else if(CarInfo[vehicleid][tuning_11] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_11]);


    } else if(CarInfo[vehicleid][tuning_12] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_12]);


    } else if(CarInfo[vehicleid][tuning_13] > 999){
    AddVehicleComponent(vehicleid, CarInfo[vehicleid][tuning_13]);


    }

    if(CarInfo[vehicleid][paintjob] > 0){
    ChangeVehiclePaintjob(vehicleid, CarInfo[vehicleid][paintjob]);
    }

    ChangeVehicleColor(vehicleid, CarInfo[vehicleid][color_1], CarInfo[vehicleid][color_1]);



    //OnVehicleMod
    if(CarInfo[vehicleid][tuning_0] < 1000){
    CarInfo[vehicleid][tuning_0] = componentid;

    } else if(CarInfo[vehicleid][tuning_1] < 1000){
    CarInfo[vehicleid][tuning_1] = componentid;

    } else if(CarInfo[vehicleid][tuning_2] < 1000){
    CarInfo[vehicleid][tuning_2] = componentid;

    } else if(CarInfo[vehicleid][tuning_3] < 1000){
    CarInfo[vehicleid][tuning_3] = componentid;

    } else if(CarInfo[vehicleid][tuning_4] < 1000){
    CarInfo[vehicleid][tuning_4] = componentid;

    } else if(CarInfo[vehicleid][tuning_5] < 1000){
    CarInfo[vehicleid][tuning_5] = componentid;

    } else if(CarInfo[vehicleid][tuning_6] < 1000){
    CarInfo[vehicleid][tuning_6] = componentid;

    } else if(CarInfo[vehicleid][tuning_7] < 1000){
    CarInfo[vehicleid][tuning_7] = componentid;

    } else if(CarInfo[vehicleid][tuning_8] < 1000){
    CarInfo[vehicleid][tuning_8] = componentid;

    } else if(CarInfo[vehicleid][tuning_9] < 1000){
    CarInfo[vehicleid][tuning_9] = componentid;

    } else if(CarInfo[vehicleid][tuning_10] < 1000){
    CarInfo[vehicleid][tuning_10] = componentid;

    } else if(CarInfo[vehicleid][tuning_11] < 1000){
    CarInfo[vehicleid][tuning_1] = componentid;

    } else if(CarInfo[vehicleid][tuning_12] < 1000){
    CarInfo[vehicleid][tuning_12] = componentid;

    } else if(CarInfo[vehicleid][tuning_13] < 1000){
    CarInfo[vehicleid][tuning_13] = componentid;
    }


    Ich hoffe ihr wisst warum das nicht funktioniert oder habt eine Idee ;(


    (PS: In meinem Vehicles Ordner erstellen 1999 car Datein obwohl es nur 2 Fahrzeuge gibt ... Warum?)


  • public SpeicherFahrzeug(carid)
    {
    if(carid <= 0)
    {
    return 1;
    }
    CarInfo[carid][cModel] = GetVehicleModel(carid);
    new str[25];
    format(str, sizeof(str), "/Vehicles/%d.car", carid);
    dini_Create(str);

    dini_IntSet(str,"cID",CarInfo[carid][cID]);
    dini_FloatSet(str,"cX", CarInfo[carid][cX]);
    dini_FloatSet(str,"cY", CarInfo[carid][cY]);
    dini_FloatSet(str,"cZ", CarInfo[carid][cZ]);
    dini_FloatSet(str,"cR", CarInfo[carid][cR]);
    dini_IntSet(str,"cModel",CarInfo[carid][cModel]);
    //tuning
    dini_IntSet(str, "tuning_0", CarInfo[carid][tuning_0]);
    dini_IntSet(str, "tuning_1", CarInfo[carid][tuning_1]);
    dini_IntSet(str, "tuning_2", CarInfo[carid][tuning_2]);
    dini_IntSet(str, "tuning_3", CarInfo[carid][tuning_3]);
    dini_IntSet(str, "tuning_4", CarInfo[carid][tuning_4]);
    dini_IntSet(str, "tuning_5", CarInfo[carid][tuning_5]);
    dini_IntSet(str, "tuning_6", CarInfo[carid][tuning_6]);
    dini_IntSet(str, "tuning_7", CarInfo[carid][tuning_7]);
    dini_IntSet(str, "tuning_8", CarInfo[carid][tuning_8]);
    dini_IntSet(str, "tuning_9", CarInfo[carid][tuning_9]);
    dini_IntSet(str, "tuning_10", CarInfo[carid][tuning_10]);
    dini_IntSet(str, "tuning_11", CarInfo[carid][tuning_11]);
    dini_IntSet(str, "tuning_12", CarInfo[carid][tuning_12]);
    dini_IntSet(str, "tuning_13", CarInfo[carid][tuning_13]);
    dini_IntSet(str, "color_1", CarInfo[carid][color_1]);
    dini_IntSet(str, "color_2", CarInfo[carid][color_2]);
    dini_IntSet(str, "paintjob", CarInfo[carid][paintjob]);

    return 1;
    }


    public LadeFahrzeug(carid)
    {
    new str[25];
    format(str, sizeof(str), "/Vehicles/%d.car", carid);

    if(carid == 0)
    {
    return 1;
    }
    if(fexist(str))
    {
    CarInfo[carid][cID] = dini_Int(str, "cID");
    CarInfo[carid][cX] = dini_Float(str, "cX");
    CarInfo[carid][cY] = dini_Float(str, "cY");
    CarInfo[carid][cZ] = dini_Float(str, "cZ");
    CarInfo[carid][cR] = dini_Float(str, "cR");
    CarInfo[carid][cModel] = dini_Int(str, "cModel");
    //tuning
    CarInfo[carid][tuning_0] = dini_Int(str, "tuning_0");
    CarInfo[carid][tuning_1] = dini_Int(str, "tuning_1");
    CarInfo[carid][tuning_2] = dini_Int(str, "tuning_2");
    CarInfo[carid][tuning_3] = dini_Int(str, "tuning_3");
    CarInfo[carid][tuning_4] = dini_Int(str, "tuning_4");
    CarInfo[carid][tuning_5] = dini_Int(str, "tuning_5");
    CarInfo[carid][tuning_6] = dini_Int(str, "tuning_6");
    CarInfo[carid][tuning_7] = dini_Int(str, "tuning_7");
    CarInfo[carid][tuning_8] = dini_Int(str, "tuning_8");
    CarInfo[carid][tuning_9] = dini_Int(str, "tuning_9");
    CarInfo[carid][tuning_10] = dini_Int(str, "tuning_10");
    CarInfo[carid][tuning_11] = dini_Int(str, "tuning_11");
    CarInfo[carid][tuning_12] = dini_Int(str, "tuning_12");
    CarInfo[carid][tuning_13] = dini_Int(str, "tuning_13");
    CarInfo[carid][color_1] = dini_Int(str, "color_1");
    CarInfo[carid][color_2] = dini_Int(str, "color_2");
    CarInfo[carid][paintjob] = dini_Int(str, "paintjob");
    }
    return 1;
    }

  • Beim Laden
    CreateVehicle(CarInfo[i][cModel], CarInfo[i][cX], CarInfo[i][cY], CarInfo[i][cZ], CarInfo[i][cR],0, 0, -1);
    zu:
    CarInfo[i][cID] = CreateVehicle(CarInfo[i][cModel], CarInfo[i][cX], CarInfo[i][cY], CarInfo[i][cZ], CarInfo[i][cR],0, 0, -1);


    und:
    new vehicleid = i;
    zu:
    new vehicleid = CarInfo[i][cID];


    Und bei SpeicherFahrzeug:
    CarInfo[carid][cModel] = GetVehicleModel(carid);
    zu:
    CarInfo[carid][cModel] = GetVehicleModel(carid);
    if(CarInfo[carid][cModel] == 0) return 1;

  • Okay ich habe die Zeilen bearbeitet sodass sie so sind wie die die du geschrieben hast. Es erstellen sich nach dem gmx schonmal keine 1999 Datein aber das tuning speichert er trotzdem nicht ... Ich habe einen voll getunten Jester geparkt und dann zerstört aber er war wieder normal nur mit dem paintjob und der farbe. In der Datei des Fahrzeugs speichert es auch kein tuning:


    Liegt der Fehler eventuell im OnVehicleMod?

  • Du kannst doch einfach das enum kleiner machen.

    enum Car_System
    {
    cID,
    cModel,
    Float:cX,
    Float:cY,
    Float:cZ,
    Float:cR,
    tuning_0,
    tuning_1,
    tuning_2,
    tuning_3,
    tuning_4,
    tuning_5,
    tuning_6,
    tuning_7,
    tuning_8,
    tuning_9,
    tuning_10,
    tuning_11,
    tuning_12,
    tuning_13,
    color_1,
    color_2,
    paintjob,
    }
    new CarInfo[MAX_VEHICLES][Car_System];



    zu:
    enum Car_System
    {
    cID,
    cModel,
    Float:cPos[4],
    tuning[14],
    color[2],
    paintjob,
    }
    new CarInfo[MAX_VEHICLES][Car_System];


    schreib mal bitte dein OnVehicleMod hierrein.


    Mehr transparents zu der Community!
    Aber bitte künftig: Transparenz und nicht Transparents

    Einmal editiert, zuletzt von Kevin_CaruZo ()

  • Ändere die "vehicleid" die mit CarInfo zu tun haben in OnVehicleSpawn und OnVehicleMod alle zu:
    idx


    und füge das ganz unten im Gamemode ein:
    stock GetIdx(vehicleid)
    {
    if(vehicleid != 0)
    {
    for(new i=0; i<sizeof(CarInfo); i++)
    {
    if(CarInfo[i][cID] == vehicleid) return i;
    }
    }
    return -1;
    }


    Und füge jeweils am Anfang von OnVehicleSpawn / OnVehicleMod das ein:
    new idx = GetIdx(vehicleid);
    if(idx == -1) return 1;

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

  • public SpeicherFahrzeug(carid)
    {
    if(carid <= 0)
    {
    return 1;
    }
    CarInfo[carid][cModel] = GetVehicleModel(carid);
    if(CarInfo[carid][cModel] == 0) return 1;
    new str[25];
    format(str, sizeof(str), "/Vehicles/%d.car", carid);
    dini_Create(str);

    dini_IntSet(str,"cID",CarInfo[carid][cID]);
    dini_FloatSet(str,"cX", CarInfo[carid][cX]);
    dini_FloatSet(str,"cY", CarInfo[carid][cY]);
    dini_FloatSet(str,"cZ", CarInfo[carid][cZ]);
    dini_FloatSet(str,"cR", CarInfo[carid][cR]);
    dini_IntSet(str,"cModel",CarInfo[carid][cModel]);
    //tuning
    dini_IntSet(str, "tuning_0", CarInfo[carid][tuning_0]);
    dini_IntSet(str, "tuning_1", CarInfo[carid][tuning_1]);
    dini_IntSet(str, "tuning_2", CarInfo[carid][tuning_2]);
    dini_IntSet(str, "tuning_3", CarInfo[carid][tuning_3]);
    dini_IntSet(str, "tuning_4", CarInfo[carid][tuning_4]);
    dini_IntSet(str, "tuning_5", CarInfo[carid][tuning_5]);
    dini_IntSet(str, "tuning_6", CarInfo[carid][tuning_6]);
    dini_IntSet(str, "tuning_7", CarInfo[carid][tuning_7]);
    dini_IntSet(str, "tuning_8", CarInfo[carid][tuning_8]);
    dini_IntSet(str, "tuning_9", CarInfo[carid][tuning_9]);
    dini_IntSet(str, "tuning_10", CarInfo[carid][tuning_10]);
    dini_IntSet(str, "tuning_11", CarInfo[carid][tuning_11]);
    dini_IntSet(str, "tuning_12", CarInfo[carid][tuning_12]);
    dini_IntSet(str, "tuning_13", CarInfo[carid][tuning_13]);
    dini_IntSet(str, "color_1", CarInfo[carid][color_1]);
    dini_IntSet(str, "color_2", CarInfo[carid][color_2]);
    dini_IntSet(str, "paintjob", CarInfo[carid][paintjob]);

    return 1;
    }



    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    new idx = GetIdx(vehicleid);
    if(idx == -1) return 1;


    if(CarInfo[idx][tuning_0] > 999){
    CarInfo[idx][tuning_0] = componentid;

    } else if(CarInfo[idx][tuning_1] > 999){
    CarInfo[idx][tuning_1] = componentid;

    } else if(CarInfo[idx][tuning_2] > 999){
    CarInfo[idx][tuning_2] = componentid;

    } else if(CarInfo[idx][tuning_3] > 999){
    CarInfo[idx][tuning_3] = componentid;

    } else if(CarInfo[idx][tuning_4] > 999){
    CarInfo[idx][tuning_4] = componentid;

    } else if(CarInfo[idx][tuning_5] > 999){
    CarInfo[idx][tuning_5] = componentid;

    } else if(CarInfo[idx][tuning_6] > 999){
    CarInfo[idx][tuning_6] = componentid;

    } else if(CarInfo[idx][tuning_7] > 999){
    CarInfo[idx][tuning_7] = componentid;

    } else if(CarInfo[idx][tuning_8] > 999){
    CarInfo[idx][tuning_8] = componentid;

    } else if(CarInfo[idx][tuning_9] > 999){
    CarInfo[idx][tuning_9] = componentid;

    } else if(CarInfo[idx][tuning_10] > 999){
    CarInfo[idx][tuning_10] = componentid;

    } else if(CarInfo[idx][tuning_11] > 999){
    CarInfo[idx][tuning_1] = componentid;

    } else if(CarInfo[idx][tuning_12] > 999){
    CarInfo[idx][tuning_12] = componentid;

    } else if(CarInfo[idx][tuning_13] > 999){
    CarInfo[idx][tuning_13] = componentid;
    }


    if(GetPlayerInterior(playerid) == 0)
    {
    BanEx(playerid, "Tuning Hack"); // Anti-tuning hack
    }
    return 1;
    }

  • if(CarInfo[idx][tuning_0] > 999){
    zu:
    if(CarInfo[idx][tuning_0] < 999){
    Natürlich bei allen in OnVehicleMod.


    Und:
    CarInfo[carid][cModel] = GetVehicleModel(carid);
    zu:
    CarInfo[carid][cModel] = GetVehicleModel(CarInfo[carid][cID]);


  • public OnVehicleMod(playerid, vehicleid, componentid)
    {
    new idx = GetIdx(vehicleid);
    if(idx == -1) return 1;


    if(CarInfo[idx][tuning_0] < 999){
    CarInfo[idx][tuning_0] = componentid;

    } else if(CarInfo[idx][tuning_1] < 999){
    CarInfo[idx][tuning_1] = componentid;

    } else if(CarInfo[idx][tuning_2] < 999){
    CarInfo[idx][tuning_2] = componentid;

    } else if(CarInfo[idx][tuning_3] < 999){
    CarInfo[idx][tuning_3] = componentid;

    } else if(CarInfo[idx][tuning_4] < 999){
    CarInfo[idx][tuning_4] = componentid;

    } else if(CarInfo[idx][tuning_5] < 999){
    CarInfo[idx][tuning_5] = componentid;

    } else if(CarInfo[idx][tuning_6] < 999){
    CarInfo[idx][tuning_6] = componentid;

    } else if(CarInfo[idx][tuning_7] < 999){
    CarInfo[idx][tuning_7] = componentid;

    } else if(CarInfo[idx][tuning_8] < 999){
    CarInfo[idx][tuning_8] = componentid;

    } else if(CarInfo[idx][tuning_9] < 999){
    CarInfo[idx][tuning_9] = componentid;

    } else if(CarInfo[idx][tuning_10] < 999){
    CarInfo[idx][tuning_10] = componentid;

    } else if(CarInfo[idx][tuning_11] < 999){
    CarInfo[idx][tuning_1] = componentid;

    } else if(CarInfo[idx][tuning_12] < 999){
    CarInfo[idx][tuning_12] = componentid;

    } else if(CarInfo[idx][tuning_13] < 999){
    CarInfo[idx][tuning_13] = componentid;
    }


    if(GetPlayerInterior(playerid) == 0)
    {
    BanEx(playerid, "Tuning Hack"); // Anti-tuning hacks script
    //(Tested and it works even on servers wich allow you to mod your vehicle using commands, menus, dialogs, etc..
    }
    return 1;
    }



    public SpeicherFahrzeug(carid)
    {
    if(carid <= 0)
    {
    return 1;
    }
    CarInfo[carid][cModel] = GetVehicleModel(CarInfo[carid][cID]);
    if(CarInfo[carid][cModel] == 0) return 1;
    new str[25];
    format(str, sizeof(str), "/Vehicles/%d.car", carid);
    dini_Create(str);

    dini_IntSet(str,"cID",CarInfo[carid][cID]);
    dini_FloatSet(str,"cX", CarInfo[carid][cX]);
    dini_FloatSet(str,"cY", CarInfo[carid][cY]);
    dini_FloatSet(str,"cZ", CarInfo[carid][cZ]);
    dini_FloatSet(str,"cR", CarInfo[carid][cR]);
    dini_IntSet(str,"cModel",CarInfo[carid][cModel]);
    //tuning
    dini_IntSet(str, "tuning_0", CarInfo[carid][tuning_0]);
    dini_IntSet(str, "tuning_1", CarInfo[carid][tuning_1]);
    dini_IntSet(str, "tuning_2", CarInfo[carid][tuning_2]);
    dini_IntSet(str, "tuning_3", CarInfo[carid][tuning_3]);
    dini_IntSet(str, "tuning_4", CarInfo[carid][tuning_4]);
    dini_IntSet(str, "tuning_5", CarInfo[carid][tuning_5]);
    dini_IntSet(str, "tuning_6", CarInfo[carid][tuning_6]);
    dini_IntSet(str, "tuning_7", CarInfo[carid][tuning_7]);
    dini_IntSet(str, "tuning_8", CarInfo[carid][tuning_8]);
    dini_IntSet(str, "tuning_9", CarInfo[carid][tuning_9]);
    dini_IntSet(str, "tuning_10", CarInfo[carid][tuning_10]);
    dini_IntSet(str, "tuning_11", CarInfo[carid][tuning_11]);
    dini_IntSet(str, "tuning_12", CarInfo[carid][tuning_12]);
    dini_IntSet(str, "tuning_13", CarInfo[carid][tuning_13]);
    dini_IntSet(str, "color_1", CarInfo[carid][color_1]);
    dini_IntSet(str, "color_2", CarInfo[carid][color_2]);
    dini_IntSet(str, "paintjob", CarInfo[carid][paintjob]);

    return 1;
    }

  • Ok, dann schreibe es so und poste dann was im Server Log steht wenn du ein Fahrzeug tunst und es dann speicherst.

    Spoiler anzeigen
    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    printf("vehicleid: %d / componentid: %d", vehicleid, componentid);
    new idx = GetIdx(vehicleid);
    if(idx == -1) return 1;

    printf("idx: %d -> %d", idx, CarInfo[idx][tuning_0]);
    if(CarInfo[idx][tuning_0] < 999){
    CarInfo[idx][tuning_0] = componentid;
    printf("0");
    } else if(CarInfo[idx][tuning_1] < 999){
    CarInfo[idx][tuning_1] = componentid;
    printf("1");
    } else if(CarInfo[idx][tuning_2] < 999){
    CarInfo[idx][tuning_2] = componentid;
    printf("2");
    } else if(CarInfo[idx][tuning_3] < 999){
    CarInfo[idx][tuning_3] = componentid;
    printf("3");
    } else if(CarInfo[idx][tuning_4] < 999){
    CarInfo[idx][tuning_4] = componentid;
    printf("4");
    } else if(CarInfo[idx][tuning_5] < 999){
    CarInfo[idx][tuning_5] = componentid;
    printf("5");
    } else if(CarInfo[idx][tuning_6] < 999){
    CarInfo[idx][tuning_6] = componentid;
    printf("6");
    } else if(CarInfo[idx][tuning_7] < 999){
    CarInfo[idx][tuning_7] = componentid;
    printf("7");
    } else if(CarInfo[idx][tuning_8] < 999){
    CarInfo[idx][tuning_8] = componentid;
    printf("8");
    } else if(CarInfo[idx][tuning_9] < 999){
    CarInfo[idx][tuning_9] = componentid;
    printf("9");
    } else if(CarInfo[idx][tuning_10] < 999){
    CarInfo[idx][tuning_10] = componentid;
    printf("10");
    } else if(CarInfo[idx][tuning_11] < 999){
    CarInfo[idx][tuning_1] = componentid;
    printf("11");
    } else if(CarInfo[idx][tuning_12] < 999){
    CarInfo[idx][tuning_12] = componentid;
    printf("12");
    } else if(CarInfo[idx][tuning_13] < 999){
    CarInfo[idx][tuning_13] = componentid;
    printf("13");
    }

    Spoiler anzeigen

    if(GetPlayerInterior(playerid) == 0)
    {
    BanEx(playerid, "Tuning Hack"); // Anti-tuning hacks script
    //(Tested and it works even on servers wich allow you to mod your vehicle using commands, menus, dialogs, etc..
    }
    return 1;
    }

    Spoiler anzeigen
    public SpeicherFahrzeug(carid)
    {
    if(carid <= 0)
    {
    return 1;
    }
    CarInfo[carid][cModel] = GetVehicleModel(CarInfo[carid][cID]);
    printf("Model: %d / carid: %d", CarInfo[carid][cModel], carid);
    if(CarInfo[carid][cModel] == 0) return 1;
    new str[25];
    format(str, sizeof(str), "/Vehicles/%d.car", carid);
    dini_Create(str);

    dini_IntSet(str,"cID",CarInfo[carid][cID]);
    dini_FloatSet(str,"cX", CarInfo[carid][cX]);
    dini_FloatSet(str,"cY", CarInfo[carid][cY]);
    dini_FloatSet(str,"cZ", CarInfo[carid][cZ]);
    dini_FloatSet(str,"cR", CarInfo[carid][cR]);
    dini_IntSet(str,"cModel",CarInfo[carid][cModel]);
    //tuning
    dini_IntSet(str, "tuning_0", CarInfo[carid][tuning_0]);
    dini_IntSet(str, "tuning_1", CarInfo[carid][tuning_1]);
    dini_IntSet(str, "tuning_2", CarInfo[carid][tuning_2]);
    dini_IntSet(str, "tuning_3", CarInfo[carid][tuning_3]);
    dini_IntSet(str, "tuning_4", CarInfo[carid][tuning_4]);
    dini_IntSet(str, "tuning_5", CarInfo[carid][tuning_5]);
    dini_IntSet(str, "tuning_6", CarInfo[carid][tuning_6]);
    dini_IntSet(str, "tuning_7", CarInfo[carid][tuning_7]);
    dini_IntSet(str, "tuning_8", CarInfo[carid][tuning_8]);
    dini_IntSet(str, "tuning_9", CarInfo[carid][tuning_9]);
    dini_IntSet(str, "tuning_10", CarInfo[carid][tuning_10]);
    dini_IntSet(str, "tuning_11", CarInfo[carid][tuning_11]);
    dini_IntSet(str, "tuning_12", CarInfo[carid][tuning_12]);
    dini_IntSet(str, "tuning_13", CarInfo[carid][tuning_13]);
    dini_IntSet(str, "color_1", CarInfo[carid][color_1]);
    dini_IntSet(str, "color_2", CarInfo[carid][color_2]);
    dini_IntSet(str, "paintjob", CarInfo[carid][paintjob]);

    return 1;
    }

  • Das kommt beim tuning:


    Und das beim speichern:
    http://pastebin.com/yqTnjgu8



    In der Datei hatt er es jetzt aber auch is aber immernoch nich drin das tuning

  • ja aber es ist nicht getunt ... also es wird anscheind doch gespeichert aber dann lädt es nicht ;(



    public LadeFahrzeug(carid)
    {
    new str[25];
    format(str, sizeof(str), "/Vehicles/%d.car", carid);

    if(carid == 0)
    {
    return 1;
    }
    if(fexist(str))
    {
    CarInfo[carid][cID] = dini_Int(str, "cID");
    CarInfo[carid][cX] = dini_Float(str, "cX");
    CarInfo[carid][cY] = dini_Float(str, "cY");
    CarInfo[carid][cZ] = dini_Float(str, "cZ");
    CarInfo[carid][cR] = dini_Float(str, "cR");
    CarInfo[carid][cModel] = dini_Int(str, "cModel");
    //tuning
    CarInfo[carid][tuning_0] = dini_Int(str, "tuning_0");
    CarInfo[carid][tuning_1] = dini_Int(str, "tuning_1");
    CarInfo[carid][tuning_2] = dini_Int(str, "tuning_2");
    CarInfo[carid][tuning_3] = dini_Int(str, "tuning_3");
    CarInfo[carid][tuning_4] = dini_Int(str, "tuning_4");
    CarInfo[carid][tuning_5] = dini_Int(str, "tuning_5");
    CarInfo[carid][tuning_6] = dini_Int(str, "tuning_6");
    CarInfo[carid][tuning_7] = dini_Int(str, "tuning_7");
    CarInfo[carid][tuning_8] = dini_Int(str, "tuning_8");
    CarInfo[carid][tuning_9] = dini_Int(str, "tuning_9");
    CarInfo[carid][tuning_10] = dini_Int(str, "tuning_10");
    CarInfo[carid][tuning_11] = dini_Int(str, "tuning_11");
    CarInfo[carid][tuning_12] = dini_Int(str, "tuning_12");
    CarInfo[carid][tuning_13] = dini_Int(str, "tuning_13");
    CarInfo[carid][color_1] = dini_Int(str, "color_1");
    CarInfo[carid][color_2] = dini_Int(str, "color_2");
    CarInfo[carid][paintjob] = dini_Int(str, "paintjob");
    }
    return 1;
    }