01-23-2015, 09:42 PM
(01-23-2015, 09:15 PM)Varanon link Wrote: The script is correct, as far as I can see... Where do you call it ?
I call the loadouts in init.sqf. Here it is in its entirety:
Code:
FHQ_fnc_safeAddLoadout = {
  _unit = _this select 0;
  _scriptName = _this select 1;
  if (!local _unit) exitWith {};
  _isHandled = _unit getVariable "FHQ_loadout_handled";
 Â
  if (isNil "_isHandled") then {
    _unit setVariable ["FHQ_loadout_handled", true, true];
    _unit call compile preprocessFileLineNumbers _scriptName;
  };
};
/*
* Important!
* There is a small window were "isPlayer xxx" yields true on a dedicated, but
* "local xxx" on the server ALSO yields true. The player object stays on the server
* until the client has connected. The below makes sure that this script doesn't continue
* on the client's machine until the player is connected correctly.
*/
if (!isDedicated) then
{
  waitUntil {!(isNull player)};
  waitUntil {alive player};
};
call compile preProcessFileLineNumbers "fhqtt.sqf";
call compile preProcessFileLineNumbers "briefing.sqf";
/*
* Initialize the loadouts
* This array contains all my loadout scripts in the order that units appear in the mission.
* You can use other methods to determine a loadout, like class
*/
_loadouts = [
  "loadouts\nov01.sqf",
  "loadouts\nov02.sqf",
  "loadouts\nov03.sqf",
  "loadouts\nov04.sqf",
  "loadouts\nov05.sqf",
  "loadouts\nov06.sqf",
  "loadouts\nov07.sqf",
  "loadouts\nov08.sqf",
  "loadouts\nov09.sqf",
  "loadouts\nov10.sqf"
];
/*
* FHQ_fnc_safeAddLoadout is a function in the function module I use for every
* mission. See below
*/
{
  if (local _x) then {
    _loadout = _loadouts select _forEachIndex;
    [_x, _loadout] call FHQ_fnc_safeAddLoadout;
  };
} foreach (switch (isMultiplayer) do { case true: {playableUnits}; default {switchableUnits};});
//by psycho
["%1 --- Executing TcB AIS init.sqf",diag_ticktime] call BIS_fnc_logFormat;
enableSaving [true,true];
enableTeamswitch true;
// TcB AIS Wounding System --------------------------------------------------------------------------
if (!isDedicated) then {
  TCB_AIS_PATH = "ais_injury\";
  {[_x] call compile preprocessFile (TCB_AIS_PATH+"init_ais.sqf")} forEach (if (isMultiplayer) then {playableUnits} else {switchableUnits});    // execute for every playable unit
 Â
  //{[_x] call compile preprocessFile (TCB_AIS_PATH+"init_ais.sqf")} forEach (units group player);                          // only own group - you cant help strange group members
 Â
  //{[_x] call compile preprocessFile (TCB_AIS_PATH+"init_ais.sqf")} forEach [p1,p2,p3,p4,p5];                            // only some defined units
};
// --------------------------------------------------------------------------------------------------------------
PMC Versus operation dossier: http://pmcversus.weebly.com/