AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved How to make client configuration persistent? (https://forums.alliedmods.net/showthread.php?t=338508)

damage220 07-08-2022 14:04

How to make client configuration persistent?
 
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.

bigdaddy424 07-08-2022 20:24

Re: How to make client configuration persistent?
 
This can come in handy
https://forums.alliedmods.net/showthread.php?t=91503

damage220 07-09-2022 07:52

Re: How to make client configuration persistent?
 
Quote:

Originally Posted by bigdaddy424 (Post 2783374)

It makes things easier, thanks for the tip.

damage220 07-09-2022 17:29

Re: How to make client configuration persistent?
 
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.

fysiks 07-09-2022 17:43

Re: How to make client configuration persistent?
 
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.


All times are GMT -4. The time now is 07:22.

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