View Single Post
Author Message
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 08-28-2022 , 18:44   [L4D1 & L4D2] Whitelist Map Changer [v1.0.3 | 29-August-2022]
Reply With Quote #1

Description

This plugin changes the current map to a whitelist one if blacklisted.

Useful for servers that allow being created from the lobby.

Use case:
  • A client creates a lobby.
  • Selects any vanilla map.
  • Starts the match looking for available servers.
  • Plugin will redirect to the custom map since "No Mercy" isn't in the whitelist. (we can't control the maps selection from the lobby)

Features
  • Allow configuring which maps are blacklisted.
  • Allow configuring which maps are whitelisted.
  • Block campaign change through a vote if map is blacklisted.

Cvars

A configuration file named "l4d_whitelist_maps.cfg" will automatically be created for you upon the first run in the "\cfg\sourcemod\" folder.

PHP Code:
// Enable/Disable the plugin.
// 0 = Disable, 1 = Enable.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_whitelist_maps_enable "1" 
Data file (data/l4d_whitelist_maps.cfg)
PHP Code:
// Attributes explained:
//  "enable" -> Enable map for changelevel or whitelist check. "0" = Disable, "1" = Enable.
// Notes:
// If more than one map is added to the changelevel section, it will be chosen randomly.

"l4d_whitelist_maps"
{
    
"changelevel"
    
{
        
"l4d2_tank_challenge" "enable" "1" }
    }

    
"whitelist"
    
{
        
"l4d2_tank_challenge"           "enable" "1" }
        
"l4d2_tank_challenge_15_rounds" "enable" "1" }
        
"l4d2_tank_challenge_20_rounds" "enable" "1" }
        
"l4d2_tank_challenge_30_rounds" "enable" "1" }
    }

Admin Commands
  • sm_whitelist_maps_reload => Reload the whitelist maps configs. (z flag required)
  • sm_print_cvars_l4d_whitelist_maps => Print the plugin related cvars and their respective values to the console. (z flag required)

Change Log

Spoiler


Notes
  • Plugin only works on DEDICATED SERVERS.
  • The loading screen may keep showing the previous map while changing the map.
  • The sample data file points to an L4D2 custom map, change it to fit your needs.

Thank you!

Post Reply
  • Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome.

Installation
  • Put the "l4d_whitelist_maps.cfg" file in your "\addons\sourcemod\data\" folder.
  • Put the "l4d_whitelist_maps.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.
Attached Files
File Type: cfg l4d_whitelist_maps.cfg (596 Bytes, 113 views)
File Type: sp Get Plugin or Get Source (l4d_whitelist_maps.sp - 178 views - 17.2 KB)
__________________

Last edited by Marttt; 01-15-2023 at 12:23.
Marttt is offline