Haussystem Probleme

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
  • Guten Tag Community,


    ich bin gerade an der arbeit eines Haussystem wenn ich ein haus kaufe wird der besitzer nicht in die datenbank eingetragen.


    Ich hoffe ihr könnt mir helfen


    ch(Float:X,Float:Y,Float:Z,preis,level)
    {
    for(new i = 0; i < sizeof(hInfo); i++)
    {
    if(hInfo[i][hcreated] != 0)continue;
    hInfo[i][hcreated] = 1;
    hInfo[i][e_x] = X;
    hInfo[i][e_y] = Y;
    hInfo[i][e_z] = Z;
    hInfo[i][ex_x] = 0;
    hInfo[i][ex_y] = 0;
    hInfo[i][ex_z] = 0;
    hInfo[i][hbesitzer] = 0;
    hInfo[i][howned] = 0;
    hInfo[i][hInt] = 0;
    hInfo[i][hvw] = 0;
    hInfo[i][hpreis] = preis;
    hInfo[i][hlevel] = level;
    CreatePickup(1339,1,X,Y,Z);
    }
    return 1;
    }


    saveHaus(hausid)
    {
    if(hInfo[hausid][hcreated] != 0)
    {
    new query[128];
    format(query,sizeof(query),"UPDATE Haus SET Besitzer='%i',created='%d',Level='%i',Preis='%i',EnterX='%f',EnterY='%f',EnterZ='%f' WHERE id='%i'",hInfo[hausid][hbesitzer],hInfo[hausid][hcreated],hInfo[hausid][hlevel],hInfo[hausid][hpreis],hInfo[hausid][e_x],hInfo[hausid][e_y],hInfo[hausid][e_z],hInfo[hausid][hID]);
    mysql_function_query(dbhandle,query,false,"","");
    }
    return 1;
    }


    ocmd:createhaus(playerid,params[])
    {
    new preis,level;
    if(sscanf(params,"dd",preis,level))return SendClientMessage(playerid,COLOR_WHITE,"Benutzung: /createhaus [Preis][Level]");
    new Float:X,Float:Y,Float:Z;
    for(new i = 0; i < sizeof(hInfo); i++)
    {
    if(hInfo[i][hcreated] != 1)
    {
    GetPlayerPos(playerid,X,Y,Z);
    ch(X,Y,Z,preis,level);
    new query[250];
    format(query,sizeof(query),"INSERT INTO haus (id,besitzer,created,Level,Preis,EnterX,EnterY,EnterZ) VALUES ('%d','%d','%d','%d','%d','%f','%f','%f')",hInfo[i][hID],hInfo[i][hbesitzer],hInfo[i][hcreated],hInfo[i][hlevel],hInfo[i][hpreis],hInfo[i][e_x],hInfo[i][e_y],hInfo[i][e_z]);
    mysql_function_query(dbhandle,query,false,"","");
    saveHaus(i);
    print("Haus saved");
    }
    }
    return 1;
    }
    ocmd:kaufen(playerid,params[])
    {
    for(new i = 0; i < sizeof(hInfo); i++)
    {
    if(hInfo[i][hcreated] == 1)
    {
    if(IsPlayerInRangeOfPoint(playerid,6,hInfo[i][e_x],hInfo[i][e_y],hInfo[i][e_z]))
    {
    hInfo[i][hbesitzer] = SpielerInfo[playerid][PID];
    saveHaus(i);
    }
    }
    }
    return 1;
    }

  • ich versuche gerade mal was wenns nicht klappt dann sende ich den log


    //edit


    [19:59:37] [ERROR] "mysql_tquery" - invalid connection handle (ID = 0)
    [19:59: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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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
    [19:59:56] [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

  • kriege jetzt nur noch das im log


    [20:12:40] [ERROR] "mysql_tquery" - invalid connection handle (ID = 0)


    //Edit


    Was mich verwirrt ich erstelle ein Haus und dann kann ich keine mehr erstellen ? :/ in der Datenbank ist aber nur ein Haus und Maximal sollen 15 Häuser erstellt werden können :/

    Einmal editiert, zuletzt von Master147 ()