Raised This Month: $51 Target: $400
 12% 

How to detect MP3Volume change from console and settings ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TBagT
Member
Join Date: Aug 2016
Location: Lithuania
Old 04-25-2018 , 09:25   How to detect MP3Volume change from console and settings ?
Reply With Quote #1

Hello guys,

I was wondering how could I get notified when user changes his MP3Volume setting ? I created a music plugin which allows player to increase volume in a menu. I use query_client_cvar( ) on client_putinserver( ) but if player changes the sound not in the created menu but in console or settings the volume variable doesn't refresh. client_infochange didn't work so I thought maybe there's another way of hooking this ?

Thanks.

Last edited by TBagT; 04-25-2018 at 09:30.
TBagT is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-25-2018 , 09:47   Re: How to detect MP3Volume change from console and settings ?
Reply With Quote #2

I believe there isn't a way to do that.
__________________
klippy is offline
TBagT
Member
Join Date: Aug 2016
Location: Lithuania
Old 04-25-2018 , 10:01   Re: How to detect MP3Volume change from console and settings ?
Reply With Quote #3

Setting task every 5s to query_client_cvar( ) would not be the smartest idea ?
TBagT is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-25-2018 , 15:28   Re: How to detect MP3Volume change from console and settings ?
Reply With Quote #4

I mean you can do that, but I don't really see a reason would you. Just let them change it through console or options menu.
__________________
klippy is offline
TBagT
Member
Join Date: Aug 2016
Location: Lithuania
Old 04-25-2018 , 23:19   Re: How to detect MP3Volume change from console and settings ?
Reply With Quote #5

Well the plugin displays players current volume if it was changed not from the menu but from console or options it doesn't refresh.
TBagT is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-26-2018 , 21:29   Re: How to detect MP3Volume change from console and settings ?
Reply With Quote #6

Quote:
Originally Posted by TBagT View Post
Well the plugin displays players current volume if it was changed not from the menu but from console or options it doesn't refresh.
He was saying that such a thing is pointless.

Simply query the cvar when you need it.
__________________
fysiks 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 11:57.


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