Сохранение аккаунтов MySQL R20
#1

Не сохраняются аккаунты в таблицу MySQL
Вот сток
pawn Код:
stock OnPlayerSave(playerid)
{
    if(gPlayerLogged[playerid] == 1)
    {
        new query[2000],string[512],str[128],strstr[128];
        new year, month, day;
        getdate(year, month, day);
        strcat(query, "UPDATE `accounts` SET ");
        format(string, sizeof(string), "Level=%d, House=%d, Bussines=%d, Ferma=%d, Fermazarobotok=%d, FermaJob=%d, AdminLevel=%d, MyRp=%d, Helper=%d, DonMon=%d, Fuelcar='%f', Reg=%d, Text=%d, HP=%d, Satiety=%d, PhoneBook=%d, Directory=%d, Car=%d, DonateAccount=%d, DonateRank=%d, Sex=%d, Arrested=%d, Muted=%d, Crimes=%d, Respect=%d, On‌lFrak=%d, Money=%d, Kills=%d, Deaths=%d, PayCheck=%d, Jailed=%d, JailTime=%d, Materials=%d, CDPlayer=%d, Drugs=%d, Leader=%d, Member=%d,",
        PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pPhousekey],PlayerInfo[playerid][pPbiskey],PlayerInfo[playerid][pFerma],PlayerInfo[playerid][pFermazarobotok],PlayerInfo[playerid][pFermajob],PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pMyRp],PlayerInfo[playerid][pHelper],PlayerInfo[playerid][pDonMon],PlayerInfo[playerid][pFuelcar],PlayerInfo[playerid][pReg],PlayerInfo[playerid][pText],PlayerInfo[playerid][pHP],PlayerInfo[playerid][pSatiety],
        PlayerInfo[playerid][pPhoneBook],PlayerInfo[playerid][pDirectory],PlayerInfo[playerid][pCar],PlayerInfo[playerid][pDonateAccount],PlayerInfo[playerid][pDonateRank], PlayerInfo[playerid][pSex],PlayerInfo[playerid][pArrested],PlayerInfo[playerid][pMuted],PlayerInfo[playerid][pCrimes],PlayerInfo[playerid][pExp],PlayerInfo[playerid][pFExp],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pPayCheck],
        PlayerInfo[playerid][pJailed],PlayerInfo[playerid][pJailTime],PlayerInfo[playerid][pMaterials],PlayerInfo[playerid][pCDPlayer],PlayerInfo[playerid][pDrugs],PlayerInfo[playerid][pLeader],PlayerInfo[playerid][pMember]);
        strcat(query, string);

        format(string, sizeof(string), "Rank=%d, Job=%d, CarLic=%d, BizLic=%d, FlyLic=%d, BoatLic=%d, FishLic=%d, GunLic=%d, Slot1=%d, Slot2=%d, Slot3=%d, Slot4=%d, Slot5=%d, Slot6=%d, Slot7=%d, Slot8=%d, Slot9=%d, Slot10=%d, Slot11=%d, Slot12=%d, Slot13=%d, Slotammo1=%d, Slotammo2=%d, Slotammo3=%d, Slotammo4=%d, Slotammo5=%d, Slotammo6=%d, Slotammo7=%d, Slotammo8=%d, Slotammo9=%d, Slotammo10=%d, Slotammo11=%d,",
        PlayerInfo[playerid][pRank],PlayerInfo[playerid][pJob],PlayerInfo[playerid][pCarLic],PlayerInfo[playerid][pBisLic],PlayerInfo[playerid][pFlyLic],PlayerInfo[playerid][pBoatLic],PlayerInfo[playerid][pFishLic],PlayerInfo[playerid][pGunLic], PlayerInfo[playerid][pSlot][0],PlayerInfo[playerid][pSlot][1],PlayerInfo[playerid][pSlot][2],PlayerInfo[playerid][pSlot][3],PlayerInfo[playerid][pSlot][4],PlayerInfo[playerid][pSlot][5],PlayerInfo[playerid][pSlot][6],
        PlayerInfo[playerid][pSlot][7],PlayerInfo[playerid][pSlot][8],PlayerInfo[playerid][pSlot][9],PlayerInfo[playerid][pSlot][10],PlayerInfo[playerid][pSlot][11],PlayerInfo[playerid][pSlot][12],PlayerInfo[playerid][pSlotammo][0],PlayerInfo[playerid][pSlotammo][1],PlayerInfo[playerid][pSlotammo][2],PlayerInfo[playerid][pSlotammo][3],PlayerInfo[playerid][pSlotammo][4],PlayerInfo[playerid][pSlotammo][5],PlayerInfo[playerid][pSlotammo][6],PlayerInfo[playerid][pSlotammo][7],
        PlayerInfo[playerid][pSlotammo][8],PlayerInfo[playerid][pSlotammo][9],PlayerInfo[playerid][pSlotammo][10]);
        strcat(query, string);

        format(string, sizeof(string), "Slotammo12=%d, Slotammo13=%d, SDPistol=%d, DesertEagle=%d, ShotGun=%d, MP5=%d, AK47=%d, M4=%d, TaxiExp=%d, TaxiLvl=%d, CarRobbingExp=%d, DLevel=%d, DExp=%d, DMgruz=%d, Dgruz=%d, Kazpay=%d, Char=%d, Int=%d, Local=%d, Model=%d, PhoneNr=%d, PayDay=%d, PayDayHad=%d,",
        PlayerInfo[playerid][pSlotammo][11],PlayerInfo[playerid][pSlotammo][12],PlayerInfo[playerid][pGunSkill][0],PlayerInfo[playerid][pGunSkill][1],PlayerInfo[playerid][pGunSkill][2],PlayerInfo[playerid][pGunSkill][3],PlayerInfo[playerid][pGunSkill][4],PlayerInfo[playerid][pGunSkill][5],PlayerInfo[playerid][pTaxiExp],PlayerInfo[playerid][pTaxiLvl],PlayerInfo[playerid][pCarRobbingExp],PlayerInfo[playerid][pDLevel],PlayerInfo[playerid][pDExp],PlayerInfo[playerid][pDMgruz],PlayerInfo[playerid][pDgruz],
        PlayerInfo[playerid][pKazpay],PlayerInfo[playerid][pChar],PlayerInfo[playerid][pInt],PlayerInfo[playerid][pLocal],PlayerInfo[playerid][pModel],PlayerInfo[playerid][pPnumber],PlayerInfo[playerid][pPayDay],PlayerInfo[playerid][pPayDayHad]);
        strcat(query, string);
       
        format(string, sizeof(string), "Tutorial=%d, Vigovor=%d, Warnings=%d, unWarns=%d, unWarnstime=%d, Fuel=%d, Married=%d, MarriedTo='%s', FriendMoney=%d, Radio=%d, Fishes=%d, MuteTime=%d, Mobile=%d, Bank=%d, Ban=%d, BanTime=%d,",
        PlayerInfo[playerid][pTut],PlayerInfo[playerid][pFvig],PlayerInfo[playerid][pWarns],PlayerInfo[playerid][punWarns],PlayerInfo[playerid][punWarnstime],PlayerInfo[playerid][pFuel],PlayerInfo[playerid][pMarried],PlayerInfo[playerid][pMarriedTo],
        PlayerInfo[playerid][pFriendMoney],PlayerInfo[playerid][pRadio],PlayerInfo[playerid][pFishes],PlayerInfo[playerid][pMuteTime],PlayerInfo[playerid][pMobile],PlayerInfo[playerid][pBank],PlayerInfo[playerid][pLocked],PlayerInfo[playerid][pBanTime]);
        strcat(query, string);

        format(string, sizeof(string), "BanData=%d, MafiaRoof=%d, UseMafiaRoof=%d, Debt=%d, BoxSkill=%d, KongfuSkill=%d, KickboxSkill=%d, Dostup=%d, Labiding=%d, Addiction=%d, NarcoLomka=%d, Procents=%d, Wheels=%d, PaintJob=%d, Spoiler=%d, FrontBumper=%d, RearBumper=%d, Color=%d, Color2=%d, Nitro=%d, Hydravlic=%d, Jubka=%d, Vozduh=%d, Vihlop=%d, PlaceJail=%d, Housecash=%d, WantedLevel=%d, SDp=%d, SDeag=%d, SShot=%d, SSMG=%d, SAK47=%d, SM4=%d, SReaf=%d, SNark=%d, HitSkil=%d, HeadValue=%d, Tazer=%d,",
        PlayerInfo[playerid][pBanData],PlayerInfo[playerid][pMafiaRoof],PlayerInfo[playerid][pUseMafiaRoof],PlayerInfo[playerid][pDebt],PlayerInfo[playerid][pBoxSkill],PlayerInfo[playerid][pKongfuSkill],PlayerInfo[playerid][pKickboxSkill],PlayerInfo[playerid][pDostup],PlayerInfo[playerid][pLabiding],PlayerInfo[playerid][pAddiction],PlayerInfo[playerid][pNarcoLomka],PlayerInfo[playerid][pProcents],PlayerInfo[playerid][pWheels],PlayerInfo[playerid][pPaintJob],PlayerInfo[playerid][pSpoiler],
        PlayerInfo[playerid][pBumper1],PlayerInfo[playerid][pBumper2],PlayerInfo[playerid][pColor],PlayerInfo[playerid][pColor1],PlayerInfo[playerid][pNitro],PlayerInfo[playerid][pHydrawlic],PlayerInfo[playerid][pJubka],PlayerInfo[playerid][pVozduh],PlayerInfo[playerid][pVihlop],PlayerInfo[playerid][pPlaceJail],PlayerInfo[playerid][pHousecash],PlayerInfo[playerid][pWantedLevel],PlayerInfo[playerid][pSSd],PlayerInfo[playerid][pSDeag],PlayerInfo[playerid][pSShot],PlayerInfo[playerid][pSSMG],
        PlayerInfo[playerid][pSAK],PlayerInfo[playerid][pSM4],PlayerInfo[playerid][pSReaf],PlayerInfo[playerid][pSNark],PlayerInfo[playerid][pSkilHit],PlayerInfo[playerid][pHeadValue],PlayerInfo[playerid][pTazer]);
        strcat(query, string);

        format(str,sizeof(str),"%i/%i/%i",day,month,year);
        format(strstr,sizeof(strstr), "%i:%i",PlayerInfo[playerid][pChas],PlayerInfo[playerid][pMin]);
        format(string, sizeof(string), "Instrument=%d, Chas=%d, Min=%d, On‌line='%s', On‌lineLid='%s' WHERE `Name` = '%s'",
        PlayerInfo[playerid][pIntsr],PlayerInfo[playerid][pChas],PlayerInfo[playerid][pMin],str,strstr,Name(playerid));
        strcat(query, str);
        printf( "string %d", strlen(string));
        mysql_query(query, -1, 0, mysql);
        printf( "query %d", strlen(query));
    }
    return true;
}
Вот debug

Код:
[19:03:28] [ERROR] ProcessQueryThread(OnQueryFinish) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Char=115, Int=0, Local=255, Model=261, PhoneNr=945, PayDay=993, PayDayHad=818,Tu' at line 1 (error ID: 1064)
[19:03:28] [DEBUG] ProcessQueryThread(OnQueryFinish) - Error will be triggered to OnQueryError().
Reply
#2

Есть подозрение что внутри PlayerInfo[playerid][pKazpay] отсутствует значение или тип его не целочисленный.
Reply
#3

Хмм такого быть не может так как на MySQL R6 подобных ошибок не было и близко ...
Reply
#4

Щас пересмотрел таблицу стоит:
90 Kazpay int(11) Нет Нет
Reply
#5

А причем тут таблица, я про запрос.
Вам так-то мускул конкретное место пишет на котором его парсер валится.
Reply
#6

Хмм тогда прийдется все переписывать?
либо уберать эту функцию?
Reply
#7

Убрал функцию ошибка не поменялась!
Reply
#8

Распечатай в лог конечный запрос и попробуй его выполнить в мускуле напрямую.
Reply
#9

Извеняюсь но не понял что нужно сделать?
Reply
#10

Quote:
Originally Posted by vitalik6243
Посмотреть сообщение
Извеняюсь но не понял что нужно сделать?
когда поймете возвращайтесь к нам, будем рады общаться с теми кто знает матчасть.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)