SA-MP Forums Archive
Cargado de coches - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Cargado de coches (/showthread.php?tid=534723)



Cargado de coches - Alexander11 - 31.08.2014

Buenas, hice un sistema para crear vehнculos IG pero resulta que no carga los coches, los coches se guardan correctamente en la carpeta Autos, estбn numerados, 1 2 3 4 5.
Ahora la cosa es que no los carga, los coches no aparecen:
pawn Код:
stock CargarAutos()
{
    new BArch[22],i;
    print("Cargando autos...\n");
    while(i < MAX_CARS)
    {
        format(BArch,sizeof(BArch),"Autos/%d.ini",i);
        if(fexist(BArch))
        {
            INI_ParseFile(BArch,"CargarAuto_%s",.bExtra = true, .extra = i);
            printf("Coche modelo: %i",InformacionA[i][aModelo]);
            Iter_Add(aAutos, i);
            CreateVehicle(InformacionA[i][aModelo], InformacionA[i][aPosX], InformacionA[i][aPosY], InformacionA[i][aPosZ], InformacionA[i][aRotacion], InformacionA[i][aColor1], InformacionA[i][aColor2], InformacionA[i][aRespawn]);
        }
        i++;
    }
    return 1;
}



Respuesta: Cargado de coches - Zume - 31.08.2014

CargarAuto usa tag?


Respuesta: Cargado de coches - Alexander11 - 31.08.2014

їTe refieres a que si el archivo tiene tag?, sн, es 'data'

EDIT: Solucionado, he habнa faltado crear el
pawn Код:
forward CargarAutos_data(vehicleid,name[],value[]);
public CargarAutos_data(vehicleid,name[],value[])
{
    INI_Int("Modelo",InformacionA[vehicleid][aModelo]);
    INI_Float("PosX",InformacionA[vehicleid][aPosX]);
    INI_Float("PosY",InformacionA[vehicleid][aPosY]);
    INI_Float("PosZ",InformacionA[vehicleid][aPosZ]);
    INI_Float("Rotacion",InformacionA[vehicleid][aRotacion]);
    INI_Int("Color1",InformacionA[vehicleid][aColor1]);
    INI_Int("Color2",InformacionA[vehicleid][aColor2]);
    INI_Int("Tiempo respawn",InformacionA[vehicleid][aRespawn]);
    return 0;
}