Jump to content
Sign in to follow this  
Slugs

Civilians with weapons

Recommended Posts

I want to have civilians that carry pistols and can use an action to holster them. I can add the pistol to the character but I cant make them holster the pistol. I have tried pressing the switch weapon or pulling out binoculars to switch it so I was wondering if there was a command I could use after: this addaction to make them put the pistol away.

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addweapon "m9";this setbehaviour "careless";

shot this civ in the leg and he pulled a m9 on me..."go figure"

Share this post


Link to post
Share on other sites

That works if the civilian is AI controlled, I want it to be player controlled. If its player controlled you start with it away but draw it a few seconds later automatically.

Share this post


Link to post
Share on other sites

ok.....

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addAction ["pistol","Holster.sqf"];

then in Holster.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if(player hasWeapon "M9")exitwith{player removeWeapon "M9"};

if not(player hasWeapon "M9")exitwith{player addWeapon "M9";player addmagazine "15Rnd_9x19_M9";player addmagazine "15Rnd_9x19_M9";};

Now for some reason the ammo isn't given to the player and I'm

not sure why the player has to take 3 steps forward when pistol is removed but have a play with it or work on another option.

cheeers

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
Sign in to follow this  

×