AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to change a sounds of weapons (https://forums.alliedmods.net/showthread.php?t=273162)

totopizza 10-13-2015 22:58

How to change a sounds of weapons
 
Hi, my name Oscar.

I do not know how to change the sounds of weapons, when:
Shoot, Reload, and when the player CHOOSE, and sought some tutorials on this forum, but I find none, I'd like some guide me how to do this plugin, I have knowledge in pawn, but still not as changing the sound of a weapon.

* Note: I am from Honduras, I'm using google translator, sorry if I do not understand well.

Thanks for your time. :)

Msalinas2877 10-13-2015 23:03

Re: How to change a sounds of weapons
 
[ESP]Hablas español?

You Speak Spanish?

totopizza 10-13-2015 23:07

Re: How to change a sounds of weapons
 
Español:
Sí, mi idioma es el español.

English:

Yes, my language is the spanish

Msalinas2877 10-13-2015 23:13

Re: How to change a sounds of weapons
 
[ESP]Bueno yo hablo tambien español asi que no tengo problemas, he encontrado esto en otro post, talvez te sirva

Well i speak spanish too so i dont have problems, i found this in another post, maybe it help you

Code:


#include <amxmodx>
#include <fakemeta>

#define MAX_KNIFE_SNDS 9

public plugin_init()
{
register_plugin("Custom knife sounds" , "0.1" , "v3x");
register_forward(FM_EmitSound , "EmitSound");
}

// Original knife sounds
new knife_sounds_o[MAX_KNIFE_SNDS][] =
{
"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"
}

// Replacement knife sounds ( edit these!! )
new knife_sounds_r[MAX_KNIFE_SNDS][] =
{
"GHW/weapons/knife_deploy1.wav",
"GHW/weapons/knife_hit1.wav",
"GHW/weapons/knife_hit2.wav",
"GHW/weapons/knife_hit3.wav",
"GHW/weapons/knife_hit4.wav",
"GHW/weapons/knife_hitwall1.wav",
"GHW/weapons/knife_slash1.wav",
"GHW/weapons/knife_slash2.wav",
"GHW/weapons/knife_stab.wav"
}

public plugin_precache()
{
for(new i = 0; i < MAX_KNIFE_SNDS; i++)
precache_sound(knife_sounds_r[i]);
}

public EmitSound(entity, channel, const sound[])
{
if(pev_valid(entity) && is_user_alive(entity))
{
for(new i = 0; i < MAX_KNIFE_SNDS; i++)
{
if(equal(sound , knife_sounds_o[i]))
{
emit_sound(entity, channel, knife_sounds_r[i], 1.0, ATTN_NORM, 0, PITCH_NORM);
return FMRES_SUPERCEDE;
}
}
}
return FMRES_IGNORED;
}


totopizza 10-13-2015 23:20

Re: How to change a sounds of weapons
 
Muchas gracias,

Si me podrías explicar la función, de como funciona, ya que nunca e usado el "sdktools"


Thank you,

If I could explain the function, how it works, and since I never used the "sdktools"

Msalinas2877 10-13-2015 23:28

Re: How to change a sounds of weapons
 
Lol i post a source mod code i am gonna edit it


All times are GMT -4. The time now is 22:15.

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