fwrite & fdelete bug
#1

Hey guys, I am improving my updates system, so here's my bug:
I can add GMX Required/Implemented/Update/BugFix as a new update using /addupdate, now I wanted to do that once the game mode starts, every GMX Required turns to Implemented automatically
I am parsing the updates to their types using a "type:%d" parameter
type:1 = implemented
type:2 = bugfix and so on

The problem is that, the update gets removed, but it's not re-written as Implemented

Here is the code:
PHP код:
if(!fexist("updates.cfg"))
    {
        new 
File:handle fopen("updates.cfg"io_readwrite);
        
fclose(handle);
    }
    else
    {
        new 
File:file fopen("updates.cfg"io_readwrite), idx 1string[128];
        while(
fread(filestring))
           {
            if(
strfind(string"type:2") != -1)
            {
                
fdeleteline("updates.cfg"idx);
                
strdel(stringstrlen(string) - 8strlen(string));
                
strins(string"type:0"strlen(string), sizeof(string));
                
fwrite(filestring);
            }
            
idx++;
           }
           
fclose(file);
    } 
Thanks in advance.
Reply


Messages In This Thread
fwrite & fdelete bug - by NeXoR - 03.11.2016, 21:17
Re: fwrite & fdelete bug - by NeXoR - 04.11.2016, 06:20
Re: fwrite & fdelete bug - by NeXoR - 04.11.2016, 10:53
Re: fwrite & fdelete bug - by NeXoR - 05.11.2016, 10:14
Re: fwrite & fdelete bug - by Nero_3D - 05.11.2016, 15:53
Re: fwrite & fdelete bug - by NeXoR - 05.11.2016, 20:14
Re: fwrite & fdelete bug - by Yaa - 05.11.2016, 21:23
Re: fwrite & fdelete bug - by ZiGGi - 05.11.2016, 22:14
Re: fwrite & fdelete bug - by SickAttack - 05.11.2016, 22:37

Forum Jump:


Users browsing this thread: 1 Guest(s)