Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 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 _spawnBuildings = [[["Altis", _altisArray], ["Tanoa", _tanoaArray]]] call TON_fnc_terrainSort;
  12.  
  13. civ_spawn_1 = nearestObjects[getMarkerPos "civ_spawn_1", _spawnBuildings,350];
  14. civ_spawn_2 = nearestObjects[getMarkerPos "civ_spawn_2", _spawnBuildings,350];
  15. civ_spawn_3 = nearestObjects[getMarkerPos "civ_spawn_3", _spawnBuildings,350];
  16. civ_spawn_4 = nearestObjects[getMarkerPos "civ_spawn_4", _spawnBuildings,350];
  17.  
  18. waitUntil {!(isNull (findDisplay 46))};
  19. 12 = 0 call life_fnc_idcard_NameCheck;
  20. waitUntil {_12};
  21. if (life_is_alive && !life_is_arrested) then {
  22. /* Spawn at our last position */
  23. player setVehiclePosition [life_civ_position, [], 0, "CAN_COLLIDE"];
  24. } else {
  25. if (!life_is_alive && !life_is_arrested) then {
  26. if (LIFE_SETTINGS(getNumber,"save_civilian_positionStrict") isEqualTo 1) then {
  27. _handle = [] spawn life_fnc_civLoadout;
  28. waitUntil {scriptDone _handle};
  29. CASH = 0;
  30. [0] call SOCK_fnc_updatePartial;
  31. };
  32. [] call life_fnc_spawnMenu;
  33. waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
  34. waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.
  35. } else {
  36. if (life_is_arrested) then {
  37. life_is_arrested = false;
  38. [player,true] spawn life_fnc_jail;
  39. };
  40. };
  41. };
  42. life_is_alive = true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement