[HELP] Saving data into a file
#5

Try.:
pawn Code:
public
    SacuvajVozila()
{
    new
        idx = 0,
        File:file2 = fopen("VozilaOwnership.cfg", io_write);  // io_write
    if(file2)
    {
        new
            coordsstring[256];
        while(idx < sizeof(Vozilo)) // Loop 64   0. - 63.  
        {
            format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%s,%d,%d\r\n", // \r\n new line
                Vozilo[idx][hModel],
                Vozilo[idx][hPozX],
                Vozilo[idx][hPozY],
                Vozilo[idx][hPozZ],
                Vozilo[idx][hPozA],
                Vozilo[idx][hBoja1],
                Vozilo[idx][hBoja2],
                Vozilo[idx][hVlasnik],
                Vozilo[idx][hOpis],
                Vozilo[idx][hCena],
                Vozilo[idx][hImaVlasnika]);
            fwrite(file2, coordsstring);
            idx++;
        }
        fclose(file2); // Close the opened file
    }
    return 1;
}
Reply


Messages In This Thread
[HELP] Saving data into a file - by Pooh7 - 09.12.2010, 22:10
Re: [HELP] Saving data into a file - by kiss - 10.12.2010, 05:11
Re: [HELP] Saving data into a file - by Pooh7 - 10.12.2010, 06:41
Respuesta: [HELP] Saving data into a file - by kirk - 10.12.2010, 13:24
Re: [HELP] Saving data into a file - by smeti - 10.12.2010, 16:27

Forum Jump:


Users browsing this thread: 1 Guest(s)