Guest User

Untitled

a guest
Nov 23rd, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #include < amxmodx >
  2. #include < fakemeta >
  3.  
  4. new Trie: g_tSounds;
  5.  
  6. public plugin_init( ) {
  7. register_plugin( "Replacement for knifesounds", "0.1", "master4life" );
  8. register_forward( FM_EmitSound, "FwdEmitSound" );
  9.  
  10. }
  11.  
  12. public plugin_end( )
  13. TrieDestroy( g_tSounds );
  14.  
  15. public plugin_precache(){
  16. g_tSounds = TrieCreate( );
  17.  
  18. new const szNewSounds[ ][ ] = {
  19. "",
  20. "",
  21. "",
  22. "",
  23. "",
  24. ""
  25. };
  26.  
  27. new const szOldSounds[ ][ ] = {
  28. "weapons/knife_hit1.wav",
  29. "weapons/knife_hit2.wav",
  30. "weapons/knife_hit3.wav",
  31. "weapons/knife_hit4.wav",
  32. "weapons/knife_stab.wav",
  33. "weapons/knife_hitwall1.wav"
  34. };
  35.  
  36. for( new i; i < sizeof szOldSounds; i++ ) {
  37. precache_sound( szNewSounds[ i ] );
  38. TrieSetString( g_tSounds, szOldSounds[ i ], szNewSounds[ i ] );
  39. }
  40. }
  41. public FwdEmitSound( const id, const iChannel, const szSound[ ], Float:fVol, Float:fAttn, const iFlags, const iPitch ) {
  42. static szNewSound[ 26 ];
  43.  
  44. if( TrieGetString( g_tSounds, szSound, szNewSound, charsmax( szNewSound ) ) ) {
  45. emit_sound( id, iChannel, szNewSound, fVol, fAttn, iFlags, iPitch );
  46.  
  47. return FMRES_SUPERCEDE;
  48. }
  49.  
  50. return FMRES_IGNORED;
  51. }
Add Comment
Please, Sign In to add comment