Raised This Month: $ Target: $400
 0% 

Replacing knife sounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 06-25-2011 , 09:22   Replacing knife sounds
Reply With Quote #1

This plugin here, doesn't change some sounds, or use them randomly from the custom sounds. I don't know if it has todo cause the names are not equal. I wanted that *_hit, should replace all the hits sounds and *slash_stab the slash1, slash2, stab sounds:

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "."

new const knife_sounds_original[][] =
{
    
"weapons/knife_deploy1.wav",
    
"weapons/knife_hit1.wav",
    
"weapons/knife_hit2.wav",
    
"weapons/knife_hit3.wav",
    
"weapons/knife_hit4.wav",
    
"weapons/knife_hitwall1.wav",
    
"weapons/knife_slash1.wav",
    
"weapons/knife_slash2.wav",
    
"weapons/knife_stab.wav"
}

new const 
knife_sounds_custom[][] =
{
    
"weapons/tazer/tazer_deploy1.wav",
    
"weapons/tazer/tazer_hit.wav",
    
"weapons/tazer/tazer_hitwall1.wav",
    
"weapons/tazer/tazer_slash_stab.wav"
}


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_EmitSound"EmitSound")
}

public 
plugin_precache()
{
    for(new 
0sizeof knife_sounds_customi++)
    {
        
precache_sound(knife_sounds_custom[i])
    }
}

public 
EmitSound(entitychannel, const sound[])
{
    if(
pev_valid(entity) && is_user_alive(entity) && get_user_team(entity) == 2)
    {
        for(new 
0sizeof knife_sounds_customi++)
        {
            if(
equal(soundknife_sounds_original[i]))
            {
                
emit_sound(entitychannelknife_sounds_custom[i], 1.0ATTN_NORM0PITCH_NORM)
                return 
FMRES_SUPERCEDE
            
}
        }
    }
    return 
FMRES_IGNORED

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode