For those that do not know what an armoury_entity is, they are the weapons that are on the ground on maps such as fy_snow and fy_iceworld that are free for players to pickup. Each of these entities can be set to a specific weapon/item type and set to hold X quantity of the item. This plugin allows you to create armoury_entity's on maps that do and do not have them by default. The following items are not available as an armoury_entity: c4, knife, pistols, famas and galil. armoury_entity's are not the same as weapons that have been dropped.
This plugin allows you to:
Create armoury_entity's
Change existing armoury_entity weapon type and/or count
Delete/Undelete armoury_entity's
All changes to armoury_entity's are stored separately for each map so you can create/modify/delete them on each map independently. Each change is specific to the exact one that was selected so changing one weapon will not affect any other weapons in the map. All changes are re-applied when the map is changed. The changes are saved to amxmodx\configs\ArmouryManager\ and the file name is the map name. The map config files are saved in binary format so do not attempt to modify them with a text editor because the file will become broken and the plugin may crash when it attempts to process it.
Commands
am_enable - This enables the Armoury Manager. It will make all armoury_entity's, even empty or deleted ones, display on the map. When the manager is enabled, you will get a HUD message when aiming at a weapon which tells you details about the weapon as well as a message telling you to hold Use to select the item. When aiming at an empty area, a HUD message will display which tells you that an item can be created. You cannot pickup any armoury_entity's while the manager is enabled so you can walk over them while you are making changes without picking them up.
am_disable - This disables the Armoury Manager. It will put all armoury_entity changes into effect and re-hide any unmodified armoury_entity's if they are empty.
am_info <optional start pos> - This displays the status of all armoury_entity's on the map, including both original and ones that have been created. Due to limitations of the MOTD window, it cannot display the status of more than ~12 at a time so to view more than the first 12, you need to specify the start pos in the command (eg. "am_info 13").
am_deletemapconfig - This deletes all saved changes for the current map. To restore all entities to their original state you must change the map.
Usage
Basic usage is as follows: am_enable command, make all entity changes, am_disable command. Weapons cannot be picked up until am_disable is used.
Change existing armoury_entity
Use am_enable command to enable the Armoury Manager.
Aim at a weapon until it glows and a HUD message appears with the items details. Hold the Use button to select the weapon. It will turn green when selected and you will see a menu appear with change options.
Select an action to take on the weapon: Change Type, Change Count and Delete Item.
When you are done making changes to all weapons that you wish to modify, use the am_disable command to disable the manager.
Create a new armoury_entity
Use am_enable command to enable the Armoury Manager.
Aim at an empty area on the map. A HUD message will display saying to hold Use to create an item. When you hold Use, you will then see a menu to select the item type to be created.
Select the type of item and then item count.
Use the am_disable command to disable the manager.
Screen shots
In this example, I am going to modify the weapon type of an existing armoury_entity.
Use am_enable command.
Aiming at weapon that I want to make a change to.
I held Use to select the weapon. I then selected Change Type.
A menu appears with change values. I selected m4a1.
Weapon type successfully changed.
Use am_disable command.
I also attached a tool with source code that I made in Visual Basic 6.0 that allows you to open an Armoury Manager map config file to view its contents/item details. I created this for debugging purposes only so there is no error trapping. As long as you only select an Armoury Manager config file with it, you should get no errors.
Please let me know if you discover any bugs and/or if there are any features that you think could make this better.
Changelog:
Spoiler
Code:
/*Changelog:
0.1b Fixed many tag mismatch warnings that appeared only in 1.8.2. (ty Smiley92)
0.1b Fixed compatibility issue with 1.8.2 by registering the TraceLine forward as post. This works in both 1.8.2 and 1.8.3. (ty Smiley92)
0.1c Fixed issue where if a weapon is created with count of X and then a count change was made of Y it would always be created with original count value X on map change.
0.1c Fixed issue where items counts would revert back to one on new round. (ty Arkshine)
0.2 Fixed issue in am_info table where it would incorrectly show a Change Weapon value when one did not exist. It was data that remained in the variable from the previous row.
0.2 Changed am_info to display changes exactly as they are applied. If the item is changed and then reverted back to its original type/count/undeleted, it aill appear as unchanged.
0.2 Increased MaxEntities count to 100. The original value of 50 was too low to accomodate fy_snow. An error will be thrown if this value is reached, the error tells you to increase it.
0.2 If a change is applied and then the item is deleted, the change details as well as the deletion will be re-applied on map change.
0.2 Menu callback added to disable type/count change options if the item is currently deleted. You must first Un-delete in order to make changes.
0.2 Added workaround fix for duplicate last item in config getting loaded into array.
0.2 Eliminated redundant pev_iuser4 reads.
0.2 Fixed issue where weapons could be picked up while the Manager was enabled if the weapon was modified of created.
0.2b Changed hud messages to use sync huds to avoid overlapping. (ty Smiley92)
0.2b Added glow when aiming at an item. The glow color will change when item is selected.
0.2b Fixed permission issue. While players without the flag could not enable/disable the editor, they could manipulate entities while it is enabled.
0.2c Added multi-player support. Multiple players can now edit/create armoury entities at the same time. It was never actually documented that this wasn't possible--but now it is.
0.2c Made all huds disappear instantly once the manager is disabled. Previously, they would remain for 1~2 seconds while the holdtime expired.
0.2c Fixed rendering issue for when the manager is enabled and a deleted entity is hovered over and glows. When the glow is removed, it was rendering back to normal instead of semi-transparent.
0.2c Fixed invalid player error in traceline forward.
0.2c Fixed bug when a created entity was deleted. The weapon deletion was not restored on map change.
0.2c Fixed bug that was breaking the aim origin returned in traceline. When the user selected to create an entity and exited out of the menu, I was not first checking if the user had an
existing entity selected before performing actions on the entity index. This was allowing actions to be taken on an entity index of 0 which was breaking traceline.
0.2c Removed some redundant code.
0.3 Changed am_info to make it able to display all entities by allowing the user to specify the starting index as an optional parameter./12 are displayed per cmd/MOTD.
0.3 Fixed issue where after an entity was deleted and Armoury Manager disabled, the entity would be invisible but could still be picked up if walked over.
0.3a Fixed issue where if a non-armoury_entity existed where the player was aiming, it would not give the HUD to allow a weapon to be created.
0.3a Made plugin check all players status when attempting to disable the Armoury Manager to make sure nobody is in the middle of an edit. Previously, only the disable-requester was checked.
0.3a Misc code cleanup.
0.3b More code cleanup.
0.3b Changed number of entities displayed per page to 10 in am_info command. I found this to be a safer value when there are multi long-length weapon names displayed (smoke grenade, vest helmet).
0.3b Fixed issue where if a player picked up the last of an armoury item and then the armourmy manager was enabled then disabled, this entity would re-appear with a count of 1.
*/
Don't forget that armoury_entity entities are cleaned up at new round, restarted more exactly (CArmoury::Restart), and entities created through create_entity() will be ignored by game. With amxx dev build, you could have used cs_create_entity(). To be consistent, you will need to cleanup manually custom armoury_entity (Ham_Restart)
Well yes that's the thing, I want to keep it backwards compatible since users will be running a mix of both.
Edit: Posted a fix to my fix. To resolve the 1.8.2 issue I had to register traceline as post. I overlooked not disabling the forward as post when disabling the manager.