by Spike » Tue Jul 09, 2013 7:32 pm
frik_file supports only strings. note that you can read/write floats/vectors via using stof/ftos / stov/vtos.
fopen returns -1 on failure, not 0.
empty lines return "" while EOF returns string_null. if (strvalue) will evaluate to true for "" and false for the null string.
don't forget to close your file. just because its good to clean up after yourself.
there's no seek support or binary files, so generally you'll want to read everything in and work in memory instead of constantly refering to the file.
\n denotes the end of a line. strings that contain that character (like centerprint messages) can thus be awkward to save.
you can use frik_file for inventory systems between maps, but you'll have to be sure to avoid issues with saved games etc. players joining midgame will require extra care.
in a deathmatch game on a public server, you probably don't want to create a new file for every player, or someone will waste all your diskspace citing 'for the luls'. there's no real way to delete files again.
.