AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blocking a one of client side sounds (https://forums.alliedmods.net/showthread.php?t=182947)

.Dare Devil. 04-15-2012 13:52

Blocking a one of client side sounds
 
hello !

Today i try to replace material pain sound,

Example, i shoot the block, the block have Wood texture that will make a strange old sound
" valve/sound/debris/wood[random 1-4].wav "


that is the sound what i want to block.

If i get the bullet entity id and the touch time when bullet touch the wall then i just emit the sound with some new sound with correct channel and it will replace the sound.

So the question is how to do it?
Thanks!

fysiks 04-15-2012 17:07

Re: Blocking a one of client side sounds
 
If it truly is client-side then you can't do anything about the sound playing. You maybe able to block the touch though which would effectively stop the sound.

Arkshine 04-15-2012 17:33

Re: Blocking a one of client side sounds
 
It's played server-side, hook FM_EmitSound. You should learn to look yourself in the HLSDK and you would have your answer..

NiHiLaNTh 04-16-2012 04:19

Re: Blocking a one of client side sounds
 
I wouldn't be so sure about this...
From cl_dlls/ev_hldm.cpp

Code:

// play a strike sound based on the texture that was hit by the attack traceline.  VecSrc/VecEnd are the
// original traceline endpoints used by the attacker, iBulletType is the type of bullet that hit the texture.
// returns volume of strike instrument (crowbar) to play
float EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *vecEnd, int iBulletType )
{
......
        case CHAR_TEX_WOOD: fvol = 0.9; fvolbar = 0.2;
        rgsz[0] = "debris/wood1.wav";
        rgsz[1] = "debris/wood2.wav";
        rgsz[2] = "debris/wood3.wav";
        cnt = 3;
        break;
......
}


Arkshine 04-16-2012 04:28

Re: Blocking a one of client side sounds
 
It would depending if you shoot at one entity or not.

func_breakable entity are handled server-side, something you can see at func_break.cpp.
And yes, if you shoot at the world, it's done client-side. I thought you were talking about the entity.

.Dare Devil. 04-16-2012 11:51

Re: Blocking a one of client side sounds
 
Quote:

Originally Posted by Arkshine (Post 1690245)
It would depending if you shoot at one entity or not.

func_breakable entity are handled server-side, something you can see at func_break.cpp.
And yes, if you shoot at the world, it's done client-side. I thought you were talking about the entity.

Right, nope non entity ofcourse or " world solid block what ever. " : )

Anyway i have idea for making my own new bullet entity on server side.
Then i need to make new weapon entity like Minigun, but that is pretty easy thing.


Is it good to create entity, give him velocity and mayby a model " or sprite "?
it will hurt if 32 players will shoot, it will take much much cpu right? :)

So, mayby we create a x entitys when server start and when player shooting then give entity player view origin and push the enitity or i dont know.. :oops:

Any ideas about that ?

Arkshine 04-16-2012 12:42

Re: Blocking a one of client side sounds
 
If you block a weapon properly as you should when creating a new weapon, such problem won't exist.
Also, there is no bullet in CS, I'm not sure why you want to create them when it's totally useless for such weapon.
To play your new texture sound, you need simply to know the hit origin and finding the texture. As simple as that.


All times are GMT -4. The time now is 06:52.

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