AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   checking what's already precached? (https://forums.alliedmods.net/showthread.php?t=50593)

lunarwolfx 01-29-2007 20:30

checking what's already precached?
 
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.

XxAvalanchexX 01-30-2007 00:21

Re: checking what's already precached?
 
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);  }

lunarwolfx 01-30-2007 00:36

Re: checking what's already precached?
 
oo thx, I totally need to start learning fakemeta.

+karma
edit: bleh can't give karma to you, but many thanks for the help.

VEN 01-30-2007 08:16

Re: checking what's already precached?
 
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);
}


All times are GMT -4. The time now is 00:40.

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