Raised This Month: $ Target: $400
 0% 

Search for files in *.gcf files


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Silencer123
Veteran Member
Join Date: Jul 2006
Old 06-01-2009 , 18:08   Search for files in *.gcf files
Reply With Quote #1

file_exists(file[]) searches for files in the mod directory. However, for every mod, all files from half-life.gcf will be used as well, although not actually copied to the modfolder on game load. For cstrike, DoD, OpFor and other Valve-made/-owned GoldScr mods, their very own *.gcf-files will be loaded as well. So, is there any way to check for file in the gcfs, and, if possible, find out what the name of the mod's *.gcf-file is, if at all?
__________________
EAT YOUR VEGGIES
Silencer123 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-01-2009 , 18:25   Re: Search for files in *.gcf files
Reply With Quote #2

If you find it in a gcf on your computer you can just precache it (hardcoded) in your plugin. afaik

HLDS doesn't use gcf files.
__________________
fysiks is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-01-2009 , 18:35   Re: Search for files in *.gcf files
Reply With Quote #3

LoadFileForMe() can load .gcf files.
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-01-2009 , 18:42   Re: Search for files in *.gcf files
Reply With Quote #4

Quote:
Originally Posted by arkshine View Post
LoadFileForMe() can load .gcf files.
Description is not avaible in the wiki.
Code:
/**
 * Loads a file using the LoadFileForMe engine function.
 *
 * The data is truncated if there is not enough space.  No null-terminator 
 * is applied; the data is the raw contents of the file.
 *
 * @param file			File to load (may be a file from the GCF).
 * @param buffer		Buffer to store file contents.
 * @param maxlength		Maximum size of the file buffer.
 * @param length		Variable to store the file length.  This may return 
 *						a number larger than the buffer size.
 * @return				-1 if the file could not be loaded.  Otherwise, 
 *						the number of cells actually written to the buffer 
 *						are returned.
 */
native LoadFileForMe(const file[], buffer[], maxlength, &length=0);
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 06-01-2009 , 18:52   Re: Search for files in *.gcf files
Reply With Quote #5

Thanks for the replies, but wow, I expected some functions specially for use with gcf-files. I don't feel like deciphering an ASCII-string with 400-million arrays just to check if some guy on a listenserver typed in the correct file path. Anyway, thanks for the answers. =)
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode