Raised This Month: $ Target: $400
 0% 

Precaching everything that's in a file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 11-27-2010 , 17:36   Re: Precaching everything that's in a file
Reply With Quote #6

Not tested.
Code:
new const File[] = "precache.ini";   public plugin_precache() {         new file = fopen(File, "r");           if (!file)                 return;           new resource[64], extension[5];           while (fgets(file, resource, 63))         {                 trim(resource);                 copy(extension, 4, resource[strlen(resource) - 4]);                   if (equal(extension, ".wav"))                         precache_sound(resource);                 else if (equal(extension, ".mdl") || equal(extension, ".spr"))                         precache_model(resource);                 else                         precache_generic(resource);         }           fclose(file); }
__________________
hleV is offline
 



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 11:23.


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