Raised This Month: $51 Target: $400
 12% 

UNprecache Sounds, like weapons old sounds.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-30-2011 , 04:56   UNprecache Sounds, like weapons old sounds.
Reply With Quote #1

Hi

I have an idea of ​​once again become, Now i want to make all weapons with different sound.

The problem is that i have only 96 precache slot left

( Every map where are func_breakable , wood, glass what ever , they take my precache slot too. )

Now what i want do is unprecache old weapons sounds and add new sounds ( not all weapons, 8-12 )

I have no idea how do unprecache sound and i need your help


Here is little code what i found here and just change something

PHP Code:
 
if(equali(szSound,"sound/weapons/ak47_boltpull.wav"))
{
    
forward_return(FMV_STRING,"sound/Evil-Night2/misc/none.wav");
    return 
FMRES_SUPERCEDE

Is that working fine ?
.Dare Devil. is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 05-30-2011 , 04:58   Re: UNprecache Sounds, like weapons old sounds.
Reply With Quote #2

from what i have read in the past weapons sounds are client side. in order to change the sound you have to recreate the weapon into an amx plugin.
Doc-Holiday is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-30-2011 , 05:25   Re: UNprecache Sounds, like weapons old sounds.
Reply With Quote #3

Quote:
Originally Posted by Doc-Holiday View Post
from what i have read in the past weapons sounds are client side. in order to change the sound you have to recreate the weapon into an amx plugin.
So that means

It is very very hard to unprecache sounds

But models are client side too and that code what i show the main post, that fail ?
.Dare Devil. is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 05-30-2011 , 13:13   Re: UNprecache Sounds, like weapons old sounds.
Reply With Quote #4

you can set weapon models just not sounds...
Doc-Holiday is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-30-2011 , 14:33   Re: UNprecache Sounds, like weapons old sounds.
Reply With Quote #5

Quote:
Originally Posted by Doc-Holiday View Post
you can set weapon models just not sounds...
No,no no , that is not good

I want to unprecache so i get free precache slot
I have only 95sound precache left.
.Dare Devil. is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 05-31-2011 , 01:31   Re: UNprecache Sounds, like weapons old sounds.
Reply With Quote #6

damn 512 precache limit.
__________________
jc980 is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 06-01-2011 , 12:17   Re: UNprecache Sounds, like weapons old sounds.
Reply With Quote #7

Code for block precaching. I guess you have to add much code if you want to replace the sounds. Maybe you will find a solution with KeyValueData. Just a tip, I have no knowledges with this function.

PHP Code:
new Trie:g_TrieSounds

public plugin_precache(){

    
// Prevent precaching of unused sounds
    // Attention we must consider all other plugins
    
g_TrieSounds TrieCreate()
    
TrieSetCell(g_TrieSounds"anything.wav"0)
    
// ...
    
register_forward(FM_PrecacheSound"fwd_precachesound")

    
// Now you must prechae your sounds manually
    // Also you have to emit the sounds all the time
    // I'm not sure if it is possible
}

public 
plugin_end(){
    
TrieDestroy(g_TrieSounds)
}

public 
fwd_precachesound(szSound[]){
    
// At first create some logs for more information
    // log_amx("Sound: %s", szSound)
    
if (TrieKeyExists(g_TrieSoundsszSound)){
        
forward_return(FMV_CELL0)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015

Last edited by Leon M.; 06-01-2011 at 12:20.
Leon M. is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-01-2011 , 13:37   Re: UNprecache Sounds, like weapons old sounds.
Reply With Quote #8

Quote:
Originally Posted by Leon M. View Post
Code for block precaching. I guess you have to add much code if you want to replace the sounds. Maybe you will find a solution with KeyValueData. Just a tip, I have no knowledges with this function.

PHP Code:
new Trie:g_TrieSounds
 
public plugin_precache(){
 
    
// Prevent precaching of unused sounds
    // Attention we must consider all other plugins
    
g_TrieSounds TrieCreate()
    
TrieSetCell(g_TrieSounds"anything.wav"0)
    
// ...
    
register_forward(FM_PrecacheSound"fwd_precachesound")
 
    
// Now you must prechae your sounds manually
    // Also you have to emit the sounds all the time
    // I'm not sure if it is possible
}
 
public 
plugin_end(){
    
TrieDestroy(g_TrieSounds)
}
 
public 
fwd_precachesound(szSound[]){
    
// At first create some logs for more information
    // log_amx("Sound: %s", szSound)
    
if (TrieKeyExists(g_TrieSoundsszSound)){
        
forward_return(FMV_CELL0)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

Thansk, is that really working ?
.Dare Devil. is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-01-2011 , 14:47   Re: UNprecache Sounds, like weapons old sounds.
Reply With Quote #9

"forward_return(FMV_CELL, 0)" is useless, but it should work yes.

Though, it won't work for weapon fire sounds. Only sounds precached by the server.
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-01-2011 , 16:10   Re: UNprecache Sounds, like weapons old sounds.
Reply With Quote #10

If you block a precache, you should block later when the sound is gonna be used.

Following plugin can already do the job for you : http://forums.alliedmods.net/showthread.php?p=514507
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 02:39.


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