Beiträge von Jeffry

    format(query,sizeof(query)," %s`Perso`=%i WHERE `Id`='%i'",query,[*]PlayerInfo[playerid][pPerso],PlayerInfo[playerid][dbid]); //fehlerzeile
    Zu
    format(query,sizeof(query),"%s, `Perso`=%i WHERE `Id`='%i'",query,PlayerInfo[playerid][pPerso],PlayerInfo[playerid][dbid]);

    Muss man beim letzten Speichervorgang (also beim disconnect) nicht auch den Cache löschen?

    Nur wenn du zuvor den Cache mit http://wiki.sa-mp.com/wiki/MySQL/R33#cache_save gespeichert hast würde das Sinn machen.
    Ansonsten hast du ja keine Möglichkeit auf den entsprechenden Cache zuzugreifen. Der dürfte nach Ausführung eines Callbacks mit Cache auch automatisch weg sein, sofern man ihn nicht speichert, sonst müsste man das ja immer machen (Ausnahme: mysql_query! -> sollte aber sowieso nicht verwendet werden).

    (06.03.2016 / 15:07)


    Du kannst die Werte die du auslesen willst, gleich wie Integers auch, mit einem SELECT Query auswählen, mit mysql_pquery in ein Callback übergeben, und dann mit http://wiki.sa-mp.com/wiki/MySQL/R33#cache_get_field_content auslesen. Vom Prinzip her genau gleich, nur dass du cache_get_field_content nutzt, anstatt cache_get_field_content_int.


    =======================================


    Edit (19.03.2016):
    Ich habe im Start-Post die Formatierung der Spoiler repariert, sodass deren Inhalt nun wieder versteckt ist und auf Wunsch ausgeklappt werden kann.

    Oh ja, ich sehe grade da fehlt ein `.
    Versuche es so:
    stock SaveAccount(extraid)
    {
    new mainQuery[2700];
    format(mainQuery, sizeof(mainQuery), "UPDATE `"#SERVERTAG"_Accounts` SET `Eingeloggt` = '%d', `Welt` = '%d', `Admin` = '%d', `Geschlecht` = '%d', `Tutorial` = '%d', `Level` = '%d', `Respekt` = '%d', `MaxRespekt` = '%d', `PayDay` = '%d', `Spawn` = '%d', `Skin` = '%d', `Job` = '%d', `JobMoney` = '%d', `Fraktion` = '%d', `FraktionSkin` = '%d', `FrakionsRank` = '%d', `FrakionsLeader` = '%d',",pInfo[extraid][pEingeloggt],pInfo[extraid][pWelt],pInfo[extraid][pAdmin],
    pInfo[extraid][pGeschlecht],pInfo[extraid][pTutorial],pInfo[extraid][pLevel],pInfo[extraid][pRespekt],pInfo[extraid][pMaxRespekt],pInfo[extraid][pPayDay],pInfo[extraid][pSpawn],pInfo[extraid][pSkin],pInfo[extraid][pJob],
    pInfo[extraid][pJobMoney],pInfo[extraid][pFraktion],pInfo[extraid][pFraktionSkin],pInfo[extraid][pFrakionsRank],pInfo[extraid][pFrakionsLeader]);
    format(mainQuery, sizeof(mainQuery), "%s`Portmanee` = '%d', `Bank` = '%d', `Sparbuch` = '%d', `Handynummer` = '%d', `Handyguthaben` = '%d', `Verwarnungen` = '%d', `Perso` = '%d', `Verheiratet` = '%s', `VerheiratetName` = '%s', `Kills` = '%d', `Tode` = '%d', `Verbrechen` = '%d', `Wanteds` = '%d', `Spielzeit` = '%d', `KnastSkill` = '%d', `Knast` = '%d', `KnastZelle` = '%d', `KnastZeit` = '%d',",mainQuery,pInfo[extraid][pPortmanee],pInfo[extraid][pBank],
    pInfo[extraid][pSparbuch],pInfo[extraid][pHandynummer],pInfo[extraid][pHandyguthaben],pInfo[extraid][pVerwarnungen],pInfo[extraid][pPerso],pInfo[extraid][pVerheiratet],pInfo[extraid][pVerheiratetName],
    pInfo[extraid][pKills],pInfo[extraid][pTode],pInfo[extraid][pVerbrechen],pInfo[extraid][pWanteds],pInfo[extraid][pSpielzeit],pInfo[extraid][pKnastSkill],pInfo[extraid][pKnast],pInfo[extraid][pKnastZelle],pInfo[extraid][pKnastZeit]);
    format(mainQuery, sizeof(mainQuery), "%s`Tot` = '%d', `TotUnix` = '%d', `TotX` = '%f', `TotY` = '%f', `TotZ` = '%f', `Premium` = '%d', `PremiumTage` = '%d', `Materialien` = '%s', `MaterialienSafe` = '%s', `Drogen` = '%d', `DrogenSafe` = '%d', `BusSkill` = '%d', `BusSkillExp` = '%d', `BusSkillMaxExp` = '%d', `Autoschein` = '%d', `Flugschein` = '%d', `Bootsschein` = '%d',",mainQuery,pInfo[extraid][pTot],pInfo[extraid][pTotUnix],pInfo[extraid][pTotX],
    pInfo[extraid][pTotY],pInfo[extraid][pTotZ],pInfo[extraid][pPremium],pInfo[extraid][pPremiumTage],pInfo[extraid][pMaterialien],pInfo[extraid][pMaterialienSafe],pInfo[extraid][pDrogen],pInfo[extraid][pDrogenSafe],
    pInfo[extraid][pBusSkill],pInfo[extraid][pBusSkillExp],pInfo[extraid][pBusSkillMaxExp],pInfo[extraid][pAutoschein],pInfo[extraid][pFlugschein],pInfo[extraid][pBootsschein]);
    format(mainQuery, sizeof(mainQuery), "%s`Angelschein` = '%d', `Waffenschein` = '%d', `Zollschein` = '%d', `HausSchluessel` = '%d' WHERE `Name` = '%s'",mainQuery,pInfo[extraid][pAngelschein],pInfo[extraid][pWaffenschein],
    pInfo[extraid][pZollschein],pInfo[extraid][pHausSchluessel],pInfo[extraid][pName]);
    mysql_function_query(mycon, mainQuery, false, "", "");
    return 1;
    }

    Du hast ganz vorne das UPDATE vergessen.


    Außerdem kannst du es etwas vereinfacht schreiben, das spart Speicher:
    stock SaveAccount(extraid)
    {
    new mainQuery[2700];
    format(mainQuery, sizeof(mainQuery), "UPDATE "#SERVERTAG"_Accounts` SET `Eingeloggt` = '%d', `Welt` = '%d', `Admin` = '%d', `Geschlecht` = '%d', `Tutorial` = '%d', `Level` = '%d', `Respekt` = '%d', `MaxRespekt` = '%d', `PayDay` = '%d', `Spawn` = '%d', `Skin` = '%d', `Job` = '%d', `JobMoney` = '%d', `Fraktion` = '%d', `FraktionSkin` = '%d', `FrakionsRank` = '%d', `FrakionsLeader` = '%d',",pInfo[extraid][pEingeloggt],pInfo[extraid][pWelt],pInfo[extraid][pAdmin],
    pInfo[extraid][pGeschlecht],pInfo[extraid][pTutorial],pInfo[extraid][pLevel],pInfo[extraid][pRespekt],pInfo[extraid][pMaxRespekt],pInfo[extraid][pPayDay],pInfo[extraid][pSpawn],pInfo[extraid][pSkin],pInfo[extraid][pJob],
    pInfo[extraid][pJobMoney],pInfo[extraid][pFraktion],pInfo[extraid][pFraktionSkin],pInfo[extraid][pFrakionsRank],pInfo[extraid][pFrakionsLeader]);
    format(mainQuery, sizeof(mainQuery), "%s`Portmanee` = '%d', `Bank` = '%d', `Sparbuch` = '%d', `Handynummer` = '%d', `Handyguthaben` = '%d', `Verwarnungen` = '%d', `Perso` = '%d', `Verheiratet` = '%s', `VerheiratetName` = '%s', `Kills` = '%d', `Tode` = '%d', `Verbrechen` = '%d', `Wanteds` = '%d', `Spielzeit` = '%d', `KnastSkill` = '%d', `Knast` = '%d', `KnastZelle` = '%d', `KnastZeit` = '%d',",mainQuery,pInfo[extraid][pPortmanee],pInfo[extraid][pBank],
    pInfo[extraid][pSparbuch],pInfo[extraid][pHandynummer],pInfo[extraid][pHandyguthaben],pInfo[extraid][pVerwarnungen],pInfo[extraid][pPerso],pInfo[extraid][pVerheiratet],pInfo[extraid][pVerheiratetName],
    pInfo[extraid][pKills],pInfo[extraid][pTode],pInfo[extraid][pVerbrechen],pInfo[extraid][pWanteds],pInfo[extraid][pSpielzeit],pInfo[extraid][pKnastSkill],pInfo[extraid][pKnast],pInfo[extraid][pKnastZelle],pInfo[extraid][pKnastZeit]);
    format(mainQuery, sizeof(mainQuery), "%s`Tot` = '%d', `TotUnix` = '%d', `TotX` = '%f', `TotY` = '%f', `TotZ` = '%f', `Premium` = '%d', `PremiumTage` = '%d', `Materialien` = '%s', `MaterialienSafe` = '%s', `Drogen` = '%d', `DrogenSafe` = '%d', `BusSkill` = '%d', `BusSkillExp` = '%d', `BusSkillMaxExp` = '%d', `Autoschein` = '%d', `Flugschein` = '%d', `Bootsschein` = '%d',",mainQuery,pInfo[extraid][pTot],pInfo[extraid][pTotUnix],pInfo[extraid][pTotX],
    pInfo[extraid][pTotY],pInfo[extraid][pTotZ],pInfo[extraid][pPremium],pInfo[extraid][pPremiumTage],pInfo[extraid][pMaterialien],pInfo[extraid][pMaterialienSafe],pInfo[extraid][pDrogen],pInfo[extraid][pDrogenSafe],
    pInfo[extraid][pBusSkill],pInfo[extraid][pBusSkillExp],pInfo[extraid][pBusSkillMaxExp],pInfo[extraid][pAutoschein],pInfo[extraid][pFlugschein],pInfo[extraid][pBootsschein]);
    format(mainQuery, sizeof(mainQuery), "%s`Angelschein` = '%d', `Waffenschein` = '%d', `Zollschein` = '%d', `HausSchluessel` = '%d' WHERE `Name` = '%s'",mainQuery,pInfo[extraid][pAngelschein],pInfo[extraid][pWaffenschein],
    pInfo[extraid][pZollschein],pInfo[extraid][pHausSchluessel],pInfo[extraid][pName]);
    mysql_function_query(mycon, mainQuery, false, "", "");
    return 1;
    }