Raised This Month: $51 Target: $400
 12% 

set_pcvar_num after plugin_init and plugin_cfg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaNaReaver
Member
Join Date: Apr 2020
Location: India
Old 10-28-2020 , 05:13   set_pcvar_num after plugin_init and plugin_cfg
Reply With Quote #1

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.
__________________

Last edited by MaNaReaver; 10-28-2020 at 05:13.
MaNaReaver is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 10-28-2020 , 07:41   Re: set_pcvar_num after plugin_init and plugin_cfg
Reply With Quote #2

set_task is what you're looking for
__________________








CrazY. is offline
MaNaReaver
Member
Join Date: Apr 2020
Location: India
Old 10-28-2020 , 10:06   Re: set_pcvar_num after plugin_init and plugin_cfg
Reply With Quote #3

Quote:
Originally Posted by CrazY. View Post
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.
__________________
MaNaReaver is offline
r0ma
Senior Member
Join Date: Apr 2012
Location: Great Tomb of Nazarick
Old 10-28-2020 , 10:37   Re: set_pcvar_num after plugin_init and plugin_cfg
Reply With Quote #4

https://www.amxmodx.org/api/amxmodx/OnConfigsExecuted
__________________
Discord:FluffyDeveloper#4753
Github: https://github.com/francoromaniello
AMX-ES: https://amxmodx-es.com/r0ma'
r0ma is offline
Send a message via MSN to r0ma
MaNaReaver
Member
Join Date: Apr 2020
Location: India
Old 11-01-2020 , 13:57   Re: set_pcvar_num after plugin_init and plugin_cfg
Reply With Quote #5

Thank you, that works perfectly!
__________________
MaNaReaver is offline
Reply



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 16:52.


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