[Hilfe] Hauscar Bug

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
  • Guten Abend liebe Bradfish Community,


    ich habe folgenen Bug:


    Ich kaufe mir ein Hauscar parke es vor mein Haus mache GMX und aufeinmal spawnen 2 Hauscars dort, obwohl ich nur eins gekauft habe.
    Ich weiß auch nicht wo der Fehler stecken könnte ... das aufeinmal 2 Autos dort sind.


    Screen:



    Es wäre echt klasse wenn jemand eine Idee hätte. Bitte meldet euch !


    MfG Sleezed

  • Hier ist der park Befehl + wie es gesaved und geladen wird.


    if (strcmp("/park", cmd, true, 10) == 0)
    {
    if (IsPlayerInVehicle(playerid,Carlist[playerid][Carid]))
    {
    GetVehiclePos(Carlist[playerid][Carid],Carlist[playerid][pos_x],Carlist[playerid][pos_y],Carlist[playerid][pos_z]);
    GetVehicleZAngle(Carlist[playerid][Carid],Carlist[playerid][z_angle]);
    SendClientMessage(playerid, COLOR_GREEN, "Fahrzeug geparkt!");
    }



    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Du sitzt nicht in deinem eigenen Auto!");
    }
    return true;
    }
    Carlist[playerid][Typ]=-1; Carlist[playerid][pos_x]=0.0; Carlist[playerid][pos_y]=0.0; Carlist[playerid][pos_z]=0.0;
    Carlist[playerid][z_angle]=0.0; Carlist[playerid][Status]=0; Carlist[playerid][Lock]=0; Carlist[playerid][Carid]=-1;
    Carlist[playerid][Farbe1]=-1; Carlist[playerid][Farbe2]=-1; Carlist[playerid][mod1]=-1; Carlist[playerid][mod2]=-1;
    Carlist[playerid][mod3]=-1; Carlist[playerid][mod4]=-1; Carlist[playerid][mod5]=-1; Carlist[playerid][mod6]=-1;
    Carlist[playerid][mod7]=-1; Carlist[playerid][mod8]=-1; Carlist[playerid][mod9]=-1; Carlist[playerid][mod10]=-1;
    Carlist[playerid][mod11]=-1; Carlist[playerid][mod12]=-1; Carlist[playerid][mod13]=-1; Carlist[playerid][mod14]=-1;
    Carlist[playerid][mod15]=-1; Carlist[playerid][mod16]=-1; Carlist[playerid][mod17]=-1; Carlist[playerid][Paintjob]=-1;
    Spectating[playerid][0]=-1;
    #if defined CARSELL
    bietetAn[playerid]={-1,0};
    #endif
    GetPlayerName(playerid, playername, sizeof(playername));
    format(dateiname, sizeof(dateiname), "Autos/%s.car", playername);
    if (fexist(dateiname))
    {
    new File: CarFile = fopen(dateiname, io_read);
    if ( CarFile )
    {
    new key[ 256 ];
    new Data[ 256 ];
    while ( fread( CarFile , Data , sizeof( Data ) ) )
    {
    key = ini_GetKey(Data);
    if(strcmp(key,"AH_Typ",true)==0) { Carlist[playerid][Typ]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_X",true)==0) { Carlist[playerid][pos_x]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Y",true)==0) { Carlist[playerid][pos_y]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Z",true)==0) { Carlist[playerid][pos_z]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Rot",true)==0) { Carlist[playerid][z_angle]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Status",true)==0) { Carlist[playerid][Status]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Lock",true)==0) { Carlist[playerid][Lock]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Paintjob",true)==0) { Carlist[playerid][Paintjob]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Farbe1",true)==0) { Carlist[playerid][Farbe1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Farbe2",true)==0) { Carlist[playerid][Farbe2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod1",true)==0) { Carlist[playerid][mod1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod2",true)==0) { Carlist[playerid][mod2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod3",true)==0) { Carlist[playerid][mod3]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod4",true)==0) { Carlist[playerid][mod4]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod5",true)==0) { Carlist[playerid][mod5]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod6",true)==0) { Carlist[playerid][mod6]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod7",true)==0) { Carlist[playerid][mod7]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod8",true)==0) { Carlist[playerid][mod8]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod9",true)==0) { Carlist[playerid][mod9]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod10",true)==0) { Carlist[playerid][mod10]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod11",true)==0) { Carlist[playerid][mod11]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod12",true)==0) { Carlist[playerid][mod12]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod13",true)==0) { Carlist[playerid][mod13]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod14",true)==0) { Carlist[playerid][mod14]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod15",true)==0) { Carlist[playerid][mod15]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod16",true)==0) { Carlist[playerid][mod16]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod17",true)==0) { Carlist[playerid][mod17]=strval(ini_GetValue(Data)); }
    }
    }
    fclose(CarFile);
    if(Carlist[playerid][Typ]!=-1 && Carlist[playerid][Status]==1)
    {
    Carlist[playerid][Carid]=CreateTunedCar(playerid);
    }
    }


    AH_Typ=1
    AH_X=1519.185791
    AH_Y=-1707.286743
    AH_Z=13.307182
    AH_Rot=181.362426
    AH_Status=1
    AH_Lock=0
    AH_Paintjob=-1
    AH_Farbe1=-1
    AH_Farbe2=-1
    AH_mod1=-1
    AH_mod2=-1
    AH_mod3=-1
    AH_mod4=-1
    AH_mod5=-1
    AH_mod6=-1
    AH_mod7=-1
    AH_mod8=-1
    AH_mod9=-1
    AH_mod10=-1
    AH_mod11=-1
    AH_mod12=-1
    AH_mod13=-1
    AH_mod14=-1
    AH_mod15=-1
    AH_mod16=-1
    AH_mod17=-1

  • Ich glaube der erste Teil den ich gepostet habe war der zum Laden und der jetzt hier zum speichern!


    ShiftInfo[playerid] = (ShiftInfo[playerid] == false) ? (true) : (true);
    #if defined AUTOHAUS
    new dateiname[MAX_PLAYER_NAME+4];
    new playername[MAX_PLAYER_NAME];
    new var[256];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(dateiname, sizeof(dateiname), "Autos/%s.car", playername);
    new File: CarFile = fopen(dateiname, io_write);
    format(var, 256, "AH_Typ=%i\n", Carlist[playerid][Typ]); fwrite(CarFile, var);
    format(var, 256, "AH_X=%f\n", Carlist[playerid][pos_x]); fwrite(CarFile, var);
    format(var, 256, "AH_Y=%f\n", Carlist[playerid][pos_y]); fwrite(CarFile, var);
    format(var, 256, "AH_Z=%f\n", Carlist[playerid][pos_z]); fwrite(CarFile, var);
    format(var, 256, "AH_Rot=%f\n", Carlist[playerid][z_angle]); fwrite(CarFile, var);
    format(var, 256, "AH_Status=%i\n", Carlist[playerid][Status]); fwrite(CarFile, var);
    format(var, 256, "AH_Lock=%i\n", Carlist[playerid][Lock]); fwrite(CarFile, var);
    format(var, 256, "AH_Paintjob=%i\n", Carlist[playerid][Paintjob]); fwrite(CarFile, var);
    format(var, 256, "AH_Farbe1=%i\n", Carlist[playerid][Farbe1]); fwrite(CarFile, var);
    format(var, 256, "AH_Farbe2=%i\n", Carlist[playerid][Farbe2]); fwrite(CarFile, var);
    format(var, 256, "AH_mod1=%i\n", Carlist[playerid][mod1]); fwrite(CarFile, var);
    format(var, 256, "AH_mod2=%i\n", Carlist[playerid][mod2]); fwrite(CarFile, var);
    format(var, 256, "AH_mod3=%i\n", Carlist[playerid][mod3]); fwrite(CarFile, var);
    format(var, 256, "AH_mod4=%i\n", Carlist[playerid][mod4]); fwrite(CarFile, var);
    format(var, 256, "AH_mod5=%i\n", Carlist[playerid][mod5]); fwrite(CarFile, var);
    format(var, 256, "AH_mod6=%i\n", Carlist[playerid][mod6]); fwrite(CarFile, var);
    format(var, 256, "AH_mod7=%i\n", Carlist[playerid][mod7]); fwrite(CarFile, var);
    format(var, 256, "AH_mod8=%i\n", Carlist[playerid][mod8]); fwrite(CarFile, var);
    format(var, 256, "AH_mod9=%i\n", Carlist[playerid][mod9]); fwrite(CarFile, var);
    format(var, 256, "AH_mod10=%i\n", Carlist[playerid][mod10]); fwrite(CarFile, var);
    format(var, 256, "AH_mod11=%i\n", Carlist[playerid][mod11]); fwrite(CarFile, var);
    format(var, 256, "AH_mod12=%i\n", Carlist[playerid][mod12]); fwrite(CarFile, var);
    format(var, 256, "AH_mod13=%i\n", Carlist[playerid][mod13]); fwrite(CarFile, var);
    format(var, 256, "AH_mod14=%i\n", Carlist[playerid][mod14]); fwrite(CarFile, var);
    format(var, 256, "AH_mod15=%i\n", Carlist[playerid][mod15]); fwrite(CarFile, var);
    format(var, 256, "AH_mod16=%i\n", Carlist[playerid][mod16]); fwrite(CarFile, var);
    format(var, 256, "AH_mod17=%i\n", Carlist[playerid][mod17]); fwrite(CarFile, var);
    fclose(CarFile);
    if(Carlist[playerid][Carid]!=-1)
    {
    SetVehicleParamsForAll(Carlist[playerid][Carid],0,0);
    DestroyVehicle(Carlist[playerid][Carid]);
    Carlist[playerid][Carid]=-1;
    Delete3DTextLabel(VehicleLicense[playerid]);
    }


    Danke im vorraus =D