@aron9forever
Thank you for the information you have provided
But I have a strange problem!
I tried to change the sound of the bomb to a map crossfire (serin.wav sound HL1 mod)
PHP Code:
#include <amxmodx>
#include <fakemeta>
#define SIREN_OLD_SOUND "ambience/siren.wav"
#define SIREN_NEW_SOUND "abc/alarm.wav"
new g_kvd
public plugin_precache ()
{
precache_sound ( SIREN_NEW_SOUND );
g_kvd = register_forward ( FM_KeyValue, "fw_KeyValue");
}
public plugin_init ()
{
if(g_kvd)
{
unregister_forward(FM_KeyValue, g_kvd)
}
}
public fw_KeyValue(ent, handle)
{
if (pev_valid ( ent ))
{
new g_keyNm[16], g_keyVl[ 32 ], g_ClassNm[16];
get_kvd ( handle, KV_ClassName, g_ClassNm, charsmax(g_ClassNm));
get_kvd ( handle, KV_KeyName, g_keyNm, charsmax ( g_keyNm ) );
get_kvd ( handle, KV_Value, g_keyVl, charsmax ( g_keyVl ) );
if (equal(g_ClassNm, "ambient_generic") && equal ( g_keyNm, "message" ) && equal ( g_keyVl, SIREN_OLD_SOUND ))
{
set_kvd(0, KV_ClassName, g_ClassNm)
set_kvd(0, KV_KeyName, g_keyNm)
set_kvd(0, KV_Value, SIREN_NEW_SOUND)
set_kvd(0, KV_fHandled, 0)
dllfunc(DLLFunc_KeyValue, ent, 0)
set_kvd(handle, KV_fHandled, get_kvd (0, KV_fHandled))
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
the old sound & the new sound have the same format :
the output :
1) siren.wav : (old sound of the map)
Quote:
Type: Audio
Codec: PCM U8 (u
Channels: Mono
Sample rate: 11025 Hz
Bits per sample: 8
|
2) alarm.wav : (new sound what i want replace)
Quote:
Type: Audio
Codec: PCM U8 (u
Channels: Mono
Sample rate: 11025 Hz
Bits per sample: 8
|
Every sound has 5 sec time
my problem : (old sound work in duration 45s Before the bomb exploded )
im not sur if 45s or mor . nvm
The old sound works and is replayed again
But the new sound only works (only 5s) and does not replayed again
@fysiks
The first explanation was the translation
The second was from my RIP ENG :stranger:
!
__________________