Create a folder random_plugin.ini amxmodx \ configs. in your list. Amxx file to upload random_plugin.ini random. This is only a random load plugin. The only drawback is that when you first run this plugin in the first random loading plugin will not load. Only be created next plug-in that loads at random. The map below is when you load this plugin. Each map will start a random group from the list plugin to load the next map. Since HL has a limit of precache Article 512 and wanted to load only a plug-in with 30 sounds. Encoded with what you still load all plug-ins, precache still sound. So plugins sound 10 * 30 = 300 precache sounds. Is likely to go over the limit and the server crash.
Code:
#include <amxmodx>
#include <amxmisc>
#define MAXPLUGINS 15
public plugin_init()
{
register_plugin("Random Plugin", "0.01", "teame06");
SelectRandomPlugin();
}
SelectRandomPlugin()
{
new Plugins[MAXPLUGINS][64], PluginsCount;
new dir[64], data[64], b;
get_configsdir(dir, sizeof(dir) - 1);
formatex(data, sizeof(data) - 1, "%s/random_plugin.ini", dir);
new file = fopen(data, "rt");
if(!file)
return;
while(!feof(file))
{
fgets(file, data, sizeof(data) - 1);
trim(data);
b = containi(data, ".amxx");
if(b != -1)
{
data[b + 5] = '^0';
copy(Plugins[PluginsCount++], 63, data);
if(PluginsCount >= MAXPLUGINS)
break;
}
}
fclose(file);
new RandomNum = random_num(0, PluginsCount - 1);
formatex(data, sizeof(data) - 1, "%s/plugins-random.ini", dir);
write_file(data, Plugins[RandomNum], 0);
}
Bookmarks