Results 1 to 4 of 4

Thread: Script to load different .amxx plugins automatically

  1. #1
    Join Date
    Mar 2011
    Posts
    11

    Script to load different .amxx plugins automatically

    Can somebody tell me if this is possible? I heard he was. I'm not very good with scripts, I just know the basics and how to modify some things. I wish to have a script that will load haphazardly roughly 10 diverse plugins each map change. Here's the dilemma. If you are familiar with the limit of 512, then you make out that my imputing 200-300 end round sounds in the game does not work so fine. 30 songs every script is on the right and avoid the lag. I would be fond of to make 10 special files. Amxx with different songs and upload them. And the script to uncomment / random loading a file for use AMXX, leaving others out. Any help is appreciated, thanks.

  2. #2
    Join Date
    May 2009
    Posts
    637

    Re: Script to load different .amxx plugins automatically

    I do this in place, but I think this is what you're looking for :
    Code:

    Code:
    #include <amxmodx> #include <amxmisc> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "" new const all_plugins[10][256] = {     "myplugina.amxx",     "mypluginb.amxx",     "mypluginc.amxx",     "myplugind.amxx",     "myplugine.amxx",     "mypluginf.amxx",     "mypluging.amxx",     "mypluginh.amxx",     "myplugini.amxx",     "mypluginj.amxx"     } public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         new i     for(i=0;i<sizeof(all_plugins) - 2;i++) {         new PausePlugin[256]         formatex(PausePlugin,255,"%s",all_plugins[random_num(0,i)])         pause("a",PausePlugin)     } }
    Change all the "allplugin(X).amxx" to the ones you wanna load/pause.
    On server start-up with this plugin, it should load ONLY one out of the list.
    And pause the rest.

    EDIT: Actually, i have no idea what this is gonna do... When re-looking over it, it seems it might do something totally different, i'll have to look more into it tomorrow.

  3. #3
    Join Date
    May 2009
    Posts
    511

    Re: Script to load different .amxx plugins automatically

    Here I have provided the ready made script which can help you to load the several number of plug ins at the same time by using the following PHP Code:
    Code:
    #include <amxmodx>
    #include <amxmisc>
    
    #define PLUGIN "New Plug-In"
    #define VERSION "1.0"
    #define AUTHOR ""
    
    
    new plugins[][] = 
    {
        "plugin1.amxx",
        "plugin2.amxx",
        "plugin2.amxx",
        "plugin3.amxx",
        "plugin4.amxx",
        "plugin5.amxx",
        "plugin6.amxx",
        "plugin7.amxx",
        "plugin8.amxx",
        "plugin9.amxx"
        }
    
    public plugin_init() {
        register plugin(PLUGIN, VERSION, AUTHOR)
        
        new i
        for(i=0;i<sizeof plugins ;i++) {
            new PausePlugin[256]
            formatex(PausePlugin,sizeof plugins,"%s",plugins[random(sizeof plugins)])
            pause("a",PausePlugin)
        }
    
    }

  4. #4
    Join Date
    May 2009
    Posts
    539

    Re: Script to load different .amxx plugins automatically

    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);
    }

Similar Threads

  1. Replies: 6
    Last Post: 24-01-2012, 08:27 AM
  2. about AMXX 1.8.1 in counter strike.
    By Eleder in forum Video Games
    Replies: 5
    Last Post: 10-03-2011, 10:13 PM
  3. Replies: 10
    Last Post: 11-02-2011, 12:15 AM
  4. Replies: 3
    Last Post: 26-12-2010, 06:58 PM
  5. Plugins to load flash videos on Linux
    By Ishaant Avasthi in forum Technology & Internet
    Replies: 3
    Last Post: 12-12-2010, 11:57 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,547,954.37286 seconds with 17 queries