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

Solved How to make client configuration persistent?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
damage220
Member
Join Date: Jul 2022
Location: Ukraine
Old 07-08-2022 , 14:04   How to make client configuration persistent?
Reply With Quote #1

Hi. I am trying to save client options, such as hits indicator style, whether fade screen or play sound on kill or not, etc. I thought that cvars was something I need but then I realized it has nothing with client or player variables. I can imagine saving properties to file along with steam id or ip, but is there easier way to do it? Like an options that player sets in its userconfig.cfg and then I request those options from plugins? I know it is possible, that is how fastcup dm (185.101.138.37:27015) /menu works. It restores my preferable settings even when I restart the client.

Last edited by damage220; 07-09-2022 at 07:53.
damage220 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 07-08-2022 , 20:24   Re: How to make client configuration persistent?
Reply With Quote #2

This can come in handy
https://forums.alliedmods.net/showthread.php?t=91503
__________________
bigdaddy424 is offline
damage220
Member
Join Date: Jul 2022
Location: Ukraine
Old 07-09-2022 , 07:52   Re: How to make client configuration persistent?
Reply With Quote #3

Quote:
Originally Posted by bigdaddy424 View Post
It makes things easier, thanks for the tip.
damage220 is offline
damage220
Member
Join Date: Jul 2022
Location: Ukraine
Old 07-09-2022 , 17:29   Re: How to make client configuration persistent?
Reply With Quote #4

I have found exactly what I was interested in.

Code:
public client_infochanged(id)
{
	new option[32];

	get_user_info(id, "plugin_param ", option, sizeof(option));
	client_print(id, print_chat, "plugin_param new value: %s", option);
}
Then type setinfo plugin_param 1 in the console. The value is restored after client restart which is awesome. And there is even an event listener to catch all changes.

Last edited by damage220; 07-09-2022 at 17:31.
damage220 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-09-2022 , 17:43   Re: How to make client configuration persistent?
Reply With Quote #5

I've used the user info approach before but I think it has a limited size so that's something you'll need to consider. I'm sure you could test this but you'll still need to consider that some people may have already used this for other things also.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 06:14.


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