Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Nov 2011
    Location
    Germany
    Posts
    154

    [BF4] Insane Limits: AdaptiveServerSize v1.0

    AdaptiveServerSize for Insane Limits [BF4]

    With this script you can change serverslots live at BF4

    Functions:
    - change serverslots live at BF4
    - adaptive ticket count at next mapchange
    - serverslots: 10/20/24/32/64
    - only for rush/smallcq/largecq

    ATTENTION:
    You must delete or command out vars.maxPlayers in your startup.txt


    SETUP LIMIT#1
    limit_evaluation: OnIntervalServer
    limit_first_check: Code
    limit_first_check_code: paste the CODE#1 here

    CODE#1
    Code:
    // Alternative AdaptiveServerSize for BF4 v1.0 by Grovax
    
    // set number of maps at maplist
    int iMapsAtMaplist = 20;
    
    // set gamemode
    // 1 = rush(32) | 2 = smallcq(32) | 3 = largecq(64)
    int iGameMode = 1;
    
    // activate adaptive tickets (not live, need mapchange)
    // true = yes | false = no
    bool bAdaptiveTickets = false;
    
    // set adaptive tickets in percent
    // 10 | 20 | 24 | 32 | 64 slots
    String[] sAdaptiveTickets = { "100" , "120" , "130" , "150" , "300" };
    
    
    /////////////
    // dont edit
    /////////////
    
    String sMapIndex = iMapsAtMaplist.ToString();
    
    // 10 slots
    if (server.PlayerCount <= 9) {
    	if (server.MaxPlayers == 10) return false;
    	plugin.PRoConChat("^b^1ServerSlots^0: Change Slots to 10");
    	if (bAdaptiveTickets) plugin.ServerCommand("vars.gameModeCounter", sAdaptiveTickets[0]);
    	plugin.ServerCommand("mapList.remove", sMapIndex);
    	plugin.ServerCommand("mapList.add", "MP_Prison", "Elimination0", "1", sMapIndex);
    // 20 slots
    } else if (server.PlayerCount >= 10 && server.PlayerCount <= 13) {
    	if (server.MaxPlayers == 20) return false;
    	plugin.PRoConChat("^b^1ServerSlots^0: Change Slots to 20");
    	if (bAdaptiveTickets) plugin.ServerCommand("vars.gameModeCounter", sAdaptiveTickets[1]);
    	plugin.ServerCommand("mapList.remove", sMapIndex);
    	plugin.ServerCommand("mapList.add", "MP_Prison", "Domination0", "1", sMapIndex);
    // 24 slots
    } else if (server.PlayerCount >= 14 && server.PlayerCount <= 21) {
    	if (server.MaxPlayers == 24) return false;
    	plugin.PRoConChat("^b^1ServerSlots^0: Change Slots to 31");
    	if (bAdaptiveTickets) plugin.ServerCommand("vars.gameModeCounter", sAdaptiveTickets[2]);
    	plugin.ServerCommand("mapList.remove", sMapIndex);
    	plugin.ServerCommand("mapList.add", "XP7_Valley", "AirSuperiority0", "1", sMapIndex);
    // 32 slots
    } else if (server.PlayerCount >= 22 && server.PlayerCount <= 31) {
    	if (server.MaxPlayers == 32) return false;
    	plugin.PRoConChat("^b^1ServerSlots^0: Change Slots to 32");
    	if (bAdaptiveTickets) plugin.ServerCommand("vars.gameModeCounter", sAdaptiveTickets[3]);
    	plugin.ServerCommand("mapList.remove", sMapIndex);
    	if (iGameMode == 3) plugin.ServerCommand("mapList.add", "MP_Prison", "ConquestSmall0", "1", sMapIndex);
    // 64 slots
    } else if (iGameMode == 3 && server.PlayerCount >= 32 && server.PlayerCount <= 64) {
    	if (server.MaxPlayers == 64) return false;
    	plugin.PRoConChat("^b^1ServerSlots^0: Change Slots to 64");
    	if (bAdaptiveTickets) plugin.ServerCommand("vars.gameModeCounter", sAdaptiveTickets[4]);
    	plugin.ServerCommand("mapList.remove", sMapIndex);
    }
    
    return false;

    SETUP LIMIT#2
    limit_evaluation: OnRoundStart
    limit_first_check: Code
    limit_first_check_code: paste the CODE#2 here

    CODE#2
    Code:
    // set gamemode
    // 1 = rush | 2 = smallcq | 3 = largecq
    int iGameMode = 1;
    
    
    
    /////////////
    // dont edit
    /////////////
    
    String sGamemode = null;
    if (iGameMode == 1) sGamemode = "RushLarge0";
    else if (iGameMode == 2) sGamemode = "ConquestSmall0";
    else if (iGameMode == 3) sGamemode = "ConquestLarge0";
    
    // skip last map with other gamemode and jump to first map
    if (server.NextGamemode != sGamemode) {
    	plugin.ServerCommand("mapList.setNextMapIndex", "0");
    	plugin.PRoConChat("^b^1GamemodeSkip^0:^n " + plugin.FriendlyMapName(server.NextMapFileName) + " (" + plugin.FriendlyModeName(server.NextGamemode) + ") and load first map");
    }
    
    return false;

    Only for server with xVotemap

    SETUP LIMIT#3
    limit_evaluation: OnRoundOver
    limit_first_check: Code
    limit_first_check_code: paste the CODE#3 here

    CODE#3
    Code:
    // set gamemode
    // 1 = rush | 2 = smallcq | 3 = largecq
    int iGameMode = 1;
    
    
    
    /////////////
    // dont edit
    /////////////
    
    String sGamemode = null;
    if (iGameMode == 1) sGamemode = "RushLarge0";
    else if (iGameMode == 2) sGamemode = "ConquestSmall0";
    else if (iGameMode == 3) sGamemode = "ConquestLarge0";
    
    if (server.NextGamemode != sGamemode) {
    	plugin.ServerCommand("mapList.setNextMapIndex", "0");
    	plugin.PRoConChat("^b^1GamemodeSkip^0:^n " + plugin.FriendlyMapName(server.NextMapFileName) + " (" + plugin.FriendlyModeName(server.NextGamemode) + ") and load first map");
    }
    
    return false;

    --------------------------------------------
    v1.0 (27-04-2017)
    - original version
    Last edited by Grovax; 05-05-2017 at 22:26.

  2. #2
    Why are you adding the maps and how can I make the plugin work, without adding your/the map!

    Edit: Ah okay... I see... it's a workaround!
    You should have mentioned it!
    But very nice! Goood bypass!
    Danke!
    Last edited by Causality85; 02-06-2017 at 03:57.

  3. #3
    Heey i wan't code for block All explosives from locker-Metro
    NOT WARNNING OR KILLING OR KICK
    PLEASE I NEED THIS CODE


    String kCounter = "_TreatAsOne_Count";
    TimeSpan time = TimeSpan.FromSeconds(3);
    // Activations within 3 seconds count as 1

    int warnings = 0;
    if (server.Data.issetInt(kCounter)) warnings = server.Data.getInt(kCounter);

    if (warnings < 6) {
    server.Data.setInt(kCounter, warnings+1);
    return false;
    }

    String msg = "none";
    if (warnings == 6) { // First warning message
    msg = plugin.R("We have a no explosive rule here %k_n%! You have over 5 kills with the %w_n%!");
    plugin.SendGlobalMessage(msg);
    plugin.PRoConChat("Insane Limits > " + msg);
    server.Data.setInt(kCounter, warnings+1);
    return false;
    }

    if (limit.Activations(killer.Name, time) > 1) return false;

    if (warnings == 7) {
    server.Data.setInt(kCounter, warnings+1);
    return false;
    }

    if (warnings == 8) { // Second warning message, yell
    msg = plugin.R("FINAL WARNING %k_n%! You are SPAMMING the %w_n%!");
    plugin.ServerCommand("admin.say", msg, "player", killer. Name);
    plugin.ServerCommand("admin.yell", msg, "15", "player", killer. Name);
    plugin.PRoConChat("Insane Limits yells at " + killer.Name + "> " + msg);
    }

    if (warnings == 9) { // Killing player with warning message
    msg = plugin.R("Killing %k_n% for ignoring warnings and spamming with %w_n%!");
    plugin.SendGlobalMessage(msg);
    plugin.PRoConChat("Insane Limits > " + msg);
    plugin.KillPlayer(killer.Name, 1);
    }else if (warnings >= 10) { // Kicking player with warning message
    msg = plugin.R("Kicking %k_n% for ignoring warnings and spamming with %w_n%!");
    plugin.SendGlobalMessage(msg);
    plugin.PRoConChat("Insane Limits > " + msg);
    plugin.KickPlayerWithMessage(killer.Name, msg);
    }
    server.Data.setInt(kCounter, warnings+1);
    return false;

  4. #4
    Community Contributor
    Join Date
    Nov 2011
    Posts
    2,970
    Ask in the Insane Limits request thread; not here.

 

 

Posting Permissions

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