Hi..
About 7 days ago I started learning MySQL..Today I'm making my own Reg/Login System.
Код:
if(gPlayerLogged[playerid] == 1)
{
new query[1024], pname[24];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "UPDATE playerdata SET Level=%d,AdminLevel=%d,DonateRank=%d,UpgradePoints=%d,ConnectedTime=%d,Registered=%d,Sex=%d,Age=%d,Origin=%d,CK=%d,Muted=%d,Respect=%d,Money=%d,Bank=%d,Crimes=%d,",);
format(query, sizeof(query), "%s,Kills=%d,Deaths=%d,Arrested=%d,WantedDeaths=%d,PhoneBook=%d,LottoNr=%d,Fishes=%d,BiggestFish=%d,Job=%d,PayCheck=%d,HeadValue=%d,Jailed=%d,JailTime=%d,Materials=%d,Drugs=%d,Leader=%d,Member=%d,FMember=%d,Rank=%d,Char=%d,ContractTime=%d,DetSkill=%d,");
format(query, sizeof(query), "%s,SexSkill=%d,BoxSkill=%d,LawSkill=%d,MechSkill=%d,JackSkill=%d,CarSkill=%d,NewsSkill=%d,DrugsSkill=%d,CookSkill=%d,FishSkill=%d,SHealth=%d,Health=%d,Int=%d,Local=%d,Team=%d,Model=%d,PhoneNr=%d,Car=%d,Car2=%d,Car3=%d,House=%d,Bizz=%d,PosX=%f,PosY=%f,PosZ=%f,");
format(query, sizeof(query), "%s,CarLic=%d,FlyLic=%d,BoatLic=%d,FishLic=%d,GunLic=%d,Gun1=%d,Gun2=%d,Gun3=%d,Gun4=%d,Ammo1=%d,Ammo2=%d,Ammo3=%d,Ammo4=%d,CarTime=%d,PayDay=%d,PayDayHad=%d,Watch=%d,Wins=%d,Loses=%d,AlcoholPerk=%d,DrugPerk=%d,MiserPerk=%d,PainPerk=%d,TraderPerk=%d,Tutorial=%d,Mission=%d,Warnings=%d,VirWorld=%d,Fuel=%d,Married=%d,MarriedTo=%s,FishTool=%d,Note1=%s,");
format(query, sizeof(query), "%s,Note1s=%d,Note2=%s,Note2s=%d,Note3=%s,Note3s=%d,Note4=%s,Note4s=%d,Note5=%s,Note5s=%d,InvWeapon=%d,InvAmmo=%d,Lighter=%d,Cigarettes=%d,Locked=%d,GameSage=%d,PinKod=%d,Kredit=%d,Naocale=%d,");
format(query, sizeof(query), "%s,MuteTime=%d,Kapa=%d,Kosa=%d,HCPosX=%f,HCPosY=%f,HCPosZ=%f,HCRot=%f,HCar=%f,Stan=%d,Vikendica=%d,Spawn=%d,Vlasnik=%s,DBodovi=%d FROM playerdata WHERE user = '%s'",
PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pDonateRank],PlayerInfo[playerid][gPupgrade],PlayerInfo[playerid][pConnectTime],PlayerInfo[playerid][pReg],
PlayerInfo[playerid][pSpol],PlayerInfo[playerid][pGodine],PlayerInfo[playerid][pDrzava],PlayerInfo[playerid][pCK],
PlayerInfo[playerid][pMuted],PlayerInfo[playerid][pExp],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pAccount],
PlayerInfo[playerid][pCrimes],query,PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pArrested],
PlayerInfo[playerid][pWantedDeaths],PlayerInfo[playerid][pPhoneBook],PlayerInfo[playerid][pLottoNr],PlayerInfo[playerid][pFishes],
PlayerInfo[playerid][pBiggestFish],PlayerInfo[playerid][pJob],PlayerInfo[playerid][pPayCheck],PlayerInfo[playerid][pHeadValue],
PlayerInfo[playerid][pJailed],PlayerInfo[playerid][pJailTime],PlayerInfo[playerid][pMats],PlayerInfo[playerid][pDrugs],
PlayerInfo[playerid][pLeader],PlayerInfo[playerid][pMember],PlayerInfo[playerid][pFMember],PlayerInfo[playerid][pRank],
PlayerInfo[playerid][pChar],PlayerInfo[playerid][pContractTime],PlayerInfo[playerid][pDetSkill],query,PlayerInfo[playerid][pSpolSkill],
PlayerInfo[playerid][pBoxSkill],PlayerInfo[playerid][pLawSkill],PlayerInfo[playerid][pMechSkill],PlayerInfo[playerid][pJackSkill],
PlayerInfo[playerid][pCarSkill],PlayerInfo[playerid][pNewsSkill],PlayerInfo[playerid][pDrugsSkill],PlayerInfo[playerid][pCookSkill],
PlayerInfo[playerid][pFishSkill],PlayerInfo[playerid][pSHealth],PlayerInfo[playerid][pHealth],PlayerInfo[playerid][pInt],PlayerInfo[playerid][pLocal],
PlayerInfo[playerid][pTeam],PlayerInfo[playerid][pModel],PlayerInfo[playerid][pPnumber],PlayerInfo[playerid][pPcarkey],
PlayerInfo[playerid][pPcarkey2],PlayerInfo[playerid][pPcarkey3],PlayerInfo[playerid][pPhousekey],PlayerInfo[playerid][pPbiskey],
PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z],query,PlayerInfo[playerid][pCarLic],
PlayerInfo[playerid][pFlyLic],PlayerInfo[playerid][pBoatLic],PlayerInfo[playerid][pFishLic],PlayerInfo[playerid][pGunLic],
PlayerInfo[playerid][pGun1],PlayerInfo[playerid][pGun2],PlayerInfo[playerid][pGun3],PlayerInfo[playerid][pGun4],
PlayerInfo[playerid][pAmmo1],PlayerInfo[playerid][pAmmo2],PlayerInfo[playerid][pAmmo3],PlayerInfo[playerid][pAmmo4],
PlayerInfo[playerid][pCarTime],PlayerInfo[playerid][pPayDay],PlayerInfo[playerid][pPayDayHad],PlayerInfo[playerid][pWatch],
PlayerInfo[playerid][pWins],PlayerInfo[playerid][pLoses],PlayerInfo[playerid][pAlcoholPerk],PlayerInfo[playerid][pDrugPerk],
PlayerInfo[playerid][pMiserPerk],PlayerInfo[playerid][pPainPerk],PlayerInfo[playerid][pTraderPerk],PlayerInfo[playerid][pTut],
PlayerInfo[playerid][pMissionNr],PlayerInfo[playerid][pWarns],PlayerInfo[playerid][pVirWorld],PlayerInfo[playerid][pFuel],
PlayerInfo[playerid][pMarried],PlayerInfo[playerid][pMarriedTo],PlayerInfo[playerid][pFishTool],PlayerInfo[playerid][pNote1],
query,PlayerInfo[playerid][pNote1s],PlayerInfo[playerid][pNote2],PlayerInfo[playerid][pNote2s],PlayerInfo[playerid][pNote3],
PlayerInfo[playerid][pNote3s],PlayerInfo[playerid][pNote4],PlayerInfo[playerid][pNote4s],PlayerInfo[playerid][pNote5],
PlayerInfo[playerid][pNote5s],PlayerInfo[playerid][pInvWeapon],PlayerInfo[playerid][pInvAmmo],PlayerInfo[playerid][pLighter],
PlayerInfo[playerid][pCigarettes],PlayerInfo[playerid][pLocked],PlayerInfo[playerid][pGameSage],PlayerInfo[playerid][pPinKod],
PlayerInfo[playerid][pKredit],PlayerInfo[playerid][pNaocale],query,PlayerInfo[playerid][pMuteTime],PlayerInfo[playerid][pKapa],
PlayerInfo[playerid][pKosa],PlayerInfo[playerid][pHCPos_x],PlayerInfo[playerid][pHCPos_y],PlayerInfo[playerid][pHCPos_z],
PlayerInfo[playerid][pHCRot_],PlayerInfo[playerid][pHCar],PlayerInfo[playerid][pPstankey],PlayerInfo[playerid][pPvikendicakey],
PlayerInfo[playerid][pSpawnChange],PlayerInfo[playerid][pVlasnikAuta],GetPVarInt(playerid, "DBodovi",pname);
mysql_query(query);
}
I've tried to do it with "\" , but it gives me more errors.
The line is too long then.
Erm, don't think that would work, just format different strings and strcat it into the query.
You must put all that into one string. Not 6, you can extended the line and then drop it below so you don't get the error telling you the line is too long.