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(hTable, szFileName);
if (iIndex != INVALID_STRING_INDEX) {
new bool:bOldState = LockStringTables(false);
SetStringTableData(hTable, iIndex, "\0", 1);
LockStringTables(bOldState);
}
}
stock FindStringIndex2(iTable, const String:szFileName[], iStart=0) {
new iMax = GetStringTableNumStrings(iTable);
decl String:szBuffer[PLATFORM_MAX_PATH];
for (new i = iStart; i < iMax; i++) {
GetStringTableData(iTable, i, szBuffer, sizeof(szBuffer));
if (strcmp(szFileName, szBuffer, false) == 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 :/