Fahrzeuge in MySQL Speichern

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
  • SpielerInfo[playerid][pRank] = cache_get_field_content_float(0, "xKord");
    SpielerInfo[playerid][pDuty] = cache_get_field_content_float(0, "yKord");
    SpielerInfo[playerid][pSkin] = cache_get_field_content_float(0, "zKord");


    Es kommen 3 Warnings
    warning 213: tag mismatch


    Und wäre es richtig wenn ich bei pLeader und so '%i' nehme für Int?
    Und wenn ja, wo muss ich das alles dann machen? überall sind das doch eig Zahlen oder ?



    Die heutigen Noobs, sind die Profis von morgen! :thumbup:


    Danke an Jeffry für seine ständige Hilfsbereitschaft und freundliche Art. 8)

  • Hä? Du schreibst die Koordinaten immer noch in die falschen Variablen.
    SpielerInfo[playerid][pRank] = cache_get_field_content_float(0, "xKord");
    SpielerInfo[playerid][pDuty] = cache_get_field_content_float(0, "yKord");
    SpielerInfo[playerid][pSkin] = cache_get_field_content_float(0, "zKord");


    zu:
    SpielerInfo[playerid][XKOORDINATE] = cache_get_field_content_float(0, "xKord");
    SpielerInfo[playerid][YKOORDINATE] = cache_get_field_content_float(0, "yKord");
    SpielerInfo[playerid][ZKOORDINATE] = cache_get_field_content_float(0, "zKord");


    Wenn du die xKord in pRank schreibst, kann das nicht klappen. ;)



    EDIT:
    @TVPikachu: Passt schon, kommt vor. :D Für mich ist sowas immer das Zeichen, dass genug für heute ist. Vielleicht machst du morgen weiter.

  • Oh haha das hab ich jetzt garnicht gesehen, wie peinlich :D


    Sorry :D


    //Edit:


    Ja klar, wenn ich das noch hinbekomme weil es speichert immer noch nicht :/
    Und er sagt mir immer ich bin kein Admin obwohl ich mich in der DB eingetragen habe..
    Brauch ich jetzt ne neue Admin abfrage?



    Die heutigen Noobs, sind die Profis von morgen! :thumbup:


    Danke an Jeffry für seine ständige Hilfsbereitschaft und freundliche Art. 8)

  • //Doch nicht -.-


    //EDIT: Paar sachen hinzugefügt, trotzdem geht es nicht


    Abfrage :
    if(SpielerInfo[playerid][pAdmin] < 1)return SendClientMessage(playerid,Color_Red,"Diesen Befehl kannst du nicht nutzen. Mindestens benötigter Rang: {00FF5A}Supporter"); {


    und mein Enum, falls du es brauchst


    enum SpielerDaten
    {
    pName[MAX_PLAYER_NAME],
    pLevel,
    pGeld,
    pKills,
    pTode,
    pAdmin,
    pBanned,
    pLeader,
    pMember,
    pTeam,
    pRank,
    pDuty,
    pSkin,
    Float:pHealth,
    Float:xKord,
    Float:yKord,
    Float:zKord,
    pInterior
    }


    forward LoadPlayer(playerid);
    public LoadPlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    cache_get_field_content(playerid-1, "Name", SpielerInfo[playerid][pName]);
    SpielerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level");
    SpielerInfo[playerid][pGeld] = cache_get_field_content_int(0, "Geld");
    SpielerInfo[playerid][pKills] = cache_get_field_content_int(0, "Kills");
    SpielerInfo[playerid][pTode] = cache_get_field_content_int(0, "Tode");
    SpielerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
    SpielerInfo[playerid][pBanned] = cache_get_field_content_int(0, "Banned");
    SpielerInfo[playerid][pLeader] = cache_get_field_content_int(0, "Leader");
    SpielerInfo[playerid][pMember] = cache_get_field_content_int(0, "Member");
    SpielerInfo[playerid][pTeam] = cache_get_field_content_int(0, "Team");
    SpielerInfo[playerid][pRank] = cache_get_field_content_int(0, "Rank");
    SpielerInfo[playerid][pDuty] = cache_get_field_content_int(0, "Duty");
    SpielerInfo[playerid][pSkin] = cache_get_field_content_int(0, "Skin");
    SpielerInfo[playerid][pHealth] = cache_get_field_content_int(0, "Health");
    SpielerInfo[playerid][xKord] = cache_get_field_content_float(0, "xKord");
    SpielerInfo[playerid][yKord] = cache_get_field_content_float(0, "yKord");
    SpielerInfo[playerid][zKord] = cache_get_field_content_float(0, "zKord");
    SetPlayerPos(playerid,SpielerInfo[playerid][xKord], SpielerInfo[playerid][xKord], SpielerInfo[playerid][zKord]);
    SetPlayerInterior(playerid,SpielerInfo[playerid][pInterior]);
    SetPlayerSkin(playerid,SpielerInfo[playerid][pSkin]);

    }
    }

    return 1;
    }
    stock SavePlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    new Float:xxKord,Float:yyKord,Float:zzKord;
    GetPlayerPos(playerid,xxKord,yyKord,zzKord);
    new typos = GetPlayerSkin(playerid);
    SpielerInfo[playerid][pGeld] = GetPlayerMoney(playerid);
    new query[512];
    format(query, sizeof(query), "UPDATE accounts SET Name = '%s', Level = '%d', Geld = '%d', Kills = '%d', Tode = '%d', Admin = '%d', Banned, Leader = '%d', Member = '%d', Team = '%d', Rank = '%d', Duty = '%d', Skin = '%d', Health = '%d', xKord = '%d', yKord = '%d', zKord, Interior = '%d' = '%d' = '%d' WHERE ID = '%d'",
    SpielerInfo[playerid][pName], SpielerInfo[playerid][pName], SpielerInfo[playerid][pLevel], SpielerInfo[playerid][pGeld], SpielerInfo[playerid][pKills], SpielerInfo[playerid][pTode], SpielerInfo[playerid][pAdmin], SpielerInfo[playerid][pBanned], SpielerInfo[playerid][pLeader], SpielerInfo[playerid][pMember], SpielerInfo[playerid][pTeam], SpielerInfo[playerid][pRank], SpielerInfo[playerid][pDuty], SpielerInfo[playerid][pSkin], SpielerInfo[playerid][pHealth], SpielerInfo[playerid][xKord], SpielerInfo[playerid][yKord], SpielerInfo[playerid][zKord], SpielerInfo[playerid][pInterior], playerid);
    mysql_tquery(handle, query);
    }
    }
    return 1;
    }



    Die heutigen Noobs, sind die Profis von morgen! :thumbup:


    Danke an Jeffry für seine ständige Hilfsbereitschaft und freundliche Art. 8)

    2 Mal editiert, zuletzt von ENEF ()

  • Du hast den Name zwei mal in den Parametern stehen.
    Teste es mal so:
    stock SavePlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    new query[512];
    format(query, sizeof(query), "UPDATE accounts SET Name = '%s', Level = '%d', Geld = '%d', Kills = '%d', Tode = '%d', Admin = '%d', Banned, Leader = '%d', Member = '%d', Team = '%d', Rank = '%d', Duty = '%d', Skin = '%d', Health = '%d', xKord = '%d', yKord = '%d', zKord, Interior = '%d' = '%d' = '%d' WHERE Name = '%s'",
    SpielerInfo[playerid][pName], SpielerInfo[playerid][pLevel], SpielerInfo[playerid][pGeld], SpielerInfo[playerid][pKills], SpielerInfo[playerid][pTode], SpielerInfo[playerid][pAdmin], SpielerInfo[playerid][pBanned], SpielerInfo[playerid][pLeader], SpielerInfo[playerid][pMember], SpielerInfo[playerid][pTeam], SpielerInfo[playerid][pRank], SpielerInfo[playerid][pDuty], SpielerInfo[playerid][pSkin], SpielerInfo[playerid][pHealth], SpielerInfo[playerid][xKord], SpielerInfo[playerid][yKord], SpielerInfo[playerid][zKord], SpielerInfo[playerid][pInterior], SpielerInfo[playerid][pName]);
    mysql_tquery(handle, query);
    printf("query: %s", query);
    }
    }
    return 1;
    }


    Wenn es nicht geht, poste was in deinem server_log steht (query: ...).

  • SQL
    [21:32:33] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "new_rl", password: "****", port: 3306, autoreconnect: true, pool_size: 2[21:32:33] [DEBUG] CMySQLHandle::Create - creating new connection..[21:32:33] [WARNING] CMySQLHandle::Create - connection already exists[21:32:33] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:32:33] [DEBUG] CMySQLConnection::Connect - connection was successful[21:32:33] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[21:32:33] [DEBUG] mysql_errno - connection: 1[21:32:33] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:32:33] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM Kassen ORDER BY ID ASC", callback: "LoadKassen", format: "d"[21:32:33] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:32:33] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:32:33] [DEBUG] CMySQLConnection::Connect - connection was successful[21:32:33] [DEBUG] CMySQLConnection::Connect - connection was successful[21:32:33] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM accounts ORDER BY ID ASC", callback: "LoadPlayer", format: "d"[21:32:33] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[21:32:33] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[21:32:33] [DEBUG] CMySQLQuery::Execute[LoadKassen] - starting query execution[21:32:33] [DEBUG] CMySQLQuery::Execute[LoadKassen] - query was successfully executed within 0.555 milliseconds[21:32:33] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:32:33] [DEBUG] CMySQLQuery::Execute[LoadPlayer] - starting query execution[21:32:33] [DEBUG] Calling callback "LoadKassen"..[21:32:33] [DEBUG] cache_get_row_count - connection: 1[21:32:33] [DEBUG] CMySQLQuery::Execute[LoadPlayer] - query was successfully executed within 0.451 milliseconds[21:32:33] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:32:33] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "1"[21:32:33] [DEBUG] cache_get_field_content - row: 0, field_name: "Name", connection: 1, max_len: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Name", data: "Staatskasse"[21:32:33] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Geld", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Geld", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Drogen", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Drogen", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Waffen", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Waffen", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 1, field_name: "ID", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "ID", data: "2"[21:32:33] [DEBUG] cache_get_field_content - row: 1, field_name: "Name", connection: 1, max_len: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Name", data: "Test1"[21:32:33] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Geld", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Geld", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Drogen", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Drogen", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Waffen", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Waffen", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 2, field_name: "ID", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "ID", data: "3"[21:32:33] [DEBUG] cache_get_field_content - row: 2, field_name: "Name", connection: 1, max_len: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Name", data: "Test2"[21:32:33] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Geld", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Geld", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Drogen", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Drogen", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Waffen", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Waffen", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 3, field_name: "ID", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "ID", data: "4"[21:32:33] [DEBUG] cache_get_field_content - row: 3, field_name: "Name", connection: 1, max_len: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Name", data: "Test3"[21:32:33] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Geld", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Geld", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Drogen", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Drogen", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Waffen", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Waffen", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 4, field_name: "ID", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "ID", data: "5"[21:32:33] [DEBUG] cache_get_field_content - row: 4, field_name: "Name", connection: 1, max_len: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Name", data: "ADAC"[21:32:33] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Geld", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Geld", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Drogen", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Drogen", data: "0"[21:32:33] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Waffen", connection: 1[21:32:33] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Waffen", data: "0"[21:32:33] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:32:33] [DEBUG] Calling callback "LoadPlayer"..[21:32:33] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:32:51] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT Name FROM accounts WHERE Name = '%e'"[21:32:51] [DEBUG] mysql_tquery - connection: 1, query: "SELECT Name FROM accounts WHERE Name = 'niddo_189'", callback: "CheckAccount", format: "d"[21:32:51] [DEBUG] CMySQLQuery::Execute[CheckAccount] - starting query execution[21:32:51] [DEBUG] CMySQLQuery::Execute[CheckAccount] - query was successfully executed within 0.515 milliseconds[21:32:51] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:32:51] [DEBUG] Calling callback "CheckAccount"..[21:32:52] [DEBUG] cache_get_row_count - connection: 1[21:32:52] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:32:54] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT Name FROM accounts WHERE Name = '%e' AND Passwort = '%e'"[21:32:54] [DEBUG] mysql_tquery - connection: 1, query: "SELECT Name FROM accounts WHERE Name = 'niddo_189' AND Passwort ", callback: "CheckPassword", format: "d"[21:32:54] [DEBUG] CMySQLQuery::Execute[CheckPassword] - starting query execution[21:32:54] [DEBUG] CMySQLQuery::Execute[CheckPassword] - query was successfully executed within 0.434 milliseconds[21:32:54] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:32:54] [DEBUG] Calling callback "CheckPassword"..[21:32:54] [DEBUG] cache_get_row_count - connection: 1[21:32:54] [DEBUG] cache_get_field_content - row: -1, field_name: "Name", connection: 1, max_len: 1[21:32:54] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('-1')[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Level", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Level")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Geld", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Geld")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Kills", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Kills")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Tode", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Tode")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Admin", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Admin")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Banned", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Banned")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Leader", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Leader")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Member", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Member")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Team", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Team")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Rank", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Rank")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Duty", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Duty")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Skin", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Skin")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Health", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Health")[21:32:54] [ERROR] cache_get_field_content_int - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_float - row: 0, field_name: "xKord", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("xKord")[21:32:54] [ERROR] cache_get_field_content_float - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_float - row: 0, field_name: "yKord", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("yKord")[21:32:54] [ERROR] cache_get_field_content_float - invalid datatype[21:32:54] [DEBUG] cache_get_field_content_float - row: 0, field_name: "zKord", connection: 1[21:32:54] [WARNING] CMySQLResult::GetRowDataByName - field not found ("zKord")[21:32:54] [ERROR] cache_get_field_content_float - invalid datatype[21:32:54] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:33:08] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM accounts ORDER BY ID ASC", callback: "SavePlayer", format: "d"[21:33:08] [DEBUG] CMySQLQuery::Execute[SavePlayer] - starting query execution[21:33:08] [DEBUG] CMySQLQuery::Execute[SavePlayer] - query was successfully executed within 0.533 milliseconds[21:33:08] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:33:08] [DEBUG] Calling callback "SavePlayer"..[21:33:08] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called


    Ging leider nicht ..



    Die heutigen Noobs, sind die Profis von morgen! :thumbup:


    Danke an Jeffry für seine ständige Hilfsbereitschaft und freundliche Art. 8)

  • SQL
    SELECT * FROM accounts ORDER BY ID ASC


    Das ist falsch. Wo auch immer das steht, das bringt da nichts.


    Dann:
    cache_get_field_content(playerid-1, "Name", SpielerInfo[playerid][pName]);
    zu:
    cache_get_field_content(0, "Name", SpielerInfo[playerid][pName]);
    Hast du vergessen.



    Und das hier schreibst du so (war mein Fehler, dass da nur Name selektiert wird):
    switch(dialogid)
    {
    case DIALOG_REGISTER:
    {
    if(response)
    {
    if(strlen(inputtext) == 0)
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Regestration","Datenbank: Das angegebene Passwort ist zu kurz!","Register","Abbrechen");
    return 1;
    }
    else
    {
    CreateAccount(playerid, inputtext);
    SetPVarInt(playerid,"Eingeloggt",1);
    SpawnPlayer(playerid);
    SetSpawnInfo(playerid, 0, 0, -1982.5010,140.7040,27.6875,89.0363, 0, 0, 0, 0, 0, 0 );
    return 1;
    }
    }
    else
    {
    Kick(playerid);
    }
    }
    case DIALOG_LOGIN:
    {
    if(response)
    {
    if(strlen(inputtext) == 0)
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Einloggen","Datenbank: Das angegebene Passwort ist falsch!","Login","Abbrechen");
    return 1;
    }
    else
    {
    new PlayerName[MAX_PLAYER_NAME], query[256];
    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    mysql_format(handle, query, sizeof(query), "SELECT * FROM users WHERE Name = '%e' AND Passwort = '%e'", PlayerName, inputtext); //name, passwort und users zu deinem anpassen!!
    mysql_tquery(handle, query, "LoadPlayer", "d", playerid);
    }
    }
    else
    {
    Kick(playerid);
    }
    }
    }


    Ich habe das Callback im mysql_tquery zu LoadPlayer umbenannt, da du das Callback ja umbenannt hast.

  • Hi Jeffry,


    danke für die Mühe und Hilfe, aber irgendwie Speichert er meine Kords. immer noch nicht und mein Adminlevel wird immer noch nicht erkannt.
    Ich weiß nicht was ich jetzt wieder falsch gemacht habe :D aber es geht einfach nicht, deswegen falls du kurz Zeit hast hier mal der komplette Code.
    Load&Save

    Spoiler anzeigen
    forward LoadPlayer(playerid);
    public LoadPlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    cache_get_field_content(0, "Name", SpielerInfo[playerid][pName]);
    SpielerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level");
    SpielerInfo[playerid][pGeld] = cache_get_field_content_int(0, "Geld");
    SpielerInfo[playerid][pKills] = cache_get_field_content_int(0, "Kills");
    SpielerInfo[playerid][pTode] = cache_get_field_content_int(0, "Tode");
    SpielerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
    SpielerInfo[playerid][pBanned] = cache_get_field_content_int(0, "Banned");
    SpielerInfo[playerid][pLeader] = cache_get_field_content_int(0, "Leader");
    SpielerInfo[playerid][pMember] = cache_get_field_content_int(0, "Member");
    SpielerInfo[playerid][pTeam] = cache_get_field_content_int(0, "Team");
    SpielerInfo[playerid][pRank] = cache_get_field_content_int(0, "Rank");
    SpielerInfo[playerid][pDuty] = cache_get_field_content_int(0, "Duty");
    SpielerInfo[playerid][pSkin] = cache_get_field_content_int(0, "Skin");
    SpielerInfo[playerid][pHealth] = cache_get_field_content_int(0, "Health");
    SpielerInfo[playerid][xKord] = cache_get_field_content_float(0, "xKord");
    SpielerInfo[playerid][yKord] = cache_get_field_content_float(0, "yKord");
    SpielerInfo[playerid][zKord] = cache_get_field_content_float(0, "zKord");
    SetPlayerPos(playerid,SpielerInfo[playerid][xKord], SpielerInfo[playerid][xKord], SpielerInfo[playerid][zKord]);
    SetPlayerInterior(playerid,SpielerInfo[playerid][pInterior]);
    SetPlayerSkin(playerid,SpielerInfo[playerid][pSkin]);

    }
    }

    return 1;
    }
    stock SavePlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    new query[512];
    new Float:xxKord,Float:yyKord,Float:zzKord;
    GetPlayerPos(playerid,xxKord,yyKord,zzKord);
    new typos = GetPlayerSkin(playerid);
    SpielerInfo[playerid][pGeld] = GetPlayerMoney(playerid);
    format(query, sizeof(query), "UPDATE accounts SET Name = '%s', Level = '%d', Geld = '%d', Kills = '%d', Tode = '%d', Admin = '%d', Banned, Leader = '%d', Member = '%d', Team = '%d', Rank = '%d', Duty = '%d', Skin = '%d', Health = '%d', xKord = '%d', yKord = '%d', zKord, Interior = '%d' = '%d' = '%d' WHERE Name = '%s'",
    SpielerInfo[playerid][pName], SpielerInfo[playerid][pLevel], SpielerInfo[playerid][pGeld], SpielerInfo[playerid][pKills], SpielerInfo[playerid][pTode], SpielerInfo[playerid][pAdmin], SpielerInfo[playerid][pBanned], SpielerInfo[playerid][pLeader], SpielerInfo[playerid][pMember], SpielerInfo[playerid][pTeam], SpielerInfo[playerid][pRank], SpielerInfo[playerid][pDuty], SpielerInfo[playerid][pSkin], SpielerInfo[playerid][pHealth], xxKord, yyKord, zzKord, SpielerInfo[playerid][pInterior], SpielerInfo[playerid][pName]);
    mysql_tquery(handle, query);
    printf("query: %s", query);
    }
    }
    return 1;
    }


    Dann meine Frage, muss ich irgendwo LoadPlayer & SavePlayer machen? Wenn ja, ich hab es versucht dann bekomm ich immer Errors

    Spoiler anzeigen

    C:\Users\Tobi\Desktop\SAMP\samp037_svr_RC1_win32\gamemodes\newrlll.pwn(1805) : error 075: input line too long (after substitutions)
    C:\Users\Tobi\Desktop\SAMP\samp037_svr_RC1_win32\gamemodes\newrlll.pwn(1807) : warning 217: loose indentation
    C:\Users\Tobi\Desktop\SAMP\samp037_svr_RC1_win32\gamemodes\newrlll.pwn(1807) : error 017: undefined symbol "id"
    C:\Users\Tobi\Desktop\SAMP\samp037_svr_RC1_win32\gamemodes\newrlll.pwn(1807) : error 029: invalid expression, assumed zero
    C:\Users\Tobi\Desktop\SAMP\samp037_svr_RC1_win32\gamemodes\newrlll.pwn(1807) : error 029: invalid expression, assumed zero
    C:\Users\Tobi\Desktop\SAMP\samp037_svr_RC1_win32\gamemodes\newrlll.pwn(1807) : fatal error 107: too many error messages on one line


    MySQL Log

    SQL
    [21:47:17] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "new_rl", password: "****", port: 3306, autoreconnect: true, pool_size: 2[21:47:17] [DEBUG] CMySQLHandle::Create - creating new connection..[21:47:17] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called[21:47:17] [DEBUG] CMySQLHandle::Create - connection created (id: 1)[21:47:17] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:47:17] [DEBUG] CMySQLConnection::Connect - connection was successful[21:47:17] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[21:47:17] [DEBUG] mysql_errno - connection: 1[21:47:17] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM Kassen ORDER BY ID ASC", callback: "LoadKassen", format: "d"[21:47:17] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:47:17] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:47:17] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:47:17] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM accounts ORDER BY ID ASC", callback: "LoadPlayer", format: "d"[21:47:17] [DEBUG] CMySQLConnection::Connect - connection was successful[21:47:17] [DEBUG] CMySQLConnection::Connect - connection was successful[21:47:17] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[21:47:17] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[21:47:17] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[21:47:17] [DEBUG] CMySQLQuery::Execute[LoadKassen] - starting query execution[21:47:17] [DEBUG] CMySQLQuery::Execute[LoadKassen] - query was successfully executed within 0.517 milliseconds[21:47:17] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:47:17] [DEBUG] CMySQLQuery::Execute[LoadPlayer] - starting query execution[21:47:17] [DEBUG] Calling callback "LoadKassen"..[21:47:17] [DEBUG] cache_get_row_count - connection: 1[21:47:17] [DEBUG] CMySQLQuery::Execute[LoadPlayer] - query was successfully executed within 0.503 milliseconds[21:47:17] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "1"[21:47:17] [DEBUG] cache_get_field_content - row: 0, field_name: "Name", connection: 1, max_len: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Name", data: "Staatskasse"[21:47:17] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Geld", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Geld", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Drogen", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Drogen", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Waffen", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Waffen", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 1, field_name: "ID", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "ID", data: "2"[21:47:17] [DEBUG] cache_get_field_content - row: 1, field_name: "Name", connection: 1, max_len: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Name", data: "Test1"[21:47:17] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Geld", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Geld", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Drogen", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Drogen", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Waffen", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Waffen", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 2, field_name: "ID", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "ID", data: "3"[21:47:17] [DEBUG] cache_get_field_content - row: 2, field_name: "Name", connection: 1, max_len: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Name", data: "Test2"[21:47:17] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Geld", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Geld", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Drogen", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Drogen", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Waffen", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Waffen", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 3, field_name: "ID", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "ID", data: "4"[21:47:17] [DEBUG] cache_get_field_content - row: 3, field_name: "Name", connection: 1, max_len: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Name", data: "Test3"[21:47:17] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Geld", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Geld", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Drogen", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Drogen", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Waffen", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Waffen", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 4, field_name: "ID", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "ID", data: "5"[21:47:17] [DEBUG] cache_get_field_content - row: 4, field_name: "Name", connection: 1, max_len: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Name", data: "ADAC"[21:47:17] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Geld", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Geld", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Drogen", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Drogen", data: "0"[21:47:17] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Waffen", connection: 1[21:47:17] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Waffen", data: "0"[21:47:17] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:47:17] [DEBUG] Calling callback "LoadPlayer"..[21:47:17] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:47:55] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT Name FROM accounts WHERE Name = '%e'"[21:47:55] [DEBUG] mysql_tquery - connection: 1, query: "SELECT Name FROM accounts WHERE Name = 'niddo_189'", callback: "CheckAccount", format: "d"[21:47:55] [DEBUG] CMySQLQuery::Execute[CheckAccount] - starting query execution[21:47:55] [DEBUG] CMySQLQuery::Execute[CheckAccount] - query was successfully executed within 0.498 milliseconds[21:47:55] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:47:55] [DEBUG] Calling callback "CheckAccount"..[21:47:55] [DEBUG] cache_get_row_count - connection: 1[21:47:55] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:47:58] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT Name FROM accounts WHERE Name = '%e' AND Passwort = '%e'"[21:47:58] [DEBUG] mysql_tquery - connection: 1, query: "SELECT Name FROM accounts WHERE Name = 'niddo_189' AND Passwort ", callback: "CheckPassword", format: "d"[21:47:58] [DEBUG] CMySQLQuery::Execute[CheckPassword] - starting query execution[21:47:58] [DEBUG] CMySQLQuery::Execute[CheckPassword] - query was successfully executed within 0.481 milliseconds[21:47:58] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:47:58] [DEBUG] Calling callback "CheckPassword"..[21:47:58] [DEBUG] cache_get_row_count - connection: 1[21:47:58] [DEBUG] cache_get_field_content - row: -1, field_name: "Name", connection: 1, max_len: 1[21:47:58] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('-1')[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Level", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Level")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Geld", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Geld")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Kills", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Kills")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Tode", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Tode")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Admin", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Admin")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Banned", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Banned")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Leader", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Leader")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Member", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Member")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Team", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Team")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Rank", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Rank")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Duty", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Duty")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Skin", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Skin")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Health", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Health")[21:47:58] [ERROR] cache_get_field_content_int - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_float - row: 0, field_name: "xKord", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("xKord")[21:47:58] [ERROR] cache_get_field_content_float - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_float - row: 0, field_name: "yKord", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("yKord")[21:47:58] [ERROR] cache_get_field_content_float - invalid datatype[21:47:58] [DEBUG] cache_get_field_content_float - row: 0, field_name: "zKord", connection: 1[21:47:58] [WARNING] CMySQLResult::GetRowDataByName - field not found ("zKord")[21:47:58] [ERROR] cache_get_field_content_float - invalid datatype[21:47:58] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:48:09] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM accounts ORDER BY ID ASC", callback: "SavePlayer", format: "d"[21:48:09] [DEBUG] CMySQLQuery::Execute[SavePlayer] - starting query execution[21:48:09] [DEBUG] CMySQLQuery::Execute[SavePlayer] - query was successfully executed within 0.603 milliseconds[21:48:09] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:48:09] [DEBUG] Calling callback "SavePlayer"..[21:48:09] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:52:06] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "new_rl", password: "****", port: 3306, autoreconnect: true, pool_size: 2[21:52:06] [DEBUG] CMySQLHandle::Create - creating new connection..[21:52:06] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called[21:52:06] [DEBUG] CMySQLHandle::Create - connection created (id: 1)[21:52:06] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:52:06] [DEBUG] CMySQLConnection::Connect - connection was successful[21:52:06] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[21:52:06] [DEBUG] mysql_errno - connection: 1[21:52:06] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:52:06] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM Kassen ORDER BY ID ASC", callback: "LoadKassen", format: "d"[21:52:06] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:52:06] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[21:52:06] [DEBUG] CMySQLConnection::Connect - connection was successful[21:52:06] [DEBUG] CMySQLConnection::Connect - connection was successful[21:52:06] [DEBUG] CMySQLConnection::Connect - connection was successful[21:52:06] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[21:52:06] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[21:52:06] [DEBUG] CMySQLQuery::Execute[LoadKassen] - starting query execution[21:52:06] [DEBUG] CMySQLQuery::Execute[LoadKassen] - query was successfully executed within 0.588 milliseconds[21:52:06] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:52:06] [DEBUG] Calling callback "LoadKassen"..[21:52:06] [DEBUG] cache_get_row_count - connection: 1[21:52:06] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "1"[21:52:06] [DEBUG] cache_get_field_content - row: 0, field_name: "Name", connection: 1, max_len: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Name", data: "Staatskasse"[21:52:06] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Geld", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Geld", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Drogen", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Drogen", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Waffen", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Waffen", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 1, field_name: "ID", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "ID", data: "2"[21:52:06] [DEBUG] cache_get_field_content - row: 1, field_name: "Name", connection: 1, max_len: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Name", data: "Test1"[21:52:06] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Geld", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Geld", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Drogen", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Drogen", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Waffen", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Waffen", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 2, field_name: "ID", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "ID", data: "3"[21:52:06] [DEBUG] cache_get_field_content - row: 2, field_name: "Name", connection: 1, max_len: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Name", data: "Test2"[21:52:06] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Geld", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Geld", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Drogen", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Drogen", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Waffen", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Waffen", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 3, field_name: "ID", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "ID", data: "4"[21:52:06] [DEBUG] cache_get_field_content - row: 3, field_name: "Name", connection: 1, max_len: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Name", data: "Test3"[21:52:06] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Geld", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Geld", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Drogen", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Drogen", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Waffen", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Waffen", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 4, field_name: "ID", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "ID", data: "5"[21:52:06] [DEBUG] cache_get_field_content - row: 4, field_name: "Name", connection: 1, max_len: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Name", data: "ADAC"[21:52:06] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Geld", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Geld", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Drogen", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Drogen", data: "0"[21:52:06] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Waffen", connection: 1[21:52:06] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Waffen", data: "0"[21:52:06] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:52:33] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT Name FROM accounts WHERE Name = '%e'"[21:52:33] [DEBUG] mysql_tquery - connection: 1, query: "SELECT Name FROM accounts WHERE Name = 'niddo_189'", callback: "CheckAccount", format: "d"[21:52:33] [DEBUG] CMySQLQuery::Execute[CheckAccount] - starting query execution[21:52:33] [DEBUG] CMySQLQuery::Execute[CheckAccount] - query was successfully executed within 0.490 milliseconds[21:52:33] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[21:52:33] [DEBUG] Calling callback "CheckAccount"..[21:52:33] [DEBUG] cache_get_row_count - connection: 1[21:52:33] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[21:52:35] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * FROM users WHERE Name = '%e' AND Passwort = '%e'"[21:52:35] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM users WHERE Name = 'niddo_189' AND Passwort = 'ged", callback: "LoadPlayer", format: "d"[21:52:36] [DEBUG] CMySQLQuery::Execute[LoadPlayer] - starting query execution[21:52:36] [ERROR] CMySQLQuery::Execute[LoadPlayer] - (error #1146) Table 'new_rl.users' doesn't exist[21:52:36] [DEBUG] CMySQLQuery::Execute[LoadPlayer] - error will be triggered in OnQueryError[21:52:36] [DEBUG] Calling callback "OnQueryError"..


    Vielen dank dir :)



    Die heutigen Noobs, sind die Profis von morgen! :thumbup:


    Danke an Jeffry für seine ständige Hilfsbereitschaft und freundliche Art. 8)

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Die Fehler im Query hast du aber gut versteckt.
    stock SavePlayer(playerid)
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    new query[512];
    new Float:xxKord,Float:yyKord,Float:zzKord;
    GetPlayerPos(playerid,xxKord,yyKord,zzKord);
    new typos = GetPlayerSkin(playerid);
    SpielerInfo[playerid][pGeld] = GetPlayerMoney(playerid);
    format(query, sizeof(query), "UPDATE accounts SET Name = '%s', Level = '%d', Geld = '%d', Kills = '%d', Tode = '%d', Admin = '%d', Banned = '%d', Leader = '%d', Member = '%d', Team = '%d', Rank = '%d', Duty = '%d', ",
    SpielerInfo[playerid][pName], SpielerInfo[playerid][pLevel], SpielerInfo[playerid][pGeld], SpielerInfo[playerid][pKills], SpielerInfo[playerid][pTode], SpielerInfo[playerid][pAdmin],
    SpielerInfo[playerid][pBanned], SpielerInfo[playerid][pLeader], SpielerInfo[playerid][pMember], SpielerInfo[playerid][pTeam], SpielerInfo[playerid][pRank], SpielerInfo[playerid][pDuty]);
    format(query, sizeof(query), "%sSkin = '%d', Health = '%d', xKord = '%f', yKord = '%f', zKord = '%f', Interior = '%d' WHERE Name = '%s'", query,
    SpielerInfo[playerid][pSkin], SpielerInfo[playerid][pHealth], xxKord, yyKord, zzKord, SpielerInfo[playerid][pInterior], SpielerInfo[playerid][pName]);
    mysql_tquery(handle, query);
    printf("query: %s", query);
    }
    return 1;
    }
    So sollte es passen.


    Und hier:
    mysql_format(handle, query, sizeof(query), "SELECT * FROM users WHERE Name = '%e' AND Passwort = '%e'", PlayerName, inputtext); //name, passwort und users zu deinem anpassen!!
    hast du die Anpassung vergessen:
    mysql_format(handle, query, sizeof(query), "SELECT * FROM accounts WHERE Name = '%e' AND Passwort = '%e'", PlayerName, inputtext); //name, passwort und users zu deinem anpassen!!


    Dann dürfte auch das gehen.


    Zitat

    Dann meine Frage, muss ich irgendwo LoadPlayer & SavePlayer machen? Wenn ja, ich hab es versucht dann bekomm ich immer Errors


    LoadPlayer nicht, das wird ja durch das Query aufgerufen.
    SavePlayer dort, wo du den Spieler speichern willst, also das muss schon irgendwo stehen.



    Und noch was:

    SQL
    SELECT * FROM accounts ORDER BY ID ASC


    Das muss aus dem Code raus, das bringt auch nichts. Ich sehe, du willst damit die Spieler speichern, das wird so nichts.


    Generell, einfach mal
    SavePlayer(playerid);
    bei OnPlayerDisconnect hinschreiben.

    3HZXdYd.png

    Einmal editiert, zuletzt von Jeffry ()

  • Danke :D
    Nur noch 1 Error :)
    format(query, sizeof(query), "UPDATE accounts SET Name = '%s', Level = '%d', Geld = '%d', Kills = '%d', Tode = '%d', Admin = '%d', Banned = '%d', Leader = '%d', Member = '%d', Team = '%d', Rank = '%d', Duty = '%d', ",
    SpielerInfo[playerid][pName], SpielerInfo[playerid][pLevel], SpielerInfo[playerid][pGeld], SpielerInfo[playerid][pKills], SpielerInfo[playerid][pTode], SpielerInfo[playerid][pAdmin],
    SpielerInfo[playerid][pBanned], SpielerInfo[playerid][pLeader], SpielerInfo[playerid][pMember], SpielerInfo[playerid][pTeam], SpielerInfo[playerid][pRank], SpielerInfo[playerid][pDuty],
    format(query, sizeof(query), "%sSkin = '%d', Health = '%d', xKord = '%f', yKord = '%f', zKord = '%f', Interior = '%d' WHERE Name = '%s'", query,
    typos, SpielerInfo[playerid][pHealth], xxKord, yyKord, zzKord, SpielerInfo[playerid][pInterior], SpielerInfo[playerid][pName]);//1807


    error 001: expected token: ",", but found ";"



    Die heutigen Noobs, sind die Profis von morgen! :thumbup:


    Danke an Jeffry für seine ständige Hilfsbereitschaft und freundliche Art. 8)

  • format(query, sizeof(query), "UPDATE accounts SET Name = '%s', Level = '%d', Geld = '%d', Kills = '%d', Tode = '%d', Admin = '%d', Banned = '%d', Leader = '%d', Member = '%d', Team = '%d', Rank = '%d', Duty = '%d', ",
    SpielerInfo[playerid][pName], SpielerInfo[playerid][pLevel], SpielerInfo[playerid][pGeld], SpielerInfo[playerid][pKills], SpielerInfo[playerid][pTode], SpielerInfo[playerid][pAdmin],
    SpielerInfo[playerid][pBanned], SpielerInfo[playerid][pLeader], SpielerInfo[playerid][pMember], SpielerInfo[playerid][pTeam], SpielerInfo[playerid][pRank], SpielerInfo[playerid][pDuty]);
    format(query, sizeof(query), "%sSkin = '%d', Health = '%d', xKord = '%f', yKord = '%f', zKord = '%f', Interior = '%d' WHERE Name = '%s'", query,
    typos, SpielerInfo[playerid][pHealth], xxKord, yyKord, zzKord, SpielerInfo[playerid][pInterior], SpielerInfo[playerid][pName]);//1807


    So passt es. :)

  • Ja die Errors sind weg :)


    but, meine Koord. werden nicht gespeichert, mein Adminlevel genau so wenig :/
    Ich verstehe es nicht hier nochmal die Logg...


    SQL
    [22:52:46] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "new_rl", password: "****", port: 3306, autoreconnect: true, pool_size: 2[22:52:46] [DEBUG] CMySQLHandle::Create - creating new connection..[22:52:46] [WARNING] CMySQLHandle::Create - connection already exists[22:52:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[22:52:46] [DEBUG] CMySQLConnection::Connect - connection was successful[22:52:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[22:52:46] [DEBUG] mysql_errno - connection: 1[22:52:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[22:52:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[22:52:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[22:52:46] [DEBUG] CMySQLConnection::Connect - connection was successful[22:52:46] [DEBUG] CMySQLConnection::Connect - connection was successful[22:52:46] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM Kassen ORDER BY ID ASC", callback: "LoadKassen", format: "d"[22:52:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[22:52:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[22:52:46] [DEBUG] CMySQLConnection::Connect - connection was successful[22:52:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[22:52:46] [DEBUG] CMySQLQuery::Execute[LoadKassen] - starting query execution[22:52:46] [DEBUG] CMySQLQuery::Execute[LoadKassen] - query was successfully executed within 0.575 milliseconds[22:52:46] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[22:52:46] [DEBUG] Calling callback "LoadKassen"..[22:52:46] [DEBUG] cache_get_row_count - connection: 1[22:52:46] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "1"[22:52:46] [DEBUG] cache_get_field_content - row: 0, field_name: "Name", connection: 1, max_len: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Name", data: "Staatskasse"[22:52:46] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Geld", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Geld", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Drogen", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Drogen", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Waffen", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Waffen", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 1, field_name: "ID", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "ID", data: "2"[22:52:46] [DEBUG] cache_get_field_content - row: 1, field_name: "Name", connection: 1, max_len: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Name", data: "Test1"[22:52:46] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Geld", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Geld", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Drogen", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Drogen", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Waffen", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Waffen", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 2, field_name: "ID", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "ID", data: "3"[22:52:46] [DEBUG] cache_get_field_content - row: 2, field_name: "Name", connection: 1, max_len: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Name", data: "Test2"[22:52:46] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Geld", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Geld", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Drogen", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Drogen", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Waffen", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Waffen", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 3, field_name: "ID", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "ID", data: "4"[22:52:46] [DEBUG] cache_get_field_content - row: 3, field_name: "Name", connection: 1, max_len: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Name", data: "Test3"[22:52:46] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Geld", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Geld", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Drogen", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Drogen", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Waffen", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Waffen", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 4, field_name: "ID", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "ID", data: "5"[22:52:46] [DEBUG] cache_get_field_content - row: 4, field_name: "Name", connection: 1, max_len: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Name", data: "ADAC"[22:52:46] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Geld", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Geld", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Drogen", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Drogen", data: "0"[22:52:46] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Waffen", connection: 1[22:52:46] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Waffen", data: "0"[22:52:46] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[22:52:46] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT Name FROM accounts WHERE Name = '%e'"[22:52:46] [DEBUG] mysql_tquery - connection: 1, query: "SELECT Name FROM accounts WHERE Name = 'niddo_189'", callback: "CheckAccount", format: "d"[22:52:46] [DEBUG] CMySQLQuery::Execute[CheckAccount] - starting query execution[22:52:46] [DEBUG] CMySQLQuery::Execute[CheckAccount] - query was successfully executed within 0.466 milliseconds[22:52:46] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[22:52:46] [DEBUG] Calling callback "CheckAccount"..[22:52:46] [DEBUG] cache_get_row_count - connection: 1[22:52:46] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[22:52:52] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * FROM accounts WHERE Name = '%e' AND Passwort = '%e'"[22:52:52] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM accounts WHERE Name = 'niddo_189' AND Passwort = '", callback: "LoadPlayer", format: "d"[22:52:52] [DEBUG] CMySQLQuery::Execute[LoadPlayer] - starting query execution[22:52:52] [DEBUG] CMySQLQuery::Execute[LoadPlayer] - query was successfully executed within 0.553 milliseconds[22:52:52] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[22:52:52] [DEBUG] Calling callback "LoadPlayer"..[22:52:52] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[22:53:32] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "new_rl", password: "****", port: 3306, autoreconnect: true, pool_size: 2[22:53:32] [DEBUG] CMySQLHandle::Create - creating new connection..[22:53:32] [WARNING] CMySQLHandle::Create - connection already exists[22:53:32] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[22:53:32] [DEBUG] CMySQLConnection::Connect - connection was successful[22:53:32] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[22:53:32] [DEBUG] mysql_errno - connection: 1[22:53:32] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[22:53:32] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[22:53:32] [DEBUG] CMySQLConnection::Connect - connection was successful[22:53:32] [DEBUG] CMySQLConnection::Connect - connection was successful[22:53:32] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM Kassen ORDER BY ID ASC", callback: "LoadKassen", format: "d"[22:53:32] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[22:53:32] [DEBUG] CMySQLConnection::Connect - connection was successful[22:53:32] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[22:53:32] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[22:53:32] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[22:53:32] [DEBUG] CMySQLQuery::Execute[LoadKassen] - query was successfully executed within 0.585 milliseconds[22:53:32] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[22:53:32] [DEBUG] Calling callback "LoadKassen"..[22:53:32] [DEBUG] cache_get_row_count - connection: 1[22:53:32] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "1"[22:53:32] [DEBUG] cache_get_field_content - row: 0, field_name: "Name", connection: 1, max_len: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Name", data: "Staatskasse"[22:53:32] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Geld", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Geld", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Drogen", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Drogen", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Waffen", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Waffen", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 1, field_name: "ID", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "ID", data: "2"[22:53:32] [DEBUG] cache_get_field_content - row: 1, field_name: "Name", connection: 1, max_len: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Name", data: "Test1"[22:53:32] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Geld", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Geld", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Drogen", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Drogen", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 1, field_name: "Waffen", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "Waffen", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 2, field_name: "ID", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "ID", data: "3"[22:53:32] [DEBUG] cache_get_field_content - row: 2, field_name: "Name", connection: 1, max_len: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Name", data: "Test2"[22:53:32] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Geld", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Geld", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Drogen", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Drogen", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 2, field_name: "Waffen", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '2', field: "Waffen", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 3, field_name: "ID", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "ID", data: "4"[22:53:32] [DEBUG] cache_get_field_content - row: 3, field_name: "Name", connection: 1, max_len: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Name", data: "Test3"[22:53:32] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Geld", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Geld", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Drogen", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Drogen", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 3, field_name: "Waffen", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '3', field: "Waffen", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 4, field_name: "ID", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "ID", data: "5"[22:53:32] [DEBUG] cache_get_field_content - row: 4, field_name: "Name", connection: 1, max_len: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Name", data: "ADAC"[22:53:32] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Geld", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Geld", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Drogen", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Drogen", data: "0"[22:53:32] [DEBUG] cache_get_field_content_int - row: 4, field_name: "Waffen", connection: 1[22:53:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '4', field: "Waffen", data: "0"[22:53:32] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[22:53:32] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT Name FROM accounts WHERE Name = '%e'"[22:53:32] [DEBUG] mysql_tquery - connection: 1, query: "SELECT Name FROM accounts WHERE Name = 'niddo_189'", callback: "CheckAccount", format: "d"[22:53:32] [DEBUG] CMySQLQuery::Execute[CheckAccount] - starting query execution[22:53:32] [DEBUG] CMySQLQuery::Execute[CheckAccount] - query was successfully executed within 0.400 milliseconds[22:53:32] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[22:53:32] [DEBUG] Calling callback "CheckAccount"..[22:53:32] [DEBUG] cache_get_row_count - connection: 1[22:53:32] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[22:53:34] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * FROM accounts WHERE Name = '%e' AND Passwort = '%e'"[22:53:34] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM accounts WHERE Name = 'niddo_189' AND Passwort = '", callback: "LoadPlayer", format: "d"[22:53:34] [DEBUG] CMySQLQuery::Execute[LoadPlayer] - starting query execution[22:53:34] [DEBUG] CMySQLQuery::Execute[LoadPlayer] - query was successfully executed within 0.536 milliseconds[22:53:34] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[22:53:34] [DEBUG] Calling callback "LoadPlayer"..[22:53:34] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called


    Ich habe alles so eingefügt wie du gesagt hast und trotzdem funktioniert es nicht :/



    Die heutigen Noobs, sind die Profis von morgen! :thumbup:


    Danke an Jeffry für seine ständige Hilfsbereitschaft und freundliche Art. 8)

  • 1. Heißt das Callback jetzt LoadPlayer oder CheckPasswort? Weil einmal stand es so da und einmal so.


    2. In dem Log Teil wird SavePlayer nie ausgeführt, also wenn du das mit speichern meinst, dann ist es klar. Hast du SavePlayer bei OnPlayerDisconnect eingefügt, und hast du den Server dann auch verlassen? Wenn ja, poste mal den Print der das query ausgibt (steht im Server Log, nicht im MySQL Log).

  • LoadPlayer & Checkpasswort sind zwei verschiedene :o
    Loadplayer:

    Spoiler anzeigen
    forward LoadPlayer(playerid);
    public LoadPlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    cache_get_field_content(0, "Name", SpielerInfo[playerid][pName]);
    SpielerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level");
    SpielerInfo[playerid][pGeld] = cache_get_field_content_int(0, "Geld");
    SpielerInfo[playerid][pKills] = cache_get_field_content_int(0, "Kills");
    SpielerInfo[playerid][pTode] = cache_get_field_content_int(0, "Tode");
    SpielerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
    SpielerInfo[playerid][pBanned] = cache_get_field_content_int(0, "Banned");
    SpielerInfo[playerid][pLeader] = cache_get_field_content_int(0, "Leader");
    SpielerInfo[playerid][pMember] = cache_get_field_content_int(0, "Member");
    SpielerInfo[playerid][pTeam] = cache_get_field_content_int(0, "Team");
    SpielerInfo[playerid][pRank] = cache_get_field_content_int(0, "Rank");
    SpielerInfo[playerid][pDuty] = cache_get_field_content_int(0, "Duty");
    SpielerInfo[playerid][pSkin] = cache_get_field_content_int(0, "Skin");
    SpielerInfo[playerid][pHealth] = cache_get_field_content_int(0, "Health");
    SpielerInfo[playerid][xKord] = cache_get_field_content_float(0, "xKord");
    SpielerInfo[playerid][yKord] = cache_get_field_content_float(0, "yKord");
    SpielerInfo[playerid][zKord] = cache_get_field_content_float(0, "zKord");
    SpielerInfo[playerid][pInterior] = cache_get_field_content_int(0, "Interior");
    SetPlayerPos(playerid,SpielerInfo[playerid][xKord], SpielerInfo[playerid][xKord], SpielerInfo[playerid][zKord]);
    SetPlayerInterior(playerid,SpielerInfo[playerid][pInterior]);
    SetPlayerSkin(playerid,SpielerInfo[playerid][pSkin]);

    }
    }

    return 1;
    }

    CheckPW
    Spoiler anzeigen
    forward CheckPassword(playerid);
    public CheckPassword(playerid)
    {
    if(cache_num_rows() != 0)
    {
    SetPVarInt(playerid,"Eingeloggt",1);
    LoadPlayer(playerid);
    SpawnPlayer(playerid);
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Einloggen","Datenbank: Das war das falsche Passwort!","Login","Abbrechen");
    }
    return 1;
    }


    Und klar ich lass ihn speichern, schau
    public OnPlayerDisconnect(playerid, reason)
    {
    DeletePVar(playerid,"Eingeloggt");
    SavePlayer(playerid);


    MfG


    //Edit:


    SQL
    [12:05:05] Incoming connection: 127.0.0.1:64723 id: 0[12:05:05] [join] niddo_189 has joined the server (0:127.0.0.1)[12:05:26] [part] niddo_189 has left the server (0:1)


    Mehr wird in der Log garnicht gespeichert.



    Die heutigen Noobs, sind die Profis von morgen! :thumbup:


    Danke an Jeffry für seine ständige Hilfsbereitschaft und freundliche Art. 8)

    Einmal editiert, zuletzt von ENEF ()

  • Ahja, na dann:
    switch(dialogid)
    {
    case DIALOG_REGISTER:
    {
    if(response)
    {
    if(strlen(inputtext) == 0)
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Regestration","Datenbank: Das angegebene Passwort ist zu kurz!","Register","Abbrechen");
    return 1;
    }
    else
    {
    CreateAccount(playerid, inputtext);
    SetPVarInt(playerid,"Eingeloggt",1);
    SpawnPlayer(playerid);
    SetSpawnInfo(playerid, 0, 0, -1982.5010,140.7040,27.6875,89.0363, 0, 0, 0, 0, 0, 0 );
    return 1;
    }
    }
    else
    {
    Kick(playerid);
    }
    }
    case DIALOG_LOGIN:
    {
    if(response)
    {
    if(strlen(inputtext) == 0)
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Einloggen","Datenbank: Das angegebene Passwort ist falsch!","Login","Abbrechen");
    return 1;
    }
    else
    {
    new PlayerName[MAX_PLAYER_NAME], query[256];
    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    mysql_format(handle, query, sizeof(query), "SELECT * FROM accounts WHERE Name = '%e' AND Passwort = '%e'", PlayerName, inputtext);
    mysql_tquery(handle, query, "CheckPassword", "d", playerid);
    }
    }
    else
    {
    Kick(playerid);
    }
    }
    }

    Dann sollte das Login klappen.


    Zwecks dem Speichern:
    Du löschst zuerst die PVar und fragst dann ab ob sie 1 ist, dann kann nicht gehen. ;)
    public OnPlayerDisconnect(playerid, reason)
    {
    DeletePVar(playerid,"Eingeloggt");
    SavePlayer(playerid);
    zu:
    public OnPlayerDisconnect(playerid, reason)
    {
    SavePlayer(playerid);
    DeletePVar(playerid,"Eingeloggt");

  • Perfekt, jetzt kann ich wenn ich mich in der DB als Admin einschreibe auch Befehle benutzen :)


    Die Log sagt auch:

    Code
    [13:34:15] [join] niddo_189 has joined the server (0:127.0.0.1)[13:34:38] query: UPDATE accounts SET Name = '', Level = '1', Geld = '0', Kills = '0', Tode = '0', Admin = '4', Banned = '0', Leader = '1', Member = '0', Team = '1', Rank = '6', Duty = '0', Skin = '283', Health = '1120403456', xKord = '1557.059692', yKord = '-1631.581420', zKord = '13.382812', Interior = '0' WHERE Name = ''[13:34:38] [part] niddo_189 has left the server (0:1)


    Nur leider wird er in der Datenbank noch nicht eingetragen :/


    //Edit:


    Wenn ich Manuell in der Datenbank sachen einfüge, werden sie auch geladen, also liegt es am SavePlayer?

    Spoiler anzeigen
    stock SavePlayer(playerid)
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    new query[512];
    new Float:xxKord,Float:yyKord,Float:zzKord;
    GetPlayerPos(playerid,xxKord,yyKord,zzKord);
    new typos = GetPlayerSkin(playerid);
    SpielerInfo[playerid][pGeld] = GetPlayerMoney(playerid);//1803
    format(query, sizeof(query), "UPDATE accounts SET Name = '%s', Level = '%d', Geld = '%d', Kills = '%d', Tode = '%d', Admin = '%d', Banned = '%d', Leader = '%d', Member = '%d', Team = '%d', Rank = '%d', Duty = '%d', ",
    SpielerInfo[playerid][pName], SpielerInfo[playerid][pLevel], SpielerInfo[playerid][pGeld], SpielerInfo[playerid][pKills], SpielerInfo[playerid][pTode], SpielerInfo[playerid][pAdmin],
    SpielerInfo[playerid][pBanned], SpielerInfo[playerid][pLeader], SpielerInfo[playerid][pMember], SpielerInfo[playerid][pTeam], SpielerInfo[playerid][pRank], SpielerInfo[playerid][pDuty]);
    format(query, sizeof(query), "%sSkin = '%d', Health = '%d', xKord = '%f', yKord = '%f', zKord = '%f', Interior = '%d' WHERE Name = '%s'", query,
    typos, SpielerInfo[playerid][pHealth], xxKord, yyKord, zzKord, SpielerInfo[playerid][pInterior], SpielerInfo[playerid][pName]);//1807
    mysql_tquery(handle, query);
    printf("query: %s", query);
    }
    return 1;
    }



    Die heutigen Noobs, sind die Profis von morgen! :thumbup:


    Danke an Jeffry für seine ständige Hilfsbereitschaft und freundliche Art. 8)

    Einmal editiert, zuletzt von ENEF ()

  • Ok, gut, dass du den print gleich gepostet hast!
    Dann schreibe im LoadPlayer-Callback das hier:
    cache_get_field_content(0, "Name", SpielerInfo[playerid][pName]);
    um zu:
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(SpielerInfo[playerid][pName], MAX_PLAYER_NAME, name);


    Dann klappt das Speichern auch.

  • Perfekt Jeffry ! Vielen Vielen Dank :)


    Da ich in der Zeit noch das SaveVehicles und LoadVehicles gemacht habe, kannst du bei bedarf da auch mal drüber schauen.
    Da hab ich nämlich das Problem, dass in der DB zwar die Einträge erstellt werden, aber ohne Werte also nur '0'
    LoadVehicle, SaveVehicle & SaveVehicles


    Spoiler anzeigen
    stock SaveVehicle(i)
    {
    new query[512];
    if(i < 0 || i >= sizeof(VehInfo)) return 1;
    {
    format(query, sizeof(query), "UPDATE Auto SET ModellID = '%d' Fraktion = '%d', PosX = '%f', PosY = '%f', PosZ = '%f', PosR = '%f', Abgeschleppt = '%d', inADAC = '%d', Name = '%s', Grund = '%s', Preis = '%d', ",
    VehInfo[i][ModellID], VehInfo[i][Fraktion], VehInfo[i][PosX], VehInfo[i][PosY],VehInfo[i][PosZ],VehInfo[i][PosR],VehInfo[i][Abgeschleppt],VehInfo[i][inADAC],VehInfo[i][Named],VehInfo[i][Grund],VehInfo[i][Preis], i);
    format(query, sizeof(query), "NewX = '%f', NewY = '%f', NewZ = '%f', NewR = '%f', Farbe1 = '%d', Farbe2 = '%d' WHERE ID = '%d'",query,
    VehInfo[i][NewX],VehInfo[i][NewY],VehInfo[i][NewZ],VehInfo[i][NewR],VehInfo[i][Farbe1],VehInfo[i][Farbe2],i);
    mysql_tquery(handle, query);
    }
    return 1;
    }
    stock SaveVehicles()
    {
    new query[512];
    for(new i=1; i < MAX_VEHICLES; i++)
    {
    format(query, sizeof(query), "UPDATE Auto SET ModellID = '%d' Fraktion = '%d', PosX = '%f', PosY = '%f', PosZ = '%f', PosR = '%f', Abgeschleppt = '%d', inADAC = '%d', Name = '%s', Grund = '%s', Preis = '%d', ",
    VehInfo[i][ModellID], VehInfo[i][Fraktion], VehInfo[i][PosX], VehInfo[i][PosY],VehInfo[i][PosZ],VehInfo[i][PosR],VehInfo[i][Abgeschleppt],VehInfo[i][inADAC],VehInfo[i][Named],VehInfo[i][Grund],VehInfo[i][Preis], i);
    format(query, sizeof(query), "NewX = '%f', NewY = '%f', NewZ = '%f', NewR = '%f', Farbe1 = '%d', Farbe2 = '%d' WHERE ID = '%d'",query,
    VehInfo[i][NewX],VehInfo[i][NewY],VehInfo[i][NewZ],VehInfo[i][NewR],VehInfo[i][Farbe1],VehInfo[i][Farbe2],i);
    mysql_tquery(handle, query);
    }
    return 1;
    }
    forward LoadVehicles(secure);
    public LoadVehicles(secure)
    {
    new query[128], bool:added, string[3];
    for(new i=0; i < sizeof(FrakAutos); i++)
    {
    format(query, sizeof(query), "INSERT INTO Auto (ID, Name) VALUES ('%d', '%s')", i, VehInfo[i][Named]);
    mysql_tquery(handle, query);
    added = true;
    format(string, sizeof string, "%d", i);
    VehInfo[i][ModellID] = cache_get_field_content_int(i, "ModellID");
    if(VehInfo[i][ModellID] < 400 || VehInfo[i][ModellID] > 611)
    {
    format(query, sizeof(query), "INSERT INTO Auto (ID, ModellID, PosX, PosY, PosZ, PosR, Farbe1, Farbe2, Fraktion) VALUES ('%d', '%d', '%f', '%f', '%f', '%f', '%d', '%d', '%d')", i,
    FrakAutos[i][ModellID],FrakAutos[i][PosX],FrakAutos[i][PosY],FrakAutos[i][PosZ],FrakAutos[i][PosR],FrakAutos[i][Farbe1],FrakAutos[i][Farbe2],FrakAutos[i][Fraktionp]);
    mysql_tquery(handle, query);
    VehInfo[i][ModellID] = FrakAutos[i][ModellID];
    added = true;
    }
    VehInfo[i][ModellID] = cache_get_field_content_int(i-1, "ModellID");
    VehInfo[i][Fraktion] = cache_get_field_content_int(i-1, "Fraktion");
    VehInfo[i][PosX] = cache_get_field_content_float(i-1, "PosX");
    VehInfo[i][PosY] = cache_get_field_content_float(i-1, "PosY");
    VehInfo[i][PosZ] = cache_get_field_content_float(i-1, "PosZ");
    VehInfo[i][PosR] = cache_get_field_content_float(i-1, "PosR");
    VehInfo[i][Abgeschleppt] = cache_get_field_content_int(i-1, "Abgeschleppt");
    VehInfo[i][inADAC] = cache_get_field_content_int(i-1, "inADAC");
    VehInfo[i][Preis] = cache_get_field_content_int(i-1, "Preis");
    cache_get_field_content(i-1, "Grund", VehInfo[i][Grund]);
    cache_get_field_content(i-1, "Name", VehInfo[i][Named]);
    VehInfo[i][NewX] = cache_get_field_content_float(i-1, "NewX");
    VehInfo[i][NewY] = cache_get_field_content_float(i-1, "NewY");
    VehInfo[i][NewZ] = cache_get_field_content_float(i-1, "NewZ");
    VehInfo[i][NewR] = cache_get_field_content_float(i-1, "NewR");
    VehInfo[i][Farbe1] = cache_get_field_content_int(i-1, "Farbe1");
    VehInfo[i][Farbe2] = cache_get_field_content_int(i-1, "Farbe2");
    VehInfo[i][veh_ID] = cache_get_field_content_int(i-1, "veh_ID");
    }
    if(added) SaveVehicles();
    //if(added && secure < 10) mysql_tquery(handle, "SELECT * FROM Auto ORDER BY ID ASC", "LoadVehicles", "d", secure+1);
    return 1;
    }


    Und in OnGameModeInit


    LoadVehicles(); // warning 202: number of arguments does not match definition


    Ich habe mich jetzt einfach irgendwie an den Kassen orientiert, also ich denke es könnte viel Mist dabei herausgekommen sein :D
    Aber ich hab mich erst an das alte MySQL gewöhnt, dass hier ist noch ziemlich kompliziert für mich :)


    Mit freundlichen Grüßen


    TV :thumbup:



    Die heutigen Noobs, sind die Profis von morgen! :thumbup:


    Danke an Jeffry für seine ständige Hilfsbereitschaft und freundliche Art. 8)

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