AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   shotting sounds? (https://forums.alliedmods.net/showthread.php?t=26307)

-=*HQz=-=mAster nOob=- 03-30-2006 16:30

shotting sounds?
 
I want to make custom sounds for some of my guns, so for example, when you have the glock, and you click to shoot, then instead of the normal shooting sound, I want a different sound to be played. Can you help me on what the commands would be?

blacam00 03-30-2006 17:10

Only the knife sounds can be modified.

diamond-optic 03-30-2006 19:12

cant you do any sound by registering the emit_sound forward then checking if it contains whichever sound file, then replace it with an emit_sound(yada)

an example would be the custom spray sound plugin floating around here somewhere.. i think its by v3x, sorry if im wrong tho...

v3x 03-31-2006 00:41

Quote:

Originally Posted by blacam00
Only the knife sounds can be modified.

That's correct if you're talking about weapons.

Now if you want to modify misc things such as the zooming sound, spraying sound, etc, you can.

Use this to log emitted sounds ( AMXx 1.7 required ):
Code:
#include <amxmodx> #include <fakemeta> new gCvarOn; public plugin_init() {   register_plugin("Emitted sound logger" , "0.1" , "v3x");   register_forward(FM_EmitSound, "EmitSound");   gCvarOn = register_cvar("log_emitted_sounds" , "0"); } public EmitSound(entity, channel, const sound[]) {   if(pev_valid(entity)) {     if(get_pcvar_num(gCvarOn))     {       new Float:vec[3];       pev(entity , pev_origin , vec); // I think that's how you do it       log_amx("Sound emitted: %s - Origin: %f, %f, %f" , sound , vec[0] , vec[1] , vec[2]);     }   } }
You'll need Fakemeta in order to make this plugin run properly. Also, you'll need to set the cvar "log_emitted_sounds" to 1.

Now go into your server, make a bunch of sounds, then check your AMXx logs.

Good luck.


All times are GMT -4. The time now is 16:42.

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