Raised This Month: $ Target: $400
 0% 

Replacing knife sounds


Post New Thread Reply   
 
Thread Tools Display Modes
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
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 06-25-2011 , 12:29   Re: Replacing knife sounds
Reply With Quote #2

PHP Code:

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"

->

PHP Code:

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

__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
bibu
Veteran Member
Join Date: Sep 2010
Old 06-25-2011 , 12:30   Re: Replacing knife sounds
Reply With Quote #3

Yes, just figured it out, thanks.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Reply



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