Search found 19 matches: OnConVarChanged

Searched query: onconvarchanged

by Painkiller
Sat Jan 22, 2022 3:50 pm
Forum: Plugin Development Support
Topic: [HL:2DM] Longjump
Replies: 0
Views: 7642

[HL:2DM] Longjump

... import ConfigObj from pathlib import Path from stringtables.downloads import Downloadables from cvars import ConVar from listeners import OnConVarChanged, OnLevelInit, OnLevelEnd, OnLevelShutdown from events import Event from messages import DialogMsg from engines.sound import Sound from ...
by JustGR
Wed Apr 29, 2020 2:57 am
Forum: General Discussion
Topic: Stopping workshop maps from overriding cvars
Replies: 8
Views: 16413

Re: Stopping workshop maps from overriding cvars

... a command. For example: from commands.server import ServerCommand from core import console_message from cvars import ConVar from listeners import OnConVarChanged from listeners.tick import Delay convars = { 'mp_roundtime': '0', 'mp_maxrounds': '0', 'mp_timelimit': ...
by L'In20Cible
Wed Apr 29, 2020 2:48 am
Forum: General Discussion
Topic: Stopping workshop maps from overriding cvars
Replies: 8
Views: 16413

Re: Stopping workshop maps from overriding cvars

I already tried @OnConVarChanged, even tried it with a nested Event decorator. This approach works for map loads, but fails when you try to manually change cvars via the console. It works fine. I assume it doesn't because your server ...
by JustGR
Wed Apr 29, 2020 2:11 am
Forum: General Discussion
Topic: Stopping workshop maps from overriding cvars
Replies: 8
Views: 16413

Re: Stopping workshop maps from overriding cvars

I already tried @OnConVarChanged, even tried it with a nested Event decorator. This approach works for map loads, but fails when you try to manually change cvars via the console. It works fine. I assume it doesn't because your server ...
by L'In20Cible
Wed Apr 29, 2020 1:14 am
Forum: General Discussion
Topic: Stopping workshop maps from overriding cvars
Replies: 8
Views: 16413

Re: Stopping workshop maps from overriding cvars

I already tried @OnConVarChanged, even tried it with a nested Event decorator. This approach works for map loads, but fails when you try to manually change cvars via the console. It works fine. I assume it doesn't because your server ...
by JustGR
Tue Apr 28, 2020 10:01 pm
Forum: General Discussion
Topic: Stopping workshop maps from overriding cvars
Replies: 8
Views: 16413

Re: Stopping workshop maps from overriding cvars

... think using server_cvar event should get manual cvar changing via console. from events import Event from cvars import ConVar from listeners import OnConVarChanged from listeners.tick import Delay convars = { 'mp_roundtime': '0', 'mp_maxrounds': '0', 'mp_timelimit': ...
by decompile
Tue Apr 28, 2020 4:49 pm
Forum: General Discussion
Topic: Stopping workshop maps from overriding cvars
Replies: 8
Views: 16413

Re: Stopping workshop maps from overriding cvars

... think using server_cvar event should get manual cvar changing via console. from events import Event from cvars import ConVar from listeners import OnConVarChanged from listeners.tick import Delay convars = { 'mp_roundtime': '0', 'mp_maxrounds': '0', 'mp_timelimit': ...
by JustGR
Tue Apr 28, 2020 4:00 pm
Forum: General Discussion
Topic: Stopping workshop maps from overriding cvars
Replies: 8
Views: 16413

Re: Stopping workshop maps from overriding cvars

Welcome to Source.Python! :smile: You could use the OnConVarChanged listener to revert the change if the value isn't the one you want to keep. For example: from listeners import OnConVarChanged from listeners.tick import Delay convars = { 'mp_roundtime': ...
by L'In20Cible
Tue Apr 28, 2020 1:13 pm
Forum: General Discussion
Topic: Stopping workshop maps from overriding cvars
Replies: 8
Views: 16413

Re: Stopping workshop maps from overriding cvars

Welcome to Source.Python! :smile: You could use the OnConVarChanged listener to revert the change if the value isn't the one you want to keep. For example: from listeners import OnConVarChanged from listeners.tick import Delay convars = { 'mp_roundtime': ...
by satoon101
Sun Oct 23, 2016 1:55 pm
Forum: Plugin Releases
Topic: Auto Respawn
Replies: 22
Views: 37230

Re: Auto Respawn

... , you are passing in the value of the ConVar at that exact moment. Also, as far as your OnConVarChanged function: @OnConVarChanged def on_convar_changed(convar, old_val): if convar.name == info.basename + "_delay" and ...
by iPlayer
Sun Oct 23, 2016 12:25 pm
Forum: Plugin Releases
Topic: Auto Respawn
Replies: 22
Views: 37230

Re: Auto Respawn

... you went with, from my example, eliminates the need for that, as it gets the value at that exact moment when you send the message. Currently, your OnConVarChanged function doesn't actually do anything. So when Trying to get the config value, it will auto update when it gets changed? Or did I understood ...
by decompile
Sun Oct 23, 2016 12:07 pm
Forum: Plugin Releases
Topic: Auto Respawn
Replies: 22
Views: 37230

Re: Auto Respawn

... you went with, from my example, eliminates the need for that, as it gets the value at that exact moment when you send the message. Currently, your OnConVarChanged function doesn't actually do anything. So when Trying to get the config value, it will auto update when it gets changed? Or did I understood ...
by satoon101
Sun Oct 23, 2016 12:06 pm
Forum: Plugin Releases
Topic: Auto Respawn
Replies: 22
Views: 37230

Re: Auto Respawn

... you went with, from my example, eliminates the need for that, as it gets the value at that exact moment when you send the message. Currently, your OnConVarChanged function doesn't actually do anything.
by satoon101
Thu Oct 20, 2016 2:55 am
Forum: Plugin Releases
Topic: Auto Respawn
Replies: 22
Views: 37230

Re: Auto Respawn

... you went with, from my example, eliminates the need for that, as it gets the value at that exact moment when you send the message. Currently, your OnConVarChanged function doesn't actually do anything. Also, I completely agree with this: And one last point: I'm not a big fan of cvars like "autorespawn_enable". ...
by L'In20Cible
Thu Jul 14, 2016 4:04 pm
Forum: Plugin Development Support
Topic: TF2 run_command hook
Replies: 29
Views: 36668

Re: TF2 run_command hook

... a tick listener and engine_server.get_client_convar_value but that feels a little inelegant. http://forums.sourcepython.com/search.php?keywords=OnConVarChanged Please, create a new topic next time!
by iPlayer
Fri Jun 03, 2016 1:29 pm
Forum: Plugin Development Support
Topic: Events vs. Listeners
Replies: 6
Views: 9273

Re: Events vs. Listeners

BackRaw wrote:There is also OnConVarChanged tho. :)


A huge upside to OnConVarChanged listener is that it doesn't require NOTIFY flag to be set on a cvar. While server_cvar event does.
by BackRaw
Fri Jun 03, 2016 6:36 am
Forum: Plugin Development Support
Topic: Events vs. Listeners
Replies: 6
Views: 9273

Re: Events vs. Listeners

Ayuto wrote:Well, I think OnClientDisconnect/player_disconnect and OnClientActive/player_activate are pretty much the only duplicates where an event and a listener exist. Since I don't know any downsides go with whatever you prefer.

Okay then, that clears it up for me :D

There is also OnConVarChanged tho. :)
by Ayuto
Sun May 29, 2016 9:15 pm
Forum: Plugin Development Support
Topic: CS:GO server_cvar event for created ConVar
Replies: 2
Views: 5413

Re: CS:GO server_cvar event for created ConVar

The server_cvar event only gets fired for ConVars that have the NOTIFY flag. I recommend to use OnConVarChanged if you don't want to add that flag.
by Ayuto
Sun Apr 03, 2016 5:10 pm
Forum: Development Status Updates
Topic: Development status update (March 2016)
Replies: 0
Views: 7405

Development status update (March 2016)

... ⋅  Added Players.spectators property. ⋅  Added SteamID render methods (to_steamid2 and to_steamid3). ⋅  Added OnConVarChanged listener. ⋅  Added crash protection to the memory module (Windows only!). ⋅ Removals: ⋅  Removed the Entity.instances ...

Go to advanced search