Raised This Month: $ Target: $400
 0% 

Help on a server_cmd


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
amxnewbie
Junior Member
Join Date: Sep 2007
Old 09-24-2007 , 11:25   Help on a server_cmd
Reply With Quote #1

During the init of a plugin, I would like to get two values from a file, (abc.cfg) under amx conf directory.

Code:
public plugin_init() {
 register_plugin(PLUGIN, VERSION, AUTHOR)
 
 //deffault value
 register_cvar("ip_common", "127.0.0.1")
 
 new configsDir[64], HostIP[32]
get_configsdir(configsDir, 63)
server_cmd("exec %s/abc.cfg", configsDir) 
 
 get_cvar_string("ip_common",HostIP,31) 
}
In the addons\amxmodx\configs\abc.cfg, I have:
Code:
ip_common "210.245.126"
My understanding for server_cmd("exec %s/abc.cfg", configsDir) is to assign the value to the the registered VAR. I follow AMX admin.sma in which it has default MySQL parameters and it also reads the setting from sql.cfg.

However, it always returns me the default value, 127.0.0.1

I went throught the tutorial, but no good news. Thanks for any suggestions.

Last edited by amxnewbie; 09-24-2007 at 11:27. Reason: typo
amxnewbie 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 16:15.


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