You can use for example fm_get_aim_origin from the
Fakemeta Utilities and check with fm_find_ent_in_sphere if there are entities close to the aim point (set the short radius for that).
If so - check whether it's a weaponbox entity (classname). If so - get the linked weapon_* entity (classname). You can use for example fm_find_ent_by_integer(-1, pev_owner, weaponbox_entity_index_here) for that.
Then you should check whether the player already have this weapon or not. You can use for example
fm_find_ent_by_owner(-1, weapon_entity_classname, player_index) for that.
Also check if the weapon isn't a C4. In CS a player will be able to collect it mannually anyway, also this will avoid breaking of some specific things.
If so - give the found weapon to a player. You can use for example fm_give_item(player_index, weapon_entity_classname) for that.
Then all you have to do is delete the weaponbox and entity that linked to it. Don't try to delete them with default methods, it may crash your server. Use dllfunc(DLLFunc_Think, weaponbox_entity_index) for that.