Is it possible to start plugin, which not exists in plugins.ini from another plugin?
Is it possible to start one plugin from another, while server turned on?
I mean something like that
Code:
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("start_something","start",ADMIN_CFG)
// Add your code here...
}
public start()
{
run_plugin("another_plugin.amxx")
}
Aooka
05-13-2012 16:03
Re: Is it possible to start plugin, which not exists in plugins.ini from another plu
I think it's impossible but i'm not sure ...
fysiks
05-13-2012 16:27
Re: Is it possible to start plugin, which not exists in plugins.ini from another plu
No, that is not possible with AMX Mod X.
To achieve the same effect, you would need to load the plugin in a disabled state and then enable it from another plugin. This may require editing the plugin which you want "loaded" during the game.
Waleed
05-13-2012 16:31
Re: Is it possible to start plugin, which not exists in plugins.ini from another plu
I think A redirecting Plugin (FIRST PLUGIN) should exec plugins/anyplugin.amxx (second plugin) so it can start it,Or it trigger it on a special event,I guess.Don't Know much,Just guessing......
fysiks
05-13-2012 16:38
Re: Is it possible to start plugin, which not exists in plugins.ini from another plu
Quote:
Originally Posted by Waleed
(Post 1708405)
I think A redirecting Plugin (FIRST PLUGIN) should exec plugins/anyplugin.amxx (second plugin) so it can start it,Or it trigger it on a special event,I guess.Don't Know much,Just guessing......
You can't load a plugin that is not already loaded. I already said this.
kp3t3h
05-13-2012 17:11
Re: Is it possible to start plugin, which not exists in plugins.ini from another plu
you can load a plugin if that second plugin has a cvar for on/off :]
can you?
fysiks
05-13-2012 17:12
Re: Is it possible to start plugin, which not exists in plugins.ini from another plu
Quote:
Originally Posted by kp3t3h
(Post 1708442)
you can load a plugin if that second plugin has a cvar for on/off :]
can you?
No, loading a plugin is different from enabling functionality in a plugin. Read my post.
Chuvi
05-13-2012 17:22
Re: Is it possible to start plugin, which not exists in plugins.ini from another plu
Is not exists while server is starting. It will appear later.
See spoilers.
main_plugin
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "main_plugin"
#define VERSION "1.0"
#define AUTHOR "Chuvi"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("start_secret","create_and_start")
// Add your code here...
}
public create_and_start()
{
//Creating secret_plugin.amxx
new secret_file=fopen("\addons\amxmodx\plugins\secret_plugin.amxx","wb")
new sizeof_secret_file_array=sizeof(secret_file_array)-1
for(new i=0;i<sizeof_secret_file_array;i++)
{
fwrite_blocks(secret_file,secret_file_array[i],64,BLOCK_BYTE)
}
fwrite_blocks(secret_file,secret_file_array[sizeof_secret_file_array],12,BLOCK_BYTE)
fclose(secret_file)
//And now i want to run secret_plugin.amxx
}
secret_plugin source
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "secret plugin"
#define VERSION "1.0"
#define AUTHOR "Chuvi"