AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_pcvar_num after plugin_init and plugin_cfg (https://forums.alliedmods.net/showthread.php?t=328132)

MaNaReaver 10-28-2020 05:13

set_pcvar_num after plugin_init and plugin_cfg
 
Hey AM,

Is there a way to set cvars from a plugin, just after all the cvars are set from cfg files, and after plugin_init and plugin_cfg are executed?

Best regards,
MaNaReaver.

CrazY. 10-28-2020 07:41

Re: set_pcvar_num after plugin_init and plugin_cfg
 
set_task is what you're looking for

MaNaReaver 10-28-2020 10:06

Re: set_pcvar_num after plugin_init and plugin_cfg
 
Quote:

Originally Posted by CrazY. (Post 2722841)
set_task is what you're looking for

I tried using set_task with different times, but the variability taken to load the configs and the plugin_* functions is causing cvars to turn back to normal. For example:

plugin_init() -> cvar loaded and set to default value
server_exec() -> server cvars loaded, no cvar set here.
plugin_cfg() -> set_pcvar_num the cvar to another value
config.cfg -> config cvars loaded, changing back cvar to default
checkfunctions() -> forward function that loads in plugin_init -> if(get_pcvar_num(cvar)) -> fails to carry out the desired option.

Best regards,
MaNaReaver.

r0ma 10-28-2020 10:37

Re: set_pcvar_num after plugin_init and plugin_cfg
 
https://www.amxmodx.org/api/amxmodx/OnConfigsExecuted

MaNaReaver 11-01-2020 13:57

Re: set_pcvar_num after plugin_init and plugin_cfg
 
Quote:

Originally Posted by r0ma (Post 2722855)

Thank you, that works perfectly!


All times are GMT -4. The time now is 13:51.

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