A big thanks to DJ_WEST
for Grenade Transfer
which I used to build this.
A massive thanks to Mr.RuyC and NanX for help testing and using their server for many, many hours!
Also thanks to AtomicStryker
for tips on improving the plugin, greatly appreciated!
Thanks to Lux
for testing v2.0 and lots of advice and ideas on optimizing.
Thanks to Dragokas
for testing version 2.0.
Thanks to JoBarfCreepy
for Danish translations.
Thanks to Tertius Gaudens
for German translations.
Thanks to disawar1
for Russian translations.
Thanks to januto
for Spanish translations.
Thanks to bazrael
for Traditional Chinese translations.
- Transfers: molotovs, pipebombs, vomitjars, defibrillators, first aid kits, pain pills, adrenaline, explosive and incendiary rounds.
- Survivor bots can pick up nearby items. (Auto Grab)
- Survivor bots can give their items to players with none. (Auto Give)
- Allows players to give items to other players.
- Allows players to give, grab or switch items with a survivor bot.
- Bots auto give/grab order can be re-arranged. Read "ORDER GRAB/GIVE" section inside the code and recompile.
- l4d_gear_transfer_notify 1 will display text to chat like this:
How to use:
(right click melee) or press your RELOAD
(default R) key whilst looking directly at another survivor.
Saved to l4d_gear_transfer.cfg
in your servers \cfg\sourcemod\
l4d_gear_transfer_allow "1" // 0=Plugin Off, 1=Plugin On.
l4d_gear_transfer_dist_give "150.0" // How close you have to be to transfer an item Affects bots auto give.
l4d_gear_transfer_dist_grab "150.0" // How close the bots need to be for them to pick up an item.
l4d_gear_transfer_method "3" // 0=Off. 1=Shove only, 2=Reload key only, 3=Shove and Reload key to transfer items.
l4d_gear_transfer_modes_bot "" // Disallow bots from auto give/grab in these game modes, separate by commas (no spaces). (Empty = none).
l4d_gear_transfer_modes_off "" // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
l4d_gear_transfer_modes_on "" // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
l4d_gear_transfer_modes_tog "0" // Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
l4d_gear_transfer_notify "1" // 0=Off, 1=Display transfer info to everyone through chat messages.
l4d_gear_transfer_sounds "1" // 0=Off, 1=Play a sound to the person giving/receiving an item.
l4d_gear_transfer_timeout "5" // Timeout to stop bots returning an item after switching with a player. Timeout to prevent bots auto grabbing a recently dropped item.
l4d_gear_transfer_timer_give "1.0" // 0.0=Off. How often to check survivor bot positions to real clients for auto give.
l4d_gear_transfer_timer_grab "0.5" // 0.0=Off. How often to check survivor bot positions to item positions for auto grab.
l4d_gear_transfer_traces "15" // Maximum number of ray traces per frame for auto give/grab. This could be increased with minimal impact.
l4d_gear_transfer_types_give "123456789" // Which type can bots auto give. 0=Off. 1=Adrenaline, 2=Pain Pills, 3=Molotov, 4=Pipe Bomb, 5=Vomit Jar, 6=First Aid, 7=Explosive Rounds, 8=Incendiary Rounds, 9=Defibrillator. Any string combination.
l4d_gear_transfer_types_grab "123456789" // Which type can bots auto grab. 0=Off. 1=Adrenaline, 2=Pain Pills, 3=Molotov, 4=Pipe Bomb, 5=Vomit Jar, 6=First Aid, 7=Explosive Rounds, 8=Incendiary Rounds, 9=Defibrillator. Any string combination.
l4d_gear_transfer_types_real "123456789" // The types real players can transfer. 0=Off. 1=Adrenaline, 2=Pain Pills, 3=Molotov, 4=Pipe Bomb, 5=Vomit Jar, 6=First Aid, 7=Explosive Rounds, 8=Incendiary Rounds, 9=Defibrillator. Any string combination.
l4d_gear_transfer_vocalize "1" // 0=Off. 1=Players vocalize when transferring items. Blocked for the first 60 seconds of a new round.
l4d_gear_transfer_version // Gear Transfer plugin version.
- Fixed right click passing conflict with "Prototype Grenades" plugin. Thanks to "fbef0102" for fixing.
- Extra checks to prevent "IsAllowedGameMode" throwing errors.
- Various changes to tidy up code.
- Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.
- Fixed duplicating weapons bug (bots picking invisible _spawn items). Thanks to "ridiculousties" for reporting.
- Fixed clients swapping to pistols. Thanks to "TiTz" for reporting.
- Switching grenades now keeps the grenade equipped.
- Fixed switching first aid with bots instead of healing them.
- Fixed bots auto giving straight away after you gave them adrenaline/pills.
- Fixed players instantly grabbing from bots after they gave adrenaline/pills.
- Fixed not being able to grab adrenaline/pills from shoving. Thanks to "KillerBudgie" for reporting.
- Added additional checks to prevent OnWeaponEquip errors. Thanks to "Mr. Man" for reporting.
- Fixed Molotov idle sound not stopping on transfer. Thanks to "ceasedU" for reporting.
- Fixed not picking up items in Survival/after round restart due to last version fixes.
- Fixed "Invalid memory access". Thanks to "Lux" for reporting.
- Fixed bots not always picking up items.
- Additional optimization for L4D1.
- Fixed error from missing event "weapon_drop" in L4D1. Thanks to "Dragokas" for reporting.
- Plugin overhauled and optimized. Several times faster than the previous version.
- Profiler used to determine the best procedures for least CPU cycles.
- Auto give/grab features and item exchange with reload/shove key is much more optimized.
- Cvars have been changed and renamed. Please delete or backup and update your old cvars config.
- Thanks to "Lux" for testing and lots of advice and ideas on optimizing.
- Thanks to "Dragokas" and "disawar1" for testing.
- Fixed invalid entity errors from "Prototype Grenades" support changes. Thanks to "Dragokas" for reporting.
- Blocks transferring items when pressing Shoot + Shove, to support "Prototype Grenades" plugin.
- Added support for "Prototype Grenades" plugin.
- Prevents auto grab and auto give during intro cut scenes.
126.96.36.199 (09-May-2019) (Dragokas)
- Added detection of sex additionally by character (for custom models).
- Removed LogError "Tracer Bug".
- Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.
- Changed cvar "l4d_gear_transfer_modes_tog" now supports L4D1.
- Fixed invalid entity error - Thanks to "Newbie_Sexy" for reporting and "Visual77" for some code.
- Fixed client not connected errors - Thanks to "Lux" for reporting.
- Fixed depreciated FCVAR_PLUGIN flag.
- Added Traditional Chinese translations - Thanks to "bazrael".
- Added cvar "l4d_gear_transfer_vocalize" to control transfer vocalizes - Thanks to "bazrael" for the request.
- Fixed the last update breaking auto give and auto grab.
- Added Russian translations - Thanks to "disawar1".
- Added cvar "l4d_gear_transfer_modes_on" to control which game modes the plugin works in.
- Added cvar "l4d_gear_transfer_modes_tog" same as above, but only works for L4D2.
- Fires the item_pickup and player_use events when bots auto grab. Required for Footlocker Spawner 1.2+.
- Added cvar 'l4d_gear_transfer_modes_off' to turn off the plugin on certain game modes.
- Fixed deleting grenade spawns which give infinite items.
- Changed the bot allow cvars (as requested by "LTR.2") so you can specify which items bots auto give/grab.
- Another attempt to fix 'm_humanSpectatorUserID' errors.
- Added chat notifications block from round start the same as vocalize block.
- Changed the previous check to make sure the netclass is 'SurvivorBot', should stop all related errors.
- Added check for 'bebop_bot_fakeclient' which caused errors.
- Removed the -attack2 after shoves thanks to Valve patching some client commands.
- Added IsVisibleTo for player to player transfers (stops transfers through walls!)
- Fixed auto give transferring directly after a player to player transfer.
- Optimized a lot code.
- Fixed allow cvars not restricting their correct items.
- Added cvar 'l4d_gear_transfer_modes' to disable auto give/grab in listed game modes.
- Added cvar 'l4d_gear_transfer_timer_item' to specify how often the auto grab item list updates.
- Added delay to auto give when switching items with bots.
- Added vocalize block for 60 seconds from round start.
- Added check for translation file.
- Added finale_vehicle_leaving event to disable auto give/grab.
- Added notifications for auto give/grab when 'l4d_gear_transfer_notify' is enabled.
- Removed hint text when l4d_gear_transfer_notify set to 2. Now only shows chat notifications.
- Added ("-attack2") to stop shoving after successful transfer.
- Added FCVAR_DONTRECORD flag to the version cvar.
- Fixed 'switch' translation being given the wrong weapon name.
- Changed weapon name text color to yellow.
- Fixed player_shoved transfers not working because of a missing exclamation mark!
- Fixed Infected receiving items.
- Optimized auto give a little.
- Re-added FileExists check for scenes, now using Valve's Filesystem!
- Small changes.
- Re-added player_shoved event to transfer items.
- Removed FileExists check from scenes, now vocalizes L4D1 characters!
- Fixed creating dupe grenades when throwing.
- Fixed AutoTimer rubbish!
- Stopped auto give/grab when survivor is incapped/reviving.
- Small fixes.
- Added displaying transfers in chat messages with translations.
- Changed some vocalize parts for The Sacrifice update.
- Fixed disabling shove transfers with first aid.
- Officially supports the first Left4Dead!
- Added check so bots will not auto grab "projectile" grenades.
- Added check so bots will not auto grab items who have owners.
- Added cvars to allow/disallow bots to auto give/grab certain items.
- Changed cvars to comply with releasing guidelines.
- Idle players no longer treated as bots.
- Small changes to auto grab.
- Disabled transfers with incapacitated players.
- Fixed disabling auto give/grab in versus.
- Changed the fix for auto grab creating two grenades again.
- Removed player_shoved event, reload+shove transfer from OnPlayerRunCmd.
- Changed the fix for auto grab creating two grenades.
- Fixed auto grab creating two grenades!
- Delaying all bots for 3 seconds after they receive an item.
- Optimized code.
- TraceFilter added on survivors so they don't block transfers.
- Delayed bots auto give for 3 seconds after they are given an item.
- Fixed auto give when sb_all_bot_team.
- Added weapon_given hook to stop pills/adrenaline being given back!
- Minor changes.
- Added adrenaline and pain pills to transfers. You can only use the reload key to switch.
- Added cvars to allow/disallow the above transfers.
- Added vocalize on first aid kit transfers.
- Renamed more appropriately to "Gear Transfer".
- Added defibrillators, first aid kits, explosive and incendiary rounds to transfers.
- Added cvars to allow/disallow the transfer of certain items.
- Changed the transfer being triggered by the Use key to the Reload key.
- Disabled auto give/grab in versus games (as they should be full with players!).
- Removed HookSingleEntityOutput, which was causing crashes.
- Some fixes.
- Added "AtomicStryker"'s Vocalize with scenes.
- Removed Vocalize stuff.
- Changed things "AtomicStryker" suggested.
- Fixed UnhookEvent error.
- Added check in case of over 64 grenades.
- Initial release.
Updating from 1.6.5 or older:
- Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
- Download "translations_gear_transfer.zip" and extract the "translations" folder to your servers \addons\sourcemod\ folder.
- New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
: English (en), Chinese Traditional (zho), Danish (da), German (de), Portuguese (pt), Russian (ru), Spanish (es).