Author |
Topic: Read client cvar |
dobledosis |
General Member Since: Apr 1, 2007 Posts: 22 Last: Apr 25, 2016 [view latest posts] |
|
|
|
modsfabio |
General Member Since: Aug 10, 2014 Posts: 23 Last: May 18, 2017 [view latest posts] |
|
|
|
dobledosis |
General Member Since: Apr 1, 2007 Posts: 22 Last: Apr 25, 2016 [view latest posts] |
|
|
Category: CoD+UO General Posted: Tuesday, Oct. 14, 2014 07:38 am |
|
modsfabio writes...Quote: Reading client cvars is not possible.
May i ask what do you want to do?
My mod allow players to setup wide screen resolution from menu, but the players sees all closer, so its not really usefull.
User can't change fov, because it's a cheat protected cvar but i discovered that i can change the user fov cvar from the server when player connects
I want to detect who has r_mode -1 and change that player fov.
Thanks |
|
|
|
morgawr |
General Member Since: Dec 15, 2004 Posts: 377 Last: Mar 19, 2023 [view latest posts] |
|
|
|
dobledosis |
General Member Since: Apr 1, 2007 Posts: 22 Last: Apr 25, 2016 [view latest posts] |
|
|
Category: CoD+UO General Posted: Thursday, Oct. 16, 2014 02:47 am |
|
morgawr writes...Quote: I recall capturing players configs using pb.
Hi morgawr, i thought about that but i don't know how to do it from the mod.
Can you explain me please?
Thanks! |
|
|
|
modsfabio |
General Member Since: Aug 10, 2014 Posts: 23 Last: May 18, 2017 [view latest posts] |
|
|
Category: CoD+UO General Posted: Thursday, Oct. 16, 2014 06:55 am |
|
You could also make a server sided var.. For example:
setCvar("mode_" + self getGuid(), "r_mode:1;b_mode:2;c_mode:3");
And read it like data = getCvar("mode_" + self getGuid());
Then you can explode the : and the ; to extract the data.
This is the way how i store levels in my mod by server side.
You can add as much player vars and data as you want in one server sided var.
I scripted a little program that reads the data by RCon and automatically writes it in a MySQL database.
So i have all data stored central.
Check this out: http://modszombies.com/serverstats/?rotu
Is a little bit complex but if you need help, please feel free to contact me :)
Regards
edited on Oct. 15, 2014 11:55 pm by modsfabio |
|
|
|
dobledosis |
General Member Since: Apr 1, 2007 Posts: 22 Last: Apr 25, 2016 [view latest posts] |
|
|
Category: CoD+UO General Posted: Friday, Oct. 17, 2014 10:00 am |
|
modsfabio writes...Quote: You could also make a server sided var.. For example:
setCvar("mode_" + self getGuid(), "r_mode:1;b_mode:2;c_mode:3");
And read it like data = getCvar("mode_" + self getGuid());
Then you can explode the : and the ; to extract the data.
This is the way how i store levels in my mod by server side.
You can add as much player vars and data as you want in one server sided var.
I scripted a little program that reads the data by RCon and automatically writes it in a MySQL database.
So i have all data stored central.
Check this out: http://modszombies.com/serverstats/?rotu
Is a little bit complex but if you need help, please feel free to contact me :)
Regards
edited on Oct. 15, 2014 11:55 pm by modsfabio
Thanks Fabio. This is too complex for my knowledge, but for what i understand of what you are telling me, what happens if a player that never entered before enters with the command r_mode in -1? The server won't detect the change and store?
Thanks |
|
|
|
morgawr |
General Member Since: Dec 15, 2004 Posts: 377 Last: Mar 19, 2023 [view latest posts] |
|
|
|
modsfabio |
General Member Since: Aug 10, 2014 Posts: 23 Last: May 18, 2017 [view latest posts] |
|
|
Category: CoD+UO General Posted: Monday, Oct. 20, 2014 06:39 am |
|
dobledosis writes...Quote: modsfabio writes...Quote: You could also make a server sided var.. For example:
setCvar("mode_" + self getGuid(), "r_mode:1;b_mode:2;c_mode:3");
And read it like data = getCvar("mode_" + self getGuid());
Then you can explode the : and the ; to extract the data.
This is the way how i store levels in my mod by server side.
You can add as much player vars and data as you want in one server sided var.
I scripted a little program that reads the data by RCon and automatically writes it in a MySQL database.
So i have all data stored central.
Check this out: http://modszombies.com/serverstats/?rotu
Is a little bit complex but if you need help, please feel free to contact me :)
Regards
edited on Oct. 15, 2014 11:55 pm by modsfabio
Thanks Fabio. This is too complex for my knowledge, but for what i understand of what you are telling me, what happens if a player that never entered before enters with the command r_mode in -1? The server won't detect the change and store?
Thanks
When a player enters the server you check if the server sided var exists.
for example you check for the var (with getcvar()) mode_123456 (when player has guid 123456).
If the var exists it will probably contain the r_mode of the player.
If it doesnt exist you do setcvar() with the default value of r_mode.
Idk if it is unterstandable :D
Regards
|
|
|
|