Hello, I'm trying to convert the @go, @warp, @jump delay when hit via plugin and I was successful.
But I want to make it read the delay from a conf setting instead of hard coded in the plugin source.
So I looked into the sample.c and tried it so it just
[cbox]
HPExport void server_preinit (void) { /* makes map server listen to mysetting:value in any "battleconf" file (including imported or custom ones) */ /* value is not limited to numbers, its passed to our plugins handler (parse_my_setting) as const char *, * and thus can be manipulated at will */ addBattleConf("go_delay",go_delay_setting); }
[/cbox]
[cbox]
void go_delay_setting(const char *val) { ShowDebug("Received 'go_delay:%s'n",val); /* do anything with the var e.g. config_switch(val) */ }
[/cbox]
So it successfully reads the go_delay I placed in the import/battle.conf
But now, I don't have any idea on how would I be able to use it like this in a source:
Hello, I'm trying to convert the @go, @warp, @jump delay when hit via plugin and I was successful.
But I want to make it read the delay from a conf setting instead of hard coded in the plugin source.
So I looked into the sample.c and tried it so it just
[cbox]
HPExport void server_preinit (void) {
/* makes map server listen to mysetting:value in any "battleconf" file (including imported or custom ones) */
/* value is not limited to numbers, its passed to our plugins handler (parse_my_setting) as const char *,
* and thus can be manipulated at will */
addBattleConf("go_delay",go_delay_setting);
}
[/cbox]
[cbox]
void go_delay_setting(const char *val) {
ShowDebug("Received 'go_delay:%s'n",val);
/* do anything with the var e.g. config_switch(val) */
}
[/cbox]
So it successfully reads the go_delay I placed in the import/battle.conf
But now, I don't have any idea on how would I be able to use it like this in a source:
battle_config.go_delay
Hope someone could help me..
Thanks in advance!
Share this post
Link to post
Share on other sites