View Single Post
Author Message
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
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