View Single Post
Author Message
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 08-08-2013 , 08:10   [L4D & L4D2] Weapon Spawn (1.15) [25-Mar-2024]
Reply With Quote #1



Related Plugins:

About:
  • Save weapons/items to the map for auto-spawning on round_start.
  • This plugin spawns single weapons/items. They are frozen in place. You can use the pos/ang commands to rotate.
  • Data config saved to l4d_weapon_spawn.cfg in your servers \addons\sourcemod\data\ folder.
  • Do not request any features. If you don't like the plugin then make your own.


Thanks:
  • disawar1 - Helped with code fixes.
  • chatyak - Lots of help.
  • Herbie - Lots of help.
  • worminater
  • Sev



Admin Commands: (requires "z" flag)

PHP Code:
sm_weapon_spawn         // Opens a menu of weapons/items to spawn. Spawns a temporary weapon at your crosshair.
sm_weapon_spawn_save    // Opens a menu of weapons/items to spawn. Spawns a weapon at your crosshair and saves to config.
sm_weapon_spawn_del     // Removes the weapon you are pointing at and deletes from the config if saved.
sm_weapon_spawn_clear   // Removes all weapons spawned by this plugin from the current map.
sm_weapon_spawn_wipe    // Removes all weapons spawned by this plugin from the current map and deletes them from the config.
sm_weapon_spawn_glow    // Toggle to enable glow on all weapons to see where they are placed.
sm_weapon_spawn_list    // Display a list weapon positions and the total number of.
sm_weapon_spawn_tele    // Teleport to a weapon (Usage: sm_weapon_spawn_tele <index: 1 to MAX_SPAWNS (32)>).
sm_weapon_spawn_ang     // Displays a menu to adjust the weapon angles your crosshair is over.
sm_weapon_spawn_mov     // Move weapon. Usage: sm_weapon_spawn_mov {x|y|z} {distance}
sm_weapon_spawn_pos     // Displays a menu to adjust the weapon origin your crosshair is over.
sm_weapon_spawn_rot     // Rotate weapon. Usage: sm_weapon_spawn_rot {x|y|z|} {degree} 


Cvars:

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

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

// 0=Infinite. How many items/weapons to give from 1 spawner.
l4d_weapon_spawn_count "1"

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

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

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

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

// 0=Off. Chance out of 100 to randomise the type of item/weapon regardless of what it's set to.
l4d_weapon_spawn_randomise "25"

// Weapon Spawn plugin version.
l4d_weapon_spawn_version 


Changes:
Code:
1.15 (25-Mar-2024)
    - Changes to fix conflicts with the "ConVars Anomaly Fixer" plugin. Thanks to "komikoza" for reporting and testing.

1.14 (25-May-2023)
    - Fixed the M60, Grenade Launcher and Chainsaw not following the count cvar limit. Thanks to "gamer_kanelita" for reporting.

1.13 (20-Sep-2022)
    - Fixed incorrect model list. Thanks to "HarryPotter" for reporting.

1.12 (10-Aug-2022)
    - Fixed the plugin attempting to back up the data file even after converting to version 2 format. Thanks to "HarryPotter" for reporting.

1.11 (04-Jun-2022)
    - Fixed not updating the full data config if an index was missing. Now throws errors to warn about missing indexes.
    - Plugin will auto backs up the previous data config before updating it.

1.10 (04-Jun-2022)
    - L4D2: Plugin now automatically converts old configs to use the new index values. Previous version was spawning the wrong types.
    - Thanks to "KoMiKoZa" for reporting.

1.9 (26-May-2022)
    - Changed the menu order of items to group similar types together.
    - Menu now displays the last page that was selected instead of returning to the first page.

1.8 (23-Apr-2022)
    - Changes to allow "CSS" weapons to spawn multiple copies with the "l4d_weapon_spawn_count" cvar. Thanks to "vikingo12" for reporting.

1.7 (15-Feb-2021)
    - Added new command "sm_weapon_spawn_mov" for direct console control of position. Thanks to "eyeonus" for scripting.
    - Added new command "sm_weapon_spawn_rot" for direct console control of rotation. Thanks to "eyeonus" for scripting.
    - Fixed invalid convar handles in L4D1. Thanks to "CryWolf" for reporting.

1.6 (10-May-2020)
    - Blocked glow command and convars from L4D1 which does not support glows.
    - Extra checks to prevent "IsAllowedGameMode" throwing errors.
    - Various changes to tidy up code.
    - Various optimizations and fixes.

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

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

1.3.1 (20-Nov-2015)
    - Fixed the Sniper Scout not spawning when "l4d_weapon_spawn_count" cvar was set to 0.

1.3 (19-Nov-2015)
    - Fixed Auto Shotgun ammo in L4D1 not filling.
    - Fixed some guns not spawning when "l4d_weapon_spawn_count" cvar was set to 0.

1.2 (29-Mar-2015)
    - Fixed the plugin not loading in L4D1 due to an Invalid Convar Handle.

1.1 (18-Aug-2013)
    - Added cvar "l4d_weapon_spawn_count" to set how many times a spawner gives items/weapons before disappearing.
    - Added cvar "l4d_weapon_spawn_randomise" to randomise the spawns based on a chance out of 100.

1.0 (08-Aug-2012)
    - Initial release.


Installation:
  • Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_weapon_spawn.sp - 128 views - 54.1 KB)
__________________

Last edited by Silvers; 03-25-2024 at 15:55.
Silvers is offline