Force pickup weapon

I need function for force pickup weapon.
pl:GetSaveTable().m_hMyWeapons just return the last pickuped weapon (Entity), but in C it is list. Changing this value will lead to bizarre consequences.

How I can get access to methods of entities in Visual Studio?


it call PlayerCanPickupWeapon. And I want work with exists weapon

[editline]17th March 2015[/editline]

and PlayerCanPickupWeapon bugged. I think PlayerCanPickupWeapon have in lua and engine and fist called in lua than in engine. You can’t pickup weapon wich origin in wall and you will need use SetPos, but it is so idiotic

PlayerCanPickupWeapon is not bugged. ( It may be for you if you use badly coded addons )

You can’t “force” pickup an entity weapon.

The way it works, is _p:Give( x ) will spawn the weapon and try to let the player pick it up through PlayerCanPickupWeapon. If you wrote something where the user needs to press E to pick up the weapon then an easy fix is to add a SpawnTime to the weapon and return true in PlayerCanPickupWeapon if the weapon was freshly spawned ( at least it’s how I do it )…