MySQL speichert nicht in die Datenbank!

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

  • ----------
    Loaded log file: "server_log.txt".
    ----------
    SA-MP Dedicated Server
    ----------------------
    v0.3z, (C)2005-2014 SA-MP Team
    [22:48:35]
    [22:48:35] Server Plugins
    [22:48:35] --------------
    [22:48:35] Loading plugin: streamer
    [22:48:35] Loaded.
    [22:48:35] Loading plugin: sscanf
    [22:48:35]
    [22:48:35] ===============================
    [22:48:35] sscanf plugin loaded.
    [22:48:35] Version: 2.8.1
    [22:48:35] (c) 2012 Alex "Y_Less" Cole
    [22:48:35] ===============================
    [22:48:35] Loaded.
    [22:48:35] Loading plugin: mysql
    [22:48:35]
    > MySQL plugin R5 successfully loaded.
    [22:48:35] Loaded.
    [22:48:35] Loading plugin: crashdetect
    [22:48:35] CrashDetect must be loaded before 'streamer.DLL'
    [22:48:35] Failed.
    [22:48:35] Loaded 3 plugins.
    [22:48:35]
    [22:48:35] Filterscripts
    [22:48:35] ---------------
    [22:48:35] Loading filterscript 'gangwar.amx'...
    [22:48:35] LoadGZ aufgerufen
    [22:48:35] 1
    [22:48:35] str = SELECT * FROM `gangwar`;
    [22:48:35] 2
    [22:48:35] 3 -> rows: 0
    [22:48:35] 4
    [22:48:35] 13
    [22:48:35] '0' Gangzone(n) wurde(n) erfolgreich erstellt und geladen.
    [22:48:35] Loaded 1 filterscripts.
    [22:48:35] [MySQL]: Die Verbindung zur Datenbank wurde erfolgreich hergestellt!
    [22:48:35]
    ----------------------------------
    [22:48:35] Blank Gamemode by your name here
    [22:48:35] ----------------------------------
    [22:48:35] Number of vehicle models: 0


    [22:48:35]
    [22:48:35] ---------------------------
    [22:48:35] MySQL Debugging activated (10/06/14)
    [22:48:35] ---------------------------
    [22:48:35]
    [22:50:12] >> mysql_real_escape_string( Connection handle: 1 )
    [22:50:12] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [22:50:12] >> mysql_query( Connection handle: 1 )
    [22:50:12] CMySQLHandler::Query(SELECT * FROM `accounts` WHERE `Spielername` = 'TaigX') - Successfully executed.
    [22:50:12] >> mysql_store_result( Connection handle: 1 )
    [22:50:12] CMySQLHandler::StoreResult() - Result was stored.
    [22:50:12] >> mysql_num_rows( Connection handle: 1 )
    [22:50:12] CMySQLHandler::NumRows() - Returned 1 row(s)
    [22:50:12] >> mysql_free_result( Connection handle: 1 )
    [22:50:12] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [22:50:15] >> mysql_real_escape_string( Connection handle: 1 )
    [22:50:15] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [22:50:15] >> mysql_query( Connection handle: 1 )
    [22:50:15] CMySQLHandler::Query(SELECT `Passwort` FROM `accounts` WHERE `Spielername` = 'TaigX') - Successfully executed.
    [22:50:15] >> mysql_store_result( Connection handle: 1 )
    [22:50:15] CMySQLHandler::StoreResult() - Result was stored.
    [22:50:15] >> mysql_fetch_row_format( Connection handle: 1 )
    [22:50:15] CMySQLHandler::FetchRow() - Return: 73eef00cc792ddc37ed99c801678057f
    [22:50:15] >> mysql_free_result( Connection handle: 1 )
    [22:50:15] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [22:50:15] >> mysql_real_escape_string( Connection handle: 1 )
    [22:50:15] CMySQLHandler::EscapeString(acounts); - Escaped 7 characters to acounts.
    [22:50:15] >> mysql_real_escape_string( Connection handle: 1 )
    [22:50:15] CMySQLHandler::EscapeString(Adresse); - Escaped 7 characters to Adresse.
    [22:50:15] >> mysql_real_escape_string( Connection handle: 1 )
    [22:50:15] CMySQLHandler::EscapeString(Spielername); - Escaped 11 characters to Spielername.
    [22:50:15] >> mysql_real_escape_string( Connection handle: 1 )
    [22:50:15] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [22:50:15] >> mysql_query( Connection handle: 1 )
    [22:50:15] CMySQLHandler::Query(SELECT `Adresse` FROM `acounts` WHERE `Spielername` = 'TaigX') - An error has occured. (Error ID: 1146, Table 'samp.acounts' doesn't exist)
    [22:50:15] >> mysql_store_result( Connection handle: 1 )
    [22:50:15] CMySQLHandler::StoreResult() - No data to store.
    [22:50:15] >> mysql_fetch_row_format( Connection handle: 1 )
    [22:50:15] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)
    [22:50:15] >> mysql_free_result( Connection handle: 1 )
    [22:50:15] CMySQLHandler::FreeResult() - The result is already empty.
    [22:50:15] >> mysql_real_escape_string( Connection handle: 1 )
    [22:50:15] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [22:50:15] >> mysql_real_escape_string( Connection handle: 1 )
    [22:50:15] CMySQLHandler::EscapeString(Adminlevel); - Escaped 10 characters to Adminlevel.
    [22:50:15] >> mysql_real_escape_string( Connection handle: 1 )
    [22:50:15] CMySQLHandler::EscapeString(Spielername); - Escaped 11 characters to Spielername.
    [22:50:15] >> mysql_real_escape_string( Connection handle: 1 )
    [22:50:15] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [22:50:15] >> mysql_query( Connection handle: 1 )
    [22:50:15] CMySQLHandler::Query(SELECT `Adminlevel` FROM `accounts` WHERE `Spielername` = 'TaigX') - Successfully executed.
    [22:50:15] >> mysql_store_result( Connection handle: 1 )
    [22:50:15] CMySQLHandler::StoreResult() - Result was stored.
    [22:50:15] >> mysql_fetch_int( Connection handle: 1 )
    [22:50:15] CMySQLHandler::FetchRow() - Return: 1
    [22:50:15] >> mysql_free_result( Connection handle: 1 )
    [22:50:15] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [22:50:15] OnQueryError() - Called.


    Steht leider nichts von gangwar.

  • Moment mal, in dem neuen Log sieht das so aus, als dass du erst LoadGZ ausführst und erst danach die Verbindung zur Datenbank herstellst.


    Ich nehme an:
    LoadGZ im Filterscript
    Verbindung zur Datenbank herstellen: Im Gamemode


    Ist das so? Wenn ja: Die Verbindung muss VOR LoadGZ hergestellt werden. Entweder du holst das verbinden in dem Filterscript, oder du setzt einen Timer der einmalig eine Sekunde läuft, welcher dann LoadGZ aufruft (musst es halt public machen).


    Bin ich mit der Annahme richtig? Wenn ja, klappt es wenn du obiges machst?

  • So nun hab ich das mit dem Timer gemacht, nun spuckt er auch was anderes raus, aber funktionieren tut es immer noch nicht.


    SA-MP Dedicated Server
    ----------------------
    v0.3z, (C)2005-2014 SA-MP Team
    [23:05:58]
    [23:05:58] Server Plugins
    [23:05:58] --------------
    [23:05:58] Loading plugin: streamer
    [23:05:58] Loaded.
    [23:05:58] Loading plugin: sscanf
    [23:05:58]
    [23:05:58] ===============================
    [23:05:58] sscanf plugin loaded.
    [23:05:58] Version: 2.8.1
    [23:05:58] (c) 2012 Alex "Y_Less" Cole
    [23:05:58] ===============================
    [23:05:58] Loaded.
    [23:05:58] Loading plugin: mysql
    [23:05:58]
    > MySQL plugin R5 successfully loaded.
    [23:05:58] Loaded.
    [23:05:58] Loading plugin: crashdetect
    [23:05:58] CrashDetect must be loaded before 'streamer.DLL'
    [23:05:58] Failed.
    [23:05:58] Loaded 3 plugins.
    [23:05:58]
    [23:05:58] Filterscripts
    [23:05:58] ---------------
    [23:05:58] Loading filterscript 'gangwar.amx'...
    [23:05:58] Loaded 1 filterscripts.
    [23:05:58] [MySQL]: Die Verbindung zur Datenbank wurde erfolgreich hergestellt!
    [23:05:58]
    ----------------------------------
    [23:05:58] Blank Gamemode by your name here
    [23:05:58] ----------------------------------
    [23:05:58] Number of vehicle models: 0
    [23:05:59] LoadGZ aufgerufen
    [23:05:59] 1
    [23:05:59] str = SELECT * FROM `gangwar`;
    [23:05:59] 2
    [23:05:59] 3 -> rows: 2
    [23:05:59] 4
    [23:05:59] 5 -> i=0 -> string = 37|0|2054.16|1328.14|2029.33|1349.8|2047.52|1334.03|10.6719|0
    [23:05:59] 6
    [23:05:59] 7
    [23:05:59] 5 -> i=1 -> string = 38|0|2039.14|1333.66|2023.3|1344.5|2037.27|1335.29|10.8203|0
    [23:05:59] 6
    [23:05:59] 7
    [23:05:59] 13
    [23:05:59] '0' Gangzone(n) wurde(n) erfolgreich erstellt und geladen.
    [23:06:27] Incoming connection: 127.0.0.1:61343
    [23:06:27] [join] TaigX has joined the server (0:127.0.0.1)
    [23:06:52] [part] TaigX has left the server (0:1)


    [23:05:59] >> mysql_query( Connection handle: 1 )
    [23:05:59] CMySQLHandler::Query(SELECT * FROM `gangwar`;) - Successfully executed.
    [23:05:59] >> mysql_store_result( Connection handle: 1 )
    [23:05:59] CMySQLHandler::StoreResult() - Result was stored.
    [23:05:59] >> mysql_num_rows( Connection handle: 1 )
    [23:05:59] CMySQLHandler::NumRows() - Returned 2 row(s)
    [23:05:59] >> mysql_fetch_row_format( Connection handle: 1 )
    [23:05:59] CMySQLHandler::FetchRow() - Return: 37|0|2054.16|1328.14|2029.33|1349.8|2047.52|1334.03|10.6719|0
    [23:05:59] >> mysql_fetch_row_format( Connection handle: 1 )
    [23:05:59] CMySQLHandler::FetchRow() - Return: 38|0|2039.14|1333.66|2023.3|1344.5|2037.27|1335.29|10.8203|0
    [23:05:59] >> mysql_fetch_row_format( Connection handle: 1 )
    [23:05:59] >> mysql_free_result( Connection handle: 1 )
    [23:05:59] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [23:06:34] >> mysql_real_escape_string( Connection handle: 1 )
    [23:06:34] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [23:06:34] >> mysql_query( Connection handle: 1 )
    [23:06:34] CMySQLHandler::Query(SELECT * FROM `accounts` WHERE `Spielername` = 'TaigX') - Successfully executed.
    [23:06:34] >> mysql_store_result( Connection handle: 1 )
    [23:06:34] CMySQLHandler::StoreResult() - Result was stored.
    [23:06:34] >> mysql_num_rows( Connection handle: 1 )
    [23:06:34] CMySQLHandler::NumRows() - Returned 1 row(s)
    [23:06:34] >> mysql_free_result( Connection handle: 1 )
    [23:06:34] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [23:06:40] >> mysql_real_escape_string( Connection handle: 1 )
    [23:06:40] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [23:06:40] >> mysql_query( Connection handle: 1 )
    [23:06:40] CMySQLHandler::Query(SELECT `Passwort` FROM `accounts` WHERE `Spielername` = 'TaigX') - Successfully executed.
    [23:06:40] >> mysql_store_result( Connection handle: 1 )
    [23:06:40] CMySQLHandler::StoreResult() - Result was stored.
    [23:06:40] >> mysql_fetch_row_format( Connection handle: 1 )
    [23:06:40] CMySQLHandler::FetchRow() - Return: 73eef00cc792ddc37ed99c801678057f
    [23:06:40] >> mysql_free_result( Connection handle: 1 )
    [23:06:40] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [23:06:40] >> mysql_real_escape_string( Connection handle: 1 )
    [23:06:40] CMySQLHandler::EscapeString(acounts); - Escaped 7 characters to acounts.
    [23:06:40] >> mysql_real_escape_string( Connection handle: 1 )
    [23:06:40] CMySQLHandler::EscapeString(Adresse); - Escaped 7 characters to Adresse.
    [23:06:40] >> mysql_real_escape_string( Connection handle: 1 )
    [23:06:40] CMySQLHandler::EscapeString(Spielername); - Escaped 11 characters to Spielername.
    [23:06:40] >> mysql_real_escape_string( Connection handle: 1 )
    [23:06:40] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [23:06:40] >> mysql_query( Connection handle: 1 )
    [23:06:40] CMySQLHandler::Query(SELECT `Adresse` FROM `acounts` WHERE `Spielername` = 'TaigX') - An error has occured. (Error ID: 1146, Table 'samp.acounts' doesn't exist)
    [23:06:40] >> mysql_store_result( Connection handle: 1 )
    [23:06:40] CMySQLHandler::StoreResult() - No data to store.
    [23:06:40] >> mysql_fetch_row_format( Connection handle: 1 )
    [23:06:40] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)
    [23:06:40] >> mysql_free_result( Connection handle: 1 )
    [23:06:40] CMySQLHandler::FreeResult() - The result is already empty.
    [23:06:40] >> mysql_real_escape_string( Connection handle: 1 )
    [23:06:40] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [23:06:40] >> mysql_real_escape_string( Connection handle: 1 )
    [23:06:40] CMySQLHandler::EscapeString(Adminlevel); - Escaped 10 characters to Adminlevel.
    [23:06:40] >> mysql_real_escape_string( Connection handle: 1 )
    [23:06:40] CMySQLHandler::EscapeString(Spielername); - Escaped 11 characters to Spielername.
    [23:06:40] >> mysql_real_escape_string( Connection handle: 1 )
    [23:06:40] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [23:06:40] >> mysql_query( Connection handle: 1 )
    [23:06:40] CMySQLHandler::Query(SELECT `Adminlevel` FROM `accounts` WHERE `Spielername` = 'TaigX') - Successfully executed.
    [23:06:40] >> mysql_store_result( Connection handle: 1 )
    [23:06:40] CMySQLHandler::StoreResult() - Result was stored.
    [23:06:40] >> mysql_fetch_int( Connection handle: 1 )
    [23:06:40] CMySQLHandler::FetchRow() - Return: 1
    [23:06:40] >> mysql_free_result( Connection handle: 1 )
    [23:06:40] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [23:06:40] OnQueryError() - Called.
    [23:06:52] >> mysql_query( Connection handle: 1 )
    [23:06:52] CMySQLHandler::Query(UPDATE accounts SET Adresse='255.255.255.255',Adminlevel=1 WHERE Spielername='TaigX') - Successfully executed.

  • Sehr gut!


    Es geht nicht, weil beide Zonen auf erstellt = 0 sind (die 0 am Ende). Wenn du das zu 1 setzt (auch beim Erstellen), dann geht es.


    Um spätere Probleme zu verhindern:
    Da du die IDs anders hast als der Index füge das hinzu
    case 1: GZ[i][zid] = strval(tmpstring);


    Und entferne
    GZ[i][zid] = i;

  • Hab das nun so gemacht, aber funktionieren tut es immer noch nicht. Und dies auf 1 setzen wie meinst du das genau soll ich das manuell machen?


    stock LoadGZ()
    {
    print("LoadGZ aufgerufen");
    new string[500], str[64];
    print("1");
    format(str, sizeof(str), "SELECT * FROM `gangwar`;");
    printf("str = %s", str);
    mysql_query(str);
    print("2");
    mysql_store_result();
    printf("3 -> rows: %d", mysql_num_rows());
    new i = -1, counter = 0;
    print("4");
    while(mysql_fetch_row(string))
    {
    i++;
    printf("5 -> i=%d -> string = %s", i, string);
    strins(string, "|", strlen(string));
    new oldx=0;
    new count=0;
    for(new x=0; x<strlen(string); x++)
    {
    if(string[x]=='|')
    {
    count++;
    new tmpstring[sizeof(string)]; tmpstring=string;
    strdel(tmpstring, x, strlen(tmpstring));
    strdel(tmpstring, 0, oldx+1);
    switch(count)
    {
    case 1: GZ[i][zid] = strval(tmpstring);
    case 2: GZ[i][owner] = strval(tmpstring);
    case 3: GZ[i][max_x] = floatstr(tmpstring);
    case 4: GZ[i][max_y] = floatstr(tmpstring);
    case 5: GZ[i][min_x] = floatstr(tmpstring);
    case 6: GZ[i][min_y] = floatstr(tmpstring);
    case 7: GZ[i][flagge_x] = floatstr(tmpstring);
    case 8: GZ[i][flagge_y] = floatstr(tmpstring);
    case 9: GZ[i][flagge_z] = floatstr(tmpstring);
    case 10: GZ[i][erstellt] = strval(tmpstring);
    }
    oldx=x;
    }
    }
    print("6");
    print("7");
    if(GZ[i][erstellt] != 1)continue;
    print("8");
    format(str,64,"%d |Besitzer: '%s'",i,FrakName(GZ[i][owner]));
    print("9");
    M_CreateZone(GZ[i][min_x],GZ[i][min_y],GZ[i][max_x],GZ[i][max_y],FrakColor(GZ[i][owner]),str,FrakColor(GZ[i][owner]));
    print("10");
    GZ[i][pickup] = CreatePickup(1314,1,GZ[i][flagge_x],GZ[i][flagge_y],GZ[i][flagge_z],0);
    print("11");
    GZ[i][label] = Create3DTextLabel("Tippe '/angriff', um das Gebiet anzugreifen.\nTippe '/flagge', um die Flagge zu erobern.",Rot,GZ[i][flagge_x],GZ[i][flagge_y],GZ[i][flagge_z],20,0);
    print("12");
    counter ++;
    }
    print("13");
    mysql_free_result();
    return printf(" '%d' Gangzone(n) wurde(n) erfolgreich erstellt und geladen.",counter);
    }
    stock LoadGZ_(i)
    {
    new string[500], str[64];
    mysql_query("SELECT * FROM gangwar");
    mysql_store_result();
    new counter = 0;
    mysql_fetch_row(string);
    strins(string, "|", strlen(string));
    new oldx=0;
    new count=0;
    for(new x=0; x<strlen(string); x++)
    {
    if(string[x]=='|')
    {
    count++;
    new tmpstring[sizeof(string)]; tmpstring=string;
    strdel(tmpstring, x, strlen(tmpstring));
    strdel(tmpstring, 0, oldx+1);
    switch(count)
    {
    case 1: GZ[i][zid] = strval(tmpstring);
    case 2: GZ[i][owner] = strval(tmpstring);
    case 3: GZ[i][max_x] = floatstr(tmpstring);
    case 4: GZ[i][max_y] = floatstr(tmpstring);
    case 5: GZ[i][min_x] = floatstr(tmpstring);
    case 6: GZ[i][min_y] = floatstr(tmpstring);
    case 7: GZ[i][flagge_x] = floatstr(tmpstring);
    case 8: GZ[i][flagge_y] = floatstr(tmpstring);
    case 9: GZ[i][flagge_z] = floatstr(tmpstring);
    case 10: GZ[i][erstellt] = strval(tmpstring);
    }
    oldx=x;
    }
    }
    if(GZ[i][erstellt] != 1)return 1;
    format(str,64,"%d |Besitzer: '%s'",i,FrakName(GZ[i][owner]));
    M_CreateZone(GZ[i][min_x],GZ[i][min_y],GZ[i][max_x],GZ[i][max_y],FrakColor(GZ[i][owner]),str,FrakColor(GZ[i][owner]));
    GZ[i][pickup] = CreatePickup(1314,1,GZ[i][flagge_x],GZ[i][flagge_y],GZ[i][flagge_z],0);
    GZ[i][label] = Create3DTextLabel("Tippe '/angriff', um das Gebiet anzugreifen.\nTippe '/flagge', um die Flagge zu erobern.",Rot,GZ[i][flagge_x],GZ[i][flagge_y],GZ[i][flagge_z],20,0);
    counter ++;
    return printf(" '%d' Gangzone(n) wurde(n) erfolgreich erstellt und geladen.",counter);
    }



    SA-MP Dedicated Server
    ----------------------
    v0.3z, (C)2005-2014 SA-MP Team
    [23:27:26]
    [23:27:26] Server Plugins
    [23:27:26] --------------
    [23:27:26] Loading plugin: streamer
    [23:27:26] Loaded.
    [23:27:26] Loading plugin: sscanf
    [23:27:26]
    [23:27:26] ===============================
    [23:27:26] sscanf plugin loaded.
    [23:27:26] Version: 2.8.1
    [23:27:26] (c) 2012 Alex "Y_Less" Cole
    [23:27:26] ===============================
    [23:27:26] Loaded.
    [23:27:26] Loading plugin: mysql
    [23:27:26]
    > MySQL plugin R5 successfully loaded.
    [23:27:26] Loaded.
    [23:27:26] Loading plugin: crashdetect
    [23:27:26] CrashDetect must be loaded before 'streamer.DLL'
    [23:27:26] Failed.
    [23:27:26] Loaded 3 plugins.
    [23:27:26]
    [23:27:26] Filterscripts
    [23:27:26] ---------------
    [23:27:26] Loading filterscript 'gangwar.amx'...
    [23:27:26] LoadGZ aufgerufen
    [23:27:26] 1
    [23:27:26] str = SELECT * FROM `gangwar`;
    [23:27:26] 2
    [23:27:26] 3 -> rows: 0
    [23:27:26] 4
    [23:27:26] 13
    [23:27:26] '0' Gangzone(n) wurde(n) erfolgreich erstellt und geladen.
    [23:27:26] Loaded 1 filterscripts.
    [23:27:26] [MySQL]: Die Verbindung zur Datenbank wurde erfolgreich hergestellt!
    [23:27:26]
    ----------------------------------
    [23:27:26] Blank Gamemode by your name here
    [23:27:26] ----------------------------------
    [23:27:26] Number of vehicle models: 0
    [23:28:02] Incoming connection: 127.0.0.1:50275
    [23:28:02] [join] TaigX has joined the server (0:127.0.0.1)
    [23:28:24] [part] TaigX has left the server (0:1)


    [23:28:09] >> mysql_real_escape_string( Connection handle: 1 )
    [23:28:09] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [23:28:09] >> mysql_query( Connection handle: 1 )
    [23:28:09] CMySQLHandler::Query(SELECT * FROM `accounts` WHERE `Spielername` = 'TaigX') - Successfully executed.
    [23:28:09] >> mysql_store_result( Connection handle: 1 )
    [23:28:09] CMySQLHandler::StoreResult() - Result was stored.
    [23:28:09] >> mysql_num_rows( Connection handle: 1 )
    [23:28:09] CMySQLHandler::NumRows() - Returned 1 row(s)
    [23:28:09] >> mysql_free_result( Connection handle: 1 )
    [23:28:09] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [23:28:13] >> mysql_real_escape_string( Connection handle: 1 )
    [23:28:13] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [23:28:13] >> mysql_query( Connection handle: 1 )
    [23:28:13] CMySQLHandler::Query(SELECT `Passwort` FROM `accounts` WHERE `Spielername` = 'TaigX') - Successfully executed.
    [23:28:13] >> mysql_store_result( Connection handle: 1 )
    [23:28:13] CMySQLHandler::StoreResult() - Result was stored.
    [23:28:13] >> mysql_fetch_row_format( Connection handle: 1 )
    [23:28:13] CMySQLHandler::FetchRow() - Return: 73eef00cc792ddc37ed99c801678057f
    [23:28:13] >> mysql_free_result( Connection handle: 1 )
    [23:28:13] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [23:28:13] >> mysql_real_escape_string( Connection handle: 1 )
    [23:28:13] CMySQLHandler::EscapeString(acounts); - Escaped 7 characters to acounts.
    [23:28:13] >> mysql_real_escape_string( Connection handle: 1 )
    [23:28:13] CMySQLHandler::EscapeString(Adresse); - Escaped 7 characters to Adresse.
    [23:28:13] >> mysql_real_escape_string( Connection handle: 1 )
    [23:28:13] CMySQLHandler::EscapeString(Spielername); - Escaped 11 characters to Spielername.
    [23:28:13] >> mysql_real_escape_string( Connection handle: 1 )
    [23:28:13] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [23:28:13] >> mysql_query( Connection handle: 1 )
    [23:28:13] CMySQLHandler::Query(SELECT `Adresse` FROM `acounts` WHERE `Spielername` = 'TaigX') - An error has occured. (Error ID: 1146, Table 'samp.acounts' doesn't exist)
    [23:28:13] >> mysql_store_result( Connection handle: 1 )
    [23:28:13] CMySQLHandler::StoreResult() - No data to store.
    [23:28:13] >> mysql_fetch_row_format( Connection handle: 1 )
    [23:28:13] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)
    [23:28:13] >> mysql_free_result( Connection handle: 1 )
    [23:28:13] CMySQLHandler::FreeResult() - The result is already empty.
    [23:28:13] >> mysql_real_escape_string( Connection handle: 1 )
    [23:28:13] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [23:28:13] >> mysql_real_escape_string( Connection handle: 1 )
    [23:28:13] CMySQLHandler::EscapeString(Adminlevel); - Escaped 10 characters to Adminlevel.
    [23:28:13] >> mysql_real_escape_string( Connection handle: 1 )
    [23:28:13] CMySQLHandler::EscapeString(Spielername); - Escaped 11 characters to Spielername.
    [23:28:13] >> mysql_real_escape_string( Connection handle: 1 )
    [23:28:13] CMySQLHandler::EscapeString(TaigX); - Escaped 5 characters to TaigX.
    [23:28:13] >> mysql_query( Connection handle: 1 )
    [23:28:13] CMySQLHandler::Query(SELECT `Adminlevel` FROM `accounts` WHERE `Spielername` = 'TaigX') - Successfully executed.
    [23:28:13] >> mysql_store_result( Connection handle: 1 )
    [23:28:13] CMySQLHandler::StoreResult() - Result was stored.
    [23:28:13] >> mysql_fetch_int( Connection handle: 1 )
    [23:28:13] CMySQLHandler::FetchRow() - Return: 1
    [23:28:13] >> mysql_free_result( Connection handle: 1 )
    [23:28:13] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [23:28:13] OnQueryError() - Called.
    [23:28:24] >> mysql_query( Connection handle: 1 )
    [23:28:24] CMySQLHandler::Query(UPDATE accounts SET Adresse='255.255.255.255',Adminlevel=1 WHERE Spielername='TaigX') - Successfully executed.

  • Du hast den Timer weg gemacht, warum? Ohne den Timer geht es nicht.


    Nein, nicht manuell. Beim Erstellen der Zone (INSERT Query setzt du die Spalte "erstellt" (eben die letzte in der Tabelle) auf 1.


    Oder, falls dir das egal ist, mache einfach das weg:
    if(GZ[i][erstellt] != 1)continue;



    Den Timer brauchst du aber zwingend, da sonst das Query vor der Verbindung ausgeführt wird, und das geht nicht.

  • Hatte denn Timer rausgenommen, weil ich was testen wollte und hab ihn vergessen wieder einzubauen. Nun klappt es endlich und ich muss mich echt ziemlich bei dir bedanken, dass du mir rund um die Uhr geholfen hast. Danke :)


    Nun wollte ich noch Fragen ob du mir zeigen bzw. erklären kannst wie ich dies nun in sscanf umbauen kann.

  • Das alles zwischen Print 5 und Print 6 musst du hiermit ersetzen:
    sscanf(string, "p<|>ddfffffffd", GZ[i][zid], GZ[i][owner], GZ[i][max_x], GZ[i][max_y], GZ[i][min_x], GZ[i][min_y], GZ[i][flagge_x], GZ[i][flagge_y], GZ[i][flagge_z], GZ[i][erstellt]);
    Ist zwar kürzer, aber bei weitem nicht so flexibel. Wenn dir das egal ist, kannst du auch sscanf nutzen. Mir ist es in meinem Code nicht egal.


    Du kannst es auch direkt in das enum splitten, dazu sollte aber die Reihenfolge im enum gleich sein wie in der Datenbank.
    Falls du das noch selbst machen willst hast du hier ein Tutorial, wie du das machst: [ SCRIPTING ] sscanf 2.0

    3HZXdYd.png

    2 Mal editiert, zuletzt von Jeffry ()