Business Coordinaten?!

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 Liebes SA-MP.DE Forum,


    Ich habe eine frage zu dem Business Coordinaten.
    Und zwar ich habe ingame denn Befehl /save, nun speichert er die Coords womit ich ingame Gesaved habe in der txt.Datei ( Savepositionen)
    Nun will ich habe das Business genau dort haben wo ich /save gemacht habe ingame...


    Hier ist mein Business mometan:

    Zitat

    0|Der Staat|Tankstelle|No-one|-2332.267822|2357.336425|5.058197|-2332.267822|2357.336425|5.058197|5|50000|7|30079|1|1|186|200|11


    Nun was für Coords sind wichtig damit ich mein Biz an der stelle habe wo ich ingame /save gemacht habe damit es natürlich auch funktioniert?


    Hier mein ingame /save:
    AddPlayerClass(285,998.7068,-914.1419,42.1797,6.4906,0,0,0,0,0,0); // Tankstellen biz


    Würde mich freuen wenn mir jemand Helfen würde oder das sogar erklären würde.


    mfg CoreX

  • Hallo,


    du speicherst alle BIZ'en in einer MySQL Datenbank ab, richtig ? Wenn ja, bitte mal die SQL Struktur abscreenen und hochladen.


    Jop Richtig, aber ich will erstmals so klar kommen, da die Business auch bei mir unter Scriptfiles dabei sind :)
    Deswegen wäre es nett wenn mir erstmals das jemand erklären würde :)


    mfg CoreX

  • So sieht das aus:


    Und die Datei ist in dem Scriptfiles Ordner und Heißt:
    Business.txt


    mfg CoreX


    //edit:
    Ich will doch nur die Coordinaten stellen wissen damit ich mein Biz auf eine andere stelle Scripten kann -.-
    Deswegen auch oben der Thread, wie ich sie ändern kann und auf was für Coords muss ich achten wenn ich /save mache ingame... das will ich wissen :D

  • Ok ich werde es mal ausprobieren...


    Trozdem danke schonmals :)


    //edit:
    Hat funktioniert... nur irgend wie kann ich jetzt das Biz nicht mehr kaufen kp wieso ich guck das ich das auch irgend wie hinbekomme liegt bestimmt an den Coords.. die noch hinten drane stehen.

  • Dafür ist das Forum doch da. :P


    Es wird funktionieren! :D


    Gruß,
    Neo. :)


    Nein irgend wie hat es nicht funktioniert.
    Guck ma ich habs so gemacht:


    0|Der Staat|Tankstelle|No-one|998.7068|-914.1419|42.1797|998.7068|-914.1419|42.1797|5|50000|7|30079|1|1|186|200|11


    Das sind die ingame Saves:
    AddPlayerClass(285,998.7068,-914.1419,42.1797,6.4906,0,0,0,0,0,0); // Tankstellen biz


    Stimmt eig oda.. ?


    mfg CoreX

  • stock UpdateBizzLabel(h)
    {
    new string[248];
    if(BizzInfo[h][bOwned] == 1)
    {
    format(string, sizeof(string), "{FFFFFF}Business:{F7F700}%s.\n{FFFFFF}Inhaber: {F7F700}%s.",BizzInfo[h][bMessage],BizzInfo[h][bOwner]);
    DestroyDynamic3DTextLabel(BizzInfo[h][blabel]);
    BizzInfo[h][blabel] = CreateDynamic3DTextLabel(string,COLOR_WHITE,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+0.5,15.0,0,0);
    }
    else
    {
    format(string, sizeof(string), "{FFFFFF}Das Business {F7F700}%s{FFFFFF} steht zum Verkauf:\n{FFFFFF}Preis: {F7F700}%d{4EF700}€.{F7F700}\n\n/buybusiness{FFFFFF} um es zu kaufen!",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice]);
    DestroyDynamic3DTextLabel(BizzInfo[h][blabel]);
    BizzInfo[h][blabel] = CreateDynamic3DTextLabel(string,COLOR_WHITE,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+0.5,15.0);
    }
    return 1;
    }


    forward SaveBizz();
    public SaveBizz()
    {
    new idx;
    new File: file2;
    while (idx < sizeof(BizzInfo))
    {
    new coordsstring[256];
    format(coordsstring, sizeof(coordsstring), "%d|%s|%s|%s|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
    BizzInfo[idx][bOwned],
    BizzInfo[idx][bOwner],
    BizzInfo[idx][bMessage],
    BizzInfo[idx][bExtortion],
    BizzInfo[idx][bEntranceX],
    BizzInfo[idx][bEntranceY],
    BizzInfo[idx][bEntranceZ],
    BizzInfo[idx][bExitX],
    BizzInfo[idx][bExitY],
    BizzInfo[idx][bExitZ],
    BizzInfo[idx][bLevelNeeded],
    BizzInfo[idx][bBuyPrice],
    BizzInfo[idx][bEntranceCost],
    BizzInfo[idx][bTill],
    BizzInfo[idx][bLocked],
    BizzInfo[idx][bInterior],
    BizzInfo[idx][bProducts],
    BizzInfo[idx][bMaxProducts],
    BizzInfo[idx][bPriceProd]);
    if(idx == 0)
    {
    file2 = fopen("Sonstiges/Business.txt", io_write);
    }
    else
    {
    file2 = fopen("Sonstiges/Business.txt", io_append);
    }
    UpdateBizzLabel(idx);
    fwrite(file2, coordsstring);
    idx++;
    fclose(file2);
    }
    }


    forward LoadBizz();
    public LoadBizz()
    {
    new arrCoords[19][64];
    new strFromFile2[256];
    new File: file = fopen("Sonstiges/Business.txt", io_read);
    if (file)
    {
    new idx;
    while (idx < sizeof(BizzInfo))
    {
    fread(file, strFromFile2);
    split(strFromFile2, arrCoords, '|');
    BizzInfo[idx][bOwned] = strval(arrCoords[0]);
    strmid(BizzInfo[idx][bOwner], arrCoords[1], 0, strlen(arrCoords[1]), 255);
    strmid(BizzInfo[idx][bMessage], arrCoords[2], 0, strlen(arrCoords[2]), 255);
    strmid(BizzInfo[idx][bExtortion], arrCoords[3], 0, strlen(arrCoords[3]), 255);
    BizzInfo[idx][bEntranceX] = floatstr(arrCoords[4]);
    BizzInfo[idx][bEntranceY] = floatstr(arrCoords[5]);
    BizzInfo[idx][bEntranceZ] = floatstr(arrCoords[6]);
    BizzInfo[idx][bExitX] = floatstr(arrCoords[7]);
    BizzInfo[idx][bExitY] = floatstr(arrCoords[8]);
    BizzInfo[idx][bExitZ] = floatstr(arrCoords[9]);
    BizzInfo[idx][bLevelNeeded] = strval(arrCoords[10]);
    BizzInfo[idx][bBuyPrice] = strval(arrCoords[11]);
    BizzInfo[idx][bEntranceCost] = strval(arrCoords[12]);
    BizzInfo[idx][bTill] = strval(arrCoords[13]);
    BizzInfo[idx][bLocked] = strval(arrCoords[14]);
    BizzInfo[idx][bInterior] = strval(arrCoords[15]);
    BizzInfo[idx][bProducts] = strval(arrCoords[16]);
    BizzInfo[idx][bMaxProducts] = strval(arrCoords[17]);
    BizzInfo[idx][bPriceProd] = strval(arrCoords[18]);
    UpdateBizzLabel(idx);
    idx++;
    }
    fclose(file);
    }
    return 1;
    }


    So :)
    Eig geht alles über die .txt datei

  • Okay, also wieso das nicht funktioniert, weiß ich nicht.
    Aber ich weiß, dass du bei dem Biz Fehler hast. Du hast nämlich etwas an der falschen Stelle.


    0|Der Staat|Lebensmittel Lager|No-one|X|Y|Z|X|Y|Z|Level|Preis|Eintrittspreis|Guthaben|Zustand (Auf/zu)|Interior|Produkte|Max. Produkte|Preis p. Produkt



    So sollte es sein.


    Vielleicht ist das ja der Grund, wieso es nicht geht. (?)


    Ich weiß aufjedenfall nicht mehr weiter - tut mir leid.


    Gruß,
    Neo. :)

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