Raised This Month: $32 Target: $400
 8% 

[L4D2] Random / Next Map [v1.1 | 8 May 2021]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
pan0s
Senior Member
Join Date: Nov 2017
Plugin ID:
7628
Plugin Version:
1.1
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 05-03-2021 , 19:46   [L4D2] Random / Next Map [v1.1 | 8 May 2021]
    Reply With Quote #1

    Description:
    It is a very simple plugin for changing random /next map when the end of the finale chapter.
    Notice: You can add maps into the source only, no .txt/.cfg map list provided for editing.

    Update Log:
    Code:
    v1.1 (8 May 2021)
    - Added repeating random maps detection - Added random custom/official or both of custom/official maps
    v1.0 (4 May 2021)
    - Initialize plugin
    Admin commands
    • Type !rm to change a random map immediately.
    • Type !nm to change a next map immediately. (on the finale chapter only, if not, it will use a random map.)

    ConVars:
    PHP Code:
    // This file was auto-generated by SourceMod (v1.11.0.6675)
    // ConVars for plugin "l4d2_nextmap.smx"


    // Random map including official maps?
    // 0=Off, 1=On
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    14d2_random_offical_on "1"

    // How many random maps changed, then allow repeating changed maps?
    // 0=Never until all map changed once
    // -
    // Default: "0"
    // Minimum: "0.000000"
    l4d2_custom_random_repeat_num "0"

    // How many seconds does it wait for the changing map after finale win?
    // -
    // Default: "5.0"
    // Minimum: "0.000000"
    l4d2_maps_delay "5.0"

    // Next map is random?
    // 0=Off, 1=On
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_maps_random_on "1"

    // L4D2 auto change next map version
    // -
    // Default: "v1.1"
    l4d2_maps_version "v1.1"

    // Random map including custom maps?
    // 0=Off, 1=On
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_random_custom_on "1" 
    Notice:
    If you found anybugs, please feel free to let me know.

    Pre-Installation:
    Nope.

    Installation:
    unzip .zip to sourcemod directory.

    Translations:
    Only en, chi, zho
    Attached Files
    File Type: zip l4d2_nextmap_v1.1.zip (19.2 KB, 1084 views)
    __________________

    Last edited by pan0s; 03-24-2022 at 08:29.
    pan0s is offline
    mikaelangelis
    Senior Member
    Join Date: Oct 2017
    Old 05-06-2021 , 01:52   Re: [L4D2] Random / Next Map [v1.0 | 4 Map 2021]
    Reply With Quote #2

    does it apply custom maps?
    mikaelangelis is offline
    pan0s
    Senior Member
    Join Date: Nov 2017
    Old 05-07-2021 , 19:28   Re: [L4D2] Random / Next Map [v1.0 | 4 Map 2021]
    Reply With Quote #3

    Quote:
    Originally Posted by mikaelangelis View Post
    does it apply custom maps?
    Yes, it does.
    pan0s is offline
    ajaixal11
    Junior Member
    Join Date: Jan 2020
    Old 06-27-2021 , 00:15   Re: [L4D2] Random / Next Map [v1.1 | 8 May 2021]
    Reply With Quote #4

    excuse me, how do i edit custom map in 1 chapter? like this Map
    ajaixal11 is offline
    kissdjmax
    Junior Member
    Join Date: May 2013
    Old 07-05-2021 , 04:17   Re: [L4D2] Random / Next Map [v1.1 | 8 May 2021]
    Reply With Quote #5

    Can Versus be used?
    kissdjmax is offline
    Deadpool69
    Junior Member
    Join Date: Jul 2015
    Old 07-19-2021 , 01:49   Re: [L4D2] Random / Next Map [v1.1 | 8 May 2021]
    Reply With Quote #6

    I tried to add my own custom maps to the .sp file, but when I compiled it, the maps wouldn't load even though I added their names to the translation file.

    Here's the list of my edited .sp file, and also my .cfg file. I only edited the maps section of the .sp file, nothing else.

    .SP
    Code:
    #pragma semicolon 1
    #pragma newdecls required
    #include <sourcemod>
    #include <sdktools>
    #include <pan0s>
    
    #define CVAR_FLAGS			FCVAR_NOTIFY
    #define VERSION             "v1.1"
    
    enum
    {
        MAP_PREV,
        MAP_NEXT,
    }
    
    // Official map codes list
    char g_sMaps[][][] =
    {
        //prev, next
    	//{"c1m1_hotel","c8m1_apartment",},
    	//{"c2m1_highway","c9m1_alleys",},
    	//{"c3m1_plankcountry","c10m1_caves",},
    	//{"c4m1_milltown_a","c11m1_greenhouse",},
    	//{"c5m1_waterfront","c12m1_hilltop",},
    	//{"c6m1_riverbank","c13m1_alpinecreek",},
    	//{"c7m1_docks","c14m1_junkyard",},
    	
    	//Best classical maps	
    	{"l4d2_stadium1_apartment","l4d2_ff01_woods",},
    	{"l4d2_daybreak01_hotel","l4d_deathaboard01_prison",},
    	{"beldurra2_1","saltwell_1_d",},
    	{"wth_1","uz_crash",},
    	{"de01_sewersde2","ec01_outlets",},
    	{"l4d_ihm01_forest","dm1_suburbs",},
    	{"redemptionII-deadstop","hotel01_market_two",},
    	{"l4d2_scream01_yards","highway01_apt_20130613",},
    	{"l4d_149_1","cdta_01detour",},
    	{"AirCrash","esc_jailbreak",},
    	{"m1_beach","lc_museum_hall25",},
    	{"the_return_lvl1","l4d_thewoods2_21",},
    	{"l4d_military_history_house","l4d_MIC2_TrapmentD",},
    	{"l4d2_motamap_m1","l4d2_deadcity01_riverside",},
    	{"desperate_houseway","Dead_Series1",},
    	{"l4d2_ic_1_city","l4d2_ic_2_1",},
    	{"l4d_damit01_orchard","damitdc1",},
    	{"uf1_boulevard","unsdwn_mp_1",},
    	{"bhm1_outskirts","x1m1_cliffs",},
    	{"l4d2_tgtn01_fridayroad","BadHoodL1",},
    	{"l4d2_downtowndine01","cwm1_intro",},
    	{"l4dblackoutbasement1","grmap1",},
    	{"lost01_club","l4d_dbde_citylights",},
    
    	//Best newer maps    //{"appartments","c2m1_undark","c3m1_rurallighthouse","l4d2_roadtonowhere_route01","l4d2_morgan_road","p84m1_apartment","bjrtcre_m1","mayuns_1","hpmap1","otosotr_m1","bt1","RichardsWorking_Map","hiking_trails","rw_beach1","l4d_greyscale_01_street","ddntr1_01urban","l4d2_deathwoods01_stranded","l4d_deadgetaway01_dam","ds2_1","shopcenter","dw_woods","l4d2_kmaps_ravine","deadbeat01_forest","claustrophobia1","l4d_coldfear01_smallforest","l4d_coaldBlood01","2ee_01","l4d_cardiff",},
    
    	// Average maps	//{"l4d2_draxmap1","l4d_draxmap0","wildride01","tripday_m1","TheCure001","bjrtc2_lvl1","rh_map01","l4d2_deadflagblues01_city","l4d2_feetunder_outpostazbo","l4d_priston01","1BM","l4d2-DisposalFacility","l4d2_base_east","Underground3","pt_home1","l4d2_planb1_v051","fox_river","nt01_mansion","l4d_auburn","d1c1","gr-mapone-7","outline_m1","l4d_lastnight01_arrival","dead_death_02","l4d_cuirmeat01","alleys1","getout","The Apartments","Return_Home","versus_1","l4d2_fallindeath01","l4d2_eft1_subsystem","l4d2_diescraper1_apartment_36","01_Derailed","canyondownthedrain","l4d2_camp_dead","l4d2_tunnel","l4d_deathrow01_streetstlm","l4d_redsea01_roofs","l4d_bureaux","route_to_city_vs1","apartment","patientscab","l4d2_darkblood01_tanker","lst_l4dmap_a","l4d_co_canal","cotd01_apartments","l4d_ccritical01csd","bloodtracks_01","bdp_bunker01","Las","youcallthatalanding","carnage_jail",},
    	
    	//A series of maps
    	//{"beginninghours_m1_shipv2","Frozen_m1_streets","neverendingwar_train","kickedout_m1_subway","lasthours_m1_alleys","revenge_m1_office_new",},
    	
    	// Maps with lots of water
    	{"c1m1_outerbayous_a","death_sentence_1",},
    	{"dayofthedead1","NewRise",},
    	{"redtide_01_alleyways","riptide_map1_final",},
    	
    	//Mashups
    	//{"amsterdam1etd","citystreets1ewc","Hideout01_v5etd","soi_m1_metrostation","l4d2_route66",},
    	
    	// Short maps	//{"m1_village","the_tunnels","building","gasfever_1","ddg1_tower_v2_1","tlv01_city","l4d_suburb01_school","l4d2_sbtd_01","campanar_coop_vs","l4d_noe1","l4d_sc_market","cbm1_lake","l4d_hopedb_gorge01","l4d_5tolife01",},
    
    	// Halloween maps
    	//{"castle_map_01","l4d_tbm_1","hf01_theforest","grave_yard",},
    	
    	// Christmas Maps
    	//{"c30m1","wow_map1","l4d_zero01_south","azhill1","Signal_Broken",},
    	
    	// Asian maps
    	{"l4d_yama_1","1_m1",},
    	{"beta_thecity1","msd1_town",},
    	{"l4c2_wall","ch_map1_city",},
    	{"port_01","l4d2_wanli01",},
    	{"bp_mapalpha1","WaterCity",},
    
    	// Latin/Euro maps
    	{"bsas_m1_barrios","srocchurch",},
    	{"l4d_viennacalling2_1","eu01_residential_b16",},
    	{"venissia","m1_fabbrecce",},
    
    	// Half-Life maps
    	{"l4d2_trainstation_01","l4d2_canals_01",},
    	{"l4d2_canals_07","l4d_ravenholm01_blackmesa",},
    	{"l4d2_ravenholmwar_1","backtoravenholm_v4_01",},
    	{"l4d2_coast_01","l4d2_city17_01",},
    	{"wfp1_track","omf_01",},
    	
    	// Modded official maps
    	//{"dcr_m1_hotel","dkr_m1_motel",},
    	//{"dprm1_milltown_a","c5m1_darkwaterfront",},
    	//{"c8m1_apartment_daytime","l4d2_hospital01_apartment",},
    	//{"ft_m1_apartments","Ulice","l4d_reverse_hos01_rooftop",},
    	//{"c9m1_alleys_daytime","l4d2_garage01_alleys_a","Alejki",},
    	//{"l4d2_smalltownday01_caves","l4d2_smalltown01_caves",},
    	//{"l4d2_DeathToll01_clam","Tunel",},
    	//{"c11m1_greenhouse_day","l4d2_airport01_greenhouse",},
    	//{"l4d_farm01_hilltop_day","l4d2_farm01_hilltop","l4d_farm05_cornfield_revbh",},
    	//{"csm1_beta_alpinecreek","c14m1_day_junkyard",},
    	//{"phantasmagoria01","r_concert",},
    };      
    
    // ConVar
    ConVar cvar_random_on;
    ConVar cvar_delay;
    ConVar cvar_random_official_on;
    ConVar cvar_random_custom_on;
    ConVar cvar_random_repeat_num;
    
    ArrayList g_listMap;
    
    int g_iStart;
    int g_iEnd;
    int g_iMapSize;
    public Plugin myinfo =
    {
    	name = "L4D2 Next Map",
    	description = "When the end of finale chapter, map will be changed automatically.",
    	author = "pan0s",
    	version = "1.1",
    	url = ""
    };
    
    public void OnPluginStart()
    {
        LoadTranslations("l4d2_nextmap.phrases");
        
        RegAdminCmd("sm_rm", HandleCmdRm, ADMFLAG_KICK);
        RegAdminCmd("sm_nm", HandleCmdNm, ADMFLAG_KICK);
    
        CreateConVar("l4d2_maps_version", VERSION, "L4D2 auto change next map version", CVAR_FLAGS);
        cvar_delay = CreateConVar("l4d2_maps_delay", "5.0", "How many seconds does it wait for the changing map after finale win?", CVAR_FLAGS, true, 0.0);
    
        cvar_random_on = CreateConVar("l4d2_maps_random_on", "1", "Next map is random?\n0=Off, 1=On", CVAR_FLAGS, true, 0.0, true, 1.0);
        cvar_random_official_on = CreateConVar("14d2_random_official_on", "1", "Random map including official maps?\n0=Off, 1=On", CVAR_FLAGS, true, 0.0, true, 1.0);
        cvar_random_custom_on = CreateConVar("l4d2_random_custom_on", "1", "Random map including custom maps?\n0=Off, 1=On", CVAR_FLAGS, true, 0.0, true, 1.0);
        cvar_random_repeat_num = CreateConVar("l4d2_custom_random_repeat_num", "0", "How many random maps changed, then allow repeating changed maps?\n0=Never until all map changed once", CVAR_FLAGS, true, 0.0);
    
    
        HookEvent("finale_win", Event_FinaleWin);
    
        AutoExecConfig(true, "l4d2_nextmap");
    
        g_listMap = new ArrayList();
    
        g_iStart = 0;
        if(!cvar_random_official_on.BoolValue && sizeof(g_sMaps)>14) g_iEnd = 14;
        g_iEnd = sizeof(g_sMaps) -1;
        if(!cvar_random_custom_on.BoolValue) g_iEnd = 13;
        g_iMapSize = (g_iEnd + 1 - g_iStart);
    }
    
    public void OnMapStart()
    {
        char map[32];
        GetCurrentMap(map, sizeof(map));
        int mapId = FindMapId(map, MAP_NEXT);
    
        // push current map to map list
        if(mapId != -1)
        {
            int repeatNum = cvar_random_repeat_num.IntValue;
            if(g_listMap.Length +1 >= g_iMapSize || repeatNum > 0 && g_listMap.Length +1 >=repeatNum) g_listMap.Clear();
            g_listMap.Push(mapId);
            // PrintToServer("================MAP: %d, SIZE:%d================", mapId, g_listMap.Length);
        }
    }
    
    public int FilterRandMap()
    {
        int next = GetRandomInt(g_iStart, g_iEnd);
    
        bool isSucceed;
        while(g_listMap.Length > 0)
        {
            for(int i = 0; i < g_listMap.Length; i++)
            {
                int map = g_listMap.Get(i);
                if(map == next)
                {
                    next = GetRandomInt(g_iStart, g_iEnd);
                    break;
                }
                if(i == g_listMap.Length-1) isSucceed = true;
            }
            if(isSucceed) return next;
        }
        return next;
    }
    
    public void GetRandMap(char[] buffer)
    {
        // CPrintToChatAll("%d/%d, L:%d, mapsize:%d", g_iStart, g_iEnd, g_listMap.Length, g_iMapSize);
        int next = FilterRandMap();
        Format(buffer, 32, "%s", g_sMaps[next][1]);
    }
    
    public int FindMapId(const char[] map, const int type)
    {
        int x = 0;
    
        for(int i=0; i<sizeof(g_sMaps); i++)
        {
            x = i;
            if(StrEqual(map, g_sMaps[i][type])) break;
            if(x == sizeof(g_sMaps) - 1) x = -1; // Next map not found
        }
        return x;
    }
    
    public void GetNextMapEx(char[] buffer, bool isForceRand)
    {
        if(isForceRand || cvar_random_on.BoolValue) GetRandMap(buffer);
        else
        {
            char map[32];
            GetCurrentMap(map, sizeof(map));
            int mapId = FindMapId(map, MAP_PREV);
            
            if(mapId == -1)
            {
                GetRandMap(buffer);
                return;
            }
            Format(buffer, 32, "%s", g_sMaps[mapId][1]);
        }
    }
    
    void Next(bool isForceRand = false)
    {
        char map[32];
        GetNextMapEx(map, isForceRand);
        float delay = cvar_delay.FloatValue;
    
        for(int i=1; i<= MaxClients; i++)
        {
            if(!IsValidClient(i)) continue;
    
            char translated[64];
            if(TranslationPhraseExists(map)) Format(translated, sizeof(translated), "%T", map, i);
            else Format(translated, sizeof(translated), "%s", map, i);
            CPrintToChat(i, "%T%T", "SYSTEM", i, "COMPLETED_FINALE", i, translated, delay);
        }
    
        DataPack pack = CreateDataPack();
        pack.WriteString(map);
        CreateTimer(delay, HandleTimerNextMap, pack);
    }
    
    public Action Event_FinaleWin(Event event, char[] name, bool dontBroadcast)
    {
        Next();
    }
    
    public Action HandleCmdRm(int client, int args)
    {
    	Next(true);
    }
    
    public Action HandleCmdNm(int client, int args)
    {
    	Next();
    }
    
    public Action HandleTimerNextMap(Handle timer, DataPack pack)
    {
        pack.Reset();
        char map[32];
        pack.ReadString(map, sizeof(map));
        ServerCommand("changelevel %s", map);
        delete pack;
    }
    .CFG
    Code:
    // This file was auto-generated by SourceMod (v1.10.0.6499)
    // ConVars for plugin "l4d2_nextmap.smx"
    
    
    // Random map including official maps?
    // 0=Off, 1=On
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    14d2_random_official_on "1"
    
    // How many random maps changed, then allow repeating changed maps?
    // 0=Never until all map changed once
    // -
    // Default: "0"
    // Minimum: "0.000000"
    l4d2_custom_random_repeat_num "0"
    
    // How many seconds does it wait for the changing map after finale win?
    // -
    // Default: "5.0"
    // Minimum: "0.000000"
    l4d2_maps_delay "2.5"
    
    // Next map is random?
    // 0=Off, 1=On
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_maps_random_on "1"
    
    // L4D2 auto change next map version
    // -
    // Default: "v1.1"
    l4d2_maps_version "v1.1"
    
    // Random map including custom maps?
    // 0=Off, 1=On
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_random_custom_on "1"
    Deadpool69 is offline
    pan0s
    Senior Member
    Join Date: Nov 2017
    Old 07-24-2021 , 06:04   Re: [L4D2] Random / Next Map [v1.1 | 8 May 2021]
    Reply With Quote #7

    Quote:
    Originally Posted by Deadpool69 View Post
    I tried to add my own custom maps to the .sp file, but when I compiled it, the maps wouldn't load even though I added their names to the translation file.

    Here's the list of my edited .sp file, and also my .cfg file. I only edited the maps section of the .sp file, nothing else.

    .SP
    Code:
    #pragma semicolon 1
    #pragma newdecls required
    #include <sourcemod>
    #include <sdktools>
    #include <pan0s>
    
    #define CVAR_FLAGS			FCVAR_NOTIFY
    #define VERSION             "v1.1"
    
    enum
    {
        MAP_PREV,
        MAP_NEXT,
    }
    
    // Official map codes list
    char g_sMaps[][][] =
    {
        //prev, next
    	//{"c1m1_hotel","c8m1_apartment",},
    	//{"c2m1_highway","c9m1_alleys",},
    	//{"c3m1_plankcountry","c10m1_caves",},
    	//{"c4m1_milltown_a","c11m1_greenhouse",},
    	//{"c5m1_waterfront","c12m1_hilltop",},
    	//{"c6m1_riverbank","c13m1_alpinecreek",},
    	//{"c7m1_docks","c14m1_junkyard",},
    	
    	//Best classical maps	
    	{"l4d2_stadium1_apartment","l4d2_ff01_woods",},
    	{"l4d2_daybreak01_hotel","l4d_deathaboard01_prison",},
    	{"beldurra2_1","saltwell_1_d",},
    	{"wth_1","uz_crash",},
    	{"de01_sewersde2","ec01_outlets",},
    	{"l4d_ihm01_forest","dm1_suburbs",},
    	{"redemptionII-deadstop","hotel01_market_two",},
    	{"l4d2_scream01_yards","highway01_apt_20130613",},
    	{"l4d_149_1","cdta_01detour",},
    	{"AirCrash","esc_jailbreak",},
    	{"m1_beach","lc_museum_hall25",},
    	{"the_return_lvl1","l4d_thewoods2_21",},
    	{"l4d_military_history_house","l4d_MIC2_TrapmentD",},
    	{"l4d2_motamap_m1","l4d2_deadcity01_riverside",},
    	{"desperate_houseway","Dead_Series1",},
    	{"l4d2_ic_1_city","l4d2_ic_2_1",},
    	{"l4d_damit01_orchard","damitdc1",},
    	{"uf1_boulevard","unsdwn_mp_1",},
    	{"bhm1_outskirts","x1m1_cliffs",},
    	{"l4d2_tgtn01_fridayroad","BadHoodL1",},
    	{"l4d2_downtowndine01","cwm1_intro",},
    	{"l4dblackoutbasement1","grmap1",},
    	{"lost01_club","l4d_dbde_citylights",},
    
    	//Best newer maps    //{"appartments","c2m1_undark","c3m1_rurallighthouse","l4d2_roadtonowhere_route01","l4d2_morgan_road","p84m1_apartment","bjrtcre_m1","mayuns_1","hpmap1","otosotr_m1","bt1","RichardsWorking_Map","hiking_trails","rw_beach1","l4d_greyscale_01_street","ddntr1_01urban","l4d2_deathwoods01_stranded","l4d_deadgetaway01_dam","ds2_1","shopcenter","dw_woods","l4d2_kmaps_ravine","deadbeat01_forest","claustrophobia1","l4d_coldfear01_smallforest","l4d_coaldBlood01","2ee_01","l4d_cardiff",},
    
    	// Average maps	//{"l4d2_draxmap1","l4d_draxmap0","wildride01","tripday_m1","TheCure001","bjrtc2_lvl1","rh_map01","l4d2_deadflagblues01_city","l4d2_feetunder_outpostazbo","l4d_priston01","1BM","l4d2-DisposalFacility","l4d2_base_east","Underground3","pt_home1","l4d2_planb1_v051","fox_river","nt01_mansion","l4d_auburn","d1c1","gr-mapone-7","outline_m1","l4d_lastnight01_arrival","dead_death_02","l4d_cuirmeat01","alleys1","getout","The Apartments","Return_Home","versus_1","l4d2_fallindeath01","l4d2_eft1_subsystem","l4d2_diescraper1_apartment_36","01_Derailed","canyondownthedrain","l4d2_camp_dead","l4d2_tunnel","l4d_deathrow01_streetstlm","l4d_redsea01_roofs","l4d_bureaux","route_to_city_vs1","apartment","patientscab","l4d2_darkblood01_tanker","lst_l4dmap_a","l4d_co_canal","cotd01_apartments","l4d_ccritical01csd","bloodtracks_01","bdp_bunker01","Las","youcallthatalanding","carnage_jail",},
    	
    	//A series of maps
    	//{"beginninghours_m1_shipv2","Frozen_m1_streets","neverendingwar_train","kickedout_m1_subway","lasthours_m1_alleys","revenge_m1_office_new",},
    	
    	// Maps with lots of water
    	{"c1m1_outerbayous_a","death_sentence_1",},
    	{"dayofthedead1","NewRise",},
    	{"redtide_01_alleyways","riptide_map1_final",},
    	
    	//Mashups
    	//{"amsterdam1etd","citystreets1ewc","Hideout01_v5etd","soi_m1_metrostation","l4d2_route66",},
    	
    	// Short maps	//{"m1_village","the_tunnels","building","gasfever_1","ddg1_tower_v2_1","tlv01_city","l4d_suburb01_school","l4d2_sbtd_01","campanar_coop_vs","l4d_noe1","l4d_sc_market","cbm1_lake","l4d_hopedb_gorge01","l4d_5tolife01",},
    
    	// Halloween maps
    	//{"castle_map_01","l4d_tbm_1","hf01_theforest","grave_yard",},
    	
    	// Christmas Maps
    	//{"c30m1","wow_map1","l4d_zero01_south","azhill1","Signal_Broken",},
    	
    	// Asian maps
    	{"l4d_yama_1","1_m1",},
    	{"beta_thecity1","msd1_town",},
    	{"l4c2_wall","ch_map1_city",},
    	{"port_01","l4d2_wanli01",},
    	{"bp_mapalpha1","WaterCity",},
    
    	// Latin/Euro maps
    	{"bsas_m1_barrios","srocchurch",},
    	{"l4d_viennacalling2_1","eu01_residential_b16",},
    	{"venissia","m1_fabbrecce",},
    
    	// Half-Life maps
    	{"l4d2_trainstation_01","l4d2_canals_01",},
    	{"l4d2_canals_07","l4d_ravenholm01_blackmesa",},
    	{"l4d2_ravenholmwar_1","backtoravenholm_v4_01",},
    	{"l4d2_coast_01","l4d2_city17_01",},
    	{"wfp1_track","omf_01",},
    	
    	// Modded official maps
    	//{"dcr_m1_hotel","dkr_m1_motel",},
    	//{"dprm1_milltown_a","c5m1_darkwaterfront",},
    	//{"c8m1_apartment_daytime","l4d2_hospital01_apartment",},
    	//{"ft_m1_apartments","Ulice","l4d_reverse_hos01_rooftop",},
    	//{"c9m1_alleys_daytime","l4d2_garage01_alleys_a","Alejki",},
    	//{"l4d2_smalltownday01_caves","l4d2_smalltown01_caves",},
    	//{"l4d2_DeathToll01_clam","Tunel",},
    	//{"c11m1_greenhouse_day","l4d2_airport01_greenhouse",},
    	//{"l4d_farm01_hilltop_day","l4d2_farm01_hilltop","l4d_farm05_cornfield_revbh",},
    	//{"csm1_beta_alpinecreek","c14m1_day_junkyard",},
    	//{"phantasmagoria01","r_concert",},
    };      
    
    // ConVar
    ConVar cvar_random_on;
    ConVar cvar_delay;
    ConVar cvar_random_official_on;
    ConVar cvar_random_custom_on;
    ConVar cvar_random_repeat_num;
    
    ArrayList g_listMap;
    
    int g_iStart;
    int g_iEnd;
    int g_iMapSize;
    public Plugin myinfo =
    {
    	name = "L4D2 Next Map",
    	description = "When the end of finale chapter, map will be changed automatically.",
    	author = "pan0s",
    	version = "1.1",
    	url = ""
    };
    
    public void OnPluginStart()
    {
        LoadTranslations("l4d2_nextmap.phrases");
        
        RegAdminCmd("sm_rm", HandleCmdRm, ADMFLAG_KICK);
        RegAdminCmd("sm_nm", HandleCmdNm, ADMFLAG_KICK);
    
        CreateConVar("l4d2_maps_version", VERSION, "L4D2 auto change next map version", CVAR_FLAGS);
        cvar_delay = CreateConVar("l4d2_maps_delay", "5.0", "How many seconds does it wait for the changing map after finale win?", CVAR_FLAGS, true, 0.0);
    
        cvar_random_on = CreateConVar("l4d2_maps_random_on", "1", "Next map is random?\n0=Off, 1=On", CVAR_FLAGS, true, 0.0, true, 1.0);
        cvar_random_official_on = CreateConVar("14d2_random_official_on", "1", "Random map including official maps?\n0=Off, 1=On", CVAR_FLAGS, true, 0.0, true, 1.0);
        cvar_random_custom_on = CreateConVar("l4d2_random_custom_on", "1", "Random map including custom maps?\n0=Off, 1=On", CVAR_FLAGS, true, 0.0, true, 1.0);
        cvar_random_repeat_num = CreateConVar("l4d2_custom_random_repeat_num", "0", "How many random maps changed, then allow repeating changed maps?\n0=Never until all map changed once", CVAR_FLAGS, true, 0.0);
    
    
        HookEvent("finale_win", Event_FinaleWin);
    
        AutoExecConfig(true, "l4d2_nextmap");
    
        g_listMap = new ArrayList();
    
        g_iStart = 0;
        if(!cvar_random_official_on.BoolValue && sizeof(g_sMaps)>14) g_iEnd = 14;
        g_iEnd = sizeof(g_sMaps) -1;
        if(!cvar_random_custom_on.BoolValue) g_iEnd = 13;
        g_iMapSize = (g_iEnd + 1 - g_iStart);
    }
    
    public void OnMapStart()
    {
        char map[32];
        GetCurrentMap(map, sizeof(map));
        int mapId = FindMapId(map, MAP_NEXT);
    
        // push current map to map list
        if(mapId != -1)
        {
            int repeatNum = cvar_random_repeat_num.IntValue;
            if(g_listMap.Length +1 >= g_iMapSize || repeatNum > 0 && g_listMap.Length +1 >=repeatNum) g_listMap.Clear();
            g_listMap.Push(mapId);
            // PrintToServer("================MAP: %d, SIZE:%d================", mapId, g_listMap.Length);
        }
    }
    
    public int FilterRandMap()
    {
        int next = GetRandomInt(g_iStart, g_iEnd);
    
        bool isSucceed;
        while(g_listMap.Length > 0)
        {
            for(int i = 0; i < g_listMap.Length; i++)
            {
                int map = g_listMap.Get(i);
                if(map == next)
                {
                    next = GetRandomInt(g_iStart, g_iEnd);
                    break;
                }
                if(i == g_listMap.Length-1) isSucceed = true;
            }
            if(isSucceed) return next;
        }
        return next;
    }
    
    public void GetRandMap(char[] buffer)
    {
        // CPrintToChatAll("%d/%d, L:%d, mapsize:%d", g_iStart, g_iEnd, g_listMap.Length, g_iMapSize);
        int next = FilterRandMap();
        Format(buffer, 32, "%s", g_sMaps[next][1]);
    }
    
    public int FindMapId(const char[] map, const int type)
    {
        int x = 0;
    
        for(int i=0; i<sizeof(g_sMaps); i++)
        {
            x = i;
            if(StrEqual(map, g_sMaps[i][type])) break;
            if(x == sizeof(g_sMaps) - 1) x = -1; // Next map not found
        }
        return x;
    }
    
    public void GetNextMapEx(char[] buffer, bool isForceRand)
    {
        if(isForceRand || cvar_random_on.BoolValue) GetRandMap(buffer);
        else
        {
            char map[32];
            GetCurrentMap(map, sizeof(map));
            int mapId = FindMapId(map, MAP_PREV);
            
            if(mapId == -1)
            {
                GetRandMap(buffer);
                return;
            }
            Format(buffer, 32, "%s", g_sMaps[mapId][1]);
        }
    }
    
    void Next(bool isForceRand = false)
    {
        char map[32];
        GetNextMapEx(map, isForceRand);
        float delay = cvar_delay.FloatValue;
    
        for(int i=1; i<= MaxClients; i++)
        {
            if(!IsValidClient(i)) continue;
    
            char translated[64];
            if(TranslationPhraseExists(map)) Format(translated, sizeof(translated), "%T", map, i);
            else Format(translated, sizeof(translated), "%s", map, i);
            CPrintToChat(i, "%T%T", "SYSTEM", i, "COMPLETED_FINALE", i, translated, delay);
        }
    
        DataPack pack = CreateDataPack();
        pack.WriteString(map);
        CreateTimer(delay, HandleTimerNextMap, pack);
    }
    
    public Action Event_FinaleWin(Event event, char[] name, bool dontBroadcast)
    {
        Next();
    }
    
    public Action HandleCmdRm(int client, int args)
    {
    	Next(true);
    }
    
    public Action HandleCmdNm(int client, int args)
    {
    	Next();
    }
    
    public Action HandleTimerNextMap(Handle timer, DataPack pack)
    {
        pack.Reset();
        char map[32];
        pack.ReadString(map, sizeof(map));
        ServerCommand("changelevel %s", map);
        delete pack;
    }
    .CFG
    Code:
    // This file was auto-generated by SourceMod (v1.10.0.6499)
    // ConVars for plugin "l4d2_nextmap.smx"
    
    
    // Random map including official maps?
    // 0=Off, 1=On
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    14d2_random_official_on "1"
    
    // How many random maps changed, then allow repeating changed maps?
    // 0=Never until all map changed once
    // -
    // Default: "0"
    // Minimum: "0.000000"
    l4d2_custom_random_repeat_num "0"
    
    // How many seconds does it wait for the changing map after finale win?
    // -
    // Default: "5.0"
    // Minimum: "0.000000"
    l4d2_maps_delay "2.5"
    
    // Next map is random?
    // 0=Off, 1=On
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_maps_random_on "1"
    
    // L4D2 auto change next map version
    // -
    // Default: "v1.1"
    l4d2_maps_version "v1.1"
    
    // Random map including custom maps?
    // 0=Off, 1=On
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_random_custom_on "1"
    You have to use the last chapter map code for the previous map,
    e.g. c1m4_atrium

    else, it can't be detected which is the last chapter.
    pan0s is offline
    Deadpool69
    Junior Member
    Join Date: Jul 2015
    Old 07-29-2021 , 21:24   Re: [L4D2] Random / Next Map [v1.1 | 8 May 2021]
    Reply With Quote #8

    Quote:
    Originally Posted by pan0s View Post
    You have to use the last chapter map code for the previous map,
    e.g. c1m4_atrium

    else, it can't be detected which is the last chapter.
    So I updated the map list in the .sp file like you said, didn't change anything else. I added tumtara, then loaded it and typed `sm_nm` but it still didn't load the next map. It was also randomized both times I used the command.

    Code:
    // Official map codes list
    char g_sMaps[][][] =
    {
        //prev, next
    	//{"c1m1_hotel","c4m1_atrium",},
    	//{"c8m1_apartment","c8m5_rooftop",},
    	//{"c2m1_highway","c2m5_concert",},
    	//{"c9m1_alleys","c9m2_lots",},
    	//{"c3m1_plankcountry","c3m4_plantation",},
    	//{"c10m1_caves","c10m5_houseboat",},
    	//{"c4m1_milltown_a","c4m5_milltown_escape",},
    	//{"c11m1_greenhouse","c11m5_runway",},
    	//{"c5m1_waterfront","c5m5_bridge",},
    	//{"c12m1_hilltop","c12m5_cornfield",},
    	//{"c6m1_riverbank","c6m3_port",},
    	//{"c13m1_alpinecreek","c13m4_cutthroatcreek",},
    	//{"c7m1_docks","c7m3_port",},
    	//{"c14m1_junkyard","c14m2_lighthouse",},
    	
    	//Best classical maps	
    	{"tumtara","l4d2_stadium1_apartment",}, // Suicide Blitz
    	{"l4d2_stadium5_stadium","l4d2_ff01_woods",}, // Fatal Freight
    	{"l4d2_ff05_station","l4d2_daybreak01_hotel",}, // Daybreak
    	{"l4d2_daybreak05_rescue","l4d_deathaboard01_prison",}, // Death Aboard
    	{"l4d_deathaboard05_light","beldurra2_1",}, // Beldurra
    	{"beldurra2_5","saltwell_1_d",}, // Salthell Park
    	{"saltwell_5_d","wth_1",}, // Welcome to Hell
    	{"WTH_5","uz_crash",}, // Undead Zone
    	{"uz_escape","uf1_boulevard",}, // Urban Flight
    	{"uf4_airfield","de01_sewersde2",}, // Dead Echo
    	{"de05_echo_finalede2","ec01_outlets",}, // Energy Crisis
    	{"ec05_quarry","l4d_ihm01_forest",}, // I Hate Mountains
    	{"l4d_ihm05_lakeside","dm1_suburbs",}, // Devil Mountain
    	{"dm5_summit","redemptionII-deadstop",}, // Redemption
    	{"roundhouse","hotel01_market_two",}, // Dead Vacation
    	{"hotel05_rooftop_two","l4d2_scream01_yards",}, // Die Screaming
    	{"l4d2_scream05_finale","highway01_apt_20130613",}, // Highway To Hell
    	{"highway05_afb02_20130820","l4d_149_1",}, // One 4 Nine
    	{"l4d_149_5","cdta_01detour",}, // Detour Ahead
    	{"cdta_05finalroad","AirCrash",}, // Heaven Can Wait
    	{"BombShelter","esc_jailbreak",}, // Escansion
    	{"esc_fly_me_to_the_moon","m1_beach",}, // Death From Above
    	{"m5_station_finale","lc_museum_hall25",}, // The Mortuary
    	{"l4d_mortuary03","the_return_lvl1",}, // The Return
    	{"the_return_lvl5","l4d_thewoods2_21",}, // The Woods
    	{"l4d_thewoods2_25","l4d_military_history_house",}, // A Military History
    	{"l4d_military_history_finalb","l4d_MIC2_TrapmentD",}, // Military Industrial Complex
    	{"l4d_mic2_Inter_Vention","l4d2_motamap_m1",}, // A Dam Mission
    	{"l4d2_motamap_m5","l4d2_deadcity01_riverside",}, // Dead City
    	{"l4d2_deadcity06_station","desperate_houseway",}, // Dead Series Original
    	{"band_of_rushers","Dead_Series1",}, // Dead Series Current
    	{"Dead_Series4","l4d2_ic_1_city",}, // Infected City I
    	{"l4d2_ic_5_Finale","l4d2_ic_2_1",}, // Infected City II
    	{"l4d2_ic2_5","l4d_damit01_orchard",}, // Dam It I
    	{"l4d_damit03_dam","damitdc1",}, // Dam It II
    	{"damitdc4","unsdwn_mp_1",}, // Undead Smackdown
    	{"unsdwn_mp_4","bhm1_outskirts",}, // Left Behind
    	{"bhm4_base","x1m1_cliffs",}, // Open Road 
    	{"x1m5_salvation","l4d2_tgtn01_fridayroad",}, // There Goes The Neighborhood
    	{"ud_map4","BadHoodL1",}, // Bad Neighborhood
    	{"BadHoodL3","l4d2_downtowndine01",}, // Downtown Dine
    	{"l4d2_downtowndine05","cwm1_intro",}, // Carried Off
    	{"cwm4_building","l4dblackoutbasement1",}, // Blackout Basement
    	{"l4dblackoutbasement4","grmap1",}, // Roadkill
    	{"grid4","lost01_club",}, // Lost
    	{"lost02_2","l4d_dbde_citylights",}, // Dead Before Dawn
    
    	//Best newer maps    //{"appartments","c2m1_undark","c3m1_rurallighthouse","l4d2_roadtonowhere_route01","l4d2_morgan_road","p84m1_apartment","bjrtcre_m1","mayuns_1","hpmap1","otosotr_m1","bt1","RichardsWorking_Map","hiking_trails","rw_beach1","l4d_greyscale_01_street","ddntr1_01urban","l4d2_deathwoods01_stranded","l4d_deadgetaway01_dam","ds2_1","shopcenter","dw_woods","l4d2_kmaps_ravine","deadbeat01_forest","claustrophobia1","l4d_coldfear01_smallforest","l4d_coaldBlood01","2ee_01","l4d_cardiff",},
    
    	// Average maps	//{"l4d2_draxmap1","l4d_draxmap0","wildride01","tripday_m1","TheCure001","bjrtc2_lvl1","rh_map01","l4d2_deadflagblues01_city","l4d2_feetunder_outpostazbo","l4d_priston01","1BM","l4d2-DisposalFacility","l4d2_base_east","Underground3","pt_home1","l4d2_planb1_v051","fox_river","nt01_mansion","l4d_auburn","d1c1","gr-mapone-7","outline_m1","l4d_lastnight01_arrival","dead_death_02","l4d_cuirmeat01","alleys1","getout","The Apartments","Return_Home","versus_1","l4d2_fallindeath01","l4d2_eft1_subsystem","l4d2_diescraper1_apartment_36","01_Derailed","canyondownthedrain","l4d2_camp_dead","l4d2_tunnel","l4d_deathrow01_streetstlm","l4d_redsea01_roofs","l4d_bureaux","route_to_city_vs1","apartment","patientscab","l4d2_darkblood01_tanker","lst_l4dmap_a","l4d_co_canal","cotd01_apartments","l4d_ccritical01csd","bloodtracks_01","bdp_bunker01","Las","youcallthatalanding","carnage_jail",},
    	
    	//A series of maps
    	//{"beginninghours_m1_shipv2","Frozen_m1_streets","neverendingwar_train","kickedout_m1_subway","lasthours_m1_alleys","revenge_m1_office_new",},
    	
    	// Maps with lots of water
    	{"l4d_dbdext_new_dawn","c1m1_outerbayous_a",}, // IMPJAW
    	{"c1m5_interstate_10","death_sentence_1",}, // Death Sentence
    	{"death_sentence_5","dayofthedead1",}, // Death Summer
    	{"dayofthedead6","NewRise",}, // Vague Reminders
    	{"NewRiseMapFinale","redtide_01_alleyways",}, // Redtide
    	{"redtide_05_beachfront","riptide_map1_final",}, // Riptide
    	
    	//Mashups
    	//{"amsterdam1etd","citystreets1ewc","Hideout01_v5etd","soi_m1_metrostation","l4d2_route66",},
    	
    	// Short maps	//{"m1_village","the_tunnels","building","gasfever_1","ddg1_tower_v2_1","tlv01_city","l4d_suburb01_school","l4d2_sbtd_01","campanar_coop_vs","l4d_noe1","l4d_sc_market","cbm1_lake","l4d_hopedb_gorge01","l4d_5tolife01",},
    
    	// Halloween maps
    	//{"castle_map_01","l4d_tbm_1","hf01_theforest","grave_yard",},
    	
    	// Christmas Maps
    	//{"c30m1","wow_map1","l4d_zero01_south","azhill1","Signal_Broken",},
    	
    	// Asian maps
    	{"riptide_map4_final","l4d_yama_1",}, // Yama
    	{"l4d_yama_5","1_m1",}, // Zengcheng City
    	{"5_m5","beta_thecity1",}, // Qiuming City
    	{"azcity_end","msd1_town",}, // Farewell Chenming
    	{"msd3_square","l4c2_wall",}, // Left in China
    	{"l4c_shrine","ch_map1_city",}, // True Fangshi
    	{"ch_map3_greatwall","port_01",}, // Dead Destination
    	{"outpost_3","l4d2_wanli01",}, // Wan Li
    
    	// Latin/Euro maps
    	{"l4d2_wanli03","bsas_m1_barrios",}, // Buenos Aires
    	{"bsas_m4_costanera","srocchurch",}, // Warcelona
    	{"mnac","l4d_viennacalling2_1",}, // Vienna Calling
    	{"l4d_viennacalling2_finale","eu01_residential_b16",}, // Tour of Terror
    	{"eu05_train_b16","venissia",}, // Venissia
    	{"xaviere","m1_fabbrecce",}, // Pesaro
    
    	// Half-Life maps
    	{"m5_sanbartolo","l4d2_trainstation_01",}, // The Train Station
    	{"l4d2_trainstation_06","l4d2_canals_01",}, // Route Kanal
    	{"l4d2_canals_06","l4d2_canals_07",}, // Water Hazard
    	{"l4d2_eli_02","l4d2_ravenholmwar_1",}, // Ravenholm V1
    	{"l4d2_ravenholmwar_4","l4d_ravenholm01_blackmesa",}, // Ravenholm V2
    	{"l4d_ravenholm05_docks","backtoravenholm_v4_01",}, // Back to Ravenholm
    	{"backtoravenholm_v4_07","l4d2_coast_01",}, // Highway 17
    	{"l4d2_coast_05","l4d2_city17_01",}, // City 17
    	{"l4d2_city17_05","wfp1_track",}, // White Forest
    	{"wfp4_commstation","omf_01",}, // Our Mutual Fiend
    	
    	// Modded official maps
    	//{"dcr_m1_hotel","dkr_m1_motel",},
    	//{"dprm1_milltown_a","c5m1_darkwaterfront",},
    	//{"c8m1_apartment_daytime","l4d2_hospital01_apartment",},
    	//{"ft_m1_apartments","Ulice","l4d_reverse_hos01_rooftop",},
    	//{"c9m1_alleys_daytime","l4d2_garage01_alleys_a","Alejki",},
    	//{"l4d2_smalltownday01_caves","l4d2_smalltown01_caves",},
    	//{"l4d2_DeathToll01_clam","Tunel",},
    	//{"c11m1_greenhouse_day","l4d2_airport01_greenhouse",},
    	//{"l4d_farm01_hilltop_day","l4d2_farm01_hilltop","l4d_farm05_cornfield_revbh",},
    	//{"csm1_beta_alpinecreek","c14m1_day_junkyard",},
    	//{"phantasmagoria01","r_concert",},
    };
    Deadpool69 is offline
    pan0s
    Senior Member
    Join Date: Nov 2017
    Old 07-30-2021 , 05:08   Re: [L4D2] Random / Next Map [v1.1 | 8 May 2021]
    Reply With Quote #9

    Quote:
    Originally Posted by Deadpool69 View Post
    So I updated the map list in the .sp file like you said, didn't change anything else. I added tumtara, then loaded it and typed `sm_nm` but it still didn't load the next map. It was also randomized both times I used the command.

    Code:
    // Official map codes list
    char g_sMaps[][][] =
    {
        //prev, next
    	//{"c1m1_hotel","c4m1_atrium",},
    	//{"c8m1_apartment","c8m5_rooftop",},
    	//{"c2m1_highway","c2m5_concert",},
    	//{"c9m1_alleys","c9m2_lots",},
    	//{"c3m1_plankcountry","c3m4_plantation",},
    	//{"c10m1_caves","c10m5_houseboat",},
    	//{"c4m1_milltown_a","c4m5_milltown_escape",},
    	//{"c11m1_greenhouse","c11m5_runway",},
    	//{"c5m1_waterfront","c5m5_bridge",},
    	//{"c12m1_hilltop","c12m5_cornfield",},
    	//{"c6m1_riverbank","c6m3_port",},
    	//{"c13m1_alpinecreek","c13m4_cutthroatcreek",},
    	//{"c7m1_docks","c7m3_port",},
    	//{"c14m1_junkyard","c14m2_lighthouse",},
    	
    	//Best classical maps	
    	{"tumtara","l4d2_stadium1_apartment",}, // Suicide Blitz
    	{"l4d2_stadium5_stadium","l4d2_ff01_woods",}, // Fatal Freight
    	{"l4d2_ff05_station","l4d2_daybreak01_hotel",}, // Daybreak
    	{"l4d2_daybreak05_rescue","l4d_deathaboard01_prison",}, // Death Aboard
    	{"l4d_deathaboard05_light","beldurra2_1",}, // Beldurra
    	{"beldurra2_5","saltwell_1_d",}, // Salthell Park
    	{"saltwell_5_d","wth_1",}, // Welcome to Hell
    	{"WTH_5","uz_crash",}, // Undead Zone
    	{"uz_escape","uf1_boulevard",}, // Urban Flight
    	{"uf4_airfield","de01_sewersde2",}, // Dead Echo
    	{"de05_echo_finalede2","ec01_outlets",}, // Energy Crisis
    	{"ec05_quarry","l4d_ihm01_forest",}, // I Hate Mountains
    	{"l4d_ihm05_lakeside","dm1_suburbs",}, // Devil Mountain
    	{"dm5_summit","redemptionII-deadstop",}, // Redemption
    	{"roundhouse","hotel01_market_two",}, // Dead Vacation
    	{"hotel05_rooftop_two","l4d2_scream01_yards",}, // Die Screaming
    	{"l4d2_scream05_finale","highway01_apt_20130613",}, // Highway To Hell
    	{"highway05_afb02_20130820","l4d_149_1",}, // One 4 Nine
    	{"l4d_149_5","cdta_01detour",}, // Detour Ahead
    	{"cdta_05finalroad","AirCrash",}, // Heaven Can Wait
    	{"BombShelter","esc_jailbreak",}, // Escansion
    	{"esc_fly_me_to_the_moon","m1_beach",}, // Death From Above
    	{"m5_station_finale","lc_museum_hall25",}, // The Mortuary
    	{"l4d_mortuary03","the_return_lvl1",}, // The Return
    	{"the_return_lvl5","l4d_thewoods2_21",}, // The Woods
    	{"l4d_thewoods2_25","l4d_military_history_house",}, // A Military History
    	{"l4d_military_history_finalb","l4d_MIC2_TrapmentD",}, // Military Industrial Complex
    	{"l4d_mic2_Inter_Vention","l4d2_motamap_m1",}, // A Dam Mission
    	{"l4d2_motamap_m5","l4d2_deadcity01_riverside",}, // Dead City
    	{"l4d2_deadcity06_station","desperate_houseway",}, // Dead Series Original
    	{"band_of_rushers","Dead_Series1",}, // Dead Series Current
    	{"Dead_Series4","l4d2_ic_1_city",}, // Infected City I
    	{"l4d2_ic_5_Finale","l4d2_ic_2_1",}, // Infected City II
    	{"l4d2_ic2_5","l4d_damit01_orchard",}, // Dam It I
    	{"l4d_damit03_dam","damitdc1",}, // Dam It II
    	{"damitdc4","unsdwn_mp_1",}, // Undead Smackdown
    	{"unsdwn_mp_4","bhm1_outskirts",}, // Left Behind
    	{"bhm4_base","x1m1_cliffs",}, // Open Road 
    	{"x1m5_salvation","l4d2_tgtn01_fridayroad",}, // There Goes The Neighborhood
    	{"ud_map4","BadHoodL1",}, // Bad Neighborhood
    	{"BadHoodL3","l4d2_downtowndine01",}, // Downtown Dine
    	{"l4d2_downtowndine05","cwm1_intro",}, // Carried Off
    	{"cwm4_building","l4dblackoutbasement1",}, // Blackout Basement
    	{"l4dblackoutbasement4","grmap1",}, // Roadkill
    	{"grid4","lost01_club",}, // Lost
    	{"lost02_2","l4d_dbde_citylights",}, // Dead Before Dawn
    
    	//Best newer maps    //{"appartments","c2m1_undark","c3m1_rurallighthouse","l4d2_roadtonowhere_route01","l4d2_morgan_road","p84m1_apartment","bjrtcre_m1","mayuns_1","hpmap1","otosotr_m1","bt1","RichardsWorking_Map","hiking_trails","rw_beach1","l4d_greyscale_01_street","ddntr1_01urban","l4d2_deathwoods01_stranded","l4d_deadgetaway01_dam","ds2_1","shopcenter","dw_woods","l4d2_kmaps_ravine","deadbeat01_forest","claustrophobia1","l4d_coldfear01_smallforest","l4d_coaldBlood01","2ee_01","l4d_cardiff",},
    
    	// Average maps	//{"l4d2_draxmap1","l4d_draxmap0","wildride01","tripday_m1","TheCure001","bjrtc2_lvl1","rh_map01","l4d2_deadflagblues01_city","l4d2_feetunder_outpostazbo","l4d_priston01","1BM","l4d2-DisposalFacility","l4d2_base_east","Underground3","pt_home1","l4d2_planb1_v051","fox_river","nt01_mansion","l4d_auburn","d1c1","gr-mapone-7","outline_m1","l4d_lastnight01_arrival","dead_death_02","l4d_cuirmeat01","alleys1","getout","The Apartments","Return_Home","versus_1","l4d2_fallindeath01","l4d2_eft1_subsystem","l4d2_diescraper1_apartment_36","01_Derailed","canyondownthedrain","l4d2_camp_dead","l4d2_tunnel","l4d_deathrow01_streetstlm","l4d_redsea01_roofs","l4d_bureaux","route_to_city_vs1","apartment","patientscab","l4d2_darkblood01_tanker","lst_l4dmap_a","l4d_co_canal","cotd01_apartments","l4d_ccritical01csd","bloodtracks_01","bdp_bunker01","Las","youcallthatalanding","carnage_jail",},
    	
    	//A series of maps
    	//{"beginninghours_m1_shipv2","Frozen_m1_streets","neverendingwar_train","kickedout_m1_subway","lasthours_m1_alleys","revenge_m1_office_new",},
    	
    	// Maps with lots of water
    	{"l4d_dbdext_new_dawn","c1m1_outerbayous_a",}, // IMPJAW
    	{"c1m5_interstate_10","death_sentence_1",}, // Death Sentence
    	{"death_sentence_5","dayofthedead1",}, // Death Summer
    	{"dayofthedead6","NewRise",}, // Vague Reminders
    	{"NewRiseMapFinale","redtide_01_alleyways",}, // Redtide
    	{"redtide_05_beachfront","riptide_map1_final",}, // Riptide
    	
    	//Mashups
    	//{"amsterdam1etd","citystreets1ewc","Hideout01_v5etd","soi_m1_metrostation","l4d2_route66",},
    	
    	// Short maps	//{"m1_village","the_tunnels","building","gasfever_1","ddg1_tower_v2_1","tlv01_city","l4d_suburb01_school","l4d2_sbtd_01","campanar_coop_vs","l4d_noe1","l4d_sc_market","cbm1_lake","l4d_hopedb_gorge01","l4d_5tolife01",},
    
    	// Halloween maps
    	//{"castle_map_01","l4d_tbm_1","hf01_theforest","grave_yard",},
    	
    	// Christmas Maps
    	//{"c30m1","wow_map1","l4d_zero01_south","azhill1","Signal_Broken",},
    	
    	// Asian maps
    	{"riptide_map4_final","l4d_yama_1",}, // Yama
    	{"l4d_yama_5","1_m1",}, // Zengcheng City
    	{"5_m5","beta_thecity1",}, // Qiuming City
    	{"azcity_end","msd1_town",}, // Farewell Chenming
    	{"msd3_square","l4c2_wall",}, // Left in China
    	{"l4c_shrine","ch_map1_city",}, // True Fangshi
    	{"ch_map3_greatwall","port_01",}, // Dead Destination
    	{"outpost_3","l4d2_wanli01",}, // Wan Li
    
    	// Latin/Euro maps
    	{"l4d2_wanli03","bsas_m1_barrios",}, // Buenos Aires
    	{"bsas_m4_costanera","srocchurch",}, // Warcelona
    	{"mnac","l4d_viennacalling2_1",}, // Vienna Calling
    	{"l4d_viennacalling2_finale","eu01_residential_b16",}, // Tour of Terror
    	{"eu05_train_b16","venissia",}, // Venissia
    	{"xaviere","m1_fabbrecce",}, // Pesaro
    
    	// Half-Life maps
    	{"m5_sanbartolo","l4d2_trainstation_01",}, // The Train Station
    	{"l4d2_trainstation_06","l4d2_canals_01",}, // Route Kanal
    	{"l4d2_canals_06","l4d2_canals_07",}, // Water Hazard
    	{"l4d2_eli_02","l4d2_ravenholmwar_1",}, // Ravenholm V1
    	{"l4d2_ravenholmwar_4","l4d_ravenholm01_blackmesa",}, // Ravenholm V2
    	{"l4d_ravenholm05_docks","backtoravenholm_v4_01",}, // Back to Ravenholm
    	{"backtoravenholm_v4_07","l4d2_coast_01",}, // Highway 17
    	{"l4d2_coast_05","l4d2_city17_01",}, // City 17
    	{"l4d2_city17_05","wfp1_track",}, // White Forest
    	{"wfp4_commstation","omf_01",}, // Our Mutual Fiend
    	
    	// Modded official maps
    	//{"dcr_m1_hotel","dkr_m1_motel",},
    	//{"dprm1_milltown_a","c5m1_darkwaterfront",},
    	//{"c8m1_apartment_daytime","l4d2_hospital01_apartment",},
    	//{"ft_m1_apartments","Ulice","l4d_reverse_hos01_rooftop",},
    	//{"c9m1_alleys_daytime","l4d2_garage01_alleys_a","Alejki",},
    	//{"l4d2_smalltownday01_caves","l4d2_smalltown01_caves",},
    	//{"l4d2_DeathToll01_clam","Tunel",},
    	//{"c11m1_greenhouse_day","l4d2_airport01_greenhouse",},
    	//{"l4d_farm01_hilltop_day","l4d2_farm01_hilltop","l4d_farm05_cornfield_revbh",},
    	//{"csm1_beta_alpinecreek","c14m1_day_junkyard",},
    	//{"phantasmagoria01","r_concert",},
    };
    sm_nm works for only the last chapter which is on the previous maps list.
    If you typed it on non-last chapter, it will be random.

    Just like I said.
    Type !nm to change a next map immediately. (on the finale chapter only, if not, it will use a random map.)

    Last edited by pan0s; 07-30-2021 at 05:09.
    pan0s is offline
    Deadpool69
    Junior Member
    Join Date: Jul 2015
    Old 07-30-2021 , 18:38   Re: [L4D2] Random / Next Map [v1.1 | 8 May 2021]
    Reply With Quote #10

    Quote:
    Originally Posted by pan0s View Post
    sm_nm works for only the last chapter which is on the previous maps list.
    If you typed it on non-last chapter, it will be random.

    Just like I said.
    Type !nm to change a next map immediately. (on the finale chapter only, if not, it will use a random map.)
    I played through an entire mission, once the credits rolled in, a message popped up saying the next map will load in 2.5 seconds (the time I set it to). But the next map didn't even load.
    Deadpool69 is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 19:21.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode