AutoHaus System [Auto spawnt nicht nach neustart]

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
  • Hallo ich habe ein Problem, das gekaufte Auto spawnt nicht nach Server neustart, Explosion.
    Jedoch finde ich keinen fehler, vielleicht könnt ihr mir dabei helfen!


    public OnPlayerConnect(playerid)
    {
    new file[256], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"Cars/%s.ini",name);
    if(dini_Exists(file))
    {
    VehicleInfo[playerid][Model] = dini_Int(file, "Model");
    VehicleInfo[playerid][Price] = dini_Int(file, "Price");
    VehicleInfo[playerid][CarX] = dini_Float(file, "X");
    VehicleInfo[playerid][CarY] = dini_Float(file, "Y");
    VehicleInfo[playerid][CarZ] = dini_Float(file, "Z");
    VehicleInfo[playerid][CarRot] = dini_Float(file, "Rot");
    VehicleInfo[playerid][Locked] = dini_Int(file, "Locked");
    VehicleInfo[playerid][mod1] = dini_Int(file, "mod1");
    VehicleInfo[playerid][mod2] = dini_Int(file, "mod2");
    VehicleInfo[playerid][mod3] = dini_Int(file, "mod3");
    VehicleInfo[playerid][mod4] = dini_Int(file, "mod4");
    VehicleInfo[playerid][mod5] = dini_Int(file, "mod5");
    VehicleInfo[playerid][mod6] = dini_Int(file, "mod6");
    VehicleInfo[playerid][mod7] = dini_Int(file, "mod7");
    VehicleInfo[playerid][mod8] = dini_Int(file, "mod8");
    VehicleInfo[playerid][mod9] = dini_Int(file, "mod9");
    VehicleInfo[playerid][mod10] = dini_Int(file, "mod10");
    VehicleInfo[playerid][mod11] = dini_Int(file, "mod11");
    VehicleInfo[playerid][mod12] = dini_Int(file, "mod12");
    VehicleInfo[playerid][mod13] = dini_Int(file, "mod13");
    VehicleInfo[playerid][mod14] = dini_Int(file, "mod14");
    VehicleInfo[playerid][mod15] = dini_Int(file, "mod15");
    VehicleInfo[playerid][mod16] = dini_Int(file, "mod16");
    VehicleInfo[playerid][mod17] = dini_Int(file, "mod17");
    VehicleInfo[playerid][paintjob] = dini_Int(file, "paintjob");
    VehicleInfo[playerid][colora] = dini_Int(file, "color1");
    VehicleInfo[playerid][colorb] = dini_Int(file, "color2");
    Vehicle[playerid] = AddStaticVehicle(VehicleInfo[playerid][Model], VehicleInfo[playerid][CarX], VehicleInfo[playerid][CarY], VehicleInfo[playerid][CarZ], VehicleInfo[playerid][CarRot], VehicleInfo[playerid][colora], VehicleInfo[playerid][colorb]);
    if(VehicleInfo[playerid][mod1]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod1]); }
    if(VehicleInfo[playerid][mod2]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod2]); }
    if(VehicleInfo[playerid][mod3]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod3]); }
    if(VehicleInfo[playerid][mod4]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod4]); }
    if(VehicleInfo[playerid][mod5]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod5]); }
    if(VehicleInfo[playerid][mod6]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod6]); }
    if(VehicleInfo[playerid][mod7]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod7]); }
    if(VehicleInfo[playerid][mod8]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod8]); }
    if(VehicleInfo[playerid][mod9]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod9]); }
    if(VehicleInfo[playerid][mod10]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod10]); }
    if(VehicleInfo[playerid][mod11]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod11]); }
    if(VehicleInfo[playerid][mod12]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod12]); }
    if(VehicleInfo[playerid][mod13]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod13]); }
    if(VehicleInfo[playerid][mod14]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod14]); }
    if(VehicleInfo[playerid][mod15]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod15]); }
    if(VehicleInfo[playerid][mod16]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod16]); }
    if(VehicleInfo[playerid][mod17]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod17]); }


    if(VehicleInfo[playerid][paintjob]!=0)
    {
    ChangeVehiclePaintjob(Vehicle[playerid],VehicleInfo[playerid][paintjob]);
    }
    new tmp[256]; tmp = dini_Get(file, "Plate");
    gPlayerHasCar[playerid] = 1;
    VehOwned[Vehicle[playerid]] = 1;
    OwnerID[Vehicle[playerid]] = playerid;
    SetVehicleParamsForPlayer(Vehicle[playerid], playerid, 0, VehicleInfo[playerid][Locked]);
    gVehLocked[Vehicle[playerid]] = VehicleInfo[playerid][Locked];
    SetVehicleNumberPlate(Vehicle[playerid], tmp);
    VehPlate[Vehicle[playerid]] = tmp;
    LoadTrunk(playerid);
    }
    return 1;
    }


    /Cars/*name.ini


    Model=561
    Price=9000
    X=1453.484741
    Y=-1750.850463
    Z=13.360281
    Rot=178.491973
    Locked=1
    Plate=XYZR 000
    mod1=0
    mod2=0
    mod3=0
    mod4=0
    mod5=0
    mod6=0
    mod7=0
    mod8=0
    mod9=0
    mod10=0
    mod11=0
    mod12=0
    mod13=0
    mod14=0
    mod15=0
    mod16=0
    mod17=0
    paintjob=0
    color1=0
    color2=0

    ¨
    Warum spawnt es nicht??? Es scheint wirklich alles richtig zu sein!