PDA

View Full Version : Question for the C++ gurus


Xylo
09-02-01, 02:28pm
I just recently went from Visual Basic to Visual C++... trust me, it's been rocky at times, but AdminMod is becoming somewhat of hobby and as such, I made the leap.

Just a few quick questions:

(1) using the "writefile" function in AdminMod, will it generate a file if none exists already?

(2) if so, is there also a function to delete such files already built into AdminMod? (if so, what is it called)

(3) and lastly, is there some kind of a glitch between AdminMod's ability to set timers and Win2000 Server (I seem to be having a bit of a prob getting a reliable timer).

Thanks in advance.

Da Rope
09-02-01, 10:06pm
1) Yes, it does. Look at the line <pre> if( (outfile=fopen(game_dir,"a"))==NULL) {</pre>It opens the file with access qualifier "a" which means that the file will be created, if it doesn't exist.

2) No, files are not deleted by adminmod. At least not in version 2.10. There's only a function resetfile() which sets the file to zero bytes.

3) Looks like so, but that is a Win32 question and not a C++ specififc question, so I am not the man to answer it. =) Alfred changed the timer system in 2.11 to use HL timers instead of creating his own timers. (Which is good, although I really liked his marvelous timer struct code)

alfred
10-02-01, 03:36pm
2.11 will fix the timer issue (or change it ;) ), and 2.11 also has a whole need set of file handling routines which should solve any file i/o problems scripters are having.