Skip to content

Commit

Permalink
weaponPointedAt hook
Browse files Browse the repository at this point in the history
  • Loading branch information
McDiod committed Apr 26, 2017
1 parent 78ce724 commit 99c2b6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -57,6 +58,8 @@ class CfgGradCivs {
spawnDistances[] = {1000,4500};
debugMode = 1;
exitOn = "";
onSpawn = "";
onHeldUp = "";
clothes[] = {
"rds_uniform_Worker1",
Expand Down
2 changes: 2 additions & 0 deletions functions/behaviour/fn_stopCiv.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions functions/init/fn_initModule.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grad-civs",
"description": "ambient civilians",
"version": "0.0.1",
"version": "0.0.2",
"contributors": [
{
"name": "nomisum"
Expand Down

0 comments on commit 99c2b6a

Please sign in to comment.