Hallo
Also ich habe mein Script auf mysql will aber z.B das GangAutohaus auf Dini machen sollte doch eig gehen oder?
Nur wenn ich sag hier speicher was und so speichert er nichts selbst wenn ich für ihn schon die .txt erstelle geht es trotzdem nicht -_-
Also meine frage ist kann man auf sein Script Mysql haben und trotzdem sachen noch über dini laufen lassen?
Und wenn nicht wie könnte ich das GangAutohaus auf Mysql umschreiben.
Hier sind die Load und Save sachen:
(wichtig ich benutze auch noch das include rft_mysql)
public LoadFactionCars(){
if(!fexist(FACTION_CAR_FILE)){
new File:tfFile=fopen(FACTION_CAR_FILE,io_write);
fclose(tfFile);
}
new File:fFile=fopen(FACTION_CAR_FILE,io_read),Content[1024],fc;
while(fread(fFile,Content) && fc<sizeof(FactionCars)){
StripNewLine(Content);
sscanf(Content,"dffffdddddddddddddddddddddd",
FactionCars[fc][fVehid],
FactionCars[fc][fPos][0],
FactionCars[fc][fPos][1],
FactionCars[fc][fPos][2],
FactionCars[fc][fPos][3],
FactionCars[fc][fCol][0],
FactionCars[fc][fCol][1],
FactionCars[fc][fFaction][0],
FactionCars[fc][fFaction][1],
FactionCars[fc][fFaction][2],
FactionCars[fc][fFaction][3],
FactionCars[fc][fFaction][4],
FactionCars[fc][fTuning][0],
FactionCars[fc][fTuning][1],
FactionCars[fc][fTuning][2],
FactionCars[fc][fTuning][3],
FactionCars[fc][fTuning][4],
FactionCars[fc][fTuning][5],
FactionCars[fc][fTuning][6],
FactionCars[fc][fTuning][7],
FactionCars[fc][fTuning][8],
FactionCars[fc][fTuning][9],
FactionCars[fc][fTuning][10],
FactionCars[fc][fTuning][11],
FactionCars[fc][fTuning][12],
FactionCars[fc][fTuning][13],
FactionCars[fc][fPrice]);
if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
FactionCars[fc][fCarid] = CreateVehicle(FactionCars[fc][fVehid],FactionCars[fc][fPos][0],FactionCars[fc][fPos][1],FactionCars[fc][fPos][2],FactionCars[fc][fPos][3],FactionCars[fc][fCol][0],FactionCars[fc][fCol][1],-255);
#if defined FACTION_CARS_LOCKABLE
fLockCar(FactionCars[fc][fCarid]);
FactionCars[fc][fLock] = true;
#endif
#if defined FACTION_CARS_TUNEABLE
if(IsAllowedFactionToTune(FactionCars[fc][fFaction][0])){
if(FactionCars[fc][fTuning][0] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][0]); }
if(FactionCars[fc][fTuning][1] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][1]); }
if(FactionCars[fc][fTuning][2] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][2]); }
if(FactionCars[fc][fTuning][3] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][3]); }
if(FactionCars[fc][fTuning][4] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][4]); }
if(FactionCars[fc][fTuning][5] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][5]); }
if(FactionCars[fc][fTuning][6] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][6]); }
if(FactionCars[fc][fTuning][7] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][7]); }
if(FactionCars[fc][fTuning][8] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][8]); }
if(FactionCars[fc][fTuning][9] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][9]); }
if(FactionCars[fc][fTuning][10] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][10]); }
if(FactionCars[fc][fTuning][11] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][11]); }
if(FactionCars[fc][fTuning][12] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][12]); }
if(FactionCars[fc][fTuning][13] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][13]); }
}
#endif
fc++;
}
}fclose(fFile);
return printf(" '%d' Fraktionsfahrzeuge wurden geladen & erstellt.",fc);
}
if(!fexist(FACTION_CAR_FILE)){
new File:tfFile=fopen(FACTION_CAR_FILE,io_write);
fclose(tfFile);
}
new File:fFile=fopen(FACTION_CAR_FILE,io_read),Content[1024],fc;
while(fread(fFile,Content) && fc<sizeof(FactionCars)){
StripNewLine(Content);
sscanf(Content,"dffffdddddddddddddddddddddd",
FactionCars[fc][fVehid],
FactionCars[fc][fPos][0],
FactionCars[fc][fPos][1],
FactionCars[fc][fPos][2],
FactionCars[fc][fPos][3],
FactionCars[fc][fCol][0],
FactionCars[fc][fCol][1],
FactionCars[fc][fFaction][0],
FactionCars[fc][fFaction][1],
FactionCars[fc][fFaction][2],
FactionCars[fc][fFaction][3],
FactionCars[fc][fFaction][4],
FactionCars[fc][fTuning][0],
FactionCars[fc][fTuning][1],
FactionCars[fc][fTuning][2],
FactionCars[fc][fTuning][3],
FactionCars[fc][fTuning][4],
FactionCars[fc][fTuning][5],
FactionCars[fc][fTuning][6],
FactionCars[fc][fTuning][7],
FactionCars[fc][fTuning][8],
FactionCars[fc][fTuning][9],
FactionCars[fc][fTuning][10],
FactionCars[fc][fTuning][11],
FactionCars[fc][fTuning][12],
FactionCars[fc][fTuning][13],
FactionCars[fc][fPrice]);
if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
FactionCars[fc][fCarid] = CreateVehicle(FactionCars[fc][fVehid],FactionCars[fc][fPos][0],FactionCars[fc][fPos][1],FactionCars[fc][fPos][2],FactionCars[fc][fPos][3],FactionCars[fc][fCol][0],FactionCars[fc][fCol][1],-255);
#if defined FACTION_CARS_LOCKABLE
fLockCar(FactionCars[fc][fCarid]);
FactionCars[fc][fLock] = true;
#endif
#if defined FACTION_CARS_TUNEABLE
if(IsAllowedFactionToTune(FactionCars[fc][fFaction][0])){
if(FactionCars[fc][fTuning][0] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][0]); }
if(FactionCars[fc][fTuning][1] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][1]); }
if(FactionCars[fc][fTuning][2] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][2]); }
if(FactionCars[fc][fTuning][3] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][3]); }
if(FactionCars[fc][fTuning][4] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][4]); }
if(FactionCars[fc][fTuning][5] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][5]); }
if(FactionCars[fc][fTuning][6] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][6]); }
if(FactionCars[fc][fTuning][7] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][7]); }
if(FactionCars[fc][fTuning][8] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][8]); }
if(FactionCars[fc][fTuning][9] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][9]); }
if(FactionCars[fc][fTuning][10] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][10]); }
if(FactionCars[fc][fTuning][11] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][11]); }
if(FactionCars[fc][fTuning][12] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][12]); }
if(FactionCars[fc][fTuning][13] != 0) { AddVehicleComponent(FactionCars[fc][fCarid],FactionCars[fc][fTuning][13]); }
}
#endif
fc++;
}
}fclose(fFile);
return printf(" '%d' Fraktionsfahrzeuge wurden geladen & erstellt.",fc);
}
public SaveFactionCars(bool:destroy){
if(fexist(FACTION_CAR_FILE)) fremove(FACTION_CAR_FILE);
new File:fFile=fopen(FACTION_CAR_FILE,io_append),Content[1024];
for(new fc;fc<sizeof(FactionCars);fc++){
if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
format(Content,sizeof(Content),"%d %.3f %.3f %.3f %.3f %03d %03d %02d %02d %02d %02d %02d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\r\n",
FactionCars[fc][fVehid],
FactionCars[fc][fPos][0],
FactionCars[fc][fPos][1],
FactionCars[fc][fPos][2],
FactionCars[fc][fPos][3],
FactionCars[fc][fCol][0],
FactionCars[fc][fCol][1],
FactionCars[fc][fFaction][0],
FactionCars[fc][fFaction][1],
FactionCars[fc][fFaction][2],
FactionCars[fc][fFaction][3],
FactionCars[fc][fFaction][4],
FactionCars[fc][fTuning][0],
FactionCars[fc][fTuning][1],
FactionCars[fc][fTuning][2],
FactionCars[fc][fTuning][3],
FactionCars[fc][fTuning][4],
FactionCars[fc][fTuning][5],
FactionCars[fc][fTuning][6],
FactionCars[fc][fTuning][7],
FactionCars[fc][fTuning][8],
FactionCars[fc][fTuning][9],
FactionCars[fc][fTuning][10],
FactionCars[fc][fTuning][11],
FactionCars[fc][fTuning][12],
FactionCars[fc][fTuning][13],
FactionCars[fc][fPrice]);
fwrite(fFile,Content);
if(destroy == true){
if(DestroyVehicle(FactionCars[fc][fCarid]))
FactionCars[fc][fCarid] = -255;
}
}
}fclose(fFile);
return true;
}
if(fexist(FACTION_CAR_FILE)) fremove(FACTION_CAR_FILE);
new File:fFile=fopen(FACTION_CAR_FILE,io_append),Content[1024];
for(new fc;fc<sizeof(FactionCars);fc++){
if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
format(Content,sizeof(Content),"%d %.3f %.3f %.3f %.3f %03d %03d %02d %02d %02d %02d %02d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\r\n",
FactionCars[fc][fVehid],
FactionCars[fc][fPos][0],
FactionCars[fc][fPos][1],
FactionCars[fc][fPos][2],
FactionCars[fc][fPos][3],
FactionCars[fc][fCol][0],
FactionCars[fc][fCol][1],
FactionCars[fc][fFaction][0],
FactionCars[fc][fFaction][1],
FactionCars[fc][fFaction][2],
FactionCars[fc][fFaction][3],
FactionCars[fc][fFaction][4],
FactionCars[fc][fTuning][0],
FactionCars[fc][fTuning][1],
FactionCars[fc][fTuning][2],
FactionCars[fc][fTuning][3],
FactionCars[fc][fTuning][4],
FactionCars[fc][fTuning][5],
FactionCars[fc][fTuning][6],
FactionCars[fc][fTuning][7],
FactionCars[fc][fTuning][8],
FactionCars[fc][fTuning][9],
FactionCars[fc][fTuning][10],
FactionCars[fc][fTuning][11],
FactionCars[fc][fTuning][12],
FactionCars[fc][fTuning][13],
FactionCars[fc][fPrice]);
fwrite(fFile,Content);
if(destroy == true){
if(DestroyVehicle(FactionCars[fc][fCarid]))
FactionCars[fc][fCarid] = -255;
}
}
}fclose(fFile);
return true;
}
(das ist das Gangautohaus von dem DreamLife-Script)
Hoffentlich kann mir einer weiterhelfen.
MFG
Rod_Boy