Advertisement
Guest User

civ init

a guest
Feb 25th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. #include "..\script_macros.hpp"
  2. /*
  3. File: fn_initCiv.sqf
  4. Author: Bryan "Tonic" Boardwine
  5.  
  6. Description:
  7. Initializes the civilian.
  8. */
  9. private _altisArray = ["Land_i_Shop_01_V1_F","Land_i_Shop_01_V2_F","Land_i_Shop_01_V3_F","Land_i_Shop_02_V1_F","Land_i_Shop_02_V2_F","Land_i_Shop_02_V3_F"];
  10. private _tanoaArray = ["Land_House_Small_01_F"];
  11. private _stratisArray = ["Land_i_Shop_01_V1_F","Land_i_Shop_01_V2_F","Land_i_Shop_01_V3_F","Land_i_Shop_02_V1_F","Land_i_Shop_02_V2_F","Land_i_Shop_02_V3_F"];
  12. private _spawnBuildings = [[["Altis", _altisArray], ["Tanoa", _tanoaArray], ["Stratis", _stratisArray]]] call TON_fnc_terrainSort;
  13.  
  14. civ_spawn_1 = nearestObjects[getMarkerPos "civ_spawn_1", _spawnBuildings,350];
  15. civ_spawn_2 = nearestObjects[getMarkerPos "civ_spawn_2", _spawnBuildings,350];
  16. civ_spawn_3 = nearestObjects[getMarkerPos "civ_spawn_3", _spawnBuildings,350];
  17. civ_spawn_4 = nearestObjects[getMarkerPos "civ_spawn_4", _spawnBuildings,350];
  18.  
  19. waitUntil {!(isNull (findDisplay 46))};
  20. if (life_is_alive && !life_is_arrested) then {
  21. /* Spawn at our last position */
  22. player setVehiclePosition [life_civ_position, [], 0, "CAN_COLLIDE"];
  23. } else {
  24. if (!life_is_alive && !life_is_arrested) then {
  25. if (LIFE_SETTINGS(getNumber,"save_civilian_positionStrict") isEqualTo 1) then {
  26. _handle = [] spawn life_fnc_civLoadout;
  27. waitUntil {scriptDone _handle};
  28. CASH = 0;
  29. [0] call SOCK_fnc_updatePartial;
  30. };
  31. [] call life_fnc_spawnMenu;
  32. waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
  33. waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.
  34. } else {
  35. if (life_is_arrested) then {
  36. life_is_arrested = false;
  37. [player,true] spawn life_fnc_jail;
  38. };
  39. };
  40. };
  41. life_is_alive = true;
  42. player addRating 9999999;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement