Hallo Leute,
nochmal wegen dem Mysql Kram. Ich habe jetzt ein verbessertes Speicher und Lade System
geschrieben. Alles sieht gut aus, doch er lädt bzw speichert nicht. Wenn ich in den Mysql_Log gucke, ist alles normal
doch am ende kommt diese Nachricht:
(Error ID: 1064, 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 '`Roadblock`= 0,`PlayMinutes`= 8,`GesamtMinutes`= 8,`MinutesSinceLogin`= 8,`Minut' at line 1)
Ich hab nach möglichen Fehlern gesucht aber ich finde sie irgendwie nicht.
stock SavePlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(gPlayerLogged[playerid])
{
new query[2048];
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid), PlayerInfo[playerid][pLevel] = GetPlayerScore(playerid);
format(query,sizeof(query),"UPDATE `accounts` SET `Level`='%d',`Admin` = '%d', `DonateRank` = '%d', `Register` = '%d', `Geschlecht` = '%d'",
PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pDonateRank],PlayerInfo[playerid][pReg],PlayerInfo[playerid][pSex]);
format(query,sizeof(query),"%s,`Alter`= %d,`Origin`= %d,`CK`= %d,`Muted`= %d,`Exp`= %d,`Geld`= %d,`Account`= %d,`PlayerKreditDauer`= %d,`PlayerKredit`= %d",
query,PlayerInfo[playerid][pAge],PlayerInfo[playerid][pOrigin],PlayerInfo[playerid][pCK],PlayerInfo[playerid][pMuted],PlayerInfo[playerid][pExp],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pAccount],PlayerInfo[playerid][pPlayerKreditDauer],PlayerInfo[playerid][pPlayerKredit]);
format(query,sizeof(query),"%s,`Crimes`= %d,`Kills`= %d,`Deaths`= %d,`Arrested`= %d,`WantedDeaths`= %d,`Telefonbuch`= %d,`LottoNr`= %d,`Beruf`= %d",
query,PlayerInfo[playerid][pCrimes],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pArrested],PlayerInfo[playerid][pWantedDeaths],PlayerInfo[playerid][pPhoneBook],PlayerInfo[playerid][pLottoNr],PlayerInfo[playerid][pJob]);
format(query,sizeof(query),"%s,`PayCheck`= %d,`HeadValue`= %d,`Jailed`= %d,`JailTime`= %d,`GangJailed`= %d,`JackSkill`= %d,`Mauled`= %d,`Mats`= %d,`Drugs`= %d",
query,PlayerInfo[playerid][pPayCheck],PlayerInfo[playerid][pHeadValue],PlayerInfo[playerid][pJailed],PlayerInfo[playerid][pJailTime],PlayerInfo[playerid][pGangJailed],PlayerInfo[playerid][pJackSkill],PlayerInfo[playerid][pMauled],PlayerInfo[playerid][pMats],PlayerInfo[playerid][pDrugs]);
format(query,sizeof(query),"%s,`Leader`= %d,`Member`= %d,`FMember`= %d,`Rank`= %d,`Char`= %d,`ContractTime`= %d,`Health`= %.2f,`SHealth`= %.2f,`Int`= %d,`Local`= %d",
query,PlayerInfo[playerid][pLeader],PlayerInfo[playerid][pMember],PlayerInfo[playerid][pFMember],PlayerInfo[playerid][pRank],PlayerInfo[playerid][pChar],PlayerInfo[playerid][pContractTime],PlayerInfo[playerid][pHealth],PlayerInfo[playerid][pSHealth],PlayerInfo[playerid][pInt],PlayerInfo[playerid][pLocal]);
format(query,sizeof(query),"%s,`Team`= %d,`Model`= %d,`Pnumber`= %d,`Phousekey`= %d,`Pbiskey`= %d,`Pos_x`= %.4f,`Pos_y`= %.4f,`Pos_z`= %.4f",
query,PlayerInfo[playerid][pTeam],PlayerInfo[playerid][pModel],PlayerInfo[playerid][pPnumber],PlayerInfo[playerid][pPhousekey],PlayerInfo[playerid][pPbiskey],PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]);
format(query,sizeof(query),"%s,`CarLic`= %d,`NewLic`= %d,`FlyLic`= %d,`BoatLic`= %d,`FishLic`= %d,`GunLic`= %d,`LKWLic`= %d,`RollerLic`= %d,`MotoLic`= %d",
query,PlayerInfo[playerid][pCarLic],PlayerInfo[playerid][pNewLic],PlayerInfo[playerid][pFlyLic],PlayerInfo[playerid][pBoatLic],PlayerInfo[playerid][pFishLic],PlayerInfo[playerid][pGunLic],PlayerInfo[playerid][pLKWLic],PlayerInfo[playerid][pRollerLic],PlayerInfo[playerid][pMotoLic]);
format(query,sizeof(query),"%s,`Zigaretten`= %d,`ZigSucht`= %d,`Gun1`= %d,`Gun2`= %d,`Gun3`= %d,`Gun4`= %d,`Ammo1`= %d,`Ammo2`= %d,`Ammo3`= %d,`Ammo4`= %d,`CarTime`= %d,`MullTime`= %d",
query,PlayerInfo[playerid][pZig],PlayerInfo[playerid][pZigSucht],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][pMulltime]);
format(query,sizeof(query),"%s,`PayDay`= %d,`PayDayHad`= %d,`AlcoholPerk`= %d,`DrugPerk`= %d,`MiserPerk`= %d,`PainPerk`= %d,`Tut`= %d,`Warns`= %d,`Adjustable`= %d,`Fuel`= %d",
query,PlayerInfo[playerid][pPayDay],PlayerInfo[playerid][pPayDayHad],PlayerInfo[playerid][pAlcoholPerk],PlayerInfo[playerid][pDrugPerk],PlayerInfo[playerid][pMiserPerk],PlayerInfo[playerid][pPainPerk],PlayerInfo[playerid][pTut],PlayerInfo[playerid][pWarns],PlayerInfo[playerid][pAdjustable],PlayerInfo[playerid][pFuel]);
format(query,sizeof(query),"%s,`Married`= %d,`MarriedTo`= %s,`Roadblock`= %d,`PlayMinutes`= %d,`GesamtMinutes`= %d,`MinutesSinceLogin`= %d,`MinutesSinceAn`= %d",
query,PlayerInfo[playerid][pMarried],PlayerInfo[playerid][pMarriedTo],PlayerInfo[playerid][pRoadblock],PlayerInfo[playerid][pPlayMinutes],PlayerInfo[playerid][pGesamtMinutes],PlayerInfo[playerid][pMinutesSinceLogin],PlayerInfo[playerid][pMinutesSinceAn]);
format(query,sizeof(query),"%s,`HandyGeld`= %d,`HandyVer`= %d,`UhrID`= %d,`HandyID`= %d,`OwnPerso`= %d,`OwnAntrag`= %d,`PersoStop`= %d,`Gehalt`= %d,`Tot`= %d,`GDeaths`= %d,`GKills`= %d",
query,PlayerInfo[playerid][pHandyGeld],PlayerInfo[playerid][pHandyVer],PlayerInfo[playerid][pUhrID],PlayerInfo[playerid][pHandyID],PlayerInfo[playerid][pOwnPerso],PlayerInfo[playerid][pOwnAntrag],PlayerInfo[playerid][pPersoStop],PlayerInfo[playerid][pGehalt],PlayerInfo[playerid][pTot],PlayerInfo[playerid][pGDeaths],PlayerInfo[playerid][pGKills]);
format(query,sizeof(query),"%s,`Meldung`= %d,`Ptankekey`= %d,`Gesperrt`= %d,`Contract`= %d,`Notruf`= %d,`Navi`= %d,`Skin`= %d,`Sprengstoff`= %d",
query,PlayerInfo[playerid][pMeldung],PlayerInfo[playerid][pPtankekey],PlayerInfo[playerid][pGesperrt],PlayerInfo[playerid][pContract],PlayerInfo[playerid][pNotruf],PlayerInfo[playerid][pNavi],PlayerInfo[playerid][pSkin],PlayerInfo[playerid][pSprengstoff]);
format(query,sizeof(query),"%s,`Startbonus`= %d,`Hotel`= %d,`TutorialLevel`= %d,`Wohnung`= %d,`FightStyle`= %d WHERE `Name`='%s'",query,PlayerInfo[playerid][pStartbonus],PlayerInfo[playerid][pHotel],PlayerInfo[playerid][pTutorialLevel],PlayerInfo[playerid][pWohnung],PlayerInfo[playerid][pFight],PlayerInfo[playerid][pName]);
mysql_query(query);
printf("Die Speicherung für %s wurde aufgerufen!", PlayerInfo[playerid][pName]),print(query);
}
}
return 1;
}
stock LoadPlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid) && gPlayerLogged[playerid])
{
new query[250];
format(query,sizeof(query),"SELECT * FROM `accounts` WHERE `Name` = '%s'",PlayerInfo[playerid][pName]);
mysql_query(query);
mysql_store_result();
print(query),printf("Das laden von %s wurde ausgeführt!", PlayerInfo[playerid][pName]);
while(mysql_retrieve_row())
{
//mysql_fetch_field_row(query, "Name"),PlayerInfo[playerid][pName]=strval(query);
mysql_fetch_field_row(query, "Level"),PlayerInfo[playerid][pLevel]=strval(query);
mysql_fetch_field_row(query, "Admin"),PlayerInfo[playerid][pAdmin]=strval(query);
mysql_fetch_field_row(query, "DonateRank"),PlayerInfo[playerid][pDonateRank]=strval(query);
mysql_fetch_field_row(query, "Register"),PlayerInfo[playerid][pReg]=strval(query);
mysql_fetch_field_row(query, "Geschlecht"),PlayerInfo[playerid][pSex]=strval(query);
mysql_fetch_field_row(query, "Alter"),PlayerInfo[playerid][pAge]=strval(query);
mysql_fetch_field_row(query, "Origin"),PlayerInfo[playerid][pOrigin]=strval(query);
mysql_fetch_field_row(query, "CK"),PlayerInfo[playerid][pCK]=strval(query);
mysql_fetch_field_row(query, "Muted"),PlayerInfo[playerid][pMuted]=strval(query);
mysql_fetch_field_row(query, "Exp"),PlayerInfo[playerid][pExp]=strval(query);
mysql_fetch_field_row(query, "Geld"),PlayerInfo[playerid][pCash]=strval(query);
mysql_fetch_field_row(query, "Account"),PlayerInfo[playerid][pAccount]=strval(query);
mysql_fetch_field_row(query, "PlayerKreditDauer"),PlayerInfo[playerid][pPlayerKreditDauer]=strval(query);
mysql_fetch_field_row(query, "PlayerKredit"),PlayerInfo[playerid][pPlayerKredit]=strval(query);
mysql_fetch_field_row(query, "Crimes"),PlayerInfo[playerid][pCrimes]=strval(query);
mysql_fetch_field_row(query, "Kills"),PlayerInfo[playerid][pKills]=strval(query);
mysql_fetch_field_row(query, "Deaths"),PlayerInfo[playerid][pDeaths]=strval(query);
mysql_fetch_field_row(query, "Arrested"),PlayerInfo[playerid][pArrested]=strval(query);
mysql_fetch_field_row(query, "WantedDeaths"),PlayerInfo[playerid][pWantedDeaths]=strval(query);
mysql_fetch_field_row(query, "Telefonbuch"),PlayerInfo[playerid][pPhoneBook]=strval(query);
mysql_fetch_field_row(query, "LottoNr"),PlayerInfo[playerid][pLottoNr]=strval(query);
mysql_fetch_field_row(query, "Beruf"),PlayerInfo[playerid][pJob]=strval(query);
mysql_fetch_field_row(query, "PayCheck"),PlayerInfo[playerid][pPayCheck]=strval(query);
mysql_fetch_field_row(query, "HeadValue"),PlayerInfo[playerid][pHeadValue]=strval(query);
mysql_fetch_field_row(query, "Jailed"),PlayerInfo[playerid][pJailed]=strval(query);
mysql_fetch_field_row(query, "JailTime"),PlayerInfo[playerid][pJailTime]=strval(query);
mysql_fetch_field_row(query, "GangJailed"),PlayerInfo[playerid][pGangJailed]=strval(query);
mysql_fetch_field_row(query, "JackSkill"),PlayerInfo[playerid][pJackSkill]=strval(query);
mysql_fetch_field_row(query, "Mauled"),PlayerInfo[playerid][pMauled]=strval(query);
mysql_fetch_field_row(query, "Mats"),PlayerInfo[playerid][pMats]=strval(query);
mysql_fetch_field_row(query, "Drugs"),PlayerInfo[playerid][pDrugs]=strval(query);
mysql_fetch_field_row(query, "Leader"),PlayerInfo[playerid][pLeader]=strval(query);
mysql_fetch_field_row(query, "Member"),PlayerInfo[playerid][pMember]=strval(query);
mysql_fetch_field_row(query, "FMember"),PlayerInfo[playerid][pFMember]=strval(query);
mysql_fetch_field_row(query, "Rank"),PlayerInfo[playerid][pRank]=strval(query);
mysql_fetch_field_row(query, "Char"),PlayerInfo[playerid][pChar]=strval(query);
mysql_fetch_field_row(query, "ContractTime"),PlayerInfo[playerid][pContractTime]=strval(query);
mysql_fetch_field_row(query, "Health"),PlayerInfo[playerid][pHealth]=strval(query);
mysql_fetch_field_row(query, "SHealth"),PlayerInfo[playerid][pSHealth]=strval(query);
mysql_fetch_field_row(query, "Int"),PlayerInfo[playerid][pInt]=strval(query);
mysql_fetch_field_row(query, "Local"),PlayerInfo[playerid][pLocal]=strval(query);
mysql_fetch_field_row(query, "Team"),PlayerInfo[playerid][pTeam]=strval(query);
mysql_fetch_field_row(query, "Model"),PlayerInfo[playerid][pModel]=strval(query);
mysql_fetch_field_row(query, "Pnumber"),PlayerInfo[playerid][pPnumber]=strval(query);
mysql_fetch_field_row(query, "Phousekey"),PlayerInfo[playerid][pPhousekey]=strval(query);
mysql_fetch_field_row(query, "Pbiskey"),PlayerInfo[playerid][pPbiskey]=strval(query);
mysql_fetch_field_row(query, "Pos_x"),PlayerInfo[playerid][pPos_x]=strval(query);
mysql_fetch_field_row(query, "Pos_y"),PlayerInfo[playerid][pPos_y]=strval(query);
mysql_fetch_field_row(query, "Pos_z"),PlayerInfo[playerid][pPos_z]=strval(query);
mysql_fetch_field_row(query, "CarLic"),PlayerInfo[playerid][pCarLic]=strval(query);
mysql_fetch_field_row(query, "NewLic"),PlayerInfo[playerid][pNewLic]=strval(query);
mysql_fetch_field_row(query, "FlyLic"),PlayerInfo[playerid][pFlyLic]=strval(query);
mysql_fetch_field_row(query, "BoatLic"),PlayerInfo[playerid][pBoatLic]=strval(query);
mysql_fetch_field_row(query, "FishLic"),PlayerInfo[playerid][pFishLic]=strval(query);
mysql_fetch_field_row(query, "GunLic"),PlayerInfo[playerid][pGunLic]=strval(query);
mysql_fetch_field_row(query, "LKWLic"),PlayerInfo[playerid][pLKWLic]=strval(query);
mysql_fetch_field_row(query, "RollerLic"),PlayerInfo[playerid][pRollerLic]=strval(query);
mysql_fetch_field_row(query, "MotoLic"),PlayerInfo[playerid][pMotoLic]=strval(query);
mysql_fetch_field_row(query, "Zigaretten"),PlayerInfo[playerid][pZig]=strval(query);
mysql_fetch_field_row(query, "ZigSucht"),PlayerInfo[playerid][pZigSucht]=strval(query);
mysql_fetch_field_row(query, "Gun1"),PlayerInfo[playerid][pGun1]=strval(query);
mysql_fetch_field_row(query, "Gun2"),PlayerInfo[playerid][pGun2]=strval(query);
mysql_fetch_field_row(query, "Gun3"),PlayerInfo[playerid][pGun3]=strval(query);
mysql_fetch_field_row(query, "Gun4"),PlayerInfo[playerid][pGun4]=strval(query);
mysql_fetch_field_row(query, "Ammo1"),PlayerInfo[playerid][pAmmo1]=strval(query);
mysql_fetch_field_row(query, "Ammo2"),PlayerInfo[playerid][pAmmo2]=strval(query);
mysql_fetch_field_row(query, "Ammo3"),PlayerInfo[playerid][pAmmo3]=strval(query);
mysql_fetch_field_row(query, "Ammo4"),PlayerInfo[playerid][pAmmo4]=strval(query);
mysql_fetch_field_row(query, "CarTime"),PlayerInfo[playerid][pCarTime]=strval(query);
mysql_fetch_field_row(query, "MullTime"),PlayerInfo[playerid][pMulltime]=strval(query);
mysql_fetch_field_row(query, "PayDay"),PlayerInfo[playerid][pPayDay]=strval(query);
mysql_fetch_field_row(query, "PayDayHad"),PlayerInfo[playerid][pPayDayHad]=strval(query);
mysql_fetch_field_row(query, "AlcoholPerk"),PlayerInfo[playerid][pAlcoholPerk]=strval(query);
mysql_fetch_field_row(query, "DrugPerk"),PlayerInfo[playerid][pDrugPerk]=strval(query);
mysql_fetch_field_row(query, "MiserPerk"),PlayerInfo[playerid][pMiserPerk]=strval(query);
mysql_fetch_field_row(query, "PainPerk"),PlayerInfo[playerid][pPainPerk]=strval(query);
mysql_fetch_field_row(query, "Tut"),PlayerInfo[playerid][pTut]=strval(query);
mysql_fetch_field_row(query, "Warns"),PlayerInfo[playerid][pWarns]=strval(query);
mysql_fetch_field_row(query, "Adjustable"),PlayerInfo[playerid][pAdjustable]=strval(query);
mysql_fetch_field_row(query, "Fuel"),PlayerInfo[playerid][pFuel]=strval(query);
mysql_fetch_field_row(query, "Married"),PlayerInfo[playerid][pMarried]=strval(query);
mysql_fetch_field_row(query, "MarriedTo"),PlayerInfo[playerid][pMarriedTo]=strval(query);
mysql_fetch_field_row(query, "Roadblock"),PlayerInfo[playerid][pRoadblock]=strval(query);
mysql_fetch_field_row(query, "PlayMinutes"),PlayerInfo[playerid][pPlayMinutes]=strval(query);
mysql_fetch_field_row(query, "GesamtMinutes"),PlayerInfo[playerid][pGesamtMinutes]=strval(query);
mysql_fetch_field_row(query, "MinutesSinceLogin"),PlayerInfo[playerid][pMinutesSinceLogin]=strval(query);
mysql_fetch_field_row(query, "MinutesSinceAn"),PlayerInfo[playerid][pMinutesSinceAn]=strval(query);
mysql_fetch_field_row(query, "HandyGeld"),PlayerInfo[playerid][pHandyGeld]=strval(query);
mysql_fetch_field_row(query, "HandyVer"),PlayerInfo[playerid][pHandyVer]=strval(query);
mysql_fetch_field_row(query, "UhrID"),PlayerInfo[playerid][pUhrID]=strval(query);
mysql_fetch_field_row(query, "HandyID"),PlayerInfo[playerid][pHandyID]=strval(query);
mysql_fetch_field_row(query, "OwnPerso"),PlayerInfo[playerid][pOwnPerso]=strval(query);
mysql_fetch_field_row(query, "OwnAntrag"),PlayerInfo[playerid][pOwnAntrag]=strval(query);
mysql_fetch_field_row(query, "PersoStop"),PlayerInfo[playerid][pPersoStop]=strval(query);
mysql_fetch_field_row(query, "Gehalt"),PlayerInfo[playerid][pGehalt]=strval(query);
mysql_fetch_field_row(query, "Tot"),PlayerInfo[playerid][pTot]=strval(query);
mysql_fetch_field_row(query, "GDeaths"),PlayerInfo[playerid][pGDeaths]=strval(query);
mysql_fetch_field_row(query, "GKills"),PlayerInfo[playerid][pGKills]=strval(query);
mysql_fetch_field_row(query, "Meldung"),PlayerInfo[playerid][pMeldung]=strval(query);
mysql_fetch_field_row(query, "Ptankekey"),PlayerInfo[playerid][pPtankekey]=strval(query);
mysql_fetch_field_row(query, "Gesperrt"),PlayerInfo[playerid][pGesperrt]=strval(query);
mysql_fetch_field_row(query, "Contract"),PlayerInfo[playerid][pContract]=strval(query);
mysql_fetch_field_row(query, "Notruf"),PlayerInfo[playerid][pNotruf]=strval(query);
mysql_fetch_field_row(query, "Navi"),PlayerInfo[playerid][pNavi]=strval(query);
mysql_fetch_field_row(query, "Skin"),PlayerInfo[playerid][pSkin]=strval(query);
mysql_fetch_field_row(query, "Sprengstoff"),PlayerInfo[playerid][pSprengstoff]=strval(query);
mysql_fetch_field_row(query, "Startbonus"),PlayerInfo[playerid][pStartbonus]=strval(query);
mysql_fetch_field_row(query, "Hotel"),PlayerInfo[playerid][pHotel]=strval(query);
mysql_fetch_field_row(query, "TutorialLevel"),PlayerInfo[playerid][pTutorialLevel]=strval(query);
mysql_fetch_field_row(query, "Wohnung"),PlayerInfo[playerid][pWohnung]=strval(query);
mysql_fetch_field_row(query, "FightStyle"),PlayerInfo[playerid][pFight]=strval(query);
}
mysql_free_result();
}
return 1;
}
Ich hoffe jemand kann helfen. Danke schonmal im Vorraus.
PS: Die Datenbank ist korrekt eingestellt. (Hab es 5 mal überprüft)
MfG
Advanced