Code:
#include < amxmodx >
new const g_szSounds[ ][ ] = {
"cyr4x/bezdech.wav",
"cyr4x/cyr4x_001.wav",
"cyr4x/cyr4x_006.wav",
"cyr4x/mk.wav",
"cyr4x/zobacz.wav"
}
public plugin_init()
register_event( "DeathMsg", "EventDeathMsg", "a", "3=1" );
public plugin_precache( )
for( new i = 0; i < sizeof g_szSounds; i++ )
precache_sound( g_szSounds[ i ] );
public EventDeathMsg( ) {
new iKiller = read_data( 1 ), iVictim = read_data( 2 );
// client_cmd( iKiller, "stopsound" ); // not needed
// client_cmd( iVictim, "stopsound" );
new iSound = random_num( 0, sizeof g_szSounds );
client_cmd( iKiller, "spk %s", g_szSounds[ iSound ] );
client_cmd( iVictim, "spk %s", g_szSounds[ iSound ] );
}
work nice
Thanks!
__________________