SA-MP Forums Archive
[HELP]Vehicle System - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP]Vehicle System (/showthread.php?tid=634310)



[HELP]Vehicle System - Alejandro041 - 16.05.2017

Hello..! i have a problem with my Vehicle system that don't save the file with numbers, the file is like this "%d.ini", This is the code

pawn Код:
forward GuardarVehiculos(vehicleid,filename[36]);
public GuardarVehiculos(vehicleid, filename[36])
{
 new dArchivo[128];
 format(dArchivo,sizeof(dArchivo),pvPATH,filename);
 new INI:archivo = INI_Open(pvPATH); //pvPATH is "/Vehicles/%d.ini"
 INI_WriteInt(archivo,"vID",vInfo[vehicleid][vID]);
 INI_WriteInt(archivo,"vModelo",vInfo[vehicleid][vModelo]);
 INI_WriteFloat(archivo,"vX",vInfo[vehicleid][vX]);
 INI_WriteFloat(archivo,"vY",vInfo[vehicleid][vY]);
 INI_WriteFloat(archivo,"vZ",vInfo[vehicleid][vZ]);
 INI_WriteInt(archivo,"Color1",vInfo[vehicleid][Color1]);
 INI_WriteInt(archivo,"Color2",vInfo[vehicleid][Color2]);
 INI_Close(archivo);
 return 1;
}

forward GuardarTodosLosVehiculos();
public GuardarTodosLosVehiculos()
{
 new saveindex = 1;
 new fname[36];
 for(new i = 0; i < MAX_VEHICLES; i ++)
 {
  format(fname, sizeof(fname), "/Vehicles/%d.ini", saveindex);
  GuardarVehiculos(i, fname);
  saveindex ++;

 }

}
Sorry for my bad english.. :P