Privatfahrzeuge Problem

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
  • Ich habe das standard Autohaus-System von LARP,
    das Problem ist jetzt folgendes-


    Wenn ich ein Auto kaufe, und es dann irgendwo parke mit "/v parken" ist alles in Ordnung, das Fahrzeug respawnt einmal und wenn ich es betrete steht da "Fahrzeug registriert für..."
    Bis dahin ist es in Ordnung,
    Aber nun wenn ich den Serverrestarte ist das Fahrzeug da wo ich es geparkt habe, es steht aber ZUM VERKAUF! Und das Fahrzeug dass ich gekauft habe steht beim Autohaus.
    Was ist das Problem hier?


    else if(strcmp(x_nr,"parken",true) == 0)
    {
    new Float:x,Float:y,Float:z;
    new Float:a;
    new carid;
    new getcarid;
    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
    else { return 1; }
    getcarid = GetPlayerVehicleID(playerid);
    GetPlayerName(playerid, playername, sizeof(playername));
    GetVehiclePos(carid, x, y, z);
    GetVehicleZAngle(carid, a);
    if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
    {
    if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 & PlayerInfo[playerid][pPcarkey3])
    {
    SendClientMessage(playerid, COLOR_ROT, "[ERROR]:Du besitzt kein Fahrzeug.");
    return 1;
    }
    if(getcarid == carid)
    {
    CarInfo[carid][cLocationx] = x;
    CarInfo[carid][cLocationy] = y;
    CarInfo[carid][cLocationz] = z;
    CarInfo[carid][cAngle] = a;
    format(string, sizeof(string), "~n~ Fahrzeug geparkt. ~n~");
    GameTextForPlayer(playerid, "Dein Fahrzeug wird ab nun hier spawnen.", 10000, 3);
    OnPropUpdate();
    OnPlayerUpdate(playerid);
    DestroyVehicle(carid);
    CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
    TogglePlayerControllable(playerid, 1);
    return 1;
    }
    }
    }


    Das ist der park Befehl


    Und hiermit werden die Autos (Privatautos) geladen


    public LoadCar()
    {
    new arrCoords[13][64];
    new strFromFile2[256];
    new File: file = fopen("/cfg/cars.cfg", io_read);
    if (file)
    {
    new idx = 538; // Fahrzeuge insgesamt ohne Carownership autos
    while (idx < sizeof(CarInfo))
    {
    fread(file, strFromFile2);
    split(strFromFile2, arrCoords, ',');
    CarInfo[idx][cModel] = strval(arrCoords[0]);
    CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
    CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
    CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
    CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
    CarInfo[idx][cColorOne] = strval(arrCoords[5]);
    CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
    strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
    strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
    CarInfo[idx][cValue] = strval(arrCoords[9]);
    CarInfo[idx][cLicense] = strval(arrCoords[10]);
    CarInfo[idx][cOwned] = strval(arrCoords[11]);
    CarInfo[idx][cLock] = strval(arrCoords[12]);
    printf("CarInfo: %d Owner:%s Kennzeichen: %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
    idx++;
    }
    }
    return 1;
    }