diff --git a/Engima/Traffic/Init.sqf b/Engima/Traffic/Init.sqf index 8fea4730..aae63dfc 100644 --- a/Engima/Traffic/Init.sqf +++ b/Engima/Traffic/Init.sqf @@ -11,7 +11,7 @@ ENGIMA_TRAFFIC_edgeBottomLeftRoads = []; ENGIMA_TRAFFIC_edgeRoadsUseful = []; if (isServer) then { - call compile preprocessFileLineNumbers "Engima\Traffic\Server\Functions.sqf"; call compile preprocessFileLineNumbers "Engima\Traffic\Server\randomCivilian.sqf"; + call compile preprocessFileLineNumbers "Engima\Traffic\Server\Functions.sqf"; call compile preprocessFileLineNumbers "Engima\Traffic\ConfigAndStart.sqf"; }; diff --git a/Engima/Traffic/Server/randomCivilian.sqf b/Engima/Traffic/Server/randomCivilian.sqf index 8789e915..2879a8b6 100644 --- a/Engima/Traffic/Server/randomCivilian.sqf +++ b/Engima/Traffic/Server/randomCivilian.sqf @@ -3,114 +3,114 @@ */ randomCivilian = { -_unit = _this select 0; - -_rds_rhs_civilian = [ -"rds_schoolteacher", -"rds_doctor", -"rds_uniform_assistant", -"rds_uniform_Worker1", -"rds_uniform_Worker2", -"rds_uniform_Worker3", -"rds_uniform_Worker4", -"rds_uniform_Woodlander1", -"rds_uniform_Woodlander2", -"rds_uniform_Woodlander3", -"rds_uniform_Woodlander4", -"rds_uniform_Villager1", -"rds_uniform_Villager2", -"rds_uniform_Villager3", -"rds_uniform_Villager4", -"rds_uniform_Profiteer1", -"rds_uniform_Profiteer2", -"rds_uniform_Profiteer3", -"rds_uniform_Profiteer4", -"rds_uniform_citizen1", -"rds_uniform_citizen2", -"rds_uniform_citizen3", -"rds_uniform_citizen4" -] call BIS_fnc_selectRandom; - -_rhsHeadGear = [ -"rds_Villager_cap1", -"rds_Villager_cap2", -"rds_Villager_cap3", -"rds_Villager_cap4", -"rds_worker_cap1", -"rds_worker_cap2", -"rds_worker_cap3", -"rds_worker_cap4", -"rds_Profiteer_cap1", -"rds_Profiteer_cap2", -"rds_Profiteer_cap3", -"rds_Profiteer_cap4", -"rhs_beanie_green", -"rhs_beanie_green" -] call BIS_fnc_selectRandom; - -_taliFaces = [ -"PersianHead_A3_01", -"PersianHead_A3_02", -"PersianHead_A3_03", -"PersianHead_A3_01", -"PersianHead_A3_02", -"PersianHead_A3_03", -"PersianHead_A3_01", -"PersianHead_A3_02", -"PersianHead_A3_03", -"WhiteHead_08", -"WhiteHead_16", -"GreekHead_A3_01", -"GreekHead_A3_02", -"GreekHead_A3_03", -"GreekHead_A3_04" -] call BIS_fnc_selectRandom; - - - - -_stripHim = { - _it = _this select 0; - removeAllWeapons _it; - removeAllItems _it; - removeAllAssignedItems _it; - removeUniform _it; - removeVest _it; - removeBackpack _it; - removeHeadgear _it; - removeGoggles _it; -}; - -_reclotheHim = { - _guy = _this select 0; - _guy forceAddUniform _rds_rhs_civilian; - if (random 2 > 1) then { - _guy addHeadgear _rhsHeadGear; + _unit = _this select 0; + + _rds_rhs_civilian = [ + "rds_schoolteacher", + "rds_doctor", + "rds_uniform_assistant", + "rds_uniform_Worker1", + "rds_uniform_Worker2", + "rds_uniform_Worker3", + "rds_uniform_Worker4", + "rds_uniform_Woodlander1", + "rds_uniform_Woodlander2", + "rds_uniform_Woodlander3", + "rds_uniform_Woodlander4", + "rds_uniform_Villager1", + "rds_uniform_Villager2", + "rds_uniform_Villager3", + "rds_uniform_Villager4", + "rds_uniform_Profiteer1", + "rds_uniform_Profiteer2", + "rds_uniform_Profiteer3", + "rds_uniform_Profiteer4", + "rds_uniform_citizen1", + "rds_uniform_citizen2", + "rds_uniform_citizen3", + "rds_uniform_citizen4" + ] call BIS_fnc_selectRandom; + + _rhsHeadGear = [ + "rds_Villager_cap1", + "rds_Villager_cap2", + "rds_Villager_cap3", + "rds_Villager_cap4", + "rds_worker_cap1", + "rds_worker_cap2", + "rds_worker_cap3", + "rds_worker_cap4", + "rds_Profiteer_cap1", + "rds_Profiteer_cap2", + "rds_Profiteer_cap3", + "rds_Profiteer_cap4", + "rhs_beanie_green", + "rhs_beanie_green" + ] call BIS_fnc_selectRandom; + + _taliFaces = [ + "PersianHead_A3_01", + "PersianHead_A3_02", + "PersianHead_A3_03", + "PersianHead_A3_01", + "PersianHead_A3_02", + "PersianHead_A3_03", + "PersianHead_A3_01", + "PersianHead_A3_02", + "PersianHead_A3_03", + "WhiteHead_08", + "WhiteHead_16", + "GreekHead_A3_01", + "GreekHead_A3_02", + "GreekHead_A3_03", + "GreekHead_A3_04" + ] call BIS_fnc_selectRandom; + + + + + _stripHim = { + _it = _this select 0; + removeAllWeapons _it; + removeAllItems _it; + removeAllAssignedItems _it; + removeUniform _it; + removeVest _it; + removeBackpack _it; + removeHeadgear _it; + removeGoggles _it; }; - [[_guy,_taliFaces], "setCustomFace"] call BIS_fnc_MP; - - -}; + _reclotheHim = { + _guy = _this select 0; + _guy forceAddUniform _rds_rhs_civilian; + if (random 2 > 1) then { + _guy addHeadgear _rhsHeadGear; + }; -addFleeingBehaviour = { - (_this select 0) setVariable ["fleeing",false]; + [[_guy,_taliFaces], "setCustomFace"] call BIS_fnc_MP; + + + }; + + addFleeingBehaviour = { + (_this select 0) setVariable ["fleeing",false]; - (_this select 0) addEventHandler ["FiredNear", { + (_this select 0) addEventHandler ["FiredNear", { - if ((_this select 0) getVariable "fleeing" == "true") exitWith {}; + if ((_this select 0) getVariable "fleeing" == "true") exitWith {}; - _thisUnit = _this select 0; + _thisUnit = _this select 0; - sleep (random 1); - {[_x] execVM "Engima\Traffic\Server\fleeYouFool.sqf";} forEach crew (vehicle _thisUnit); - }]; -}; + sleep (random 1); + {[_x] execVM "Engima\Traffic\Server\fleeYouFool.sqf";} forEach crew (vehicle _thisUnit); + }]; + }; -[_unit] call _stripHim; -sleep 0.1; -[_unit] call _reclotheHim; -[_unit] call addFleeingBehaviour; + [_unit] call _stripHim; + sleep 0.1; + [_unit] call _reclotheHim; + // [_unit] call addFleeingBehaviour; diff --git a/init.sqf b/init.sqf index 2fde8138..9b42d56e 100644 --- a/init.sqf +++ b/init.sqf @@ -89,7 +89,9 @@ if (!isMultiplayer) then { // Editor /* {_x disableAI "MOVE"} forEach allUnits;*/ }; -[] execVM "Engima\Traffic\Init.sqf"; +if (CIVILIAN_TRAFFIC == 1) then { + [] execVM "Engima\Traffic\Init.sqf"; +}; if (isServer) then { // allow view distance to be up to 10k