GMS_RC/@GMS/addons/GMS/Compiles/Missions/fn_spawnMissionLootVehicles.sqf

39 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-09-23 14:05:31 +00:00
/*
GMS_fnc_spawnMissionLootVehicles
by Ghostridere-GRG-
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\x\addons\GMS\Compiles\Init\GMS_defines.hpp"
2023-09-23 14:05:31 +00:00
params["_coords","_missionLootVehicles",["_loadCrateTiming","atMissionSpawn"],["_lock",0]];
if (count _coords isEqualTo 2) then {_coords pushBack 0};
private _vehs = [];
{
_x params["_vehType","_vehOffset",["_dir",0],"_lootArray","_lootCounts"];
_veh = [_vehType, _coords vectorAdd _vehOffset] call GMS_fnc_spawnVehicle;
2023-10-21 11:42:13 +00:00
[_veh, _dir] call GMSCore_fnc_setDirUp;
2023-09-23 14:05:31 +00:00
_veh lock _lock;
if (_loadCrateTiming isEqualTo "atMissionSpawnGround") then
{
[_veh,_lootArray,_lootCounts] call GMS_fnc_fillBoxes;
_veh setVariable["lootLoaded",true];
private _crateMoney = missionNamespace getVariable (format["GMS_crateMoney%1",_difficulty]);
[format["GMS_fnc_spawnMissionLootVehicles (29) _crateMoney = %1",_crateMoney]] call GMS_fnc_log;
//[_veh,missionNamespace getVariable (format["GMS_crateMoney%1",_difficulty])] call GMS_fnc_setMoney;
} else {
_veh setVariable["lootArray",_lootArray];
_veh setVariable["lootCounts",_lootCounts];
_veh setVariable["lootLoaded",false];
};
_vehs pushback _veh;
}forEach _missionLootVehicles;
_vehs