_goggle(s)Types = ["G_Diving"]

_goggle(s)Types = ["G_Diving"]

« posted: Jul 29, 2016, 02:01 PM »
Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Name: createRandomSoldier.sqf
/*
 * Creates a random civilian diver.
 *
 * Arguments: [ position, group, init, skill, rank]: Array
 *    position: Position - Location unit is created at.
 *    group: Group - Existing group new unit will join.
 *    init: String - (optional, default "") Command to be executed upon creation of unit. Parameter this is set to the created unit and passed to the code.
 *    skill: Number - (optional, default 0.5)
 *    rank: String - (optional, default "PRIVATE")
 */

if (!isServer) exitWith {};

private ["_soldierTypes",
"_uniformTypes",
"_vestTypes",
"_goggleTypes"
"_weaponTypes",
"_group",
"_position",
"_rank",
"_soldier"];

_soldierTypes = ["C_man_polo_1_F", "C_man_polo_2_F", "C_man_polo_3_F", "C_man_polo_4_F", "C_man_polo_5_F", "C_man_polo_6_F"];
_uniformTypes = ["U_O_Wetsuit", "U_B_Wetsuit" ,"U_I_Wetsuit"];
_vestTypes = ["V_RebreatherB","V_RebreatherIR","V_RebreatherIA"];
_goggleTypes = ["G_Diving"]
_weaponTypes = ["arifle_SDAR_F"];

_group = _this select 0;
_position = _this select 1;
_rank = param [2, "", [""]];

_soldier = _group createUnit [_soldierTypes call BIS_fnc_selectRandom, _position, [], 0, "NONE"];
_soldier addUniform (_uniformTypes call BIS_fnc_selectRandom);
_soldier addVest (_vestTypes call BIS_fnc_selectRandom);
_soldier addGoggle (_goggleTypes call BIS_fnc_selectRandom);
[_soldier, _weaponTypes call BIS_fnc_selectRandom, 3] call BIS_fnc_addWeapon;

if (_rank != "") then
{
_soldier setRank _rank;
};

_soldier spawn refillPrimaryAmmo;
_soldier spawn addMilCap;
_soldier spawn tlq_killTicker;
_soldier call setMissionSkill;

_soldier addEventHandler ["Killed", server_playerDied];

_soldier

I want to create a random diver. I think, everything's fine. But one question:

"_goggleTypes"
_goggleTypes = ["G_Diving"]
_soldier addGoggle (_goggleTypes call BIS_fnc_selectRandom);


OR

"_gogglesTypes"
_gogglesTypes = ["G_Diving"]
_soldier addGoggles (_gogglesTypes call BIS_fnc_selectRandom);
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: _goggle(s)Types = ["G_Diving"]

« Reply #1 posted: Jul 29, 2016, 05:11 PM »
Code: [Select]
_gogglesTypes = ["G_Diving","G_Blah"] call BIS_fnc_selectRandom;
_soldier addGoggles _gogglesTypes;

- from the grassy knoll -

Re: _goggle(s)Types = ["G_Diving"]

« Reply #2 posted: Jul 29, 2016, 06:41 PM »
thx, m8!  8)