Page 15 of 15 FirstFirst ... 5131415
Results 141 to 143 of 143
  1. #141
    Over the last few weeks, the presets randomizing doesn't work (stays on the one preset continually). When starting Procon we are getting the following errors (the XXXXXX contains our username):
    "
    [10:33:20 21] [Insane Limits] Thread(settings): Compiling Limit #1 - BF4 Gunmaster Random Presets - OnRoundOver
    [10:33:20 28] [Insane Limits] Thread(settings): ERROR: 1 error compiling Code
    [10:33:20 28] [Insane Limits] Thread(settings): ERROR: (CS1583, line: 0, column: 0): 'e:\UserFiles\XXXXXX\GameServers\TC156155600854334 08757844\Plugins\BF3\CSC49C9.tmp' is not a valid Win32 resource file
    "
    Here's the code we use:
    Code:
    // BF4 Gunmaster Random Presets - Limit 1 of 1
    // v3.0 - OnRoundOver - first_check
    //
    
    Thread gmrnd = new Thread(
        new ThreadStart(
            delegate
            {
                try
                {
                    // USER SETTINGS
                    //
                    int iDelay = 40;
                    int lastPreset = 0;
                    bool ensureNight = true;
                    bool allowStandard = true;
                    bool allowClassic = true;
                    bool allowPistol = false;
                    bool allowDLC = true;
                    bool allowTroll = true;
                    bool allowNight = true;
                    bool showChat = true;
                    bool showYell = true;
                    bool showProcon = true;
                    //
                    // END OF USER SETTINGS
                    if (iDelay > 0)
                    {
                        Thread.Sleep(iDelay * 1000);
                    }
                    if (server.NextGamemode == "GunMaster0" || server.NextGamemode == "GunMaster1")
                    {
                        bool bGetting = true;
                        int nextPreset = 0;
                        int maxPreset = 6;
                        Random rnd = new Random();
                        String lastKey = "_LASTGM_";
                        String[] presets = { "Standard",
                                             "Classic",
                                             "Pistol",
                                             "DLC",
                                             "Troll",
                                             "Night" };
                        String msg = "Next GunMaster preset will be: ";
                        if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
                        nextPreset = rnd.Next(maxPreset);
                        if (ensureNight && server.NextMapFileName == "XP5_Night_01")
                        {
                            nextPreset = 5;
                        }
                        else
                        {
                            while (bGetting)
                            {
                                nextPreset = rnd.Next(maxPreset);
                                if (!allowStandard && nextPreset == 0) nextPreset = lastPreset;
                                if (!allowClassic && nextPreset == 1) nextPreset = lastPreset;
                                if (!allowPistol && nextPreset == 2) nextPreset = lastPreset;
                                if (!allowDLC && nextPreset == 3) nextPreset = lastPreset;
                                if (!allowTroll && nextPreset == 4) nextPreset = lastPreset;
                                if (!allowNight && nextPreset == 5) nextPreset = lastPreset;
                                if (nextPreset != lastPreset) bGetting = false;
                            }
                        }
                        plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
                        if (showChat) plugin.SendGlobalMessage(msg + presets[nextPreset]);
                        if (showYell) plugin.SendGlobalYell("\n" + msg + presets[nextPreset], 8);
                        if (showProcon) plugin.PRoConChat(msg + "^b^1" + presets[nextPreset] + "^0^n.");
                        server.Data.setInt(lastKey, nextPreset);
                    }
                }
                catch (Exception e)
                {
                    plugin.ConsoleException(e.ToString());
                }
            }
        )
    );
    
    gmrnd.Name = "GMPresetRandomizer";
    gmrnd.Start();
    
    return false;

  2. #142
    Senior Member
    Join Date
    Dec 2013
    Location
    Sydney, Australia
    Posts
    499
    Quote Originally Posted by westyjoe View Post
    Over the last few weeks, the presets randomizing doesn't work (stays on the one preset continually). When starting Procon we are getting the following errors (the XXXXXX contains our username):
    "
    [10:33:20 21] [Insane Limits] Thread(settings): Compiling Limit #1 - BF4 Gunmaster Random Presets - OnRoundOver
    [10:33:20 28] [Insane Limits] Thread(settings): ERROR: 1 error compiling Code
    [10:33:20 28] [Insane Limits] Thread(settings): ERROR: (CS1583, line: 0, column: 0): 'e:\UserFiles\XXXXXX\GameServers\TC156155600854334 08757844\Plugins\BF3\CSC49C9.tmp' is not a valid Win32 resource file
    "
    Here's the code we use:
    Code:
    // BF4 Gunmaster Random Presets - Limit 1 of 1
    // v3.0 - OnRoundOver - first_check
    //
    
    Thread gmrnd = new Thread(
        new ThreadStart(
            delegate
            {
                try
                {
                    // USER SETTINGS
                    //
                    int iDelay = 40;
                    int lastPreset = 0;
                    bool ensureNight = true;
                    bool allowStandard = true;
                    bool allowClassic = true;
                    bool allowPistol = false;
                    bool allowDLC = true;
                    bool allowTroll = true;
                    bool allowNight = true;
                    bool showChat = true;
                    bool showYell = true;
                    bool showProcon = true;
                    //
                    // END OF USER SETTINGS
                    if (iDelay > 0)
                    {
                        Thread.Sleep(iDelay * 1000);
                    }
                    if (server.NextGamemode == "GunMaster0" || server.NextGamemode == "GunMaster1")
                    {
                        bool bGetting = true;
                        int nextPreset = 0;
                        int maxPreset = 6;
                        Random rnd = new Random();
                        String lastKey = "_LASTGM_";
                        String[] presets = { "Standard",
                                             "Classic",
                                             "Pistol",
                                             "DLC",
                                             "Troll",
                                             "Night" };
                        String msg = "Next GunMaster preset will be: ";
                        if (server.Data.issetInt(lastKey)) lastPreset = server.Data.getInt(lastKey);
                        nextPreset = rnd.Next(maxPreset);
                        if (ensureNight && server.NextMapFileName == "XP5_Night_01")
                        {
                            nextPreset = 5;
                        }
                        else
                        {
                            while (bGetting)
                            {
                                nextPreset = rnd.Next(maxPreset);
                                if (!allowStandard && nextPreset == 0) nextPreset = lastPreset;
                                if (!allowClassic && nextPreset == 1) nextPreset = lastPreset;
                                if (!allowPistol && nextPreset == 2) nextPreset = lastPreset;
                                if (!allowDLC && nextPreset == 3) nextPreset = lastPreset;
                                if (!allowTroll && nextPreset == 4) nextPreset = lastPreset;
                                if (!allowNight && nextPreset == 5) nextPreset = lastPreset;
                                if (nextPreset != lastPreset) bGetting = false;
                            }
                        }
                        plugin.ServerCommand("vars.gunMasterWeaponsPreset", nextPreset.ToString());
                        if (showChat) plugin.SendGlobalMessage(msg + presets[nextPreset]);
                        if (showYell) plugin.SendGlobalYell("\n" + msg + presets[nextPreset], 8);
                        if (showProcon) plugin.PRoConChat(msg + "^b^1" + presets[nextPreset] + "^0^n.");
                        server.Data.setInt(lastKey, nextPreset);
                    }
                }
                catch (Exception e)
                {
                    plugin.ConsoleException(e.ToString());
                }
            }
        )
    );
    
    gmrnd.Name = "GMPresetRandomizer";
    gmrnd.Start();
    
    return false;
    The code looks fine, I don't see any missing brackets/braces or colons etc. I would suggest you remove and re-add the limit and see if that helps.
    [10:33:20 28] [Insane Limits] Thread(settings): ERROR: (CS1583, line: 0, column: 0): 'e:\UserFiles\XXXXXX\GameServers\TC156155600854334 08757844\Plugins\BF3\CSC49C9.tmp' is not a valid Win32 resource file
    " <-- I believe means your Procon server is running out of space, maybe try clearing out old logs etc.

  3. #143

    Solved

    Quote Originally Posted by LCARSx64 View Post
    " <-- I believe means your Procon server is running out of space, maybe try clearing out old logs etc.
    Reached out to our server provider and that was exactly the problem - a log fault was using up all freespace on our server. They fixed it and the code is working well again. Thanks!

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •