Beiträge von ENEF

    Hallo Jeffry,


    bei OnGameModeInit()
    LoadHouse();


    Der Public dazu:

    Spoiler anzeigen
    LoadHouse()
    {
    CreateHouseTable();
    mysql_tquery(handle, "SELECT * FROM Hausdaten ORDER BY ID ASC", "LoadHouse_Data");
    return 1;
    }
    forward LoadHouse_Data();
    public LoadHouse_Data()
    {
    new rows;
    rows = cache_num_rows();
    for(new i=0; i<rows; i++)
    {
    cache_get_field_content(0, "Besitzer", hInfo[i][Besitzer],handle,34);
    hInfo[i][Level] = cache_get_field_content_int(i, "Level");
    hInfo[i][PosX] = cache_get_field_content_float(i, "PosX");
    hInfo[i][PosY] = cache_get_field_content_float(i, "PosY");
    hInfo[i][PosZ] = cache_get_field_content_float(i, "PosZ");
    hInfo[i][IntX] = cache_get_field_content_float(i, "IntX");
    hInfo[i][IntY] = cache_get_field_content_float(i, "IntY");
    hInfo[i][IntZ] = cache_get_field_content_float(i, "IntZ");
    hInfo[i][IntID] = cache_get_field_content_int(i, "IntID");
    hInfo[i][VID] = cache_get_field_content_int(i, "VID");
    hInfo[i][Lock] = cache_get_field_content_int(i, "Locked");
    hInfo[i][Mietpreis] = cache_get_field_content_int(i, "Mietpreis");
    hInfo[i][Kaufpreis] = cache_get_field_content_int(i, "Kaufpreis");
    hInfo[i][Gekauft] = cache_get_field_content_int(i, "Gekauft");
    if(i == MAX_HOUSE-1) return print("Es können keine weiteren Häuser geladen werden, Limit wurde erreicht.");
    }
    return 1;
    }


    Jeffry:


    Mit freundlichen Grüßen

    Hi,


    nun geht es fast. Das Problem ist nun, dass beim neustart die Pickups nicht erstellt werden und ich nach einem Neustart auch wieder 5 Häuser erstellen kann(MAX_HOUSE) die überschreiben dann die vorhandenen Häuser.
    Die Log:


    SQL
    [13:51:10] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,IntY,IntZ, IntID, VID, `Locked`, Mietpreis, Kaufpreis, Gekauft) VALUES ('0','Besitzer: Niemand', '3', '-1967.758789', '135.019241', '36.962287', '1267.663208', '-781.323242', '1091.906250', '5', '2', '0', '0', '9', '0')", callback: "(null)", format: "(null)"[13:51:10] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:51:11] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 473.748 milliseconds[13:51:11] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving[13:51:11] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,IntY,IntZ, IntID, VID, `Locked`, Mietpreis, Kaufpreis, Gekauft) VALUES ('1','Besitzer: Niemand', '3', '-1968.293457', '134.778381', '36.962287', '1267.663208', '-781.323242', '1091.906250', '5', '2', '0', '0', '9', '0')", callback: "(null)", format: "(null)"[13:51:11] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:51:11] [ERROR] CMySQLQuery::Execute[] - (error #1062) Duplicate entry '1' for key 'PRIMARY'[13:51:11] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:51:11] [DEBUG] Calling callback "OnQueryError"..[13:51:13] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,IntY,IntZ, IntID, VID, `Locked`, Mietpreis, Kaufpreis, Gekauft) VALUES ('2','Besitzer: Niemand', '3', '-1968.952758', '134.022994', '36.962287', '1267.663208', '-781.323242', '1091.906250', '5', '2', '0', '0', '9', '0')", callback: "(null)", format: "(null)"[13:51:13] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:51:14] [ERROR] CMySQLQuery::Execute[] - (error #1062) Duplicate entry '2' for key 'PRIMARY'[13:51:14] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:51:14] [DEBUG] Calling callback "OnQueryError"..[13:51:14] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,IntY,IntZ, IntID, VID, `Locked`, Mietpreis, Kaufpreis, Gekauft) VALUES ('3','Besitzer: Niemand', '3', '-1968.952758', '134.022994', '36.962287', '1267.663208', '-781.323242', '1091.906250', '5', '2', '0', '0', '9', '0')", callback: "(null)", format: "(null)"[13:51:14] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:51:14] [ERROR] CMySQLQuery::Execute[] - (error #1062) Duplicate entry '3' for key 'PRIMARY'[13:51:14] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:51:14] [DEBUG] Calling callback "OnQueryError"..[13:51:15] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,IntY,IntZ, IntID, VID, `Locked`, Mietpreis, Kaufpreis, Gekauft) VALUES ('4','Besitzer: Niemand', '3', '-1968.952758', '134.022994', '36.962287', '1267.663208', '-781.323242', '1091.906250', '5', '2', '0', '0', '9', '0')", callback: "(null)", format: "(null)"[13:51:15] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:51:15] [ERROR] CMySQLQuery::Execute[] - (error #1062) Duplicate entry '4' for key 'PRIMARY'[13:51:15] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:51:15] [DEBUG] Calling callback "OnQueryError"..[13:51:23] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE accounts SET Name = 'iCarus', Level = '5', Geld = '3805', Kills = '0', Tode = '12', Admin = '6', Banned = '0', Leader = '1', Member = '0', Team = '1', Rank = '6', Duty = '0', Skin = '303', Health = '0.000000', xKord = '-1969.639038', yKord = '133.236831', zKord = '36.962287', Interior = '0', Carlic = '0', Bikelic = '0', Flylic = '0', Bootlic = '0', LKWlic = '0', Konto = '1', Kontostand = '170775', Beantragt = '0', Pin = '1229', Kontonummer = '2006', Abholen = '0', `Alter` = '18', Geschlecht = 'Maennlich', Levelpunkte = '18', Payday = '7', Herkunft = 'Baden-Wuerttemberg', Verheiratetmit = 'Niemand', Telefonnummer = '0', Tutorial = '2', Dutyskin = '283', Tot = '0', Totskin = '162', Wanteds = '0', Knast = '0', Knastzeit = '-1428061883', KnastzeitBis = '0', Knastskin = '0', Sterne = '0', Verbrechen = '0', wTot = '0', Inhaftiert = '0', tWerbung = '1', Perso = '1', Persobereit = '2', vWelt = '0' WHERE Name = 'iCarus'", callback: "(null)", format: "(null)"[13:51:23] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:51:23] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = 'Besitzer: Niemand', Level = '3', PosX = '-1967.758789', PosY = '135.019241', PosZ = '36.962287', IntX = '1267.663208', IntY = '-781.323242',IntZ = '1091.906250',IntID = '5', VID = '2', `Locked` = '0', Mietpreis = '0', Kaufpreis = '9', Gekauft = '0' WHERE ID = '0'", callback: "(null)", format: "(null)"[13:51:23] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = 'Besitzer: Niemand', Level = '3', PosX = '-1968.293457', PosY = '134.778381', PosZ = '36.962287', IntX = '1267.663208', IntY = '-781.323242',IntZ = '1091.906250',IntID = '5', VID = '2', `Locked` = '0', Mietpreis = '0', Kaufpreis = '9', Gekauft = '0' WHERE ID = '1'", callback: "(null)", format: "(null)"[13:51:23] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 0.649 milliseconds[13:51:23] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving[13:51:23] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = 'Besitzer: Niemand', Level = '3', PosX = '-1968.952758', PosY = '134.022994', PosZ = '36.962287', IntX = '1267.663208', IntY = '-781.323242',IntZ = '1091.906250',IntID = '5', VID = '2', `Locked` = '0', Mietpreis = '0', Kaufpreis = '9', Gekauft = '0' WHERE ID = '2'", callback: "(null)", format: "(null)"[13:51:23] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = 'Besitzer: Niemand', Level = '3', PosX = '-1968.952758', PosY = '134.022994', PosZ = '36.962287', IntX = '1267.663208', IntY = '-781.323242',IntZ = '1091.906250',IntID = '5', VID = '2', `Locked` = '0', Mietpreis = '0', Kaufpreis = '9', Gekauft = '0' WHERE ID = '3'", callback: "(null)", format: "(null)"[13:51:23] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = 'Besitzer: Niemand', Level = '3', PosX = '-1968.952758', PosY = '134.022994', PosZ = '36.962287', IntX = '1267.663208', IntY = '-781.323242',IntZ = '1091.906250',IntID = '5', VID = '2', `Locked` = '0', Mietpreis = '0', Kaufpreis = '9', Gekauft = '0' WHERE ID = '4'", callback: "(null)", format: "(null)"[13:51:24] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 170.765 milliseconds[13:51:24] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving[13:51:24] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:51:24] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 54.653 milliseconds[13:51:24] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving[13:51:24] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:51:24] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 34.662 milliseconds[13:51:24] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving[13:51:24] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:51:24] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 18.547 milliseconds[13:51:24] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving[13:51:24] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:51:24] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 21.23 milliseconds[13:51:24] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving


    Falls du Code brauchst, sag bescheid.
    Danke dir Jeffry: (und danke Goldkiller:)


    //Edit:
    Ahh. Nach einem Neustart sind die Werte in jeder Spalte wieder 0 wenn ich ein neues Haus erstelle(geht trotz MAX_HOUSE anzahl schon erreicht).
    Mit freundlichen Grüßen

    Huhu,


    also das Problem war ich hatte ein '%d' für die ID vergessen.
    Ich kann jetzt aber irgendwie nur ein Haus erstellen, die anderen werden nicht eingetragen.
    Noch dazu wird es denke ich nicht geladen, da kein Pickup erstellt wird.


    Die Log:

    SQL
    [13:32:48] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', PosY = '0.000000', PosZ = '0.000000', IntX = '0.000000', IntY = '0.000000',IntZ = '0.000000',IntID = '0', VID = '0', `Locked` = '0', Mietpreis = '0', Kaufpreis = '0', Gekauft = '0' WHERE ID =", callback: "(null)", format: "(null)"[13:32:48] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', PosY = '0.000000', PosZ = '0.000000', IntX = '0.000000', IntY = '0.000000',IntZ = '0.000000',IntID = '0', VID = '0', `Locked` = '0', Mietpreis = '0', Kaufpreis = '0', Gekauft = '0' WHERE ID =", callback: "(null)", format: "(null)"[13:32:48] [DEBUG] CMySQLQuery::Execute[] - starting query executionSET Besitzer = '', Level = '0', PosX = '0.000000', PosY = '0.000000', PosZ = '0.000000', IntX = '0.000000', IntY = '0.000000',IntZ = '0.000000',IntID = '0', VID = '0', `Locked` = '0', Mietpreis = '0', Kaufpreis = '0', Gekauft = '0' WHERE ID =", callback: "(null)", format: "(null)"[13:32:48] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', PosY = '0.000000', PosZ = '0.000000', IntX = '0.000000', IntY = '0.000000',IntZ = '0.000000',IntID = '0', VID = '0', `Locked` = '0', Mietpreis = '0', Kaufpreis = '0', Gekauft = '0' WHERE ID =", callback: "(null)", format: "(null)"[13:32:48] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[13:32:48] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', PosY = '0.000000', PosZ = '0.000000', IntX = '0.000000', IntY = '0.000000',IntZ = '0.000000',IntID = '0', VID = '0', `Locked` = '0', Mietpreis = '0', Kaufpreis = '0', Gekauft = '0' WHERE ID =", callback: "(null)", format: "(null)"[13:32:48] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:32:48] [DEBUG] Calling callback "OnQueryError"..uery execution[13:32:48] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[13:32:48] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:32:48] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:32:48] [DEBUG] Calling callback "OnQueryError"..[13:32:48] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[13:32:48] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:32:48] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:32:48] [DEBUG] Calling callback "OnQueryError"..[13:32:48] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[13:32:48] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:32:48] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:32:48] [DEBUG] Calling callback "OnQueryError"..[13:32:48] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[13:32:48] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:32:48] [DEBUG] Calling callback "OnQueryError"..[13:33:25] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,IntY,IntZ, IntID, VID, `Locked`, Mietpreis, Kaufpreis, Gekauft) VALUES ('0','Besitzer: Niemand', '1', '-1975.987670', '149.568283', '36.962287', '1267.663208', '-781.323242', '1091.906250', '5', '1', '0', '0', '1', '0')", callback: "(null)", format: "(null)"[13:33:26] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:33:26] [ERROR] CMySQLQuery::Execute[] - (error #1062) Duplicate entry '0' for key 'PRIMARY'[13:33:26] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:33:26] [DEBUG] Calling callback "OnQueryError"..[13:33:54] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = 'Besitzer: Niemand', Level = '1', PosX = '-1975.987670', PosY = '149.568283', PosZ = '36.962287', IntX = '1267.663208', IntY = '-781.323242',IntZ = '1091.906250',IntID = '5', VID = '1', `Locked` = '0', Mietpreis = '0', Kaufprei", callback: "(null)", format: "(null)"[13:33:54] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', PosY = '0.000000', PosZ = '0.000000', IntX = '0.000000', IntY = '0.000000',IntZ = '0.000000',IntID = '0', VID = '0', `Locked` = '0', Mietpreis = '0', Kaufpreis = '0', Gekauft = '0' WHERE ID =", callback: "(null)", format: "(null)"[13:33:54] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:33:54] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', PosY = '0.000000', PosZ = '0.000000', IntX = '0.000000', IntY = '0.000000',IntZ = '0.000000',IntID = '0', VID = '0', `Locked` = '0', Mietpreis = '0', Kaufpreis = '0', Gekauft = '0' WHERE ID =", callback: "(null)", format: "(null)"[13:33:54] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', PosY = '0.000000', PosZ = '0.000000', IntX = '0.000000', IntY = '0.000000',IntZ = '0.000000',IntID = '0', VID = '0', `Locked` = '0', Mietpreis = '0', Kaufpreis = '0', Gekauft = '0' WHERE ID =", callback: "(null)", format: "(null)"[13:33:54] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', PosY = '0.000000', PosZ = '0.000000', IntX = '0.000000', IntY = '0.000000',IntZ = '0.000000',IntID = '0', VID = '0', `Locked` = '0', Mietpreis = '0', Kaufpreis = '0', Gekauft = '0' WHERE ID =", callback: "(null)", format: "(null)"[13:33:54] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:33:54] [DEBUG] Calling callback "OnQueryError"..[13:33:54] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[13:33:54] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:33:54] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:33:54] [DEBUG] Calling callback "OnQueryError"..[13:33:54] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[13:33:54] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:33:54] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:33:54] [DEBUG] Calling callback "OnQueryError"..[13:33:54] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[13:33:54] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:33:54] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:33:54] [DEBUG] Calling callback "OnQueryError"..[13:33:54] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[13:33:54] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:33:54] [DEBUG] Calling callback "OnQueryError"..[13:33:55] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,IntY,IntZ, IntID, VID, `Locked`, Mietpreis, Kaufpreis, Gekauft) VALUES ('0','Besitzer: Niemand', '3', '-1972.968627', '150.254165', '36.962287', '1267.663208', '-781.323242', '1091.906250', '5', '2', '0', '0', '4', '0')", callback: "(null)", format: "(null)"[13:33:55] [DEBUG] CMySQLQuery::Execute[] - starting query execution[13:33:55] [ERROR] CMySQLQuery::Execute[] - (error #1062) Duplicate entry '0' for key 'PRIMARY'[13:33:55] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[13:33:55] [DEBUG] Calling callback "OnQueryError"..


    Command:

    Spoiler anzeigen
    ocmd:createhouse(playerid, params[])
    {
    // if(MAX_HOUSE-1) != 0) return SendClientMessage(playerid, error, "Es können keine weiteren Häuser erstellt werden.");
    new Inte, V, hLv, hPreis,text [128];
    if(sscanf(params,"dddd",Inte, V, hLv, hPreis))return SendClientMessage(playerid,info,"/Createhouse [IntID] [Virtuelle Welt] [Level] [Preis]");
    if(SpielerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, error, "Du bist kein Admin!");
    for(new i=0; i<MAX_HOUSE; i++)
    {
    new Float:Pos[3];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    hInfo[i][PosX] = Pos[0];
    hInfo[i][PosY] = Pos[1];
    hInfo[i][PosZ] = Pos[2];
    hInfo[i][IntID] = Inte;
    hInfo[i][VID] = V;
    hInfo[i][Level] = hLv;
    hInfo[i][Kaufpreis] = hPreis;
    hInfo[i][Mietpreis] = 0;
    hInfo[i][Gekauft] = 0;
    hInfo[i][Lock] = 0;
    switch(Inte)
    {
    case 5:
    {
    hInfo[i][IntX] =1267.663208;
    hInfo[i][IntY] =-781.323242;
    hInfo[i][IntZ] =1091.906250;
    }
    /*case 1:
    {
    hInfo[i][IntX] = ;
    hInfo[i][IntY] = ;
    hInfo[i][IntZ] = ;
    }*/
    }
    format(hInfo[i][Besitzer], 34, "Besitzer: Niemand");
    new query[1024];
    format(query, sizeof(query), "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,IntY,IntZ, IntID, VID, `Locked`, Mietpreis, Kaufpreis, Gekauft) VALUES ('%d','%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d', '%d', '%d', '%d', '%d')",
    i, hInfo[i][Besitzer], hInfo[i][Level], hInfo[i][PosX], hInfo[i][PosY], hInfo[i][PosZ], hInfo[i][IntX], hInfo[i][IntY], hInfo[i][IntZ], hInfo[i][IntID], hInfo[i][VID], hInfo[i][Lock], hInfo[i][Mietpreis], hInfo[i][Kaufpreis], hInfo[i][Gekauft], i);
    mysql_tquery(handle, query);
    CreatePickup(1273,1,Pos[0],Pos[1],Pos[2],0);
    format(text, sizeof(text), "Besitzer: Niemand\nPreis: %d\nLevel: %d",hInfo[i][Kaufpreis],hInfo[i][Level]);
    Create3DTextLabel(text,0x0FFF00FF,Pos[0],Pos[1],Pos[2],20.0,0,1);
    return SendClientMessage(playerid, 0x00FF00FF, "Haus wurde erfolgreich gespeichert.");
    }
    return 1;
    }


    Und Save&Load

    Spoiler anzeigen
    LoadHouse()
    {
    CreateHouseTable();
    mysql_tquery(handle, "SELECT * FROM Hausdaten ORDER BY ID ASC", "LoadHouse_Data");
    return 1;
    }
    forward LoadHouse_Data();
    public LoadHouse_Data()
    {
    new rows;
    rows = cache_num_rows();
    for(new i=0; i<rows; i++)
    {
    cache_get_field_content(0, "Besitzer", hInfo[i][Besitzer],handle,34);
    hInfo[i][Level] = cache_get_field_content_int(i, "Level");
    hInfo[i][PosX] = cache_get_field_content_float(i, "PosX");
    hInfo[i][PosY] = cache_get_field_content_float(i, "PosY");
    hInfo[i][PosZ] = cache_get_field_content_float(i, "PosZ");
    hInfo[i][IntX] = cache_get_field_content_float(i, "IntX");
    hInfo[i][IntY] = cache_get_field_content_float(i, "IntY");
    hInfo[i][IntZ] = cache_get_field_content_float(i, "IntZ");
    hInfo[i][IntID] = cache_get_field_content_int(i, "IntID");
    hInfo[i][VID] = cache_get_field_content_int(i, "VID");
    hInfo[i][Lock] = cache_get_field_content_int(i, "Locked");
    hInfo[i][Mietpreis] = cache_get_field_content_int(i, "Mietpreis");
    hInfo[i][Kaufpreis] = cache_get_field_content_int(i, "Kaufpreis");
    hInfo[i][Gekauft] = cache_get_field_content_int(i, "Gekauft");
    if(i == MAX_HOUSE-1) return print("Es können keine weiteren Häuser geladen werden, Limit wurde erreicht.");
    }
    return 1;
    }
    forward SaveAllHouses();
    public SaveAllHouses()
    {
    new query[256];
    for(new i=0; i<MAX_HOUSE; i++)
    {
    format(query, sizeof(query), "UPDATE House SET Besitzer = '%s', Level = '%d', PosX = '%f', PosY = '%f', PosZ = '%f', IntX = '%f', IntY = '%f',IntZ = '%f',IntID = '%d', VID = '%d', `Locked` = '%d', Mietpreis = '%d', Kaufpreis = '%d', Gekauft = '%d' WHERE ID = '%d'",
    hInfo[i][Besitzer], hInfo[i][Level], hInfo[i][PosX], hInfo[i][PosY], hInfo[i][PosZ], hInfo[i][IntX], hInfo[i][IntY], hInfo[i][IntZ], hInfo[i][IntID], hInfo[i][VID], hInfo[i][Lock], hInfo[i][Mietpreis], hInfo[i][Kaufpreis], hInfo[i][Gekauft], i);
    mysql_tquery(handle, query);
    }
    return 1;
    }


    Unter Ongaemodeinit hab ich das mit dem Pickup:
    //________________ Haus ______________________
    for(new i=0; i<MAX_HOUSE; i++)
    {
    if(hInfo[i][Gekauft] == 0)
    {
    new text[128];
    format(text, sizeof(text), "Besitzer: Niemand\nPreis: %d\nLevel: %d",hInfo[i][Kaufpreis],hInfo[i][Level]);
    Create3DTextLabel(text,0x0FFF00FF,hInfo[i][PosX],hInfo[i][PosY],hInfo[i][PosZ],20.0,0,1);
    CreatePickup(1273,1,hInfo[i][PosX],hInfo[i][PosY],hInfo[i][PosZ],1);
    }
    else if(hInfo[i][Gekauft] == 1)
    {
    new text[128];
    format(text, sizeof(text), "Besitzer: %s\nMiete: %d\nLevel: %d",hInfo[i][Besitzer],hInfo[i][Mietpreis],hInfo[i][Level]);
    Create3DTextLabel(text,0xB90000FF,hInfo[i][PosX],hInfo[i][PosY],hInfo[i][PosZ],20.0,0,1);
    CreatePickup(1273,1,hInfo[i][PosX],hInfo[i][PosY],hInfo[i][PosZ],1);
    }
    }


    Sorry für die vielen Edits und den Code.
    Jeffry:

    Leider immer noch nichts..


    Log:
    [12:52:19] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
    [12:52:22] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,I", callback: "(null)", format: "(null)"
    [12:52:22] [DEBUG] CMySQLQuery::Execute[] - starting query execution
    [12:52:22] [ERROR] CMySQLQuery::Execute[] - (error #1136) Column count doesn't match value count at row 1
    [12:52:22] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
    [12:52:22] [DEBUG] Calling callback "OnQueryError"..


    Jeffry:


    Habe es sogar auf 1024 gestellt aber auch ohne Erfolg..



    //Edit:


    Jetzt ist mehr in der Log:

    SQL
    [12:54:25] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,I", callback: "(null)", format: "(null)"[12:54:27] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:54:27] [ERROR] CMySQLQuery::Execute[] - (error #1136) Column count doesn't match value count at row 1[12:54:27] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:54:27] [DEBUG] Calling callback "OnQueryError"..[12:55:02] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = 'Besitzer: Niemand', Level = '1', Po", callback: "(null)", format: "(null)"[12:55:02] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:55:02] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:55:02] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:55:02] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:55:02] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:55:02] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:55:02] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:55:02] [DEBUG] Calling callback "OnQueryError"..uery execution[12:55:02] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:55:02] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:55:02] [DEBUG] Calling callback "OnQueryError"..uery execution[12:55:02] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:55:02] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:55:02] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:55:02] [DEBUG] Calling callback "OnQueryError"..[12:55:02] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:55:02] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:55:02] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:55:02] [DEBUG] Calling callback "OnQueryError"..[12:55:02] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:55:02] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:55:02] [DEBUG] Calling callback "OnQueryError"..[12:56:09] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = 'Besitzer: Niemand', Level = '1', Po", callback: "(null)", format: "(null)"[12:56:09] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:56:09] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:56:09] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:56:09] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:56:09] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:56:10] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:56:10] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:56:10] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:56:10] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:56:10] [DEBUG] Calling callback "OnQueryError"..[12:56:10] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:56:10] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:56:10] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:56:10] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:56:10] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:56:10] [DEBUG] Calling callback "OnQueryError"..[12:56:10] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:56:10] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:56:10] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:56:10] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:56:10] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:56:10] [DEBUG] Calling callback "OnQueryError"..[12:57:15] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = 'Besitzer: Niemand', Level = '1', Po", callback: "(null)", format: "(null)"[12:57:15] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:57:15] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:57:15] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:57:15] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:57:15] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:57:15] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE House SET Besitzer = '', Level = '0', PosX = '0.000000', ", callback: "(null)", format: "(null)"[12:57:15] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:57:15] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:57:15] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:57:15] [DEBUG] Calling callback "OnQueryError"..[12:57:15] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:57:15] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:57:15] [DEBUG] Calling callback "OnQueryError"..[12:57:15] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:57:15] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:57:15] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:57:15] [DEBUG] Calling callback "OnQueryError"..[12:57:15] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:57:15] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:57:15] [DEBUG] CMySQLQuery::Execute[] - starting query execution[12:57:15] [DEBUG] Calling callback "OnQueryError"..[12:57:15] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1[12:57:15] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[12:57:15] [DEBUG] Calling callback "OnQueryError"..


    MfG

    Nein, habe einen Syntax fehler sagt die Log:



    Jeffry:

    Hi,


    Okey, danke dir für die schnelle Antwort.


    Oben steht noch der komplette Code :)


    Hier:


    Spoiler anzeigen
    ocmd:createhouse(playerid, params[])
    {
    // if(MAX_HOUSE-1) != 0) return SendClientMessage(playerid, error, "Es können keine weiteren Häuser erstellt werden.");
    new Inte, V, hLv, hPreis,text [128];
    if(sscanf(params,"dddd",Inte, V, hLv, hPreis))return SendClientMessage(playerid,info,"/Createhouse [IntID] [Virtuelle Welt] [Level] [Preis]");
    if(SpielerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, error, "Du bist kein Admin!");
    for(new i=0; i<MAX_HOUSE; i++)
    {
    new Float:Pos[3];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    hInfo[i][PosX] = Pos[0];
    hInfo[i][PosY] = Pos[1];
    hInfo[i][PosZ] = Pos[2];
    hInfo[i][IntID] = Inte;
    hInfo[i][VID] = V;
    hInfo[i][Level] = hLv;
    hInfo[i][Kaufpreis] = hPreis;
    hInfo[i][Mietpreis] = 0;
    hInfo[i][Gekauft] = 0;
    hInfo[i][Lock] = 0;
    switch(Inte)
    {
    case 5:
    {
    hInfo[i][IntX] =1267.663208;
    hInfo[i][IntY] =-781.323242;
    hInfo[i][IntZ] =1091.906250;
    }
    case 1:
    {
    hInfo[i][IntX] = ;
    hInfo[i][IntY] = ;
    hInfo[i][IntZ] = ;
    }
    }
    format(hInfo[i][Besitzer], 34, "Besitzer: Niemand");
    new query[256];
    format(query, sizeof(query), "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,IntY,IntZ, IntID, VID, Lock, Mietpreis, Kaufpreis, Gekauft) VALUES ('%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d', '%d', '%d', '%d', '%d')",
    i, hInfo[i][Besitzer], hInfo[i][Level], hInfo[i][PosX], hInfo[i][PosY], hInfo[i][PosZ], hInfo[i][IntX], hInfo[i][IntY], hInfo[i][IntZ], hInfo[i][IntID], hInfo[i][VID], hInfo[i][Lock], hInfo[i][Mietpreis], hInfo[i][Kaufpreis], hInfo[i][Gekauft], i);
    mysql_tquery(handle, query);
    CreatePickup(1273,1,Pos[0],Pos[1],Pos[2],0);
    format(text, sizeof(text), "Besitzer: Niemand\nPreis: %d\nLevel: %d",hInfo[i][Kaufpreis],hInfo[i][Level]);
    Create3DTextLabel(text,0x0FFF00FF,Pos[0],Pos[1],Pos[2],20.0,0,1);
    return SendClientMessage(playerid, 0x00FF00FF, "Haus wurde erfolgreich gespeichert.");
    }
    return 1;
    }

    Das pickup wird erstellt, der 3D text auch..


    Bloß der rest wird nicht eingetragen :/


    MfG
    Jeffry:

    Hi,


    okey habe mich mal ran gewagt:


    switch(Inte)
    {
    case 5:
    {
    hInfo[i][IntX] =1267.663208;
    hInfo[i][IntY] =-781.323242;
    hInfo[i][IntZ] =1091.906250;
    }
    //case 1: hInfo[i][IntX], hInfo[i][IntY], hInfo[i][IntZ] = ;
    //case 2: hInfo[i][IntX], hInfo[i][IntY], hInfo[i][IntZ] = ;
    }//case 2: hInfo[i][IntX], hInfo[i][IntY], hInfo[i][IntZ] = ;
    }
    Inte ist ja das Interior, also wenn case 5 dann Interior 5 ist soll es die Koordinaten von der Mad Dogg Villa eintragen.
    Ist das richtig so?
    Und könnte mir jemand vielleicht noch beim Rest helfen?
    kurze Schilderung:


    Die Datenbank wird zwar erstellt, jedoch bei /Createhouse wird keine Spalte angelegt ..


    Spoiler anzeigen
    CreateHouseTable()
    {
    new query[1024];
    format(query, sizeof(query), "CREATE TABLE IF NOT EXISTS `House` (");
    format(query, sizeof(query), "%s`ID` int(11) NOT NULL PRIMARY KEY,", query);
    format(query, sizeof(query), "%s `Besitzer` varchar(24) NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `Level` int(11) NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `PosX` float NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `PosY` float NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `PosZ` float NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `IntX` float NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `IntY` float NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `IntZ` float NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `IntID` int(11) NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `VID` int(11) NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `Lock` int(11) NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `Mietpreis` int(11) NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `Kaufpreis` int(11) NOT NULL DEFAULT '0',", query);
    format(query, sizeof(query), "%s `Gekauft` int(11) NOT NULL DEFAULT '0'", query);
    format(query, sizeof(query), "%s) ENGINE=InnoDB DEFAULT CHARSET=latin1;", query);
    mysql_tquery(handle, query);
    printf("query: %s", query);
    return 1;
    }


    Ist hier irgendwas falsch?


    Jeffry:


    Kannst du mal schauen?
    Mit freundlichen Grüßen

    Doch. Tabelle wird erstellt blos hab ich den Code nicht gepostet. Den braucht man ja nicht, da alle Spalten korrekt erstellt werden.



    Mit freundlichen Grüßen

    Hallo leute, ich habe mal ein paar Fragen bezüglich des Haussystems das ich grad versuch zu erstellen mit dem Tutorial von Jeffry
    [URL = [ SCRIPTING ] [jTuT] Fraktions-Fahrzeug-System mit MySQL R39-2]Hier[/URL]


    Gut, ich bekomme schonmal keine Warns/Errors, jedoch gibt es für mich paar sachen die ich nicht verstehe und im Thread vom Tutorial das zu posten, würde unschön aussehen.
    Jeffry:


    Ich habe das jetzt so gemacht, man kann ein Haus erstellen mit /Createhouse [IntID] [Virtuelle Welt] [Level] [Preis]
    Mein Enum sieht so aus:

    Spoiler anzeigen
    enum HausDaten
    {
    Besitzer[34],
    Float:PosX,//Position an der man steht(später der eingang)
    Float:PosY,
    Float:PosZ,
    Float:IntX,(Position des Interior da wo man beim reingehen spawn)
    Float:IntZ,
    Float:IntY,
    IntID,
    VID,
    Lock,
    Kaufpreis,
    Mietpreis,
    Level,
    Gekauft
    }


    So aber jetzt möchte ich es so haben, das wenn man bsp die Interior ID 5 eingibt(Mad Dogg Villa) das die IntX/Y/Z Daten bzw Koordinaten dann halt auch davon in die Datenbank eingetragen werden, also das ich sie beim Command nicht eingeben muss.
    Hier mal mein Command:


    Spoiler anzeigen
    ocmd:createhouse(playerid, params[])
    {
    // if(MAX_HOUSE-1) != 0) return SendClientMessage(playerid, error, "Es können keine weiteren Häuser erstellt werden.");//Hier würde er mir 4 Errors anzeigen
    new Int, V, hLv, hPreis;
    if(sscanf(params,"dddd",Int, V, hLv, hPreis))return SendClientMessage(playerid,info,"/Createhouse [IntID] [Virtuelle Welt] [Level] [Preis]");
    if(SpielerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, error, "Du bist kein Admin!");
    for(new i=0; i<MAX_HOUSE; i++)
    {
    new Float:Pos[3];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    hInfo[i][PosX] = Pos[0];
    hInfo[i][PosY] = Pos[1];
    hInfo[i][PosZ] = Pos[2];
    hInfo[i][IntID] = Int;
    hInfo[i][VID] = V;
    hInfo[i][Level] = hLv;
    hInfo[i][Kaufpreis] = hPreis;
    hInfo[i][Mietpreis] = 0;
    hInfo[i][Gekauft] = 0;
    hInfo[i][Lock] = 0;
    format(hInfo[i][Besitzer], 34, "Besitzer: Niemand");
    new query[256];
    format(query, sizeof(query), "INSERT INTO House (ID, Besitzer, Level, PosX, PosY, PosZ, IntX,IntY,IntZ, IntID, VID, Lock, Mietpreis, Kaufpreis, Gekauft) VALUES ('%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d', '%d', '%d', '%d', '%d')",
    i, hInfo[i][Besitzer], hInfo[i][Level], hInfo[i][PosX], hInfo[i][PosY], hInfo[i][PosZ], hInfo[i][IntX], hInfo[i][IntY], hInfo[i][IntZ], hInfo[i][IntID], hInfo[i][VID], hInfo[i][Lock], hInfo[i][Mietpreis], hInfo[i][Kaufpreis], hInfo[i][Gekauft], i);
    mysql_tquery(handle, query);
    return SendClientMessage(playerid, 0x00FF00FF, "Haus wurde erfolgreich gespeichert.");
    }
    return 1;
    }


    Hier einmal die Errors:

    Spoiler anzeigen
    C:\Users\Tobi\Desktop\samp037_svr_RC3_win32\gamemodes\newrl.pwn(5021) : warning 206: redundant test: constant expression is non-zero
    C:\Users\Tobi\Desktop\samp037_svr_RC3_win32\gamemodes\newrl.pwn(5021) : error 029: invalid expression, assumed zero
    C:\Users\Tobi\Desktop\samp037_svr_RC3_win32\gamemodes\newrl.pwn(5021) : warning 215: expression has no effect
    C:\Users\Tobi\Desktop\samp037_svr_RC3_win32\gamemodes\newrl.pwn(5021) : error 001: expected token: ";", but found ")"
    C:\Users\Tobi\Desktop\samp037_svr_RC3_win32\gamemodes\newrl.pwn(5021) : error 029: invalid expression, assumed zero
    C:\Users\Tobi\Desktop\samp037_svr_RC3_win32\gamemodes\newrl.pwn(5021) : fatal error 107: too many error messages on one line

    Spoiler anzeigen
    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

    Spoiler anzeigen
    4 Errors.

    Zeile:
    if(MAX_HOUSE-1) != 0) return SendClientMessage(playerid, error, "Es können keine weiteren Häuser erstellt werden.");


    Gut, nun zu Nr 2:
    Der /deltehouse Command soll so aufgebaut sein, dass wenn man in der Nähe eines erstellten Haus steht(3.0 Radius) dies dann gelöscht wird.
    Leider hab ich bis jetzt nur eine Abfrage ob er in der Nähe ist, leider weiß ich nicht wie ich dann genau dieses Haus lösche..
    Command sieht momentan so aus:


    Spoiler anzeigen
    ocmd:deletehouse(playerid, params[])
    {
    new Float:dPos[3];
    GetPlayerPos(playerid, dPos[0],dPos[1],dPos[2]);
    if(SpielerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, error, "Du bist kein Admin!");
    for(new i=0; i<MAX_HOUSE; i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 3.0, hInfo[i][PosY],hInfo[i][PosX],hInfo[i][PosZ]))
    {

    hInfo[i][PosX] = 0;
    hInfo[i][PosY] = 0;
    hInfo[i][PosZ] = 0;
    hInfo[i][IntX] = 0;
    hInfo[i][IntY] = 0;
    hInfo[i][IntZ] = 0;
    hInfo[i][IntID] = 0;
    hInfo[i][VID] = 0;
    hInfo[i][Level] = 0;
    hInfo[i][Kaufpreis] = 0;
    hInfo[i][Mietpreis] = 0;
    hInfo[i][Gekauft] = 0;
    hInfo[i][Lock] = 0;

    Spoiler anzeigen
    new query[128];
    format(query, sizeof(query), "DELETE FROM House WHERE ID = '%d'", i);
    mysql_tquery(handle, query);
    return SendClientMessage(playerid, erfolg, "Haus wurde erfolgreich gelöscht.");
    }
    else {
    SendClientMessage(playerid, error, "Du bist nicht in der Nähe eines Hauses!");
    }
    }
    return 1;
    }


    //Edit: Was ich gerade gemerkt habe, es wird garkein Haus in der Tabelle angelegt :/


    Spoiler anzeigen
    public LoadHouse_Data()
    {
    new rows;
    rows = cache_num_rows();
    for(new i=0; i<rows; i++)
    {
    //Fahrzeug existiert in der Datenbank, wir laden die Daten jetzt aus dem Cache.
    cache_get_field_content(0, "Besitzer", hInfo[i][Besitzer],handle,34);
    hInfo[i][Level] = cache_get_field_content_int(i, "Level");
    hInfo[i][PosX] = cache_get_field_content_float(i, "PosX");
    hInfo[i][PosY] = cache_get_field_content_float(i, "PosY");
    hInfo[i][PosZ] = cache_get_field_content_float(i, "PosZ");
    hInfo[i][IntX] = cache_get_field_content_float(i, "IntX");
    hInfo[i][IntY] = cache_get_field_content_float(i, "IntY");
    hInfo[i][IntZ] = cache_get_field_content_float(i, "IntZ");
    hInfo[i][IntID] = cache_get_field_content_int(i, "IntID");
    hInfo[i][VID] = cache_get_field_content_int(i, "VID");
    hInfo[i][Lock] = cache_get_field_content_int(i, "Lock");
    hInfo[i][Mietpreis] = cache_get_field_content_int(i, "Mietpreis");
    hInfo[i][Kaufpreis] = cache_get_field_content_int(i, "Kaufpreis");
    hInfo[i][Gekauft] = cache_get_field_content_int(i, "Gekauft");
    if(i == MAX_HOUSE-1) return print("Es können keine weiteren Häuser geladen werden, Limit wurde erreicht.");
    }
    return 1;
    }
    LoadHouse()
    {
    CreateHouseTable();
    mysql_tquery(handle, "SELECT * FROM Hausdaten ORDER BY ID ASC", "LoadHouse_Data");
    return 1;
    }
    forward SaveAllHouses();
    public SaveAllHouses()
    {
    new query[256];
    for(new i=0; i<MAX_HOUSE; i++)
    {
    format(query, sizeof(query), "UPDATE House SET Besitzer = '%s', Level = '%d', PosX = '%f', PosY = '%f', PosZ = '%f', IntX = '%f', IntY = '%f',IntZ = '%f',IntID = '%d', VID = '%d', Lock = '%d', Mietpreis = '%d', Kaufpreis = '%d', Gekauft = '%d' WHERE ID = '%d'",
    hInfo[i][Besitzer], hInfo[i][Level], hInfo[i][PosX], hInfo[i][PosY], hInfo[i][PosZ], hInfo[i][IntX], hInfo[i][IntY], hInfo[i][IntZ], hInfo[i][IntID], hInfo[i][VID], hInfo[i][Lock], hInfo[i][Mietpreis], hInfo[i][Kaufpreis], hInfo[i][Gekauft], i);
    mysql_tquery(handle, query);
    }
    return 1;
    }


    Hier ist doch alles richtig oder? :/


    Falls ihr irgendwas nicht verstanden habt könnt ihr das ja ins Thread schreiben, oder falls ihr weitere Fehler seht..
    Ich wäre euch dafür sehr dankbar.
    Jede hilfe kann ich gebrauchen :)
    Ich danke schon mal im vorraus !


    Mit freundlichen Grüßen

    Ihr solltet mal die Rechtschreibfehler von eurem "Header" im Forum beheben^^


    'dein in einer ganz anderen Demnision' :D


    sollte bestimmt heißen 'Dein Leben in einer ganz anderen Dimension'


    In eurem TS ist kein Mensch on, somit kann man mit euch auch nicht 'Persönlich' sprechen.


    Überarbeitet mal alles, bevor ihr vorhabt einen Server zu eröffnen.



    Mit freundlichen Grüßen

    Hi,


    irgendwie will das nicht so ganz.
    Ich möchte den Textdraw weiter links, aber er bleibt irgendwie an der gleichen Position :/




    Spoiler anzeigen
    Perso5[playerid] = CreatePlayerTextDraw(playerid, 400.500000, 295.188873, "_");
    PlayerTextDrawLetterSize(playerid, Perso5[playerid], 10.000000, 5.559879);
    PlayerTextDrawFont(playerid, Perso5[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW);
    PlayerTextDrawTextSize(playerid, Perso5[playerid], 50.000000, 50.000000);
    PlayerTextDrawUseBox(playerid, Perso5[playerid], true);
    PlayerTextDrawBoxColor(playerid, Perso5[playerid], 102);
    // PlayerTextDrawTextSize(playerid, Perso5[playerid], 40.0, 40.0);
    // PlayerTextDrawSetPreviewRot(playerid, Perso5[playerid], -10.0, 0.0, -20.0, 1.0);


    Mit freundlichen Grüßen

    Hi, jetzt geht es perfekt!
    Danke dir!


    Was genau hast du jetzt verändert? Die Textsize?
    Was hast du dabei beachtet oder woran hast du dich orientiert :O?



    @Mencent:



    Mit freundlichen Grüßen