More fixes + SpawnCrate

Created function SpawnCrate

Updated missions to use DMS_SpawnCrate

Fix (I think) issue with _side being passed to onkilled

updated test PBO
This commit is contained in:
eraser1 2015-08-31 01:08:30 -05:00
parent a883bff0c0
commit 6e3a9b8615
8 changed files with 40 additions and 5 deletions

View File

@ -32,6 +32,7 @@ DMS_SetGroupBehavior = compileFinal preprocessFileLineNumbers "\x\addons\dms\
DMS_AddMissionToMonitor = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\AddMissionToMonitor.sqf";
DMS_CreateMarker = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\CreateMarker.sqf";
DMS_FindSuppressor = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\FindSuppressor.sqf";//<--- TODO Improve
DMS_SpawnCrate = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\SpawnCrate.sqf";
//Load config
#include "config.sqf";

View File

@ -38,7 +38,7 @@ _group =
// Create Crate
_crate = createVehicle ["Box_NATO_Wps_F",_pos,[], 0, "CAN_COLLIDE"];
_crate = ["Box_NATO_Wps_F",_pos] call DMS_SpawnCrate;
// Set crate loot values
_crate_loot_values =

View File

@ -35,7 +35,7 @@ _group =
// Create Crate
_crate = createVehicle ["Box_NATO_Wps_F",_pos,[], 0, "CAN_COLLIDE"];
_crate = ["Box_NATO_Wps_F",_pos] call DMS_SpawnCrate;
// Set crate loot values
_crate_loot_values =

View File

@ -35,7 +35,7 @@ _group =
// Create Crate
_crate = createVehicle ["Box_NATO_Wps_F",_pos,[], 0, "CAN_COLLIDE"];
_crate = ["Box_NATO_Wps_F",_pos] call DMS_SpawnCrate;
// Set crate loot values
_crate_loot_values =

View File

@ -35,7 +35,7 @@ _group =
// Create Crate
_crate = createVehicle ["Box_NATO_Wps_F",_pos,[], 0, "CAN_COLLIDE"];
_crate = ["Box_NATO_Wps_F",_pos] call DMS_SpawnCrate;
// Set crate loot values
_crate_loot_values =

View File

@ -270,7 +270,7 @@ else
// Soldier killed event handler
_unit addMPEventHandler ["MPKilled",{[_this, _side, "soldier"] call DMS_OnKilled;}];
_unit addMPEventHandler ["MPKilled",'[_this, '+str _side+', "soldier"] call DMS_OnKilled;'];
_unit enableAI "TARGET";
_unit enableAI "AUTOTARGET";

View File

@ -0,0 +1,34 @@
/*
DMS_SpawnCrate
Created by eraser1
Usage:
[
_crateClassName,
_pos
] call DMS_SpawnCrate;
Returns crate object
*/
private ["_crateClassName", "_pos", "_crate"];
_OK = params
[
["_crateClassName","ERROR",[""]],
["_pos","ERROR",[[]],[3]]
];
if (!_OK) then
{
diag_log format ["DMS ERROR :: Calling DMS_SpawnCrate with invalid parameters: %1",_this];
};
_crate = createVehicle [_crateClassName,_pos,[], 0, "CAN_COLLIDE"];
clearWeaponCargoGlobal _crate;
clearItemCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
_crate;

Binary file not shown.