Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < fakemeta >
- new Trie: g_tSounds;
- public plugin_init( ) {
- register_plugin( "Replacement for knifesounds", "0.1", "master4life" );
- register_forward( FM_EmitSound, "FwdEmitSound" );
- }
- public plugin_end( )
- TrieDestroy( g_tSounds );
- public plugin_precache(){
- g_tSounds = TrieCreate( );
- new const szNewSounds[ ][ ] = {
- "",
- "",
- "",
- "",
- "",
- ""
- };
- new const szOldSounds[ ][ ] = {
- "weapons/knife_hit1.wav",
- "weapons/knife_hit2.wav",
- "weapons/knife_hit3.wav",
- "weapons/knife_hit4.wav",
- "weapons/knife_stab.wav",
- "weapons/knife_hitwall1.wav"
- };
- for( new i; i < sizeof szOldSounds; i++ ) {
- precache_sound( szNewSounds[ i ] );
- TrieSetString( g_tSounds, szOldSounds[ i ], szNewSounds[ i ] );
- }
- }
- public FwdEmitSound( const id, const iChannel, const szSound[ ], Float:fVol, Float:fAttn, const iFlags, const iPitch ) {
- static szNewSound[ 26 ];
- if( TrieGetString( g_tSounds, szSound, szNewSound, charsmax( szNewSound ) ) ) {
- emit_sound( id, iChannel, szNewSound, fVol, fAttn, iFlags, iPitch );
- return FMRES_SUPERCEDE;
- }
- return FMRES_IGNORED;
- }
Add Comment
Please, Sign In to add comment