Hey,
Wenn man sein Fahrzeug auftunen will geht das zwar aber wenn man sich Reloggt oder das Auto kaputt geht speichert das nicht mein Code:
public LoadPlayerVehicles(playerid, slot)
{
new result[25], rows, fields;
cache_get_data(rows, fields);
if(rows)
{
cache_get_field_content(0, "vehBesitzer", result);
format(PrivateVehicle[playerid][slot][vehBesitzer], 25, result);
PrivateVehicle[playerid][slot][modelid] = cache_get_field_content_int(0, "modelid");
PrivateVehicle[playerid][slot][vehPosX] = cache_get_field_content_float(0, "vehPosX");
PrivateVehicle[playerid][slot][vehPosY] = cache_get_field_content_float(0, "vehPosY");
PrivateVehicle[playerid][slot][vehPosZ] = cache_get_field_content_float(0, "vehPosZ");
PrivateVehicle[playerid][slot][vehPosA] = cache_get_field_content_float(0, "vehPosA");
PrivateVehicle[playerid][slot][vehHealth] = cache_get_field_content_float(0, "vehHealth");
PrivateVehicle[playerid][slot][vehColor1] = cache_get_field_content_int(0, "vehColor1");
PrivateVehicle[playerid][slot][vehColor2] = cache_get_field_content_int(0, "vehColor2");
PrivateVehicle[playerid][slot][vehPaintjob] = cache_get_field_content_int(0, "vehPaintjob");
PrivateVehicle[playerid][slot][vehSpoiler] = cache_get_field_content_int(0, "vehSpoiler");
PrivateVehicle[playerid][slot][vehHood] = cache_get_field_content_int(0, "vehHood");
PrivateVehicle[playerid][slot][vehRoof] = cache_get_field_content_int(0, "vehRoof");
PrivateVehicle[playerid][slot][vehSideskirt] = cache_get_field_content_int(0, "vehSideskirt");
PrivateVehicle[playerid][slot][vehLamps] = cache_get_field_content_int(0, "vehLamps");
PrivateVehicle[playerid][slot][vehNitro] = cache_get_field_content_int(0, "vehNitro");
PrivateVehicle[playerid][slot][vehExhaust] = cache_get_field_content_int(0, "vehExhaust");
PrivateVehicle[playerid][slot][vehWheels] = cache_get_field_content_int(0, "vehWheels");
PrivateVehicle[playerid][slot][vehStereo] = cache_get_field_content_int(0, "vehStereo");
PrivateVehicle[playerid][slot][vehHydraulics] = cache_get_field_content_int(0, "vehHydraulics");
PrivateVehicle[playerid][slot][vehFrontBumper] = cache_get_field_content_int(0, "vehFrontBumper");
PrivateVehicle[playerid][slot][vehRearBumper] = cache_get_field_content_int(0, "vehRearBumper");
PrivateVehicle[playerid][slot][vehVentRight] = cache_get_field_content_int(0, "vehVentRight");
PrivateVehicle[playerid][slot][vehVentLeft] = cache_get_field_content_int(0, "vehVentLeft");
PrivateVehicle[playerid][slot][vehPreis] = cache_get_field_content_int(0, "vehPreis");
PrivateVehicle[playerid][slot][vehNeonID] = cache_get_field_content_int(0, "vehNeonID");
cache_get_field_content(0, "vehNumberPlate", PrivateVehicle[playerid][slot][vehNumberPlate], myCon, 32);
PrivateVehicle[playerid][slot][vehID] = CreateVehicleEx(PrivateVehicle[playerid][slot][modelid], PrivateVehicle[playerid][slot][vehPosX], PrivateVehicle[playerid][slot][vehPosY], PrivateVehicle[playerid][slot][vehPosZ], PrivateVehicle[playerid][slot][vehPosA], PrivateVehicle[playerid][slot][vehColor1], PrivateVehicle[playerid][slot][vehColor2], -1, false, 0);
PrivateVehicle[playerid][slot][vehAbgeschleppt] = cache_get_field_content_int(0, "vehAbgeschleppt");
cache_get_field_content(0, "vehAbgeschlepptVon", PrivateVehicle[playerid][slot][vehAbgeschlepptVon], myCon, 32);
PrivateVehicle[playerid][slot][vehMaterialien] = cache_get_field_content_int(0, "vehMaterialien");
PrivateVehicle[playerid][slot][vehDrogen] = cache_get_field_content_int(0, "vehDrogen");
PrivateVehicle[playerid][slot][vehAKRounds] = cache_get_field_content_int(0, "vehAKRounds");
PrivateVehicle[playerid][slot][vehM4Rounds] = cache_get_field_content_int(0, "vehM4Rounds");
PrivateVehicle[playerid][slot][vehSniperRounds] = cache_get_field_content_int(0, "vehSniperRounds");
PrivateVehicle[playerid][slot][vehDeagleRounds] = cache_get_field_content_int(0, "vehDeagleRounds");
PrivateVehicle[playerid][slot][vehMP5Rounds] = cache_get_field_content_int(0, "vehMP5Rounds");
PrivateVehicle[playerid][slot][vehShotgunRounds] = cache_get_field_content_int(0, "vehShotgunRounds");
Vehicle[PrivateVehicle[playerid][slot][vehID]][vehFuel] = cache_get_field_content_float(0, "vehFuel");
Vehicle[PrivateVehicle[playerid][slot][vehID]][vehKMStand] = cache_get_field_content_float(0, "vehKMStand");
Vehicle[PrivateVehicle[playerid][slot][vehID]][vehInterior] = cache_get_field_content_int(0, "vehInterior");
Vehicle[PrivateVehicle[playerid][slot][vehID]][vehWorld] = cache_get_field_content_int(0, "vehWorld");
VehicleTuning(playerid, slot);
}
return 1;
}
stock SavePlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
new mainQuery[2046], secondQuery[512];
format(secondQuery, sizeof(secondQuery), "UPDATE `accounts` SET `Level`='%d', `Admin`='%d', `SpawnHealth`='%f', `PayDay`='%d', `Exp`='%d', `Fraktion`='%d', `PBPoints`='%d', `Zigaretten`='%d', `Bierflaschen`='%d', `Ipod`='%d', ",
Spieler[playerid][pLevel], Spieler[playerid][pAdmin], Spieler[playerid][pSpawnHealth],
Spieler[playerid][pPayDay], Spieler[playerid][pExp], Spieler[playerid][pFraktion], Spieler[playerid][pPBPoints], Spieler[playerid][pZigaretten], Spieler[playerid][pBierflaschen], Spieler[playerid][pIpod]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`Tutorial`='%d', `Skin`='%d', `FrakSkin`='%d', `Geschlecht`='%d', `Perso`='%d', `CarLicense`='%d', `CarLicensePoints`='%d', `Wanteds`='%d', ",
Spieler[playerid][pTutorial], Spieler[playerid][pSkin], Spieler[playerid][pFrakSkin],
Spieler[playerid][pGeschlecht], Spieler[playerid][pPerso],
Spieler[playerid][pCarLicense], Spieler[playerid][pCarLicensePoints],
Spieler[playerid][pWanteds], GetName(playerid));
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`JobMoney`='%d', `JobCount`='%d', `BusSkill`='%d', `BusSkillEXP`='%d', `Tot`='%d', `TotUnix`='%d', `TotX`='%f', `TotY`='%f', `TotZ`='%f', `Kills`='%d', `Deaths`='%d', `Jailed`='%d', `JailTime`='%d', ",
Spieler[playerid][pJobMoney], Spieler[playerid][pJobCount], Spieler[playerid][pBusSkill], Spieler[playerid][pBusSkillEXP],
Spieler[playerid][pTot], Spieler[playerid][pTotUnix], Spieler[playerid][pTotX], Spieler[playerid][pTotY], Spieler[playerid][pTotZ],
Spieler[playerid][pKills], Spieler[playerid][pDeaths], Spieler[playerid][pJailed], Spieler[playerid][pJailTime]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`Rank`='%d', `Verbrechen`='%d', `JailType`='%d', `Banned`='%d', `BanReason`='%s', `BanAdmin`='%s', `Erstehilfe`='%d', `GotMD5`='%d', ",
Spieler[playerid][pRank], Spieler[playerid][pVerbrechen], Spieler[playerid][pJailType], Spieler[playerid][pBanned], Spieler[playerid][pBanReason], Spieler[playerid][pBanAdmin],
Spieler[playerid][pErstehilfe], GotMD5[playerid]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`Number`='%d', `Handy`='%d', `HandyStatus`='%d', `HandyGuthaben`='%d', `Akku`='%f', `DetektivSkill`='%d', `DetektivSkillEXP`='%d', ",
Spieler[playerid][pNumber], Spieler[playerid][pHandy], Spieler[playerid][pHandyStatus], Spieler[playerid][pHandyGuthaben], Spieler[playerid][pAkku], Spieler[playerid][pDetektivSkill], Spieler[playerid][pDetektivSkillEXP]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`PlayTime`='%d', `Warns`='%d', `Crimes`='%d', `JailVisits`='%d', `Eisen`='%d', `EisenSafe`='%d', `Marihuana`='%d', ",
Spieler[playerid][pPlayTime], Spieler[playerid][pWarns], Spieler[playerid][pCrimes], Spieler[playerid][pJailVisits], Spieler[playerid][pEisen], Spieler[playerid][pEisenSafe], Spieler[playerid][pMarihuana]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`MarihuanaSafe`='%d', `Kanister`='%d', `Verheiratet`='%d', `VerheiratetName`='%s', `Bank`='%d', `Premium`='%d', `SkillPoints`='%d', `Lotto`='%d', ",
Spieler[playerid][pMarihuanaSafe], Spieler[playerid][pKanister], Spieler[playerid][pVerheiratet], Spieler[playerid][pVerheiratetName], Spieler[playerid][pBank], Spieler[playerid][pPremium], Spieler[playerid][pSkillPoints], Spieler[playerid][pLotto]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`FlyLicense`='%d', `BoatLicense`='%d', `FishLicense`='%d', `GunLicense`='%d', `Zollpass`='%d', `Job`='%d', `Money`='%d', `QuitJob`='%d', `Boombox`='%d', `HaveBoombox`='%d' WHERE `Name`='%s'",
Spieler[playerid][pFlyLicense], Spieler[playerid][pBoatLicense], Spieler[playerid][pFishLicense],
Spieler[playerid][pGunLicense], Spieler[playerid][pZollpass], Spieler[playerid][pJob], GetMoney(playerid), Spieler[playerid][pQuitJob], Spieler[playerid][pBoombox], Spieler[playerid][pHaveBoombox],GetName(playerid));
strcat(mainQuery, secondQuery);
mysql_function_query(myCon, mainQuery, false, "", "");
strdel(mainQuery, 0, sizeof(mainQuery));
strdel(secondQuery, 0, sizeof(secondQuery));
format(secondQuery, sizeof(secondQuery), "UPDATE `accounts` SET `Geschenk`='%d', `GeschenkCount`='%d' WHERE `Name`='%s'",
Spieler[playerid][pGeschenk], Spieler[playerid][pGeschenkCount], GetName(playerid));
strcat(mainQuery, secondQuery);
mysql_function_query(myCon, mainQuery, false, "", "");
strdel(mainQuery, 0, sizeof(mainQuery));
strdel(secondQuery, 0, sizeof(secondQuery));
// Neuer Query für Save
format(secondQuery, sizeof(secondQuery), "UPDATE `accounts` SET `Muted`='%d', `MuteReason`='%s', `TruckSkill`='%d', `TruckSkillEXP`='%d', `SpawnChange`='%d', `PremiumZeit`='%d', ",
Spieler[playerid][pMuted], Spieler[playerid][pMuteReason], Spieler[playerid][pTruckSkill], Spieler[playerid][pTruckSkillEXP], Spieler[playerid][pSpawnChange], Spieler[playerid][pPremiumZeit]);
strcat(mainQuery, secondQuery);
new xplTime = gettime();
format(secondQuery, sizeof(secondQuery), "`FishSkill`='%d', `FishSkillEXP`='%d', `OrgMember`='%d', `Contract`='%d', `ContractCount`='%d', `LastLogin`='%d', `PilotSkill`='%d', `PilotSkillEXP`='%d', ",
Spieler[playerid][pFishSkill], Spieler[playerid][pFishSkillEXP], Spieler[playerid][pOrgMember], Spieler[playerid][pContract], Spieler[playerid][pContractCount], xplTime, Spieler[playerid][pPilotSkill], Spieler[playerid][pPilotSkillEXP]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`HouseKey`='%d', `TotWorld`='%d', `Hitsound`='%d', `Messages`='%d', `Fished`='%d', `FishTime`='%d', `FishSperre`='%d', `SkillDrug`='%f', `Festgeld`='%d', `HatFestgeld`='%d', `BisFestgeld`='%d' WHERE `Name`='%s'",
Spieler[playerid][pHouseKey], Spieler[playerid][pTotWorld], Spieler[playerid][pHitsound], Spieler[playerid][pMessages], Spieler[playerid][pFished], Spieler[playerid][pFishTime], Spieler[playerid][pFishSperre], Spieler[playerid][pSkillDrug], Spieler[playerid][pFestgeld], Spieler[playerid][pHatFestgeld], Spieler[playerid][pBisFestgeld], GetName(playerid));
strcat(mainQuery, secondQuery);
mysql_function_query(myCon, mainQuery, false, "", "");
strdel(mainQuery, 0, sizeof(mainQuery));
strdel(secondQuery, 0, sizeof(secondQuery));
// Fish
format(secondQuery, sizeof(secondQuery), "UPDATE `accounts` SET `FishID1`='%d', `FishID2`='%d', `FishID3`='%d', `FishID4`='%d', `FishID5`='%d',",
Spieler[playerid][pFishID][1], Spieler[playerid][pFishID][2], Spieler[playerid][pFishID][3], Spieler[playerid][pFishID][4], Spieler[playerid][pFishID][5]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), " `Fishweight1`='%d', `Fishweight2`='%d', `Fishweight3`='%d', `Fishweight4`='%d', `Fishweight5`='%d' WHERE `Name`='%s'",
Spieler[playerid][pFishweight][1], Spieler[playerid][pFishweight][2], Spieler[playerid][pFishweight][3], Spieler[playerid][pFishweight][4], Spieler[playerid][pFishweight][5], GetName(playerid));
strcat(mainQuery, secondQuery);
mysql_function_query(myCon, mainQuery, false, "", "");
strdel(mainQuery, 0, sizeof(mainQuery));
strdel(secondQuery, 0, sizeof(secondQuery));
format(secondQuery, sizeof(secondQuery), "UPDATE `accounts` SET `CookID1`='%d', `CookID2`='%d', `CookID3`='%d', `CookID4`='%d', `CookID5`='%d',",
Spieler[playerid][pCookID][1], Spieler[playerid][pCookID][2], Spieler[playerid][pCookID][3], Spieler[playerid][pCookID][4], Spieler[playerid][pCookID][5]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), " `CookHP1`='%d', `CookHP1`='%d', `CookHP1`='%d', `CookHP1`='%d', `CookHP1`='%d' WHERE `Name`='%s'",
Spieler[playerid][pCookHP][1], Spieler[playerid][pCookHP][2], Spieler[playerid][pCookHP][3], Spieler[playerid][pCookHP][4], Spieler[playerid][pCookHP][5], GetName(playerid));
strcat(mainQuery, secondQuery);
mysql_function_query(myCon, mainQuery, false, "", "");
strdel(mainQuery, 0, sizeof(mainQuery));
strdel(secondQuery, 0, sizeof(secondQuery));
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
//Ab hier ist wichtig
for(new vehSlot=0;vehSlot<MAX_PLAYER_VEHICLES;vehSlot++)
{
if(!strcmp(GetName(playerid), PrivateVehicle[playerid][vehSlot][vehBesitzer], true))
{
if(PrivateVehicle[playerid][vehSlot][modelid] != 0)
{
format(secondQuery, sizeof(secondQuery), "UPDATE `script_vehicles` SET `modelid`='%d', `vehPosX`='%f', `vehPosY`='%f', `vehPosZ`='%f', `vehPosA`='%f', `vehHealth`='%f', ",
PrivateVehicle[playerid][vehSlot][modelid],
PrivateVehicle[playerid][vehSlot][vehPosX],
PrivateVehicle[playerid][vehSlot][vehPosY],
PrivateVehicle[playerid][vehSlot][vehPosZ],
PrivateVehicle[playerid][vehSlot][vehPosA],
PrivateVehicle[playerid][vehSlot][vehHealth]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`vehColor1`='%d', `vehColor2`='%d', `vehPaintjob`='%d', `vehSpoiler`='%d', `vehHood`='%d', ",
PrivateVehicle[playerid][vehSlot][vehColor1],
PrivateVehicle[playerid][vehSlot][vehColor2],
PrivateVehicle[playerid][vehSlot][vehPaintjob],
PrivateVehicle[playerid][vehSlot][vehSpoiler],
PrivateVehicle[playerid][vehSlot][vehHood]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`vehRoof`='%d', `vehSideskirt`='%d', `vehLamps`='%d', `vehNitro`='%d', `vehExhaust`='%d', ",
PrivateVehicle[playerid][vehSlot][vehRoof],
PrivateVehicle[playerid][vehSlot][vehSideskirt],
PrivateVehicle[playerid][vehSlot][vehLamps],
PrivateVehicle[playerid][vehSlot][vehNitro],
PrivateVehicle[playerid][vehSlot][vehExhaust]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`vehWheels`='%d', `vehStereo`='%d', `vehHydraulics`='%d', `vehFrontBumper`='%d', `vehRearBumper`='%d', ",
PrivateVehicle[playerid][vehSlot][vehWheels],
PrivateVehicle[playerid][vehSlot][vehStereo],
PrivateVehicle[playerid][vehSlot][vehHydraulics],
PrivateVehicle[playerid][vehSlot][vehFrontBumper],
PrivateVehicle[playerid][vehSlot][vehRearBumper]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`vehVentRight`='%d', `vehVentLeft`='%d', `vehPreis`='%d', `vehNeonID`='%d', `vehNumberPlate`='%s', `vehFuel`='%f', ",
PrivateVehicle[playerid][vehSlot][vehVentRight],
PrivateVehicle[playerid][vehSlot][vehVentLeft],
PrivateVehicle[playerid][vehSlot][vehPreis],
PrivateVehicle[playerid][vehSlot][vehNeonID],
PrivateVehicle[playerid][vehSlot][vehNumberPlate],
Vehicle[PrivateVehicle[playerid][vehSlot][vehID]][vehFuel]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`vehAKRounds`='%d', `vehM4Rounds`='%d', `vehSniperRounds`='%d', `vehDeagleRounds`='%d', `vehMP5Rounds`='%d', `vehShotgunRounds`='%d', ",
PrivateVehicle[playerid][vehSlot][vehAKRounds], PrivateVehicle[playerid][vehSlot][vehM4Rounds], PrivateVehicle[playerid][vehSlot][vehSniperRounds], PrivateVehicle[playerid][vehSlot][vehDeagleRounds],
PrivateVehicle[playerid][vehSlot][vehMP5Rounds], PrivateVehicle[playerid][vehSlot][vehShotgunRounds]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`vehKMStand`='%f', `vehInterior`='%d', `vehWorld`='%d', `vehAbgeschleppt`='%d', `vehAbgeschlepptVon`='%s', `vehMaterialien`='%d', `vehDrogen`='%d' WHERE `vehBesitzer`='%s' AND `Slot`='%d'",
Vehicle[PrivateVehicle[playerid][vehSlot][vehID]][vehKMStand],
PrivateVehicle[playerid][vehSlot][vehInterior],
PrivateVehicle[playerid][vehSlot][vehWorld],
PrivateVehicle[playerid][vehSlot][vehAbgeschleppt],
PrivateVehicle[playerid][vehSlot][vehAbgeschlepptVon],
PrivateVehicle[playerid][vehSlot][vehMaterialien],
PrivateVehicle[playerid][vehSlot][vehDrogen],
PrivateVehicle[playerid][vehSlot][vehBesitzer],
vehSlot);
strcat(mainQuery, secondQuery);
SendClientMessageToAll(COLOR_YELLOW, mainQuery);
mysql_function_query(myCon, mainQuery, false, "", "");
strdel(mainQuery, 0, sizeof(mainQuery));
strdel(secondQuery, 0, sizeof(secondQuery));
}
}
}
}
return 1;
}
Bitte um Hilfe, vielen Dank.