Sorry for the confusion Captain. I should have explained more clearly. That is just a fictional name of a variable I created for the example. In order for it to be used we have to set it to the position of your trash bin. Before going on, make sure you are familiar with these entries in the COMREF.
position (array type)
position (command)
getPos (same as the
position command)
setPos (command)
Ok, now let's make the code more specific. What are using for a trash bin? Are using a barrel object that you have placed in the editor? If so, put "bin" (without quotes) in the name field of that object. If you are using an object that is already on the map, the process is a little different. Assuming the barrel (or similar object
you place) we are actually going to skip using _position, and just use getPos and setPos directly instead. Try this code in your script:
_binWep = "WeaponHolder" createVehicle (getPos bin); // Create a weapon holder at the position of the bin (using getPos).
_binWep addMagazineCargo ["15Rnd_9x19_M9SD",2]; // Add two M9SD magazines to the bin.
_binWep addWeaponCargo ["M9SD", 1]; // Add one M9SD to the bin.
_binWep Setpos [(getPos bin Select 0), (GetPos bin Select 1), (getPos bin select 2) + .85] // Sets the weapon/mags "exactly" on top of the bin using setPos (otherwise it would be hidden within the barrel)
If you are using a object that already exists on the map, I recommend you create a game logic, name it bin, and place it exactly where you want the weapons to be.
FYI, you may have to move about a bit and try the action a couple of times before you see "Take M9 Silenced" in the action menu and can pick it up.
Good luck!