MySQL-Fraktionssystem #2

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
  • HeyHoo,


    Ich hab ein Problem mit meinem MySQL-Fraktionssystem.
    Ganz einfach:


    Er lädt die Fraktion nicht :o


    Enum(merator)
    #define MAX_FACTIONS 21
    enum FraktionsDaten
    {
    fID,
    fName[64],
    fTyp[16],
    fMapIcon,
    Float:fMapIconX,
    Float:fMapIconY,
    Float:fMapIconZ,
    fKasse,
    Float:fFacEnterX,
    Float:fFacEnterY,
    Float:fFacEnterZ,
    Float:fFacExitX,
    Float:fFacExitY,
    Float:fFacExitZ,
    fInterior,
    fVirtualWorld,
    fRankname1[16],
    fRankname2[16],
    fRankname3[16],
    fRankname4[16],
    fRankname5[16],
    fLeadrankname[16],
    Float:fWTposX,
    Float:fWTposY,
    Float:fWTposZ,
    Float:fWaffenlagerX,
    Float:fWaffenlagerY,
    Float:fWaffenlagerZ,
    fMaxCars,
    fMaxMember,
    Float:fCar1X,
    Float:fCar1Y,
    Float:fCar1Z,
    Float:fCar1A,
    Float:fCar2X,
    Float:fCar2Y,
    Float:fCar2Z,
    Float:fCar2A,
    Float:fCar3X,
    Float:fCar3Y,
    Float:fCar3Z,
    Float:fCar3A,
    Float:fCar4X,
    Float:fCar4Y,
    Float:fCar4Z,
    Float:fCar4A,
    Float:fCar5X,
    Float:fCar5Y,
    Float:fCar5Z,
    Float:fCar5A,
    Float:fCar6X,
    Float:fCar6Y,
    Float:fCar6Z,
    Float:fCar6A,
    Float:fCar7X,
    Float:fCar7Y,
    Float:fCar7Z,
    Float:fCar7A,
    Float:fCar8X,
    Float:fCar8Y,
    Float:fCar8Z,
    Float:fCar8A,
    Float:fCar9X,
    Float:fCar9Y,
    Float:fCar9Z,
    Float:fCar9A,
    Float:fCar10X,
    Float:fCar10Y,
    Float:fCar10Z,
    Float:fCar10A,
    Float:fCar11X,
    Float:fCar11Y,
    Float:fCar11Z,
    Float:fCar11A,
    Float:fCar12X,
    Float:fCar12Y,
    Float:fCar12Z,
    Float:fCar12A,
    Float:fCar13X,
    Float:fCar13Y,
    Float:fCar13Z,
    Float:fCar13A,
    fCarID1,
    fCarID2,
    fCarID3,
    fCarID4,
    fCarID5,
    fCarID6,
    fCarID7,
    fCarID8,
    fCarID9,
    fCarID10,
    fCarID11,
    fCarID12,
    fCarID13,
    fMember1[24],
    fMember2[24],
    fMember3[24],
    fMember4[24],
    fMember5[24],
    fMember6[24],
    fMember7[24],
    fMember8[24],
    fMember9[24],
    fMember10[24],
    fMember11[24],
    fMember12[24],
    fMember13[24],
    fMember14[24],
    fMember15[24],
    fMember16[24],
    fMember17[24],
    fMember18[24],
    fMember19[24],
    fMember20[24],
    fLeader[24],
    fDrugs,
    fMats,
    fDruglager,
    fMatslager
    }
    new FacInfo[MAX_FACTIONS][FraktionsDaten];


    Createfaction-Befehl
    ocmd:createfac(playerid,params[])
    {
    if(!isPlayerAFK(playerid))
    {
    if(isPlayerAnAdmin(playerid,5))
    {
    new fiID,fname[64],ftyp[16];
    if(sscanf(params,"iss",fiID,fname,ftyp))return SCM(playerid,COLOR_GREY,"Benutze: /createfac [FraktionsID] [Fraktionsname] [Fraktionstyp (Staatsfraktion, Gang oder Mafia)]");
    {
    if(CheckFacID(fiID) == 0)
    {
    if(strcmp(ftyp,"Staatsfraktion ", true))
    {
    CreateFaction(playerid, fiID, fname, ftyp);
    SCM(playerid,COLOR_LIGHTGREEN,"Fraktion erfolgreich erstellt!");
    }
    else if(strcmp(ftyp,"Gang ", true))
    {
    CreateFaction(playerid, fiID, fname, ftyp);
    SCM(playerid,COLOR_LIGHTGREEN,"Fraktion erfolgreich erstellt!");
    }
    else if(strcmp(ftyp,"Mafia ", true))
    {
    CreateFaction(playerid, fiID, fname, ftyp);
    SCM(playerid,COLOR_LIGHTGREEN,"Fraktion erfolgreich erstellt!");
    }
    }
    else
    {
    SCM(playerid,COLOR_LIGHTRED,"Diese FraktionsID wurde bereits erstellt! Bitte benutze eine andere!");
    }
    }
    }
    }
    else
    {
    SCM(playerid,AFK,"Du bist Abwesend gemeldet. Mit dem Befehl /back kannst du dich wieder Anwesend melden!");
    }
    return 1;
    }


    stock CreateFaction, LoadFaction & CheckFacID
    stock LoadFaction(Faction)
    {
    FacInfo[Faction][fID] = GetMySQLint("faction", "id", "id", FacInfo[Faction][fID]);
    format(FacInfo[Faction][fName],32,"%s",GetMySQLstring("faction", "Name", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fTyp],32,"%s",GetMySQLstring("faction", "Typ", "id", FacInfo[Faction][fID]));
    FacInfo[Faction][fMapIcon] = GetMySQLint("faction", "MapIcon", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fMapIconX] = GetMySQLfloat("faction", "MapIconX", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fMapIconY] = GetMySQLfloat("faction", "MapIconY", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fMapIconZ] = GetMySQLfloat("faction", "MapIconZ", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fKasse] = GetMySQLint("faction", "Kasse", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fFacEnterX] = GetMySQLfloat("faction", "FacEnterX", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fFacEnterY] = GetMySQLfloat("faction", "FacEnterY", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fFacEnterZ] = GetMySQLfloat("faction", "FacEnterZ", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fFacExitX] = GetMySQLfloat("faction", "FacExitX", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fFacExitY] = GetMySQLfloat("faction", "FacExitY", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fFacExitZ] = GetMySQLfloat("faction", "FacExitZ", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fInterior] = GetMySQLint("faction", "Interior", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fVirtualWorld] = GetMySQLint("faction", "VirtualWorld", "id", FacInfo[Faction][fID]);
    format(FacInfo[Faction][fRankname1],16,"%s",GetMySQLstring("faction", "Rankname1", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fRankname2],16,"%s",GetMySQLstring("faction", "Rankname2", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fRankname3],16,"%s",GetMySQLstring("faction", "Rankname3", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fRankname4],16,"%s",GetMySQLstring("faction", "Rankname4", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fRankname5],16,"%s",GetMySQLstring("faction", "Rankname5", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fLeadrankname],16,"%s",GetMySQLstring("faction", "Leadrankname", "id", FacInfo[Faction][fID]));
    FacInfo[Faction][fWTposX] = GetMySQLfloat("faction", "WtposX", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fWTposY] = GetMySQLfloat("faction", "WtposY", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fWTposZ] = GetMySQLfloat("faction", "WtposZ", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fWaffenlagerX] = GetMySQLfloat("faction", "WaffenlagerX", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fWaffenlagerY] = GetMySQLfloat("faction", "WaffenlagerY", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fWaffenlagerZ] = GetMySQLfloat("faction", "WaffenlagerZ", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fMaxCars] = GetMySQLint("faction", "MaxCars", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fMaxMember] = GetMySQLint("faction", "MaxMember", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar1X] = GetMySQLfloat("faction", "Fahrzeug1X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar1Y] = GetMySQLfloat("faction", "Fahrzeug1Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar1Z] = GetMySQLfloat("faction", "Fahrzeug1Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar1A] = GetMySQLfloat("faction", "Fahrzeug1A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar2X] = GetMySQLfloat("faction", "Fahrzeug2X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar2Y] = GetMySQLfloat("faction", "Fahrzeug2Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar2Z] = GetMySQLfloat("faction", "Fahrzeug2Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar2A] = GetMySQLfloat("faction", "Fahrzeug2A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar3X] = GetMySQLfloat("faction", "Fahrzeug3X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar3Y] = GetMySQLfloat("faction", "Fahrzeug3Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar3Z] = GetMySQLfloat("faction", "Fahrzeug3Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar3A] = GetMySQLfloat("faction", "Fahrzeug3A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar4X] = GetMySQLfloat("faction", "Fahrzeug4X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar4Y] = GetMySQLfloat("faction", "Fahrzeug4Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar4Z] = GetMySQLfloat("faction", "Fahrzeug4Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar4A] = GetMySQLfloat("faction", "Fahrzeu4A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar5X] = GetMySQLfloat("faction", "Fahrzeug5X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar5Y] = GetMySQLfloat("faction", "Fahrzeug5Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar5Z] = GetMySQLfloat("faction", "Fahrzeug5Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar5A] = GetMySQLfloat("faction", "Fahrzeug5A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar6X] = GetMySQLfloat("faction", "Fahrzeug6X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar6Y] = GetMySQLfloat("faction", "Fahrzeug6Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar6Z] = GetMySQLfloat("faction", "Fahrzeug6Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar6A] = GetMySQLfloat("faction", "Fahrzeug6A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar7X] = GetMySQLfloat("faction", "Fahrzeug7X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar7Y] = GetMySQLfloat("faction", "Fahrzeug7Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar7Z] = GetMySQLfloat("faction", "Fahrzeug7Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar7A] = GetMySQLfloat("faction", "Fahrzeug7A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar8X] = GetMySQLfloat("faction", "Fahrzeug8X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar8Y] = GetMySQLfloat("faction", "Fahrzeug8Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar8Z] = GetMySQLfloat("faction", "Fahrzeug8Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar8A] = GetMySQLfloat("faction", "Fahrzeug8A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar9X] = GetMySQLfloat("faction", "Fahrzeug9X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar9Y] = GetMySQLfloat("faction", "Fahrzeug9Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar9Z] = GetMySQLfloat("faction", "Fahrzeug9Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar9A] = GetMySQLfloat("faction", "Fahrzeug9A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar10X] = GetMySQLfloat("faction", "Fahrzeug10X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar10Y] = GetMySQLfloat("faction", "Fahrzeug10Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar10Z] = GetMySQLfloat("faction", "Fahrzeug10Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar10A] = GetMySQLfloat("faction", "Fahrzeug10A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar11X] = GetMySQLfloat("faction", "Fahrzeug11X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar11Y] = GetMySQLfloat("faction", "Fahrzeug11Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar11Z] = GetMySQLfloat("faction", "Fahrzeug11Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar11A] = GetMySQLfloat("faction", "Fahrzeug11A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar12X] = GetMySQLfloat("faction", "Fahrzeug12X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar12Y] = GetMySQLfloat("faction", "Fahrzeug12Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar12Z] = GetMySQLfloat("faction", "Fahrzeug12Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar12A] = GetMySQLfloat("faction", "Fahrzeug12A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar13X] = GetMySQLfloat("faction", "Fahrzeug13X", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar13Y] = GetMySQLfloat("faction", "Fahrzeug13Y", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar13Z] = GetMySQLfloat("faction", "Fahrzeug13Z", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCar13A] = GetMySQLfloat("faction", "Fahrzeug13A", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID1] = GetMySQLint("faction", "Fahrzeug1ID", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID2] = GetMySQLint("faction", "Fahrzeug2ID", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID3] = GetMySQLint("faction", "Fahrzeug3ID", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID4] = GetMySQLint("faction", "Fahrzeug4ID", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID5] = GetMySQLint("faction", "Fahrzeug5ID", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID6] = GetMySQLint("faction", "Fahrzeug6D", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID7] = GetMySQLint("faction", "Fahrzeug7ID", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID8] = GetMySQLint("faction", "Fahrzeug8ID", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID9] = GetMySQLint("faction", "Fahrzeug9ID", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID10] = GetMySQLint("faction", "Fahrzeug10ID", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID11] = GetMySQLint("faction", "Fahrzeug11ID", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID12] = GetMySQLint("faction", "Fahrzeug12ID", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fCarID13] = GetMySQLint("faction", "Fahrzeug13ID", "id", FacInfo[Faction][fID]);
    format(FacInfo[Faction][fMember1],24,"%s",GetMySQLstring("faction", "Member1", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember2],24,"%s",GetMySQLstring("faction", "Member2", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember3],24,"%s",GetMySQLstring("faction", "Member3", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember4],24,"%s",GetMySQLstring("faction", "Member4", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember5],24,"%s",GetMySQLstring("faction", "Member5", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember6],24,"%s",GetMySQLstring("faction", "Member6", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember7],24,"%s",GetMySQLstring("faction", "Member7", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember8],24,"%s",GetMySQLstring("faction", "Member8", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember9],24,"%s",GetMySQLstring("faction", "Member9", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember10],24,"%s",GetMySQLstring("faction", "Member10", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember11],24,"%s",GetMySQLstring("faction", "Member11", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember12],24,"%s",GetMySQLstring("faction", "Member12", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember13],24,"%s",GetMySQLstring("faction", "Member13", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember14],24,"%s",GetMySQLstring("faction", "Member14", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember15],24,"%s",GetMySQLstring("faction", "Member15", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember16],24,"%s",GetMySQLstring("faction", "Member16", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember17],24,"%s",GetMySQLstring("faction", "Member17", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember18],24,"%s",GetMySQLstring("faction", "Member18", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember19],24,"%s",GetMySQLstring("faction", "Member19", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fMember10],24,"%s",GetMySQLstring("faction", "Member20", "id", FacInfo[Faction][fID]));
    format(FacInfo[Faction][fLeader],24,"%s",GetMySQLstring("faction", "Leader", "id", FacInfo[Faction][fID]));
    FacInfo[Faction][fDrugs] = GetMySQLint("faction", "FacDrugs", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fMats] = GetMySQLint("faction", "FacMats", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fDruglager] = GetMySQLint("faction", "FacDruglager", "id", FacInfo[Faction][fID]);
    FacInfo[Faction][fMatslager] = GetMySQLint("faction", "FacMatslager", "id", FacInfo[Faction][fID]);
    CreatePickup(1318,1,FacInfo[Faction][fFacEnterX],FacInfo[Faction][fFacEnterY],FacInfo[Faction][fFacEnterZ]);
    Create3DTextLabel("Eintreten: Enter drücken",COLOR_RED,FacInfo[Faction][fFacEnterX],FacInfo[Faction][fFacEnterY],FacInfo[Faction][fFacEnterZ],10,0);
    return 1;
    }

    stock CreateFaction, LoadFaction & CheckFacID
    stock CreateFaction(playerid, factionid, fname[], typ[])
    {
    new query[256], Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid,pX,pY,pZ);
    mysql_real_escape_string(fname,fname);
    mysql_real_escape_string(typ,typ);
    format(query, sizeof(query), "INSERT INTO `faction` (`id`, `Name`, `Typ`, `FacEnterX`, `FacEnterY`, `FacEnterZ`) VALUES ('%d', '%s', '%s', '%f', '%f', '%f')", factionid, fname, typ, pX, pY, pZ);
    mysql_query(query);
    LoadFaction(factionid);
    return true;
    }

    stock CreateFaction, LoadFaction & CheckFacID
    stock CheckFacID(factionid)
    {
    new Query[128],count;
    format(Query, sizeof(Query), "SELECT * FROM `faction` WHERE `id` = '%d'", factionid);
    mysql_query(Query);
    mysql_store_result();
    count = mysql_num_rows();
    mysql_free_result();
    return count;
    }


    Warum klappt des denn ned :o


    Bitte um Hilfe <-- is kla oda?


    lg
    Deagle

  • Durch grobes Überfliegen des Logs, kann man erkennen, dass du in deiner Datenbank ein paar Spalten nicht erstellt hast. (z.B. 'Interior' und 'VirtualWorld')
    Du musst im ganzen Log nachschauen, welche Spalten dir fehlen und diese einfügen.

    Außerdem als Tipp:
    Du lädst die Fraktionen jeweils mit z.B. GetMySQLfloat. Du führst also x male ein Query aus und das für jede x Fraktion! Kannst du dir vorstellen, dass das nicht gerade Ressourcen freundlich ist?

    Als Anregung:

    stock LoadFactions()
    {
    new data[800], field[/*Anzahl der Felder in deiner Datenbank*/][64],factcount;
    mysql_query("SELECT * FROM faction WHERE id='%i'");
    mysql_store_result();
    while(mysql_fetch_row(data))
    {
    splitfu(data, field, '|');
    FacInfo[factcount][fID] = strval(field[0]); //Felder aus der Datenbank
    //usw...
    factcount++;
    }
    mysql_free_result();
    }


    Müssteste halt an dein Script und die Datenbank anpassen. Sollte aber etwas Ressourcen sparen. ;)


    Mfg,
    UncleSub

  • Habe die SQL-Datei hier selbst geschrieben und dann hochgeladen:




    sollte nix falsch sein


    /e Code

  • `FacVirtualWorld` int(3) NOT NULL,


    Code
    [15:53:36] CMySQLHandler::Query(SELECT `VirtualWorld` FROM `faction` WHERE `id` = 'ÿ') - An error has occured. (Error ID: 1054, Unknown column 'VirtualWorld' in 'field list')


    Schonmal ein Fehler. Das selbe auch bei Interior.


    `Fahrzeug4A` float NOT NULL,


    Code
    [15:53:37] CMySQLHandler::Query(SELECT `Fahrzeu(!!!!g!!!!)4A` FROM `faction` WHERE `id` = 'ÿ') - An error has occured. (Error ID: 1054, Unknown column 'Fahrzeu4A' in 'field list')


    Rechtschreibfehler...


    Also schau alles nach, ob es richtig geschrieben ist und pass es an.


    Mfg,
    UncleSub