ich habe ein kleines Problem, und zwar benutze ich ein Filterscript, dass mir ein Autohaus ermöglicht. So schön und gut, das Problem dabei ist aber jetzt, dass das geld beim Kauf eines Autos zwar abgezogen wird, aber nicht beim Disconnect in die Account Datei geschrieben wird. Aber halt NUR wenn ich ein Auto kaufe, wenn ich in den 24/7 gehe und dort mit zb. ein Handy kaufe, wird das Geld abgezogen UND beim disconecten auch in der Account datei gespeichert...
public AutoKaufen(playerid,autoid)
{
for(new ik = 0; ik < sizeof Buycars; ik++)
{
if(GetPlayerVehicleID(playerid) == kaufauto[ik])
{
for(new jk = 0; jk < sizeof Autohaus; jk++)
{
if(!strcmp(Autohaus[jk][Name],Buycars[ik][Autohausname],true))
{
new Autodatei[100],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Autodatei,sizeof(Autodatei),"/Autos/%s_Auto_%d.ini",name,autoid);
dini_Create(Autodatei);
dini_Set(Autodatei,"Name",Buycars[ik][Name]);
dini_IntSet(Autodatei,"modelid",Buycars[ik][modelid]);
dini_FloatSet(Autodatei,"HP",1000.00);
dini_FloatSet(Autodatei,"posx",Autohaus[jk][spawnx]);
dini_FloatSet(Autodatei,"posy",Autohaus[jk][spawny]);
dini_FloatSet(Autodatei,"posz",Autohaus[jk][spawnz]);
dini_FloatSet(Autodatei,"posa",Autohaus[jk][spawna]);
dini_IntSet(Autodatei,"Farbe1",-1);
dini_IntSet(Autodatei,"Farbe2",-1);
dini_IntSet(Autodatei,"Paintjob",-1);
dini_Set(Autodatei,"Nummernschild",Buycars[ik][Name]);
Spielercar[playerid][autoid] = CreateVehicle(Buycars[ik][modelid],Autohaus[jk][spawnx],Autohaus[jk][spawny],Autohaus[jk][spawnz],Autohaus[jk][spawna],-1,-1,-1);
SetVehicleNumberPlate(Spielercar[playerid][autoid],dini_Get(Autodatei,"Nummernschild"));
dini_IntSet(Autodatei,"Spoiler",GetVehicleComponentInSlot(Spielercar[playerid][autoid],0));
dini_IntSet(Autodatei,"Hood",GetVehicleComponentInSlot(Spielercar[playerid][autoid],1));
dini_IntSet(Autodatei,"Roof",GetVehicleComponentInSlot(Spielercar[playerid][autoid],2));
dini_IntSet(Autodatei,"Sideskirt",GetVehicleComponentInSlot(Spielercar[playerid][autoid],3));
dini_IntSet(Autodatei,"Lamps",GetVehicleComponentInSlot(Spielercar[playerid][autoid],4));
dini_IntSet(Autodatei,"Nitro",GetVehicleComponentInSlot(Spielercar[playerid][autoid],5));
dini_IntSet(Autodatei,"Exhaust",GetVehicleComponentInSlot(Spielercar[playerid][autoid],6));
dini_IntSet(Autodatei,"Wheels",GetVehicleComponentInSlot(Spielercar[playerid][autoid],7));
dini_IntSet(Autodatei,"Stereo",GetVehicleComponentInSlot(Spielercar[playerid][autoid],8));
dini_IntSet(Autodatei,"Hydraulics",GetVehicleComponentInSlot(Spielercar[playerid][autoid],9));
dini_IntSet(Autodatei,"FrontBumper",GetVehicleComponentInSlot(Spielercar[playerid][autoid],10));
dini_IntSet(Autodatei,"RearBumper",GetVehicleComponentInSlot(Spielercar[playerid][autoid],11));
dini_IntSet(Autodatei,"VentRight",GetVehicleComponentInSlot(Spielercar[playerid][autoid],12));
dini_IntSet(Autodatei,"VentLeft",GetVehicleComponentInSlot(Spielercar[playerid][autoid],13));
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-Buycars[ik][Preis]); //geld system anpassen
Autohaus[jk][Kasse]+=Buycars[ik][Preis];
Autos[playerid][autoid][modelid] = dini_Int(Autodatei,"modelid");
Autos[playerid][autoid][HP] = dini_Int(Autodatei,"HP");
Autos[playerid][autoid][Farbe1] = dini_Int(Autodatei,"Farbe1");
Autos[playerid][autoid][Farbe2] = dini_Int(Autodatei,"Farbe2");
Autos[playerid][autoid][Paintjob] = dini_Int(Autodatei,"Paintjob");
Autos[playerid][autoid][Nummernschild] = dini_Int(Autodatei,"Nummernschild");
Autos[playerid][autoid][posx] = dini_Int(Autodatei,"posx");
Autos[playerid][autoid][posy] = dini_Int(Autodatei,"posy");
Autos[playerid][autoid][posz] = dini_Int(Autodatei,"posz");
Autos[playerid][autoid][posa] = dini_Int(Autodatei,"posa");
Autos[playerid][autoid][Spoiler] = dini_Int(Autodatei,"Spoiler");
Autos[playerid][autoid][Wheels] = dini_Int(Autodatei,"Wheels");
Autos[playerid][autoid][Nitro] = dini_Int(Autodatei,"Nitro");
Autos[playerid][autoid][Roof] = dini_Int(Autodatei,"Roof");
Autos[playerid][autoid][Hood] = dini_Int(Autodatei,"Hood");
Autos[playerid][autoid][Sideskirt] = dini_Int(Autodatei,"Sideskirt");
Autos[playerid][autoid][Lamps] = dini_Int(Autodatei,"Lamps");
Autos[playerid][autoid][Exhaust] = dini_Int(Autodatei,"Exhaust");
Autos[playerid][autoid][Stereo] = dini_Int(Autodatei,"Stereo");
Autos[playerid][autoid][Hydraulics] = dini_Int(Autodatei,"Hydraulics");
Autos[playerid][autoid][VentRight] = dini_Int(Autodatei,"VentRight");
Autos[playerid][autoid][VentLeft] = dini_Int(Autodatei,"VentLeft");
Autos[playerid][autoid][FrontBumper] = dini_Int(Autodatei,"FrontBumper");
Autos[playerid][autoid][RearBumper] = dini_Int(Autodatei,"RearBumper");
}
}
}
}
return 1;
}
[expander] format(var, 32, "Materials=%d\n",PlayerInfo[playerid][pMats]);fwrite(hFile, var);
format(var, 32, "BrauchDrogen=%d\n",PlayerInfo[playerid][pBrauchDroge]);fwrite(hFile, var);
format(var, 32, "Drugs=%d\n",PlayerInfo[playerid][pDrugs]);fwrite(hFile, var);
format(var, 32, "DrogenAbhängig=%d\n",PlayerInfo[playerid][pDabhaengig]);fwrite(hFile, var);
format(var, 32, "Leader=%d\n",PlayerInfo[playerid][pLeader]);fwrite(hFile, var);
format(var, 32, "Member=%d\n",PlayerInfo[playerid][pMember]);fwrite(hFile, var);
format(var, 32, "Rank=%d\n",PlayerInfo[playerid][pRank]);fwrite(hFile, var);
format(var, 32, "Char=%d\n",PlayerInfo[playerid][pChar]);fwrite(hFile, var);
format(var, 32, "DetSkill=%d\n",PlayerInfo[playerid][pDetSkill]);fwrite(hFile, var);
format(var, 32, "SexSkill=%d\n",PlayerInfo[playerid][pSexSkill]);fwrite(hFile, var);
format(var, 32, "BoxSkill=%d\n",PlayerInfo[playerid][pBoxSkill]);fwrite(hFile, var);
format(var, 32, "LawSkill=%d\n",PlayerInfo[playerid][pLawSkill]);fwrite(hFile, var);
format(var, 32, "MechSkill=%d\n",PlayerInfo[playerid][pMechSkill]);fwrite(hFile, var);
format(var, 32, "JackSkill=%d\n",PlayerInfo[playerid][pJackSkill]);fwrite(hFile, var);
format(var, 32, "CarSkill=%d\n",PlayerInfo[playerid][pCarSkill]);fwrite(hFile, var);
format(var, 32, "NewsSkill=%d\n",PlayerInfo[playerid][pNewsSkill]);fwrite(hFile, var);
format(var, 32, "DrugsSkill=%d\n",PlayerInfo[playerid][pDrugsSkill]);fwrite(hFile, var);
format(var, 32, "FishSkill=%d\n",PlayerInfo[playerid][pFishSkill]);fwrite(hFile, var);
format(var, 32, "pSHealth=%.1f\n",PlayerInfo[playerid][pSHealth]);fwrite(hFile, var);
GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
format(var, 32, "pHealth=%.1f\n",PlayerInfo[playerid][pHealth]);fwrite(hFile, var);
format(var, 32, "Int=%d\n",PlayerInfo[playerid][pInt]);fwrite(hFile, var);
format(var, 32, "Local=%d\n",PlayerInfo[playerid][pLocal]);fwrite(hFile, var);
format(var, 32, "Team=%d\n",PlayerInfo[playerid][pTeam]);fwrite(hFile, var);
format(var, 32, "Model=%d\n",PlayerInfo[playerid][pModel]);fwrite(hFile, var);
format(var, 32, "PhoneNr=%d\n",PlayerInfo[playerid][pPnumber]);fwrite(hFile, var);
format(var, 32, "House=%d\n",PlayerInfo[playerid][pPhousekey]);fwrite(hFile, var);
format(var, 32, "Bizz=%d\n",PlayerInfo[playerid][pPbiskey]);fwrite(hFile, var);
format(var, 32, "HandyGeld=%d\n",PlayerInfo[playerid][pHandyGeld]);fwrite(hFile, var);
format(var, 32, "HandyVer=%d\n",PlayerInfo[playerid][pHandyVer]);fwrite(hFile, var);
format(var, 32, "Arbeitgeld=%d\n",PlayerInfo[playerid][pHartzIV]);fwrite(hFile, var);
format(var, 32, "Hotel=%d\n",PlayerInfo[playerid][pHotel]);fwrite(hFile, var);
if(Spectate[playerid] != 255)
{
PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
}
format(var, 32, "Pos_x=%.1f\n",PlayerInfo[playerid][pPos_x]);fwrite(hFile, var);
format(var, 32, "Pos_y=%.1f\n",PlayerInfo[playerid][pPos_y]);fwrite(hFile, var);
format(var, 32, "Pos_z=%.1f\n",PlayerInfo[playerid][pPos_z]);fwrite(hFile, var);
format(var, 32, "CarLic=%d\n",PlayerInfo[playerid][pCarLic]);fwrite(hFile, var);
format(var, 32, "NewLic=%d\n",PlayerInfo[playerid][pNewLic]);fwrite(hFile, var);
format(var, 32, "FlyLic=%d\n",PlayerInfo[playerid][pFlyLic]);fwrite(hFile, var);
format(var, 32, "BoatLic=%d\n",PlayerInfo[playerid][pBoatLic]);fwrite(hFile, var);
format(var, 32, "FishLic=%d\n",PlayerInfo[playerid][pFishLic]);fwrite(hFile, var);
format(var, 32, "GunLic=%d\n",PlayerInfo[playerid][pGunLic]);fwrite(hFile, var);// hier wird aller 30 min alles geupdated und gespeichert
format(var, 32, "LKWLic=%d\n",PlayerInfo[playerid][pLKWLic]);fwrite(hFile, var);
format(var, 32, "MotoLic=%d\n",PlayerInfo[playerid][pMotoLic]);fwrite(hFile, var);
format(var, 32, "Zig=%d\n",PlayerInfo[playerid][pZig]);fwrite(hFile, var);
format(var, 32, "ZigSucht=%d\n",PlayerInfo[playerid][pZigSucht]);fwrite(hFile, var);
format(var, 32, "Gun1=%d\n",PlayerInfo[playerid][pGun1]);fwrite(hFile, var);
format(var, 32, "Gun2=%d\n",PlayerInfo[playerid][pGun2]);fwrite(hFile, var);
format(var, 32, "Gun3=%d\n",PlayerInfo[playerid][pGun3]);fwrite(hFile, var);
format(var, 32, "Gun4=%d\n",PlayerInfo[playerid][pGun4]);fwrite(hFile, var);
format(var, 32, "Ammo1=%d\n",PlayerInfo[playerid][pAmmo1]);fwrite(hFile, var);
format(var, 32, "Ammo2=%d\n",PlayerInfo[playerid][pAmmo2]);fwrite(hFile, var);
format(var, 32, "Ammo3=%d\n",PlayerInfo[playerid][pAmmo3]);fwrite(hFile, var);
format(var, 32, "Ammo4=%d\n",PlayerInfo[playerid][pAmmo4]);fwrite(hFile, var);
format(var, 32, "CarTime=%d\n",PlayerInfo[playerid][pCarTime]);fwrite(hFile, var);
format(var, 32, "CDPlayer=%d\n",PlayerInfo[playerid][pCDPlayer]);fwrite(hFile, var);
format(var, 32, "Wins=%d\n",PlayerInfo[playerid][pWins]);fwrite(hFile, var);
format(var, 32, "Loses=%d\n",PlayerInfo[playerid][pLoses]);fwrite(hFile, var);
format(var, 32, "ContractTime=%d\n",PlayerInfo[playerid][pContractTime]);fwrite(hFile, var);
format(var, 32, "Tutorial=%d\n",PlayerInfo[playerid][pTut]);fwrite(hFile, var);
format(var, 32, "Warnings=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
format(var, 32, "Adjustable=%d\n",PlayerInfo[playerid][pAdjustable]);fwrite(hFile, var);
if(PlayerInfo[playerid][pDonateRank] < 1) { PlayerInfo[playerid][pFuel] = 0; }
format(var, 32, "Fuel=%d\n",PlayerInfo[playerid][pFuel]);fwrite(hFile, var);
format(var, 32, "Married=%d\n",PlayerInfo[playerid][pMarried]);fwrite(hFile, var);
format(var, 32, "MarriedTo=%s\n",PlayerInfo[playerid][pMarriedTo]);fwrite(hFile, var);
format(var, 32, "SpawnChange=%d\n",SpawnChange[playerid]);fwrite(hFile, var);
format(var, 32, "WantedLevel=%d\n",WantedLevel[playerid]);fwrite(hFile, var);
format(var, 32, "WantedPoints=%d\n",WantedPoints[playerid]);fwrite(hFile, var);
format(var, 32, "PlayMinutes=%d\n",PlayerInfo[playerid][pPlayMinutes]);fwrite(hFile, var);
format(var, 32, "GesamtMinutes=%d\n",PlayerInfo[playerid][pGesamtMinutes]);fwrite(hFile, var);
format(var, 32, "MinutesSinceAn=%d\n",PlayerInfo[playerid][pMinutesSinceAn]);fwrite(hFile, var);
format(var, 32, "Knast=%d\n",Knast[playerid]);fwrite(hFile, var);
format(var, 32, "Uhr=%d\n",PlayerInfo[playerid][pUhrID]);fwrite(hFile, var);
format(var, 32, "Handy=%d\n",PlayerInfo[playerid][pHandyID]);fwrite(hFile, var);
format(var, 32, "Paycheck=%d\n",PlayerInfo[playerid][pPayCheck]);fwrite(hFile, var);
format(var, 32, "KnastTime=%d\n",KnastTime[playerid]);fwrite(hFile, var);
format(var, 32, "Perso=%d\n",PlayerInfo[playerid][pOwnPerso]);fwrite(hFile, var);
format(var, 32, "PayDay=%d\n",PlayerInfo[playerid][pPayDay]);fwrite(hFile, var);
format(var, 64, "PayDayHad=%d\n",PlayerInfo[playerid][pPayDayHad]);fwrite(hFile, var);
format(var, 32, "FrakSperre=%d\n",PlayerInfo[playerid][pFrakSperre]);fwrite(hFile, var);
fclose(hFile);
}
}
}
return 1;
}