If you didn't know, "game_player_equip" is the name of a mechanism, implemented in some Source Engine based games, which allows mappers to set the outfit of players during gameplay. In Day of Defeat: Source, this can be used to place pickable weapons in the scenery; so, for example, a player can change their main weapon without changing class, and without waiting the drop of another player, or can pick a grenade not provided by his class. But in Day of Defeat: Source there are two issues about this mechanism:
- These pickable weapons can't have more than one ammo.
- If the player picks a weapon (except some grenades) which takes up a slot occupied by a weapons he owns, the picked weapon is spawned to the player position, falls over the ground then disappears. (mainly a visual issue, however)
so, this plugin fixes this.
Requirements:
I tested this plugin on SourceMod 1.7.3 build 5275, but every build which works on the latest version of Day of Defeat: Source should be good.
Notes for programmers and mappers:
- This plugin needs SMlib during compile; i have attached the snapshot from its GitHub i used.
- This plugin corrects what happens when the game_player_equip entity receive the Use input and the activator is the player. I tested it with a trigger_multiple linked to a game_player_equip, but even a func_button should work.
- As you can imagine, the amount of ammo must be specified in the value field related to the weapon specified as key name. A single unit of ammo is a single round, not a single bullet (except for bazooka and grenades).
- I attached a map for testing purposes.
Maps designed for this plugin:
Obviously, any feedback is well accepted.
A thanks to the authors of SourceMod, the SMlib and
SPEdit.