Saving Vehicles Help.
#1

Never Mind Removed
Reply
#2

Add this

Код:
if(!vfile) return printf("File did not open");
Over the loop, below the opening of the file, for debugging and try to save the vehicles again.

Do you get the message in the console?
Reply
#3

Never Mind Removed
Reply
#4

Код:
SaveVehicles() 
{ 
    new filestring[125]; 
    new File: vfile = fopen("vehicles.txt", io_write); 
    if(!vfile) return printf("File did not open");
    for(new vehicleid = 1;vehicleid<MAX_VEH;vehicleid++) 
    { 
        if(cInfo[vehicleid][Car1Model] != 0) 
        { 
            format(filestring, sizeof(filestring), "%i,%f\n",cInfo[vehicleid][Car1Model],cInfo[vehicleid][CarX1]); 
            fwrite(vfile, filestring); 
        } 
    } 
    fclose(vfile); 
    return 1; 
}
Paste that and try again, then check the server's console. Is the message 'File did not open' showing there?
Reply
#5

Never Mind Removed
Reply
#6

What's your native language?
Reply
#7

Never Mind Removed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)