Jump to content

Home

File loading.


GangsterAngel

Recommended Posts

  • 1 month later...

Here is the code Im using in my mod to save the player data files (slightly modified so it is a stand alone function, real one relies on some global vars)

 

qboolean SaveFile(char FileName[MAX_STRING_CHARS], char FileSaveData[MAX_STRING_CHARS]){
            FILE *TheFile;
if(strlen(FileSaveData) <= 0) return qfalse;
if(!FileName || !FileName[0]) return qfalse;
TheFile = fopen(FileName, "w");
if(!TheFile) return qfalse;
fwrite(FileSaveData, sizeof( char ), strlen(FileSaveData) , TheFile);
fclose( TheFile );
return qtrue;
}

 

Im not shure if it will work with any platform besides windows though...

 

try taking a look at the trap_FS stuff.

 

and im fairly shure the game can read any file, regardless of its extention

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...