Jump to content
roguetrooper

Spawn pistol into player's inventory (not hands)

Recommended Posts

How could it be achieved to spawn a pistol (AS THE ONLY WEAPON) into a player's inventory so that the pistol remains within the inventory and is not taken into hands automatically?

When you give a player a weapon (player addweapon "weaponname") and immediately execute

player action ["SWITCHWEAPON",player,player,-1]

the gun still in his hands for a second.

Share this post


Link to post
Share on other sites

Maybe this:

anim_player = animationState player;
player addWeapon "classname";
player action ["SWITCHWEAPON",player,player,-1]
player switchMove anim_player;

 

Share this post


Link to post
Share on other sites

What about

player addItemToUniform "hgun_Rook40_F";

? Same goes for addItemToVest and addItemToBackpack.

Share this post


Link to post
Share on other sites

Sure, that's not the same thing though.

Share this post


Link to post
Share on other sites

What I always do for this is just spawn a box in the editor and add this to the init:  ["AmmoboxInit",[this,true]] call BIS_fnc_arsenal;

Now go ingame and open the arsenal then pick whatever you want, exit the arsenal > put it in your bags etc etc...

And again back to the arsenal to save or export it for use...

 

 

If you know all the names it is easy to just add it like 7erra says...

But if not, yea it might be easier to just use the arsenal instead.

When you click on export it automatically removes everything and add's the things you've just exported(also when u put things in u bag as explained).

Now you can just paste this code directly into the init of the players unit.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×