Raised This Month: $ Target: $400
 0% 

[ENGINE] plugin_cfg() fires before cvars loaded


  
 
 
Thread Tools Display Modes
Author Message
ripcurl2
Member
Join Date: Oct 2004
Old 10-28-2004 , 18:42   [ENGINE] plugin_cfg() fires before cvars loaded
#1

I don't know if this is a bug or my bad interpretation, but here goes (with AMXMODX 0.20 RC6):

regarding plugin_cfg()
Notes: All commmands and cvars should be already registered by the time this is forwarded.

Problem: any plugin using cvars at this time (plugin_cfg) will have a hard time getting values as written in file, because the cfgfiles (amxx.cfg sql.cfg etc) are not yet executed. And it's stated that cvars are ready to use in this function

See the below code when someplugin executes plugin.cfg the cvar is default, and when mapstart fires the cvar is loaded from file

Code:
L 10/29/2004 - 02:31:05: -------- Mapchange --------
L 10/29/2004 - 02:31:05: [someplugin.amxx] plugin_init
L 10/29/2004 - 02:31:05: [someplugin.amxx] plugin_cfg
L 10/29/2004 - 02:31:05: [someplugin.amxx] plugin_cfg - amx_sql_table = admins    <-----

Executing AMX Mod X Configuration File
Scrolling message displaying frequency: 10:00 minutes
[AMXX] No admins found.
couldn't exec listip.cfg
Server logging data to file logs/L1029007.log
L 10/29/2004 - 02:31:06: Log file started (file "logs/L1029007.log") (game "cstrike") (version "47/1.1.2.5/Stdio/2738")
Adding auth server 65.73.232.253:27040
Adding master server 207.173.177.11:27010
Adding master server 69.28.151.178:27010
L 10/29/2004 - 02:31:14: World triggered "Round_Start"
L 10/29/2004 - 02:31:15: "RipCurl<1><STEAM_ID_PENDING><>" connected, address "***********"
L 10/29/2004 - 02:31:16: "RipCurl<1><********><>" STEAM USERID validated
L 10/29/2004 - 02:31:19: [someplugin.amxx] mapstart - amx_sql_table = adminasdf    <-----
ripcurl2 is offline
BAILOPAN
Join Date: Jan 2004
Old 10-28-2004 , 22:05  
#2

Code:
L 10/28/2004 - 22:04:32: -------- Mapchange --------
__CVAR=60 <-- after exec amxx.cfg
[AMXX] Loaded 1 admin from file
CVAR1=60 <-- plugin_init()
CVAR2=60 <-- plugin_cfg()

Executing AMX Mod X Configuration File
Scrolling message displaying frequency: 10:00 minutes
couldn't exec listip.cfg
couldn't exec banned.cfg
Adding auth server 65.73.232.253:27040
Adding master server 207.173.177.11:27010
Adding master server 207.173.177.12:27010
CVAR3=10 <-- 2.0 seconds after plugin_init
It appears that the effects of "exec" don't take effect right away or something. weird.
__________________
egg
BAILOPAN is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 10-29-2004 , 07:59  
#3

You have to call the server_exec() native (or the SERVER_EXECUTE() function from a metamod plugin) to force everything in some buffer to be executed I think. Just try to server_exec() in plugin_cfg before doing anything else
__________________
hello, i am pm
PM is offline
BAILOPAN
Join Date: Jan 2004
Old 10-29-2004 , 17:12  
#4

Well, I kind of fixed this by adding server_exec() after plugin_init() on admin.sma

So there ya go ;]
__________________
egg
BAILOPAN is offline
 



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 15:24.


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