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

Delete a precached sound with SetStringTable?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
crewparadise
Member
Join Date: Jun 2015
Location: Seoul, South Korea
Old 09-28-2016 , 06:43   Delete a precached sound with SetStringTable?
Reply With Quote #1

Hello, I am trying to remove some VPK packed sound with this and i did with

PHP Code:
public OnMapStart()
{
    
RemoveSoundFromStringTable("some/sound/in/vpk01.wav");
    
RemoveSoundFromStringTable("some/sound/in/vpk02.wav");
    
RemoveSoundFromStringTable("some/sound/in/vpk03.wav");
}

stock RemoveSoundFromStringTable(const String:szFileName[]) {
    static 
hTable INVALID_STRING_TABLE;
    
    if (
hTable == INVALID_STRING_TABLE) {
        
hTable FindStringTable("soundprecache");
    }
    
    new 
iIndex FindStringIndex2(hTableszFileName);
    if (
iIndex != INVALID_STRING_INDEX) {
        new 
bool:bOldState LockStringTables(false);
        
SetStringTableData(hTableiIndex"\0"1);
        
LockStringTables(bOldState);
    }
}

stock FindStringIndex2(iTable, const String:szFileName[], iStart=0) {
    new 
iMax GetStringTableNumStrings(iTable);
    
    
decl String:szBuffer[PLATFORM_MAX_PATH];
    for (new 
iStartiMaxi++) {
        
GetStringTableData(iTableiszBuffersizeof(szBuffer));
        if (
strcmp(szFileNameszBufferfalse) == 0) {
            return 
i;
        }
    }
    
    return 
INVALID_STRING_INDEX;

and sound is still playing, How can fix this ?

P.S. That sound is client-sided sounds and should be deleted for my custom mod, I tried AddNormalSoundHook() and not worked :/

Last edited by crewparadise; 09-28-2016 at 06:45.
crewparadise is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 09-28-2016 , 07:20   Re: Delete a precached sound with SetStringTable?
Reply With Quote #2

Quote:
Originally Posted by psychonic View Post
You cannot remove an entry from the stringtable. Even if you were to force it out on the server, the client would flip out (or at best, ignore the entry it was replaced with) since that functionality is not supported.
I don't think you can do that with sounds.
__________________
Benoist3012 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 20:26.


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