forked from AsYetUntitled/Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fn_initCiv.sqf
39 lines (36 loc) · 1.6 KB
/
fn_initCiv.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "..\script_macros.hpp"
/*
File: fn_initCiv.sqf
Author: Bryan "Tonic" Boardwine
Description:
Initializes the civilian.
*/
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"];
private _tanoaArray = ["Land_House_Small_01_F"];
private _spawnBuildings = [[["Altis", _altisArray], ["Tanoa", _tanoaArray]]] call TON_fnc_terrainSort;
civ_spawn_1 = nearestObjects[getMarkerPos "civ_spawn_1", _spawnBuildings,350];
civ_spawn_2 = nearestObjects[getMarkerPos "civ_spawn_2", _spawnBuildings,350];
civ_spawn_3 = nearestObjects[getMarkerPos "civ_spawn_3", _spawnBuildings,350];
civ_spawn_4 = nearestObjects[getMarkerPos "civ_spawn_4", _spawnBuildings,350];
waitUntil {!(isNull (findDisplay 46))};
if (life_is_alive && !life_is_arrested) then {
/* Spawn at our last position */
player setVehiclePosition [life_civ_position, [], 0, "CAN_COLLIDE"];
} else {
if (!life_is_alive && !life_is_arrested) then {
if (LIFE_SETTINGS(getNumber,"save_civilian_positionStrict") isEqualTo 1) then {
[] call life_fnc_startupLoadout;
CASH = 0;
[0] call SOCK_fnc_updatePartial;
};
[] call life_fnc_spawnMenu;
waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.
} else {
if (life_is_arrested) then {
life_is_arrested = false;
[player,true] spawn life_fnc_jail;
};
};
};
life_is_alive = true;