Jump to content
Sign in to follow this  
cyop

Simple script for unit to respawn with 'original' custom load-out?

Recommended Posts

For instance, give a Corpsman an M16A4, he dies, reinforce with SecOp, he comes back with the M16A4, instead of the M4A1.

Let me be clear... I want this to work with all units in my squad, no matter what their custom load-out.

EDIT: Title.

Edited by CyOp

Share this post


Link to post
Share on other sites

step one: collect information on what weapons the unit has

step two: give him the weaposn

in the init line for a unit: null = this execVM "weapons.sqf"

weapons.sqf

 
_player = _this select 0;
_weapons = weapons _player;
_magazines = magazines player;

while {true} do
{
waitUntil !(alive _player);
waitUntil (alive _player);

{_player addMagazine _x} forEach _magazines;
{_player addWeapon _x} forEach _weapons;

};

Untested, so don't pin me down on it. Also, new to sqf scripting:rolleyes:

Edited by Toasted Duckie

Share this post


Link to post
Share on other sites

_player = _this select 0;
_weapons = weapons _player;
_magazines = magazines [color="Red"]_[/color]player;

while {true} do
{
waitUntil !(alive _player);
waitUntil (alive _player);

{_player addMagazine _x} forEach _magazines;
{_player addWeapon _x} forEach _weapons;

};

Well, that might work with something like SP/MP Warfare, or maybe even in MP, for the player, but I wanted something for my squad respawns in SP that are reinforced through the SecOp.

Thank you, though. I appreciate the reply. :)

EDIT: Reference

Edited by CyOp

Share this post


Link to post
Share on other sites

BTW, this does not have to happen through the SOM.

I found something for ArmA, but not ArmA 2.

Anyone?

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  

×