Raised This Month: $81 Target: $400

[L4D2] Footlocker Spawner (1.19) [22-Nov-2023]

Post New Thread Reply   
Thread Tools Display Modes
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
Plugin Version:
Plugin Category:
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    Plugin Description:
    Auto-spawn footlockers on round start.
    Old 05-17-2011 , 14:23   [L4D2] Footlocker Spawner (1.19) [22-Nov-2023]
    Reply With Quote #1

    Related Plugins:

    • Auto spawns footlockers from a config on round start.
    • Config included with footlockers on every Valve map (apart from The Passing and most finales).
    • Specify which items can spawn and how many. No support for other items or weapons. Please do not request.
    • Versus and scavenge games spawn the same footlockers and items for both teams (except Witch).

    • alexip121093 - For the idea and HookEntityOutput code and help testing.
    • Boikinov, Zuko & McFlurry for source code (full credits inside the source).
    • Zergling89 - Testing.
    • ZombieAssassinator - Testing.
    • Mr.RuyC - Testing.
    • JoBarfCreepy - Testing.
    • disawar1 - Testing and reporting bugs.
    • Mr. Man - Testing.
    • recon-1 - Testing.
    • bubbabyte - Testing and reporting bugs.
    • Accelerator74 - Testing and reporting bugs.

    • In Hard Rain all spawned Footlockers and items (except Firework crates) are saved and created for the return journey.
    • When placing footlockers in Hard Rain, you MUST:
      [1] Copy "c4m1_milltown_a" data to "c4m4_milltown_b" and "c4m5_milltown_escape" (c4m5 if they are in the finale map area).
      [2] Copy "c4m2_sugarmill_a" data to "c4m3_sugarmill_b".

    • Firework crates cannot be picked up on Hard Rain return journey.
    • Do not create temporary footlockers on the Hard Rain outbound journey. This will mess up saving/spawning of footlockers.
    • Engine Error: The server will crash if an item (eg vomitjar) is spawned within another item. This seems to be a problem on Windows only. The error message:
      "models/w_models/weapons/w_eq_bile_flask.mdl (2) at -1.$ -1.$ -1.$ in contact with world (2) at -35.8 14.4 65.0, crash. dist = -1, minq = 100000002004087730000.000000"
    • If this error occurs, please let me know which map and which locker was opened (thats when it happens). This can be caused by spawning temporary lockers on top of items.

    Admin Commands:

    PHP Code:
    sm_locker        // Spawns a footlocker at crosshair. <type: 1=Molotov, 2=Pipebomb, 4=Vomitjar, 8=Adrenaline, 16=Pain Pills, 32=Fireworks crate, w=Witch> <count: 0=infinite>
    sm_lockersave    // Same as above. (Lockers cannot be saved with the Witch, the 'w' command is for temporary lockers only.
    sm_lockerdel     // Removes the footlocker your crosshair is pointing at.
    sm_lockerclear   // Removes the footlockers from the current map only.
    sm_lockerwipe    // Removes all footlockers from the current map and deletes them from the config.
    sm_lockerglow    // Toggle to enable glow on all footlockers to see where they are placed.
    sm_lockerlist    // Display a list footlocker positions and the number of footlockers.
    sm_lockertele    // Teleport to a footlocker (Usage: sm_lockertele <index: 1 to MAX_FOOTLOCKERS>). 


    Saved to l4d2_footlocker.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // 0=Plugin off, 1=Plugin on.
    l4d2_footlocker_allow "1"

    // 0=Off. Any other value is the range at which the glow will turn on.
    l4d2_footlocker_glow "100"

    // 0=Default glow color. Three values between 0-255 separated by spaces. RGB Color255 - Red Green Blue.
    l4d2_footlocker_glow_color "0 255 0"

    // 0=Off. 1=Notify to all players in chat who opened the Footlocker.
    l4d2_footlocker_hint "1"

    // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    l4d2_footlocker_modes ""

    // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = off).
    l4d2_footlocker_modes_off ""

    // Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
    l4d2_footlocker_modes_tog "0"

    // -1=All, 0=Off, Randomly select this many footlockers to spawn from the maps config.
    l4d2_footlocker_random "3"

    // 0=Off. How many seconds it takes to open a footlocker.
    l4d2_footlocker_timed "1"

    // How many items can be taken from the locker before it's empty. 0=Infinite.
    l4d2_footlocker_total "0"

    // Which items can spawn. 1=Molotov, 2=Pipebomb, 4=Vomitjar, 8=Adrenaline, 16=Pain Pills, 32=Fireworks crate. 63=All
    l4d2_footlocker_types "63"

    // Allows survivors to vocalize when they see a footlocker and open it.
    l4d2_footlocker_vocalize "1"

    // 0=Off, 1/cvar. The chance of a footlocker containing a witch.
    l4d2_footlocker_witch "100"

    // Footlocker Spawner plugin version.

    1.19 (22-Nov-2023)
        - Changed to TeleportEntity before DispatchSpawn to prevent crashes. Thanks to "HarryPotter" for reporting.
    1.18 (11-Dec-2022)
        - Changes to fix compile warnings on SourceMod 1.11.
    1.17 (27-Oct-2021)
        - Changed the way Firework Crates are spawned to be compatible with "Physics fix" plugin. Thanks to "Marttt" for fixing.
    1.16a (23-Feb-2021)
        - Data config updated - removed bad footlocker placement on "c9m1_alleys" map. Thanks to "PEK727" for reporting.
    1.16 (30-Sep-2020)
        - Fixed compile errors on SM 1.11.
    1.15 (10-May-2020)
        - Various changes to tidy up code.
    1.14 (12-Apr-2020)
        - Extra checks to prevent "IsAllowedGameMode" throwing errors.
    1.13 (01-Apr-2020)
        - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.
    1.12 (14-Mar-2020)
        - Fixed invalid entity error. Thanks to "sxslmk" for reporting.
    1.11 (04-Mar-2020)
        - Fixed potential server hanging/crashing on map change with the error:
            "Host_Error: SV_CreatePacketEntities: GetEntServerClass failed for ent 2."
        - This was caused by spawning the "info_gamemode" entity in OnMapStart. Fixed by adding a 0.1 delay.
        - Thanks to "Xanaguy" and "sxslmk" for reporting.
    1.10.3 (14-Aug-2018)
        - Another fix attempt for incorrect items spawning, tested on coop/versus/hard rain.
        - Fixed "Inserted func_button with no model" error when pressing a button.
    1.10.2 (18-Jun-2018)
        - Fixed spawning items not working correctly. Thanks to "Accelerator74" for reporting and testing.
    1.10.1 (17-May-2018)
        - Fixed array index error, which broke spawning items in versus. Thanks to "Accelerator74" for reporting.
    1.10.0 (05-May-2018)
        - Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.
        - Changed: Versus and scavenge games now spawn the same footlockers and items for both teams (except Witch).
    1.9.2 (14-Jun-2015)
        - Fixed "Client index is invalid" errors.
    1.9.1 (13-Apr-2015)
        - Fixed the plugin not compiling on SourceMod 1.7.x.
    1.9 (21-Jul-2013)
        - Removed Sort_Random work-around. This was fixed in SourceMod 1.4.7, all should update or spawning issues will occur.
    1.8 (02-Jun-2012)
        - Fixed the last update breaking a patch for the "Gear Transfer" plugin removing items.
    1.7 (01-Jun-2012)
        - Added cvar "l4d2_footlocker_glow_color" to set the glow color.
        - Fixed items not respawning after being taken.
        - Fixed the witch sometimes getting stuck inside the Footlocker.
        - More prevention for players getting stuck inside the Footlocker.
    1.6 (26-May-2012)
        - Fixed witch blocking players or disappearing.
    1.5 (10-May-2012)
        - Added command "sm_lockerang" to change the cabinet angle.
        - Added command "sm_lockerpos" to change the cabinet origin.
        - Added cvar "l4d2_footlocker_modes_off" to control which game modes the plugin works in.
        - Added cvar "l4d2_footlocker_modes_tog" same as above.
        - Added cvar "l4d2_footlocker_hint" to notify players who opened the footlocker.
        - Changed cvar "l4d2_footlocker_modes" to enable the plugin on specified modes.
        - Fixed another bug with the witch and firework crates.
        - Removed max entity check and related error logging.
    1.4 (01-Mar-2011)
        - Fixed firework crates spawning when a witch spawns.
    1.3 (14-Jan-2012)
        - Fixed the cvar "l4d2_footlocker_random" to actually work.
    1.2 (01-Dec-2011)
        - Incompatibility: If you use Gear Transfer, you must update to 1.5.7 or greater.
        - Added Footlockers to these maps: Crash Course, Death Toll, Dead Air, Blood Harvest, Cold Stream.
        - Added command "sm_lockerclear" to remove all Footlockers from the current map.
        - Added cvar "l4d2_footlocker_allow" to enable or disable the plugin.
        - Changed cvar "l4d2_footlocker_random", 0 turns off spawning random footlockers, -1 spawns all.
        - Fixed server crashes due to the removal of *_spawn items.
        - Fixed adrenaline and pills not dispensing unlimited items.
        - Pushes players away if they are too close when opening footlockers to avoid them getting stuck.
        - Stopped respawning items on Hard Rain in Versus and Scavenge modes.
    1.1 (22-May-2011)
        - Added cvar "l4d2_footlocker_timed" to set how many seconds it takes to open a footlocker.
    1.01 (17-May-2011)
        - Stopped L4D1 characters from vocalizing (missing audio).
    1.0 (17-May-2011)
        - Initial release.

    1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
    2. Download "l4d2_footlocker.cfg" and put into your servers \addons\sourcemod\data\ folder.

    Updating from 1.6 or older:
    • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
    Attached Files
    File Type: cfg l4d2_footlocker.cfg (24.7 KB, 1411 views)
    File Type: sp Get Plugin or Get Source (l4d2_footlocker.sp - 220 views - 68.3 KB)

    Last edited by Silvers; 11-22-2023 at 16:59.
    Silvers is offline
    Senior Member
    Join Date: Mar 2010
    Old 05-17-2011 , 16:03   Re: [L4D2] Footlocker Spawner (1.0 - 17-May-2011)
    Reply With Quote #2

    Wow, amazing, I thought the code was to messy to make it into a plugin? Never the less, cannot wait to try this out.
    Elektramode is offline
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 05-17-2011 , 16:19   Re: [L4D2] Footlocker Spawner (1.0 - 17-May-2011)
    Reply With Quote #3

    When I previously checked it looked harder than it was. It still took me a couple months to get this done. The hardest part was making support for Hard Rain return journey.

    There are still minors bugs with this such as Pills and Adrenaline item count not saving for the return journey but this is valves fault. Also because the game engine spawns the items and Firework Crates on the return journey for some reason you're unable to pick up the firework crates. I'll see what can be done.
    Silvers is offline
    Senior Member
    Join Date: Sep 2010
    Old 05-17-2011 , 16:40   Re: [L4D2] Footlocker Spawner (1.01 - 17-May-2011)
    Reply With Quote #4

    Ahahahaha, awesome! XD

    Keep up the work Silvers! ;)

    P.S: to install i put the smx file in the sourcemod plugins folder as normal, and the cfg to ... ??? And what you mean by:

    When placing footlockers in Hard Rain, you MUST:
    [1] Copy "c4m1_milltown_a" data to "c4m4_milltown_b" and "c4m5_milltown_escape" (c4m5 if they are in the finale map area).
    [2] Copy "c4m2_sugarmill_a" data to "c4m3_sugarmill_b".

    Can't understand what i have to copy...
    paul92 is offline
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 05-17-2011 , 16:45   Re: [L4D2] Footlocker Spawner (1.01 - 17-May-2011)
    Reply With Quote #5

    Cfg to data folder, it says....

    Regarding Hard Rain. Basically the keyvalue for the angles and origins have to be copied from c4m1 to c4m4 and c4m5 so the same lockers can be created on the return journey. The c4m2 data has to be copied to the c4m3 map just like the previous lot of data. This is only if you plan on placing your own footlockers on Hard Rain. I took the liberty of doing that already but not everyone will like where I placed them.
    Silvers is offline
    Senior Member
    Join Date: Dec 2009
    Location: Hong Kong
    Old 05-18-2011 , 04:57   Re: [L4D2] Footlocker Spawner (1.01 - 17-May-2011)
    Reply With Quote #6

    finally public released
    support this good plugin

    cool pic love it

    I want a boomer in the footlocker
    alexip121093 is offline
    Send a message via MSN to alexip121093
    Senior Member
    Join Date: Mar 2010
    Old 05-19-2011 , 16:34   Re: [L4D2] Footlocker Spawner (1.01 - 17-May-2011)
    Reply With Quote #7

    Great plugin, thanks for sharing
    siangc is offline
    Join Date: Apr 2006
    Old 05-19-2011 , 17:36   Re: [L4D2] Footlocker Spawner (1.01 - 17-May-2011)
    Reply With Quote #8

    Very Nice work, I'm still impressed by how many awesome plugins you are producing.

    Still now only if some one could remake the last boss plugin to work better and more effectively in Versus mode :0.
    war450 is offline
    Join Date: Dec 2010
    Old 05-20-2011 , 04:01   Re: [L4D2] Footlocker Spawner (1.01 - 17-May-2011)
    Reply With Quote #9

    Good ideas, footlocker finally useful.
    xindong is offline
    Join Date: Dec 2009
    Old 05-20-2011 , 17:24   Re: [L4D2] Footlocker Spawner (1.01 - 17-May-2011)
    Reply With Quote #10

    good plugin, i like it.
    I have suggestions.
    My idea
    I wanted it to random items all gun weapons and all melee weapon and extra infection.
    Hope that the plugin next version., Will be a modify good.

    Add Item List
    first_aid_kit, defibrillator, gascan, oxygentank, propanetank, upgradepack_explosive, upgradepack_incendiary

    Gun Weapons List
    autoshotgun, gnome, grenade_launcher, hunting_rifle, pistol, pistol_magnum, pumpshotgun, rifle, rifle_ak47, rifle_desert, rifle_sg552, shotgun_chrome, shotgun_spas, smg, smg_mp5, smg_silenced, sniper_awp, sniper_military, sniper_scout, M60

    Melee Weapon List baseball_bat, cricket_bat, crowbar, electric_guitar, fireaxe, frying_pan, katana, machete, tonfa, knife, cola_bottles, golfclub, chainsaw

    Add Special Zombie List Mod Zombie, boomer, hunter, smoker, spitter, jockey, charger

    uncommon Infected
    riot, ceda, clown, mud, roadcrew, jimmy, fallen

    songpal is offline

    Thread Tools
    Display Modes

    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 06:02.

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