New vehicules save
#3

I found something to help me but the Id for count the vehicles is the Same = 1

PHP код:
stock SaveVeh()
{
    new 
idx 1File:file;
    new 
stringv[256];
    while(
idx MAX_VEHICULES)
    {
        
format(stringvsizeof(stringv),"%d|%d|%d|%f|%f|%f|%f|%d|%d|%f|%f\r\n",
        
VInfo[idx][vId],
        
VInfo[idx][vModel],
        
VInfo[idx][vMoteur],
        
VInfo[idx][vX],
        
VInfo[idx][vY],
        
VInfo[idx][vZ],
        
VInfo[idx][vA],
        
VInfo[idx][vCol1],
        
VInfo[idx][vCol2],
        
VInfo[idx][vMessence],
        
VInfo[idx][vEssence]);
        if(
idx == 1)
        {
            
file fopen("vehicules.cfg"io_write);
        }
        else
        {
            
file fopen("vehicules.cfg"io_append);
        }
        
fwrite(filestringv);
        
fclose(file);
        
idx++;
    }
    print(
"Vehicules sauvegarder correctement.");
    return 
1;

In my vehicules.cfg
1|568|0|159.164733|1191.708618|14.953808|163.54959 1|-1|-1|100.000000|13.259981
1|568|0|-161.715179|1083.066772|19.548107|312.414306|-1|-1|100.000000|14.919998
1|0|0|0.000000|0.000000|0.000000|0.000000|-1|-1|100.000000|14.919998

EDIT : I check up for this part "|-1|-1|100.000000|14.919998" and i solve them don't woory about it
Reply


Messages In This Thread
New vehicules save - by tysanio - 16.02.2014, 16:51
Re: New vehicules save - by phoon - 16.02.2014, 17:00
Re: New vehicules save - by tysanio - 16.02.2014, 23:43

Forum Jump:


Users browsing this thread: 1 Guest(s)