Files
Clarksons_Logi_Framework/functions/fn_initBaseHQ.sqf
T

67 lines
1.2 KiB
Plaintext
Raw Normal View History

/*
Author: Clarky
Usage:
[this, side] call CLF_fnc_initBaseHQ;
Intended to run on the server, which calls a CBA event handler that runs a client-level script for adding relevant interactions
Purpose:
Initialises a logistics base HQ. Adds the new base to the global base hashmap. Runs a child function to intialise clientside actions.
*/
params ["_hq", "_side"];
waitUntil { !isNull _hq; };
_hq setVariable ["isBaseHQ", true, true];
// _hq setVariable [];
// Set BaseID
private _baseID = format [
"BASE_%1",
diag_tickTime
];
_hq setVariable [
"baseID",
_baseID,
true
];
_hq setVariable [
"baseDetails",
createHashMapFromArray [
["id", _baseID],
["hq", _hq],
["buildings", []],
["depots", []],
["side", _side]
]
];
/*
// Fetch global mission Base Hashmap
private _bases = missionNamespace getVariable "LogisticsBases";
// Add new Base to global hashmap
_bases set [
_baseID,
createHashMapFromArray [
["id", _baseID],
["hq", _hq],
["buildings", []],
["depots", []],
["side", _side]
]
];
missionNamespace setVariable ["LogisticsBases", _bases, true];
*/
// Initialise base HQ interactions for all clients
[_hq] remoteExecCall [
"CLF_fnc_initBaseHQInteractions",
0,
true
];