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

[L4D & L4D2] Health Cabinet (1.12) [23-Apr-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
2747
Plugin Version:
1.12
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    10 
    Plugin Description:
    Auto-Spawns Health Cabinets.
    Old 12-30-2011 , 22:04   [L4D & L4D2] Health Cabinet (1.12) [23-Apr-2022]
    Reply With Quote #1



    Related Plugins:

    About:
    • Auto-spawns saved Health Cabinets with first aid kits, defibrillators, adrenaline, pain pills.
    • The auto-spawn data config is saved to l4d_cabinet.cfg in your servers \addons\sourcemod\data\ folder.


    Thanks:

    Admin Commands: (requires "z" flag)
    PHP Code:
    sm_cabinet        // Spawns a temporary Health Cabinet at your crosshair.
    sm_cabinetsave    // Spawns a Health Cabinet at your crosshair and saves to config. Usage: sm_cabinetsave <first> <pills> <adren> <defib>.
    sm_cabinetlist    // Displays a list of Health Cabinets spawned by the plugin and their locations.
    sm_cabinetglow    // (L4D2 only). Toggle to enable glow on all cabinets to see where they are placed.
    sm_cabinettele    // Teleport to a cabinet (Usage: sm_cabinettele <index: 1 to MAX_CABINETS>).
    sm_cabinetdel     // Removes the Health Cabinet you are aiming at and deletes from the config if saved.
    sm_cabinetclear   // Removes all Health Cabinets from the current map.
    sm_cabinetwipe    // Removes all Health Cabinets from the current map and deletes them from the config.
    sm_cabinetang     // Displays a menu to adjust the cabinet angles your crosshair is over.
    sm_cabinetpos     // Displays a menu to adjust the cabinet origin your crosshair is over.

    // Examples for: sm_cabinet and sm_cabinetsave:
    // Usage: sm_cabinetsave <first aid> <pills> <adrenaline> <defibrillators>.
    // Value: -1=Cvar default, 0=No chance, 100=Best chance.
    sm_cabinet -1 100         // Pills have 100% chance spawning, the rest use the cvar defaults: l4d_cabinet_spawn_*
    sm_cabinet 50 100 100 0   // Spawns mostly pills, adrenaline, some first aid and no defibrillators.
    sm_cabinet 0 0 0 100      // Does not spawn anything except defibrillators.
    sm_cabinet 1 1 1 1        // Everything has an equal chance of spawning, but spawning is random so you won't get 1 of each item. 


    CVars:

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

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

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

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

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

    // (L4D2 only). 0=Off. Range the cabinet glows.
    l4d_cabinet_glow "150"

    // (L4D2 only). 0=Default glow color. Three values between 0-255 separated by spaces. RGB Color255 - Red Green Blue.
    l4d_cabinet_glow_color "255 0 0"

    // Maximum number of items.
    l4d_cabinet_max "4"

    // Minimum number of items.
    l4d_cabinet_min "1"

    // -1=All, 0=Off, other value randomly spawns that many from the config.
    l4d_cabinet_random "2"

    // Chance out of 100 to spawn adrenaline.
    l4d_cabinet_spawn_adren "80"

    // Chance out of 100 to spawn defibrillators.
    l4d_cabinet_spawn_defib "10"

    // Chance out of 100 to spawn first aid kits.
    l4d_cabinet_spawn_first "30"

    // Chance out of 100 to spawn pain pills.
    l4d_cabinet_spawn_pills "100"

    // Health Cabinet plugin version.
    l4d_cabinet_version 


    Changes:
    Code:
    1.12 (23-Apr-2022)
        - Fixed cabinets spawning all the same items in the second round of Versus modes. Thanks to "dahyun4220" for reporting.
        - Compatibility support for SourceMod 1.11. Fixed various warnings.
    
    1.11 (01-Jul-2021)
        - Now precaches the door opening sound to stop server console saying it's not cached.
    
    1.10 (10-May-2020)
        - Various changes to tidy up code.
    
    1.9 (29-Apr-2020)
        - Extra checks to prevent "IsAllowedGameMode" throwing errors.
        - Fixed rare invalid handle errors.
    
    1.8 (01-Apr-2020)
        - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.
    
    1.7.1 (03-Jul-2019)
        - Fixed minor memory leak when saving or creating a temporary cabinet.
    
    1.7 (05-May-2018)
        - Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.
        - Changed cvar "l4d_cabinet_modes_tog" now supports L4D1.
    
    1.6 (18-Jul-2013)
        - Fixed spawning issues.
    
    1.5.1 (05-Jun-2012)
        - Fixed print to chat error from the command "sm_cabinetglow".
    
    1.5.0 (01-Jun-2012)
        - Added cvar "l4d_cabinet_glow_color" to set the glow color, L4D2 only.
        - Fixed bugs with deleting Cabinets.
        - Prevention for empty Cabinets, now spawns 1 second after opening when bugged.
        - Versus games now spawn the same cabinets and items for both teams - Requested by "Dont Fear The Reaper".
    
    1.4 (10-May-2012)
        - Added command "sm_cabinetglow" to see where cabinets are placed.
        - Added command "sm_cabinettele" to teleport to a cabinet.
        - Added command "sm_cabinetang" to change the cabinet angle.
        - Added command "sm_cabinetpos" to change the cabinet origin.
        - Fixed a bug causing errors when deleting cabinets.
    
    1.3 (03-Mar-2012)
        - Added command "sm_cabinetglow" to see where cabinets are placed.
        - Added command "sm_cabinettele" to teleport to a cabinet.
        - Added cvar "l4d_cabinet_spawn_adren" to set the chance of spawning adrenaline.
        - Added cvar "l4d_cabinet_spawn_defib" to set the chance of spawning defibrillators.
        - Added cvar "l4d_cabinet_spawn_first" to set the chance of spawning first aid kits.
        - Added cvar "l4d_cabinet_spawn_pills" to set the chance of spawning pain pills.
        - Changed command "sm_cabinet" and "sm_cabinetsave" usage: sm_cabinetsave <first> <pills> <adren> <defib>.
        - Changed default values of some cvars.
        - Changed the data config format. Please use the "sm_silvercfg" plugin to convert reformat the config.
        - Removed cvar "l4d_cabinet_type".
        - Removed cvar "l4d_cabinet_type1".
        - Removed cvar "l4d_cabinet_type2".
    
    1.2 (02-Jan-2012)
        - Temporary update:
        - Fixed bots auto-grabbing items from closed cabinets.
        - Added cvar "l4d_cabinet_type1".
        - Added cvar "l4d_cabinet_type2".
        - Changed command "sm_cabinet" and "sm_cabinetsave" usage.
    
    1.1 (31-Dec-2011)
        - Removed useless code.
    
    1.0 (31-Dec-2011)
        - Initial release.


    Installation:
    • Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.

    Updating from 1.4 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: sp Get Plugin or Get Source (l4d_cabinet.sp - 959 views - 45.9 KB)
    __________________

    Last edited by Silvers; 04-27-2022 at 15:06.
    Silvers is offline
    Marcus101RR
    Veteran Member
    Join Date: Aug 2009
    Location: Tampa, FL
    Old 12-30-2011 , 22:31   Re: [L4D & L4D2] Health Cabinet (1.0) [31-Dec-2011]
    Reply With Quote #2

    Testing...

    Will report back to see if this is a good plugin.

    EDIT: Works great, too bad the bots can take the stuff out of the box before its even open.

    Last edited by Marcus101RR; 12-31-2011 at 01:05.
    Marcus101RR is offline
    Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 12-31-2011 , 02:43   Re: [L4D & L4D2] Health Cabinet (1.1) [31-Dec-2011]
    Reply With Quote #3

    Hmm I hadn't noticed that. I'll have a play about, it probably needs a different solid type. I know Gear Transfer does this so I'll look into a fix.
    __________________
    Silvers is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 12-31-2011 , 15:06   Re: [L4D & L4D2] Health Cabinet (1.1) [31-Dec-2011]
    Reply With Quote #4

    Why not add defib support as well?
    __________________
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    Marcus101RR
    Veteran Member
    Join Date: Aug 2009
    Location: Tampa, FL
    Old 12-31-2011 , 20:30   Re: [L4D & L4D2] Health Cabinet (1.1) [31-Dec-2011]
    Reply With Quote #5

    Quote:
    Originally Posted by McFlurry View Post
    Why not add defib support as well?
    The cabinets in l4d only carry pills or a medkit. That is why, if you want extra item spawns, use stripper.
    Marcus101RR is offline
    Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
    The 5th Survivor
    Senior Member
    Join Date: Mar 2012
    Old 06-05-2012 , 11:42   Re: [L4D & L4D2] Health Cabinet (1.1) [31-Dec-2011]
    Reply With Quote #6

    Quote:
    Originally Posted by Marcus101RR View Post
    The cabinets in l4d only carry pills or a medkit. That is why, if you want extra item spawns, use stripper.

    What is this stripper he is referring to? Does it allows you to spawn and save items/infected through a map just like how you can spawn and save health cabinets with this plugin?





    Quote:
    Originally Posted by Marcus101RR View Post
    sm_cabinetdel - It doesn't delete it from the config...
    &
    Quote:
    Originally Posted by Silvers View Post
    Marcus is right the current version is broken as I've not bothered to upload 20 plugin updates. It should and does delete from the config but not always. Will upload one day.
    Been playing around with this (versions 1.4 and 1.5) and that seems to be the only issue with the plugin. You can use sm_cabinetdel to remove any cabinet, but it doesn't always delete it from the config file (sometimes it does though). The command sm_vendordel for your Health Vending Machines plugin does remove and delete from the config (if it saved in the config) every time. Maybe you can compare the two and see what's causing sm_cabinetdel to not always remove from the config file. Not really a big deal though because if anyone really needs to remove a cabinet they can manually delete it from the config file. Great plugin though

    Edit:
    Just found something else with this plugin installed. If all players are idle and get kick by the console, the server will not read any CFG file in the CFG\Sourcemod folder when another player joins the server. The only fix I manage to do was either reset the server or reinstall the plugin and restart the server anyway. I tested it multiple times with the same results. If I remove this plugin, none of that happens. The Health Vending Machine plugin practically works the same way as this plugin and it doesn't cause that. Any ideas?

    Last edited by The 5th Survivor; 06-05-2012 at 18:40.
    The 5th Survivor is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 06-06-2012 , 01:51   Re: [L4D & L4D2] Health Cabinet (1.1) [31-Dec-2011]
    Reply With Quote #7

    Quote:
    Originally Posted by The 5th Survivor View Post
    Been playing around with this (versions 1.4 and 1.5) and that seems to be the only issue with the plugin. You can use sm_cabinetdel to remove any cabinet, but it doesn't always delete it from the config file (sometimes it does though). The command sm_vendordel for your Health Vending Machines plugin does remove and delete from the config (if it saved in the config) every time. Maybe you can compare the two and see what's causing sm_cabinetdel to not always remove from the config file. Not really a big deal though because if anyone really needs to remove a cabinet they can manually delete it from the config file. Great plugin though

    Edit:
    Just found something else with this plugin installed. If all players are idle and get kick by the console, the server will not read any CFG file in the CFG\Sourcemod folder when another player joins the server. The only fix I manage to do was either reset the server or reinstall the plugin and restart the server anyway. I tested it multiple times with the same results. If I remove this plugin, none of that happens. The Health Vending Machine plugin practically works the same way as this plugin and it doesn't cause that. Any ideas?
    1.5 the delete works. I cannot replicate your problem, you sure you tried with 1.5? Tell me how to replicate...

    The configs I highly doubt is this plugin, most likely due too many cvars/cvar configs/Battle-RPG and the likes which have many cvars. I have not had a single problem such as you described, and under the same circumstances.
    __________________
    Silvers is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 01-01-2012 , 06:50   Re: [L4D & L4D2] Health Cabinet (1.1) [31-Dec-2011]
    Reply With Quote #8

    Update:See first thread.

    Good idea thanks MCFlurry. Also now spawns items when the Cabinet is opened, no longer will the bots grab before
    __________________

    Last edited by Silvers; 03-03-2012 at 05:52.
    Silvers is offline
    Marcus101RR
    Veteran Member
    Join Date: Aug 2009
    Location: Tampa, FL
    Old 01-07-2012 , 16:12   Re: [L4D & L4D2] Health Cabinet (1.1) [31-Dec-2011]
    Reply With Quote #9

    Quote:
    Originally Posted by Silvers View Post
    Update: I am placing this here for now...


    Good idea thanks MCFlurry. Also now spawns items when the Cabinet is opened, no longer will the bots grab before


    Changed cvar:
    "l4d_cabinet_type" - Chance out of 100 to spawn pills/adrenaline, remainder to spawn first aid kits/defibrillators.

    Added 2 new cvars:
    "l4d_cabinet_type1" - Chance out of 100 to select pills, remainder to select adrenaline.
    "l4d_cabinet_type2" - Chance out of 100 to select first aid kits, remainder to select defibrillators.

    You can specify what spawns. The type arguments below is exactly what the type cvars do. This is also applied to sm_cabinetsave (which is then saved to the data config for auto-spawning).

    PHP Code:
    sm_cabinet <type> <type1> <type2>

    // Example: 
    sm_cabinet 100 100    // Spawns only pills
    sm_cabinet 100 1      // Spawns only adrenaline
    sm_cabinet 50 1 1     // Spawns either adrenaline or defibrillators
    sm_cabinet 50 100 100 // Spawns either pills or first aid kits
    sm_cabinet 50 50 100  // Spawns either pills, adrenaline or first aid kits 
    Sorry if this is confusing, I don't know a better way to do this or explain.
    very confusing to be honest. would be better if you could make it a bit more easier...

    sm_cabinetsave <medkits> <pills> <adrenaline> <defib>

    0 = Never spawns
    1 = Spawns

    Considering the last plugin had a variable that controlled the percent...you could also do:

    0 = Never/Zero Spawns
    1 = 1 of Item Spawns
    2 = 2 of Item Spawns
    3 = 3 of Item Spawns
    4 = 4 of Item Spawns

    Example:
    sm_cabinetsave <medkits> <pills> <adrenaline> <defib>
    sm_cabinetsave 2 0 1 1

    This cabinet spawns 2 Medkits, 0 pills, 1 adrenaline, and 1 debif always.
    Marcus101RR is offline
    Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
    hg0827
    Junior Member
    Join Date: Nov 2010
    Old 01-06-2012 , 21:11   Re: [L4D & L4D2] Health Cabinet (1.1) [31-Dec-2011]
    Reply With Quote #10

    can make plugin for Auto spawns ammo pit ?
    hg0827 is offline
    Reply


    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 13:34.


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