View Single Post
Author Message
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 02-27-2012 , 23:33   [L4D & L4D2] Health Vending Machines (1.12) [11-Dec-2022]
Reply With Quote #1


(1. Cooler, 2. Fountain, 3. Drinks, 4. Vendor, 5. Snacks, 6. Coffee)


Related Plugins:

About:
  • Gives temporary health or main health. Not above 100 HP.
  • Selection of 6 Health Vending Machines.
  • Save up to 32 Vendors for auto-spawning. Saved to l4d_vendor.cfg in your servers \addons\sourcemod\data\ folder.


Thanks:
  • AtomicStryker, Zuko and McFlurry - For source code (credits inside).
  • alexip121093
  • disawar1
  • xioSlayer
  • [Resistance] Yoshi
  • [Resistance] Soroshi
  • januto
  • Recon-1
  • ilyaadminman
  • Herbie_06
  • JoBarfCreepy - Idea for the Coffee and Snacks vendors.
  • The 5th Survivor - Text corrections to the cvars.
  • adrianman


Admin Commands: (requires "z" flag)

PHP Code:
sm_vendor         // Spawns a temporary vending machine at your crosshair. Usage: sm_vendor <1|2|3|4|5|6>.
sm_vendorsave     // Spawns a vending machine at your crosshair and saves to config. Usage: sm_vendorsave <1|2|3|4|5|6>.
sm_vendordel      // Removes the vending machine your crosshair is pointing at and deletes from the config if saved.
sm_vendorwipe     // Removes all vendors from the current map and deletes them from the config.
sm_vendorglow     // Toggle to enable glow on all vendors to see where they are placed.
sm_vendorlist     // Display a list vending machine positions and the total number of.
sm_vendorang      // Displays a menu to adjust the vendor angles your crosshair is over.
sm_vendorpos      // Displays a menu to adjust the vendor origin your crosshair is over. 


Cvars:

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

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

// (L4D2 only). 0=Off. Any other value is the range at which the glow will turn on.
l4d_vendor_glow "100"

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

// The health given to players when using the Coffee Machines (6).
l4d_vendor_health_coffee "5"

// The health given to players when using the Water Coolers (1).
l4d_vendor_health_cooler "2"

// The health given to players when using the Small Drink vendor (3).
l4d_vendor_health_drinks "5"

// The health given to players when using the Water Fountains (2).
l4d_vendor_health_fountain "2"

// The health given to players when using the Snack Vendors (5).
l4d_vendor_health_snacks "5"

// The health given to players when using the Drink Vendors (4).
l4d_vendor_health_vendor "5"

// 0=Infinite. Maximum number of times a Coffee Machine can be used.
l4d_vendor_max_coffee "10"

// 0=Infinite. Maximum number of times a Water Cooler can be used.
l4d_vendor_max_cooler "15"

// 0=Infinite. Maximum number of times a Small Drink vendor can be used.
l4d_vendor_max_drinks "10"

// 0=Infinite. Maximum number of times a Water Fountain can be used.
l4d_vendor_max_fountain "15"

// 0=Infinite. Maximum number of times a Snack vendor can be used.
l4d_vendor_max_snacks "10"

// 0=Infinite. Maximum number of times a Drink vendor can be used.
l4d_vendor_max_vendor "10"

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

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

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

// -1=All, 0=None. Otherwise randomly select this many vendors to spawn from the maps config.
l4d_vendor_random "-1"

// 0=Add to normal health. -1=Add temporary health. Values between 1 and 100 create a chance to give health.
l4d_vendor_temp "25"

// How many seconds it takes to use a vending machine.
l4d_vendor_timed "1.0"

// Vending Machine plugin version.
l4d_vendor_version 


Changes:
Code:
1.12 (25-Oct-2023)
    - Changed the plugin to allow healing over 100 max health. Now uses the players "m_iMaxHealth" value for limit. Requested by "efa561".

1.11 (11-Dec-2022)
    - Changes to fix compile warnings on SourceMod 1.11.

1.10 (10-Apr-2021)
    - Increased the interaction range of Vending Machines. This allows positioning over a maps vendors. Thanks to "Shao" for reporting.

1.9 (30-Sep-2020)
    - Fixed compile errors on SM 1.11.

1.8 (10-May-2020)
    - Extra checks to prevent "IsAllowedGameMode" throwing errors.
    - Various changes to tidy up code.
    - Various optimizations and fixes.

1.7 (01-Apr-2020)
    - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.

1.6 (05-May-2018)
    - Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.
    - Changed cvar "l4d_vendor_modes_tog" now supports L4D1.

1.5 (25-Aug-2013)
    - Fixed the plugin crashing or not working on some maps.

1.4 (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.3 (01-Jul-2012)
    - Fixed healing players above 100 HP - Thanks to "adrianman" for reporting.

1.2 (01-Jun-2012)
    - Added cvar "l4d_vendor_glow_color" to set the glow color, L4D2 only.
    - Text corrections to the cvars - Thanks to "The 5th Survivor".
    - Restricted command "sm_vendorglow" to L4D2 only.
    - Restricted cvar "l4d_vendor_glow" to L4D2 only.

1.1 (10-May-2012)
    - Added 2 new models, Coffee and Snacks - Thanks to "JoBarfCreepy".
    - Added 4 new cvars for the above addition.
    - Added cvar "l4d_vendor_modes_off" to control which game modes the plugin works in.
    - Added cvar "l4d_vendor_modes_tog" same as above, but only works for L4D2.
    - Changed cvar "l4d_vendor_modes" to enable the plugin on specified modes.
    - Removed max entity check and related error logging.

1.0 (28-Feb-2012)
    - Initial release.


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

Updating from 1.1 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_vendor.sp - 374 views - 49.1 KB)
__________________

Last edited by Silvers; 04-29-2024 at 06:15.
Silvers is offline