Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //CYWILE
- /////////////////////////////////////////////////////
- //THIS FINDS OUT WHAT MAP IS RUNNING AND WHAT SET OF HOUSES TO CHECK FOR
- //MAPS SUPPORTED: Stratis, Altis, Tanoa, Takistan, Zargabad, and Chernarus
- //You can easily add more maps to list by adjusting examples below
- if(isServer)then{
- switch(worldName)do{
- default{//If any of the above maps aren't detected, default select A2 Takistan houses
- nH_List=["Land_House_K_1_EP1","Land_House_K_3_EP1","Land_House_K_5_EP1","Land_House_K_6_EP1","Land_House_K_7_EP1","Land_House_K_8_EP1","Land_House_L_1_EP1","Land_House_L_2_EP1","Land_House_L_3_EP1","Land_House_L_4_EP1","Land_House_L_6_EP1","Land_House_L_7_EP1","Land_House_L_8_EP1","Land_House_L_9_EP1","Land_House_C_1_EP1","Land_House_C_1_v2_EP1","Land_House_C_2_EP1","Land_House_C_3_EP1","Land_House_C_4_EP1","Land_House_C_5_EP1","Land_House_C_5_V1_EP1","Land_House_C_5_V2_EP1","Land_House_C_5_V3_EP1","Land_House_C_10_EP1","Land_House_C_11_EP1","Land_House_C_12_EP1","Land_A_Mosque_small_1_EP1","Land_A_Mosque_small_2_EP1","Land_A_Mosque_big_addon_EP1","Land_A_Mosque_big_hq_EP1"];
- };
- publicVariable "nH_List";
- };
- //THIS IS THE EVENTHANDLER THAT MAKES THE CIVILIANS FLEE
- {if(side _x==civilian)then{
- _x addEventHandler["FiredNear",{
- _civ=_this select 0;
- switch(round(random 2))do{
- case 0:{_civ switchMove "ApanPercMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};
- case 1:{_civ playMoveNow "ApanPknlMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};
- case 2:{_civ playMoveNow "ApanPpneMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};
- default{_civ playMoveNow "ApanPknlMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};};
- //nearestObjects[ PositionOrTarget, ["List","Of","Classnames","To","Look","For"], MaxDistanceToSearchAroundTarget ];
- _nH=nearestObjects[_civ,nH_List,100];
- _H=selectRandom _nH;//Pick an object found in the above nearestObjects array
- _HP=_H buildingPos -1;//Finds list of all available building positions in the selected building
- _HP=selectRandom _HP;//Picks a building position from the list of building positions
- _civ doMove _HP;//Orders the civilian to move to the building position
- //Remove the eventHandler to prevent spamming
- _civ removeAllEventHandlers "FiredNear";}];};
- }forEach allUnits-switchableUnits-playableUnits
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement