AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   USP Weapon, replace shots-sound. (https://forums.alliedmods.net/showthread.php?t=86472)

Wentix 02-26-2009 09:52

USP Weapon, replace shots-sound.
 
Hello,
How can I replace USP-shots to shots like a silence-mode.
I tried cs_set_weapon_silen(), but this not what I need.

Anyone can help?)
sorry for bad english :)

Empowers 02-26-2009 10:07

Re: USP Weapon, replace shots-sound.
 
http://forums.alliedmods.net/showthread.php?t=45461

Wentix 02-27-2009 02:39

Re: USP Weapon, replace shots-sound.
 
Thanks.

I try this:
Code:

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

new g_soundlist[64] = "items/flashlight1.wav";

public plugin_init()
{
        register_forward(FM_EmitSound, "block_sound");
}

public block_sound(entity, channel, const sound[])
{
        if(equali(sound, g_soundlist)){
                        return FMRES_SUPERCEDE;
        }
        return FMRES_IGNORED;
}

It works.

But when I replace flashlight.wav to weapons/usp_unsil-1.wav, its not working...
Maybe cs use another sound-file?

Wentix 02-27-2009 23:22

Re: USP Weapon, replace shots-sound.
 
so..
anyone can help? :(

iNspiratioN 02-28-2009 05:39

Re: USP Weapon, replace shots-sound.
 
2 Attachment(s)
use "weapons/usp1.wav" for silence shot.
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

new g_soundlist[2][64] =
{
    
"weapons/usp1.wav",
    
"weapons/usp2.wav"
}

public 
plugin_init() {
    
register_forward(FM_EmitSound"block_sound")
}

public 
block_sound(entitychannel, const sound[]) {

    new 
g_listsize sizeof g_soundlist
    
for(new ii<g_listsizei++)
    {
        if( 
equali(soundg_soundlist[i]) )
            return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED


I guess like this...

Wentix 02-28-2009 07:01

Re: USP Weapon, replace shots-sound.
 
iNspiratioN, your code is not working (


All times are GMT -4. The time now is 17:08.

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