Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1.  
  2. //CYWILE
  3. /////////////////////////////////////////////////////
  4. //THIS FINDS OUT WHAT MAP IS RUNNING AND WHAT SET OF HOUSES TO CHECK FOR
  5. //MAPS SUPPORTED: Stratis, Altis, Tanoa, Takistan, Zargabad, and Chernarus
  6. //You can easily add more maps to list by adjusting examples below
  7. if(isServer)then{
  8. switch(worldName)do{
  9.  
  10. default{//If any of the above maps aren't detected, default select A2 Takistan houses
  11. 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"];
  12. };
  13. publicVariable "nH_List";
  14. };
  15.  
  16.  
  17. //THIS IS THE EVENTHANDLER THAT MAKES THE CIVILIANS FLEE
  18. {if(side _x==civilian)then{
  19. _x addEventHandler["FiredNear",{
  20. _civ=_this select 0;
  21.  
  22. switch(round(random 2))do{
  23. case 0:{_civ switchMove "ApanPercMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};
  24. case 1:{_civ playMoveNow "ApanPknlMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};
  25. case 2:{_civ playMoveNow "ApanPpneMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};
  26. default{_civ playMoveNow "ApanPknlMstpSnonWnonDnon_G01";_civ setSpeedMode "FULL";};};
  27.  
  28. //nearestObjects[ PositionOrTarget, ["List","Of","Classnames","To","Look","For"], MaxDistanceToSearchAroundTarget ];
  29. _nH=nearestObjects[_civ,nH_List,100];
  30.  
  31.  
  32. _H=selectRandom _nH;//Pick an object found in the above nearestObjects array
  33.  
  34. _HP=_H buildingPos -1;//Finds list of all available building positions in the selected building
  35.  
  36. _HP=selectRandom _HP;//Picks a building position from the list of building positions
  37.  
  38. _civ doMove _HP;//Orders the civilian to move to the building position
  39.  
  40. //Remove the eventHandler to prevent spamming
  41. _civ removeAllEventHandlers "FiredNear";}];};
  42. }forEach allUnits-switchableUnits-playableUnits
  43. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement