[HELP] Emit Sound on Coordinates
So far emit_sound needs an entity to produce the sound from. I'm wondering if you can emit a sound in 3D space using just coordinates. Is there a separate function for this? Or module of sorts I don't know of?...
|
Re: [HELP] Emit Sound on Coordinates
Not sure if it can be done with any module, but it's most likely impossible via raw AMXX. If I may ask, then why don't you normally emit sound throughout an entity?
Edit: This might help. https://wiki.alliedmods.net/Half-Lif...AWNSTATICSOUND |
Re: [HELP] Emit Sound on Coordinates
I think what you want is something like this: https://forums.alliedmods.net/showthread.php?t=238457
(btw this is a module) Quote:
For example: PHP Code:
|
Re: [HELP] Emit Sound on Coordinates
or a simple stock : ( not sure if it's most efficient way )
Code:
|
Re: [HELP] Emit Sound on Coordinates
Quote:
Quote:
EDIT: Quote:
|
Re: [HELP] Emit Sound on Coordinates
Quote:
Quote:
|
Re: [HELP] Emit Sound on Coordinates
Quote:
The Bullet Whizz plugin sounds very similar. https://forums.alliedmods.net/showthread.php?p=255370 |
Re: [HELP] Emit Sound on Coordinates
Quote:
|
Re: [HELP] Emit Sound on Coordinates
Hello again, guys! After much fiddling, I've decided to go with Arkshines codes since it seems most convenient. So what's left is establishing the coordinates where the sounds will be emitted, which I've done as well with a test plugin. The problem is I'm not sure if my method is the most efficient way of doing this.
What I intend to do is when a player fires a gun, 4 points forming a cross relative to his coordinates will be the origin of the emitted sound. Height is fixed by the way, just +100.0 of the players coord. All I did was duplicate the code four times with 4 different combinations of coordinates: PHP Code:
|
Re: [HELP] Emit Sound on Coordinates
3 Attachment(s)
Quote:
So you want a sound to match muzzle blast? In other words the opposite of Bullet Whizz which is on the receiving end. Quote:
These 2 figures show what 50 looks like from the abstract from either using pev_origin or get_user_origin. Former is standing over the head while other is piggy back ride at 50. Attachment 177620 Code:
By the way 5 sounds being fired off per round may cause performance issues. Emit already emits. Quit while you are ahead. The code you are using accomplishes the same as emit_sound but it is a while lot more complex and easier to crash sending messages instead of simply using emit_sound. You are over-complicating not using emit_sound just to reinvent the wheel with this. The sound still passes through the player just a few coordinates away. So then, it is here, instead of there. The oth dimension {0,0,0} is what you see 99.9% of the code around the world over. Just a dot. Moving outside the box is not that complicated. You have your chickens to help you do that now. Use MSG_PAS as it will use least resources. MSG_ONE sends it to people on other side of map who can't hear it anyway as well as increase crash likelihood down the line. |
| All times are GMT -4. The time now is 02:49. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.