Crashdetector.
#7

Sure. I chose SaveHouses as an example since the code there is the most straightforward, but the idea remains the same everywhere, you just have to check if the handle isn't zero after using fopen.

Код:
stock SaveHouses()
{
    new
        szFileStr[1024],
        File: fHandle = fopen("houses.cfg", io_write);

    if(!fHandle) {
        return 0; // the handle is invalid for some reason, don't do anything else
    }
 
    for(new iIndex; iIndex < MAX_HOUSES; iIndex++) {
        format(szFileStr, sizeof(szFileStr), ...);
        fwrite(fHandle, szFileStr);
    }
    return fclose(fHandle);
}
Reply


Messages In This Thread
Crashdetector. - by codeine666 - 15.11.2018, 15:20
Re: Crashdetector. - by kristo - 15.11.2018, 15:24
Re: Crashdetector. - by codeine666 - 15.11.2018, 15:30
Re: Crashdetector. - by codeine666 - 15.11.2018, 15:41
Re: Crashdetector. - by kristo - 15.11.2018, 15:42
Re: Crashdetector. - by codeine666 - 15.11.2018, 15:57
Re: Crashdetector. - by kristo - 15.11.2018, 16:11
Re: Crashdetector. - by codeine666 - 15.11.2018, 16:22
Re: Crashdetector. - by codeine666 - 15.11.2018, 17:17

Forum Jump:


Users browsing this thread: 2 Guest(s)