This plugin was a request - read about it here
DESCRIPTION
When a weapon is dropped as a result of a player's death, an ammo box will be dropped alongside the weapon. The weapon entity's extra ammo will be set to 0 and the ammo box will contain what the extra ammo was. If the weapon had 15 in the clip with 75 reserve, the ammo box will have 75 rounds.
It will also record the weapon type (Rifle, Pistol, or Shotgun) and the ammo type. There are CVars (see below) where you can deem if a player can fill their ammo even if the ammo type is different. You can also set this plugin to abide by weapon ammo max so that players cannot pick up more than the default ammo max allowed.
Explanation of allowing or disallowing picking up ammo of the same type if the weapon that dropped it was different - player1 dropped their MP5 rifle and a box of 9mm ammo was dropped from that weapon. If player2 has a glock (which is 9mm) and you have mixed ammo set to "allow" then player2 can pick up that 9mm ammo - if, on the other hand, you have mixed ammo set to "disallow" then player2 cannot pick up that ammo even though their glock uses the same ammo type.
There are three models for the ammo boxes (all included with CS:S, so no need to have anything downloaded to your clients). A model for shotgun ammo, a model for pistol ammo, and a model for rifle ammo. There's also two sound files (also included with CS:S, no need for a download) that fires when players pick up the ammo (you define which one you want to use).
Here are the three models:

You can also set to only allow players to drop pistol ammo, or only drop rifle ammo, or be able to drop both. Also, you can set if bots drop ammo or not.
Also, this plugin is Updater capable and a CVar is present (defaulted to off) so you can set whether this plugin gets auto-updated or not (if you have the Updater plugin).
CVars
"sm_afd_anymixedammo" = "0" min. 0.000000 max. 1.000000
- If ON, players can refill their pistol ammo by picking up any pistol ammo box, same for shotguns with shotgun ammo box, and the same for rifles (SMG, Rifle, Sniper Rifle, and Machine Gun) with rifle ammo box.
1=ON, 0=OFF
"sm_afd_botsdrop" = "1" min. 0.000000 max. 1.000000
- Do bots drop ammo?
1=yes, 0=no
"sm_afd_enabled" = "1" min. 0.000000 max. 1.000000
- Am I enabled?
1=yes, 0=no
"sm_afd_maxammo" = "1" min. 0.000000 max. 1.000000
- Should plugin abide by the weapon's max ammo when picking up dropped ammo?
If yes, then the left over ammo will remain on the ground. If all of the ammo is picked up, then the ammo box will disappear.
1=yes, 0=no
"sm_afd_mixedammo" = "1" min. 0.000000 max. 1.000000
- Allow player to pickup ammo if "ammo type" is the same regardless of if "gun type" is different (UMP vs glock)?
1=yes, 0=no
"sm_afd_pistols" = "1" min. 0.000000 max. 1.000000
- Drop pistol ammo?
1=yes, 0=no
"sm_afd_playsound" = "1" min. 1.000000 max. 2.000000
- Who should hear the sound?
1 = Only the player
2 = Everyone in the vicinity (like normal item pickups)
"sm_afd_rifles" = "1" min. 0.000000 max. 1.000000
- Drop rifle (shotty, awp, auto, rifle) ammo?
1=yes, 0=no
"sm_afd_sound" = "1" min. 1.000000 max. 3.000000
- Which sound should we play when ammo is picked up?
1 = cstrike/items/itempickup.wav
2 = hl2/items/ammo_pickup.wav
3 = cstrike/items/ammopickup.wav
"sm_afd_useupdater" = "0" min. 0.000000 max. 1.000000
- Utilize Updater plugin to auto-update ammo_from_dead when updates are published?
1=yes, 0=no
REQUIREMENTS
SDKHooks
Optional
Updater
CREDITS and THANKS
Bacardi for borrowed code from Healthkit from dead plugin
GrO for the tremendous help in testing and suggesting tweaks. GrO was the initial requester and helped out a lot.
Folks on IRC for putting up with my questions
CHANGE LOG
Version 0.2.0.1
- Initial release
TO DO LIST
mmm - suggest something

INSTALLATION
Copy the SMX file to your plugins folder. If you want to compile yourself, you'll need SDKHooks include and Updater include files. The web compiler will not compile the .sp, so you'll need to download the attached .smx.
Also, you need to put the giveammo.txt in your gamedata folder.
A config file will be created when you first launch this plugin - it will be in your cfgsourcemod folder named plugin.ammo_from_dead.cfg
SCREENSHOTS
Attached Thumbnails
https://forums.allie...=1&d=1325352952 Attached Files



Wyświetl pełny artykuł