diff --git a/README.md b/README.md index 4c40791d..c8205405 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,8 @@ autoInit | 1 | Toggles on automatic initialization of module o maxCivs | 60 | Maximum number of civs that can exist at any time. spawnDistances | [1000,4500] | Minimum and maximum distance to players that civilians can spawn in. debugMode | 0 | Toggles debug mode (0/1). -onSpawn | "" | Code to execute on civilian spawn. Passed parameters are: [unit]. +onSpawn | "" | Code to execute on civilian spawn. Passed parameters are: [civilian]. +onHeldUp | "" | Code to execute when civilian stops because a weapon is pointed at him. Passed parameters are: [civilian]. exitOn | "" | Condition upon which grad-civs loops will stop. clothes | [] | All classnames of clothes that civilians may wear. faces | [] | All classnames of faces that civilians may have. @@ -57,6 +58,8 @@ class CfgGradCivs { spawnDistances[] = {1000,4500}; debugMode = 1; exitOn = ""; + onSpawn = ""; + onHeldUp = ""; clothes[] = { "rds_uniform_Worker1", diff --git a/functions/behaviour/fn_stopCiv.sqf b/functions/behaviour/fn_stopCiv.sqf index 2936aa9a..b8c941fa 100644 --- a/functions/behaviour/fn_stopCiv.sqf +++ b/functions/behaviour/fn_stopCiv.sqf @@ -11,6 +11,8 @@ if (_civ getVariable ["GRAD_civs_stopScriptRunning", false]) exitWith { _civ setVariable ["GRAD_civs_stopScriptRunning", true]; + [_civ] call GRAD_CIVS_ONHELDUP; + _isInCar = (!(_civ isEqualTo vehicle _civ)); _veh = vehicle _civ; _grp = group _civ; diff --git a/functions/init/fn_initModule.sqf b/functions/init/fn_initModule.sqf index 23b0d7d8..95eea740 100644 --- a/functions/init/fn_initModule.sqf +++ b/functions/init/fn_initModule.sqf @@ -14,6 +14,7 @@ if (isServer) then { missionNamespace setVariable ["GRAD_CIVS_MAXCOUNT",[missionConfigFile >> "cfgGradCivs","maxCivs",""] call BIS_fnc_returnConfigEntry,true]; missionNamespace setVariable ["GRAD_CIVS_DEBUGMODE",([missionConfigFile >> "cfgGradCivs","debugMode",0] call BIS_fnc_returnConfigEntry) == 1,false]; missionNamespace setVariable ["GRAD_CIVS_ONSPAWN",compile ([missionConfigFile >> "cfgGradCivs","onSpawn",""] call BIS_fnc_returnConfigEntry),true]; + missionNamespace setVariable ["GRAD_CIVS_ONHELDUP",compile ([missionConfigFile >> "cfgGradCivs","onHeldUp",""] call BIS_fnc_returnConfigEntry),true]; _distances = [missionConfigFile >> "cfgGradCivs","spawnDistances",[1000,4500]] call BIS_fnc_returnConfigEntry; missionNamespace setVariable ["GRAD_CIVS_SPAWNDISTANCEMIN",_distances select 0,true]; diff --git a/package.json b/package.json index 79a50d8d..7cd2bcc5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "grad-civs", "description": "ambient civilians", - "version": "0.0.1", + "version": "0.0.2", "contributors": [ { "name": "nomisum"