Raised This Month: $ Target: $400
 0% 

checking what's already precached?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lunarwolfx
Member
Join Date: Feb 2005
Old 01-29-2007 , 20:30   checking what's already precached?
Reply With Quote #1

I was thinking of working on a plugin that involves showing sounds that have been precached, however I can only think of ways to show what the plugin precaches, but not the sounds that the game includes. Just wondering if it's possible to check what's already been precached.
lunarwolfx is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-30-2007 , 00:21   Re: checking what's already precached?
Reply With Quote #2

You could intercept all precache calls, and remember them, like so:

Code:
 #define MAX_SOUNDS 512  new sounds[MAX_SOUNDS][48];  new soundCount;  public plugin_init()  {     register_forward(FM_PrecacheSound,"fw_precachesound");  }  public fw_precachesound(sound[])  {     format(sounds[soundCount++],47,"%s",sound);  }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
lunarwolfx
Member
Join Date: Feb 2005
Old 01-30-2007 , 00:36   Re: checking what's already precached?
Reply With Quote #3

oo thx, I totally need to start learning fakemeta.

+karma
edit: bleh can't give karma to you, but many thanks for the help.
lunarwolfx is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 01-30-2007 , 08:16   Re: checking what's already precached?
Reply With Quote #4

This will put each sound name to the array according to it's index:
Quote:
public plugin_init()
{
register_forward(FM_PrecacheSound,"fw_precachesound", 1);
}

public fw_precachesound(sound[])
{
format(sounds[get_orig_retval()],47,"%s",sound);
}
VEN is offline
Reply


Thread Tools
Display Modes

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 00:40.


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