Raised This Month: $32 Target: $400
 8% 

Solved SVC_STOPSOUND message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
damage220
Member
Join Date: Jul 2022
Location: Ukraine
Old 11-21-2022 , 22:21   SVC_STOPSOUND message
Reply With Quote #1

How should I use this message? I cannot get it to work.
PHP Code:
message_begin(MSG_ONESVC_STOPSOUND, {000}, pid);
write_short(pid);
message_end(); 
According to the doc:
Quote:
SVC_STOPSOUND
Stops an ambient sound.

Name: SVC_STOPSOUND
Structure: short EntityIndex
Am I correct to think that this is server side alternative to "stopsound" console command?

Last edited by damage220; 11-29-2022 at 11:22.
damage220 is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-22-2022 , 01:34   Re: SVC_STOPSOUND message
Reply With Quote #2

Quote:
Originally Posted by damage220 View Post
How should I use this message? I cannot get it to work.
PHP Code:
message_begin(MSG_ONESVC_STOPSOUND, {000}, pid);
write_short(pid);
message_end(); 
According to the doc:

Am I correct to think that this is server side alternative to "stopsound" console command?
client_cmd( id, "stopsound" );

should work to stop the ambient sound, i tested
MrPickles is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 11-22-2022 , 02:15   Re: SVC_STOPSOUND message
Reply With Quote #3

Quote:
Originally Posted by MrPickles View Post
client_cmd( id, "stopsound" );

should work to stop the ambient sound, i tested
Stop sound will stop all sound currently playing on the client
So depend what you need, it could be bad if you just want to silent 1 entity
__________________
My plugin:
Celena Luna is offline
damage220
Member
Join Date: Jul 2022
Location: Ukraine
Old 11-22-2022 , 14:12   Re: SVC_STOPSOUND message
Reply With Quote #4

Quote:
Originally Posted by MrPickles View Post
client_cmd( id, "stopsound" );

should work to stop the ambient sound, i tested
And indeed it works. It is how I currently stop ambient sound. I just assumed that this command triggers procedure:
1. Server sends "stopsound" to client
2. Client executes the command telling the server to stop the sound
3. Server stops the sound for the client

And so I decided to optimize the process. Does it make sense or the command need no server to stop the sound? I mean is it fully client side command with no further server communication?
damage220 is offline
damage220
Member
Join Date: Jul 2022
Location: Ukraine
Old 11-22-2022 , 14:16   Re: SVC_STOPSOUND message
Reply With Quote #5

Quote:
Originally Posted by Celena Luna View Post
Stop sound will stop all sound currently playing on the client
So depend what you need, it could be bad if you just want to silent 1 entity
I do not completely understand the message. Ii it supposed to stop the sound that a player hears, or it should stop the sound that the entity produce?

Last edited by damage220; 11-22-2022 at 14:16.
damage220 is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-22-2022 , 14:16   Re: SVC_STOPSOUND message
Reply With Quote #6

Quote:
Originally Posted by Celena Luna View Post
Stop sound will stop all sound currently playing on the client
So depend what you need, it could be bad if you just want to silent 1 entity
You only stop it when the client enters the server, it will only stop the ambient sound, because the client at that moment will not be playing any other sound

Quote:
Originally Posted by damage220 View Post
And indeed it works. It is how I currently stop ambient sound. I just assumed that this command triggers procedure:
1. Server sends "stopsound" to client
2. Client executes the command telling the server to stop the sound
3. Server stops the sound for the client

And so I decided to optimize the process. Does it make sense or the command need no server to stop the sound? I mean is it fully client side command with no further server communication?

and for this, the ambient sound is independent of each user/client

Last edited by MrPickles; 11-22-2022 at 14:16.
MrPickles is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 11-23-2022 , 10:13   Re: SVC_STOPSOUND message
Reply With Quote #7

Quote:
Originally Posted by damage220 View Post
I do not completely understand the message. Ii it supposed to stop the sound that a player hears, or it should stop the sound that the entity produce?
It immediately stops every sound player hear
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951
kww is offline
damage220
Member
Join Date: Jul 2022
Location: Ukraine
Old 11-25-2022 , 06:20   Re: SVC_STOPSOUND message
Reply With Quote #8

Quote:
Originally Posted by kww View Post
It immediately stops every sound player hear
Then why does it do nothing when I send it? I can still hear ambient sound on de_train or de_aztec, unlike when I issue stopsound command. You can see the code at the beginning of this thread (pid is player id).
damage220 is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-25-2022 , 16:47   Re: SVC_STOPSOUND message
Reply With Quote #9

Quote:
Originally Posted by damage220 View Post
Then why does it do nothing when I send it? I can still hear ambient sound on de_train or de_aztec, unlike when I issue stopsound command. You can see the code at the beginning of this thread (pid is player id).
You are getting too complicated for something very simple, just use stopound, the efficiency is minimal and almost irrelevant, just place it once when you enter the server and that's it
MrPickles is offline
damage220
Member
Join Date: Jul 2022
Location: Ukraine
Old 11-26-2022 , 01:16   Re: SVC_STOPSOUND message
Reply With Quote #10

Quote:
Originally Posted by MrPickles View Post
You are getting too complicated for something very simple, just use stopound, the efficiency is minimal and almost irrelevant, just place it once when you enter the server and that's it
As far as I know you cannot use this command on client connect. It works only after spawn and have to be issued every round. Okay, I understand your point. It is not that important. I usually try to improve things if I can.
damage220 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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