[MYSQL] Spieler 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
  • Guten Tag Community,


    ICh habe ein großes Problem mit Mysql xD . Vorhin wurde alles gespeichert ausser Geld Skin.


    Jetzt habe ich mal alles umgeschrieben von mysql_SetInt auf querys und jetzt wird zwar das Geld Skin gespeichert aber viele andere Sachen wie z.B Level nicht.


    Hier die stock SpielerSpeichern



    stock SpielerSpeichern(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(gPlayerLogged[playerid] == 1)
    {
    new query[2048];
    PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);

    format(query, sizeof(query), "UPDATE `accounts` SET Level = '%d',AdminLevel = '%d',Supporter = '%d',DonateRank = '%d',UpgradePoints = '%d',ConnectedTime = '%d',Registered = '%d',Sex = '%d',Alter = '%d',Origin = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pSupporter],PlayerInfo[playerid][pDonateRank],PlayerInfo[playerid][gPupgrade],
    PlayerInfo[playerid][pConnectTime],PlayerInfo[playerid][pReg],PlayerInfo[playerid][pSex],PlayerInfo[playerid][pAge],PlayerInfo[playerid][pOrigin],PlayerInfo[playerid][pName]);
    mysql_query(query);

    format(query, sizeof(query), "UPDATE `accounts` SET CK = '%d',Muted = '%d',Respekt = '%d',Geld = '%d',Bank = '%d',Kredit = '%d',KreditDauer = '%d',Verbrechen = '%d',Kills = '%d',Deaths = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pCK],PlayerInfo[playerid][pMuted],PlayerInfo[playerid][pExp],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pAccount],
    PlayerInfo[playerid][pPlayerKredit],PlayerInfo[playerid][pPlayerKreditDauer],PlayerInfo[playerid][pCrimes],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pName]);
    mysql_query(query);

    format(query, sizeof(query), "UPDATE `accounts` SET WantedDeaths = '%d',Telefonbuch = '%d',LottoNr = '%d',Fische = '%d',BiggestFish = '%d',Job = '%d',PayCheck = '%d',Jailed = '%d',GangJailed = '%d',Mauled = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pWantedDeaths],PlayerInfo[playerid][pPhoneBook],PlayerInfo[playerid][pLottoNr],PlayerInfo[playerid][pFishes],PlayerInfo[playerid][pBiggestFish],
    PlayerInfo[playerid][pJob],PlayerInfo[playerid][pPayCheck],PlayerInfo[playerid][pJailed],PlayerInfo[playerid][pGangJailed],PlayerInfo[playerid][pMauled],PlayerInfo[playerid][pName]);
    mysql_query(query);

    format(query, sizeof(query), "UPDATE `accounts` SET JailTime = '%d',Material = '%d',Drogen = '%d',BMaterial = '%d',BDrogen = '%d',Leader = '%d',Member = '%d',FMember = '%d',Rank = '%d',Char = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pJailTime],PlayerInfo[playerid][pMats],PlayerInfo[playerid][pDrugs],PlayerInfo[playerid][pBoxMats],PlayerInfo[playerid][pBoxDrugs],
    PlayerInfo[playerid][pLeader],PlayerInfo[playerid][pMember],PlayerInfo[playerid][pFMember],PlayerInfo[playerid][pRank],PlayerInfo[playerid][pChar],PlayerInfo[playerid][pName]);
    mysql_query(query);

    format(query, sizeof(query), "UPDATE `accounts` SET ContractTime = '%d',Contract = '%d',DetSkill = '%d',LawSkill = '%d',PilotSkill = '%d',BusSkill = '%d',MechSkill = '%d',JackSkill = '%d',CarSkill = '%d',DrugsSkill = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pContractTime],PlayerInfo[playerid][pContract],PlayerInfo[playerid][pDetSkill],PlayerInfo[playerid][pLawSkill],PlayerInfo[playerid][pPilotSkill],
    PlayerInfo[playerid][pBusSkill],PlayerInfo[playerid][pMechSkill],PlayerInfo[playerid][pJackSkill],PlayerInfo[playerid][pCarSkill],PlayerInfo[playerid][pDrugsSkill],PlayerInfo[playerid][pName]);
    mysql_query(query);


    format(query, sizeof(query), "UPDATE `accounts` SET CookSkill = '%d',SHealth = '%d',Health = '%d',Interior = '%d',Local = '%d',Team = '%d',Model = '%d',pPNumber = '%d',House = '%d',Bizz = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pCookSkill],PlayerInfo[playerid][pSHealth],PlayerInfo[playerid][pHealth],PlayerInfo[playerid][pInt],PlayerInfo[playerid][pLocal],
    PlayerInfo[playerid][pTeam],PlayerInfo[playerid][pModel],PlayerInfo[playerid][pPnumber],PlayerInfo[playerid][pPhousekey],PlayerInfo[playerid][pPbiskey],PlayerInfo[playerid][pName]);
    mysql_query(query);


    format(query, sizeof(query), "UPDATE `accounts` SET HandyGeld = '%d',HandyVer = '%d',pPos_x = '%d',pPos_y = '%d',pPos_z = '%d',CarLic = '%d',NewLic = '%d',FlyLic = '%d',BoatLic = '%d',FishLic = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pHandyGeld],PlayerInfo[playerid][pHandyVer],PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z],
    PlayerInfo[playerid][pCarLic],PlayerInfo[playerid][pNewLic],PlayerInfo[playerid][pFlyLic],PlayerInfo[playerid][pBoatLic],PlayerInfo[playerid][pFishLic],PlayerInfo[playerid][pName]);
    mysql_query(query);


    format(query, sizeof(query), "UPDATE `accounts` SET GunLic = '%d',LKWLic = '%d',RollerLic = '%d',MotoLic = '%d',Zig = '%d',Kekse = '%d',ZigSucht = '%d',CarTime = '%d',MullTime = '%d',PayDay = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pGunLic],PlayerInfo[playerid][pLKWLic],PlayerInfo[playerid][pRollerLic],PlayerInfo[playerid][pMotoLic],PlayerInfo[playerid][pZig],
    PlayerInfo[playerid][pKekse],PlayerInfo[playerid][pZigSucht],PlayerInfo[playerid][pCarTime],PlayerInfo[playerid][pMulltime],PlayerInfo[playerid][pPayDay],PlayerInfo[playerid][pName]);
    mysql_query(query);

    format(query, sizeof(query), "UPDATE `accounts` SET PayDayHad = '%d',CDPlayer = '%d',Wins = '%d',Loses = '%d',AlcoholPerk = '%d',DrugPerk = '%d',MiserPerk = '%d',PainPerk = '%d',TraderPerk = '%d',Tutorial = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pPayDayHad],PlayerInfo[playerid][pCDPlayer],PlayerInfo[playerid][pWins],PlayerInfo[playerid][pLoses],PlayerInfo[playerid][pAlcoholPerk],
    PlayerInfo[playerid][pDrugPerk],PlayerInfo[playerid][pPainPerk],PlayerInfo[playerid][pMiserPerk],PlayerInfo[playerid][pTraderPerk],PlayerInfo[playerid][pTut],PlayerInfo[playerid][pName]);
    mysql_query(query);


    format(query, sizeof(query), "UPDATE `accounts` SET Warns = '%d',Adjustable = '%d',Fuel = '%d',Married = '%d',MarriedTo = '%d',SpawnChange = '%d',WantedLevel = '%d',WantedPoints = '%d',PlayMinutes = '%d',GesamtMinutes = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pWarns],PlayerInfo[playerid][pAdjustable],PlayerInfo[playerid][pFuel],PlayerInfo[playerid][pMarried],PlayerInfo[playerid][pMarriedTo],
    SpawnChange[playerid],WantedLevel[playerid],WantedPoints[playerid],PlayerInfo[playerid][pPlayMinutes],PlayerInfo[playerid][pGesamtMinutes],PlayerInfo[playerid][pName]);
    mysql_query(query);

    format(query, sizeof(query), "UPDATE `accounts` SET MinutesSinceAn = '%d',SFPass = '%d',LVPASS = '%d',OffFlucht = '%d',Knast = '%d',KnastTime = '%d',Handy = '%d',Uhr = '%d',Perso = '%d',FrakSperre = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pMinutesSinceAn],PlayerInfo[playerid][pSFPASS],PlayerInfo[playerid][pLVPASS],OfflineFlucht[playerid],Knast[playerid],
    KnastTime[playerid],PlayerInfo[playerid][pHandyID],PlayerInfo[playerid][pUhrID],PlayerInfo[playerid][pOwnPerso],PlayerInfo[playerid][pFrakSperre],PlayerInfo[playerid][pName]);
    mysql_query(query);

    format(query, sizeof(query), "UPDATE `accounts` SET Gehalt = '%d',InvWeapon = '%d',InvAmmo = '%d',InvWeapon2 = '%d',InvAmmo2 = '%d',InvMats = '%d',InvDrugs = '%d',gDeaths = '%d',gKills = '%d',Meldung = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pGehalt],PlayerInfo[playerid][pInvWeapon],PlayerInfo[playerid][pInvAmmo],PlayerInfo[playerid][pInvWeapon2],PlayerInfo[playerid][pInvAmmo2],
    PlayerInfo[playerid][pInvMats],PlayerInfo[playerid][pInvDrugs],PlayerInfo[playerid][pGDeaths],PlayerInfo[playerid][pGKills],PlayerInfo[playerid][pMeldung],PlayerInfo[playerid][pName]);
    mysql_query(query);


    format(query, sizeof(query), "UPDATE `accounts` SET Tanke = '%d',Zollpass = '%d',Zollpasstime = '%d',Banned = '%d' WHERE `Name` = '%s'",
    PlayerInfo[playerid][pGehalt],PlayerInfo[playerid][pPtankekey],PlayerInfo[playerid][pZollPass],PlayerInfo[playerid][pZollPassTime],PlayerInfo[playerid][pGesperrt],PlayerInfo[playerid][pName]);
    mysql_query(query);

    printf("Spielerdaten vom Spieler %s erfolgreich in der Datenbank gespeichert.",SpielerName(playerid));
    }
    }
    return 1;
    }

    MFG