Ladet keine Häuser im spiel

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 User,


    ich habe heute ein Haussystem in Gamemode eingebaut aber ich habe ein problem
    wenn ich in spiel ein hauserstelle wir alles angzeigt und geht alles wir gespeichert
    aber wenn ich server neustart mache werden die häuser nicht geladen
    ich weis net was ich machen muss ich bitte um hilfe

  • Am besten wäre es auch, wenn du uns mal paar Zeile davon schicken würdest, dort wo es Gespeichert und Geladen wird.

    //Edit 1.


    Hast du das auch so gemacht, das sie nach dem Restart gespeichert werden sollen??

    Die Kritik an anderen hat noch keinem die eigene Leistung erspart.

    – Noël Coward

  • da sind die zeilen


    stock LoadHouses()
    {
    new str[128];
    for(new i = 0; i<MAX_HOUSES; i++)
    {
    format(str, sizeof str, "/Houses/%d.ini", i);
    if(fexist(str))
    {
    if(INI_Open(str))
    {
    HouseInfo[i][hOwned] = INI_ReadInt("Owned");
    INI_ReadString(HouseInfo[i][hOwner], "Owner", MAX_PLAYER_NAME);
    HouseInfo[i][hEntrx] = INI_ReadFloat("Entrx");
    HouseInfo[i][hEntry] = INI_ReadFloat("Entry");
    HouseInfo[i][hEntrz] = INI_ReadFloat("Entrz");
    HouseInfo[i][hPrice] = INI_ReadInt("Price");
    HouseInfo[i][hIntid] = INI_ReadInt("Intid");
    HouseInfo[i][hLocked] = INI_ReadInt("Locked");
    HouseInfo[i][hRentable] = INI_ReadInt("Rentable");
    HouseInfo[i][hRent] = INI_ReadInt("Rent");
    HouseInfo[i][hIntx] = Interiors[HouseInfo[i][hIntid]][intpx];
    HouseInfo[i][hInty] = Interiors[HouseInfo[i][hIntid]][intpy];
    HouseInfo[i][hIntz] = Interiors[HouseInfo[i][hIntid]][intpz];
    HouseInfo[i][hInt] = Interiors[HouseInfo[i][hIntid]][interiorid];
    format(HouseInfo[i][hDescr], 50, Interiors[HouseInfo[i][hIntid]][description]);
    INI_Close();
    if(!HouseInfo[i][hOwned]) format(str, sizeof str, "%s\nZum Verkauf\nPreis: %d€", HouseInfo[i][hDescr], HouseInfo[i][hPrice]);
    else if(HouseInfo[i][hOwned] && !HouseInfo[i][hRentable]) format(str, sizeof str, "%s\nBesitzer: %s",HouseInfo[i][hDescr], HouseInfo[i][hOwner]);
    else if(HouseInfo[i][hOwned] && HouseInfo[i][hRentable]) format(str, sizeof str, "%s\nBesitzer: %s\nMiete: %d€\n/mieten zum Mieten",HouseInfo[i][hDescr], HouseInfo[i][hOwner], HouseInfo[i][hRent]);
    HouseInfo[i][hLabel] = CreateDynamic3DTextLabel(str, COLOR_HOUSELABEL, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz], 50);
    if(!HouseInfo[i][hOwned]) HouseInfo[i][hPick] = CreateDynamicPickup(1273, 1,HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz]);
    else HouseInfo[i][hPick] = CreateDynamicPickup(1272, 1, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz]);
    }
    }
    }
    return 1;
    }


    stock LoadHouse(i)
    {
    new str[128];
    format(str, sizeof str, "/Houses/%d.ini", i);
    if(fexist(str))
    {
    if(INI_Open(str))
    {
    HouseInfo[i][hOwned] = INI_ReadInt("Owned");
    INI_ReadString(HouseInfo[i][hOwner], "Owner", MAX_PLAYER_NAME);
    HouseInfo[i][hEntrx] = INI_ReadFloat("Entrx");
    HouseInfo[i][hEntry] = INI_ReadFloat("Entry");
    HouseInfo[i][hEntrz] = INI_ReadFloat("Entrz");
    HouseInfo[i][hPrice] = INI_ReadInt("Price");
    HouseInfo[i][hIntid] = INI_ReadInt("Intid");
    HouseInfo[i][hLocked] = INI_ReadInt("Locked");
    HouseInfo[i][hRentable] = INI_ReadInt("Rentable");
    HouseInfo[i][hRent] = INI_ReadInt("Rent");
    HouseInfo[i][hIntx] = Interiors[HouseInfo[i][hIntid]][intpx];
    HouseInfo[i][hInty] = Interiors[HouseInfo[i][hIntid]][intpy];
    HouseInfo[i][hIntz] = Interiors[HouseInfo[i][hIntid]][intpz];
    HouseInfo[i][hInt] = Interiors[HouseInfo[i][hIntid]][interiorid];
    format(HouseInfo[i][hDescr], 50, Interiors[HouseInfo[i][hIntid]][description]);
    INI_Close();
    if(!HouseInfo[i][hOwned]) format(str, sizeof str, "%s\nZum Verkauf\nPreis: %d€", HouseInfo[i][hDescr], HouseInfo[i][hPrice]);
    else if(HouseInfo[i][hOwned] && !HouseInfo[i][hRentable]) format(str, sizeof str, "%s\nBesitzer: %s",HouseInfo[i][hDescr], HouseInfo[i][hOwner]);
    else if(HouseInfo[i][hOwned] && HouseInfo[i][hRentable]) format(str, sizeof str, "%s\nBesitzer: %s\nMiete: %d€\n/mieten zum Mieten",HouseInfo[i][hDescr], HouseInfo[i][hOwner], HouseInfo[i][hRent]);
    HouseInfo[i][hLabel] = CreateDynamic3DTextLabel(str, COLOR_HOUSELABEL, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz], 50);
    if(!HouseInfo[i][hOwned]) HouseInfo[i][hPick] = CreateDynamicPickup(1273, 1,HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz]);
    else HouseInfo[i][hPick] = CreateDynamicPickup(1272, 1, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz]);
    }
    }
    return 1;
    }

  • alter lese genau oben des speichert alles und des lade aber nur nicht in imgame nach dem server restart auch die häuser


    Dann mach in deinem Restartbefehl rein, das er die Häuser abspeichert.






    P.S


    Lern mal bitte besser Deutsch, denn dein Deutsch ist ziemlich schlecht.

    Die Kritik an anderen hat noch keinem die eigene Leistung erspart.

    – Noël Coward

  • Alter du hast auf jeden vall keine ahnung lese genau oben bei mir geht alles mit hausensystem nur das er
    nach dem server restart nicht die Häuser ladet (die werden abgespeichert)

  • hast du das auch bei OnGameModeinit drin?


    LoadHouses();


    wenn das nicht da is geht es ja auch net

  • Dann erstell ein stock zbs so.


    stock LoadHaus(hausid){
    new pfad[50];
    format(pfad,50,"/haus/%d.txt",hausid);
    if(!fexist(pfad))return 0; //überprüft ob die Datei existiert, wenn nicht wird 0 zurückgegeben


    HausInfo[hausid][haus_x] = dini_Float(pfad,"x"); // hier laden wir die Werte
    HausInfo[hausid][haus_y] = dini_Float(pfad,"y");
    HausInfo[hausid][haus_z] = dini_Float(pfad,"z");
    HausInfo[hausid][haus_preis] = dini_Int(pfad,"preis");
    format(HausInfo[hausid][haus_besitzer],32,"%s",dini_Get(pfad,"besitzer"));


    return print("Das Haus wurde erfolgreich geladen"); }

    Die Kritik an anderen hat noch keinem die eigene Leistung erspart.

    – Noël Coward

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • was hast du gemacht? die funktion von eddy oder meine idee?

  • deine idee geht aber jetzt ladet der net die haus inen raum nicht wenn ichr ein gehen will
    LoadHouses();

  • immerhin lädt er es wie machst du das mit den eingang?


    per befehl oder per taste?

  • wenn ich ingame ein haus erstellen wenn ich dan reingehen im haus der interrior ist da aber wenn ich jetzt server restart und rein gehe ist schwarz

  • ich gehe mit F oder mit enter Tasteso wirts abgespeichert



    stock SaveHouse(i)
    {
    new str[60];
    format(str, sizeof str, "/Houses/%d.ini", i);
    if(fexist(str))
    {
    if(INI_Open(str))
    {
    INI_WriteString("Owner", HouseInfo[hOwner]);
    INI_WriteInt("Owned", HouseInfo[hOwned]);
    INI_WriteFloat("Entrx", HouseInfo[hEntrx]);
    INI_WriteFloat("Entry", HouseInfo[hEntry]);
    INI_WriteFloat("Entrz", HouseInfo[i][hEntrz]);
    INI_WriteInt("Price", HouseInfo[i][hPrice]);
    INI_WriteInt("Rentable", HouseInfo[i][hRentable]);
    INI_WriteInt("Rent", HouseInfo[i][hRent]);
    INI_WriteInt("Intid", HouseInfo[i][hIntid]);
    INI_WriteInt("Locked", HouseInfo[i][hLocked]);
    INI_Save();
    INI_Close();
    }
    }
    return 1;
    }
    wie soll ich es machen
    [/i][/i][/i][/i][/i][/i]

    Einmal editiert, zuletzt von Hitman1994 ()