Jump to content
Sign in to follow this  
T.Hanford

Selecting a preset loadout

Recommended Posts

Is there a way that i can have a player spawn in, and then pick a new loadout from certain presets?

thanks in advance

-timmyrules

3rd parachute battalion

Share this post


Link to post
Share on other sites

You can create a preset loadout in the Virtual Arsenal (It's under Learn - when you first start Arma 3). Once you have it created, you can click save/export. This will copy a text code and you can paste (ctrl+v) into the "initialization" box when you are in editor mode for each of the units.

Share this post


Link to post
Share on other sites

If you need to have the loadout capability after they respawn you could put addActions on the player in the onPlayerRespawn.sqf, each addAction passing a different argument into your loadout script to be used in a switch statement, which will then loadout the player depending on the loadout selected, then removeAllActions from the player after that.

onPlayerRespawn.sqf:

(_this select 0) addAction ["Loadout 1", "loadout.sqf", [0], 6, false, true, "", ""];
(_this select 0) addAction ["Loadout 2", "loadout.sqf", [1], 6, false, true, "", ""];
(_this select 0) addAction ["Loadout 3", "loadout.sqf", [2], 6, false, true, "", ""];
(_this select 0) addAction ["Loadout 4", "loadout.sqf", [3], 6, false, true, "", ""];

loadout.sqf:

_unit = (_this select 1);
_loadout = (_this select 3) select 0;

switch (_loadout) do {

case 0: {
//code for loadout
};

case 1: {
//code for loadout
};

case 2: {
//code for loadout
};

case 3: {
//code for loadout
};

default {
hintSilent "Error in loadout script switch variable.";
};

};

removeAllActions player;

Edited by JShock

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  

×