Skip to content

Commit 8f7db89

Browse files
committed
Add back civ_alive
1 parent edf87d2 commit 8f7db89

File tree

11 files changed

+1280
-1283
lines changed

11 files changed

+1280
-1283
lines changed

AL.ini

Lines changed: 352 additions & 352 deletions
Large diffs are not rendered by default.
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
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-
private _alive = !(life_civ_position isEqualTo []);
20-
if (_alive && !life_is_arrested) then {
21-
/* Spawn at our last position */
22-
player setVehiclePosition [life_civ_position, [], 0, "CAN_COLLIDE"];
23-
} else {
24-
if (!_alive && !life_is_arrested) then {
25-
if (LIFE_SETTINGS(getNumber,"save_civilian_positionStrict") isEqualTo 1) then {
26-
[] call life_fnc_startLoadout;
27-
CASH = 0;
28-
[0] call SOCK_fnc_updatePartial;
29-
};
30-
[] call life_fnc_spawnMenu;
31-
waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
32-
waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.
33-
} else {
34-
if (life_is_arrested) then {
35-
life_is_arrested = false;
36-
[player,true] spawn life_fnc_jail;
37-
};
38-
};
39-
};
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+
life_civ_position params ["_alive","_position"];
20+
if (_alive && !life_is_arrested) then {
21+
/* Spawn at our last position */
22+
player setVehiclePosition [_position, [], 0, "CAN_COLLIDE"];
23+
} else {
24+
if (!_alive && !life_is_arrested) then {
25+
if (LIFE_SETTINGS(getNumber,"save_civilian_positionStrict") isEqualTo 1) then {
26+
[] call life_fnc_startLoadout;
27+
CASH = 0;
28+
[0] call SOCK_fnc_updatePartial;
29+
};
30+
[] call life_fnc_spawnMenu;
31+
waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
32+
waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.
33+
} else {
34+
if (life_is_arrested) then {
35+
life_is_arrested = false;
36+
[player,true] spawn life_fnc_jail;
37+
};
38+
};
39+
};
Lines changed: 112 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,112 @@
1-
#include "..\..\script_macros.hpp"
2-
/*
3-
File: fn_requestReceived.sqf
4-
Author: Bryan "Tonic" Boardwine
5-
6-
Description:
7-
Called by the server saying that we have a response so let's
8-
sort through the information, validate it and if all valid
9-
set the client up.
10-
*/
11-
12-
private _count = count _this;
13-
life_session_tries = life_session_tries + 1;
14-
if (life_session_completed) exitWith {}; //Why did this get executed when the client already initialized? Fucking arma...
15-
if (life_session_tries > 3) exitWith {cutText[localize "STR_Session_Error","BLACK FADED"]; 0 cutFadeOut 999999999;};
16-
17-
0 cutText [localize "STR_Session_Received","BLACK FADED"];
18-
0 cutFadeOut 9999999;
19-
20-
//Error handling and junk..
21-
if (isNil "_this") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
22-
if (_this isEqualType "") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
23-
if (count _this isEqualTo 0) exitWith {[] call SOCK_fnc_insertPlayerInfo;};
24-
if ((_this select 0) isEqualTo "Error") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
25-
if (!(getPlayerUID player isEqualTo (_this select 0))) exitWith {[] call SOCK_fnc_dataQuery;};
26-
27-
//Lets make sure some vars are not set before hand.. If they are get rid of them, hopefully the engine purges past variables but meh who cares.
28-
if (!isServer && (!isNil "life_adminlevel" || !isNil "life_coplevel" || !isNil "life_donorlevel")) exitWith {
29-
[profileName,getPlayerUID player,"VariablesAlreadySet"] remoteExecCall ["SPY_fnc_cookieJar",RSERV];
30-
[profileName,format ["Variables set before client initialization...\nlife_adminlevel: %1\nlife_coplevel: %2\nlife_donorlevel: %3",life_adminlevel,life_coplevel,life_donorlevel]] remoteExecCall ["SPY_fnc_notifyAdmins",RCLIENT];
31-
sleep 0.9;
32-
failMission "SpyGlass";
33-
};
34-
35-
//Parse basic player information.
36-
CASH = _this select 2;
37-
BANK = _this select 3;
38-
CONST(life_adminlevel,(_this select 4));
39-
if (LIFE_SETTINGS(getNumber,"donor_level") isEqualTo 1) then {
40-
CONST(life_donorlevel,(_this select 5));
41-
} else {
42-
CONST(life_donorlevel,0);
43-
};
44-
45-
//Loop through licenses
46-
if !((_this select 6) isEqualTo []) then {
47-
{missionNamespace setVariable [(_x select 0),(_x select 1)];} forEach (_this select 6);
48-
};
49-
50-
//Parse side specific information.
51-
switch (playerSide) do {
52-
case west: {
53-
CONST(life_coplevel,(_this select 7));
54-
CONST(life_medicLevel,0);
55-
life_blacklisted = _this select 9;
56-
if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
57-
life_hunger = ((_this select 10) select 0);
58-
life_thirst = ((_this select 10) select 1);
59-
player setDamage ((_this select 10) select 2);
60-
};
61-
};
62-
63-
case civilian: {
64-
life_is_arrested = _this select 7;
65-
CONST(life_coplevel, 0);
66-
CONST(life_medicLevel, 0);
67-
life_houses = _this select (_count - 3);
68-
if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
69-
life_hunger = ((_this select 9) select 0);
70-
life_thirst = ((_this select 9) select 1);
71-
player setDamage ((_this select 9) select 2);
72-
};
73-
74-
//Position
75-
if (LIFE_SETTINGS(getNumber,"save_civilian_position") isEqualTo 1) then {
76-
life_civ_position = _this select 10;
77-
if !(life_civ_position isEqualTo []) then {
78-
if (life_civ_position distance (getMarkerPos "respawn_civilian") < 300) then {life_civ_position = []};
79-
};
80-
};
81-
82-
{
83-
_house = nearestObject [(call compile format ["%1",(_x select 0)]), "House"];
84-
life_vehicles pushBack _house;
85-
} forEach life_houses;
86-
87-
life_gangData = _this select (_count - 2);
88-
if !(life_gangData isEqualTo []) then {
89-
[] spawn life_fnc_initGang;
90-
};
91-
[] spawn life_fnc_initHouses;
92-
};
93-
94-
case independent: {
95-
CONST(life_medicLevel,(_this select 7));
96-
CONST(life_coplevel,0);
97-
if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
98-
life_hunger = ((_this select 9) select 0);
99-
life_thirst = ((_this select 9) select 1);
100-
player setDamage ((_this select 9) select 2);
101-
};
102-
};
103-
};
104-
105-
life_gear = _this select 8;
106-
[true] call life_fnc_loadGear;
107-
108-
if !((_this select (_count - 1)) isEqualTo []) then {
109-
{life_vehicles pushBack _x;} forEach (_this select (_count - 1));
110-
};
111-
112-
life_session_completed = true;
1+
#include "..\..\script_macros.hpp"
2+
/*
3+
File: fn_requestReceived.sqf
4+
Author: Bryan "Tonic" Boardwine
5+
6+
Description:
7+
Called by the server saying that we have a response so let's
8+
sort through the information, validate it and if all valid
9+
set the client up.
10+
*/
11+
12+
private _count = count _this;
13+
life_session_tries = life_session_tries + 1;
14+
if (life_session_completed) exitWith {}; //Why did this get executed when the client already initialized? Fucking arma...
15+
if (life_session_tries > 3) exitWith {cutText[localize "STR_Session_Error","BLACK FADED"]; 0 cutFadeOut 999999999;};
16+
17+
0 cutText [localize "STR_Session_Received","BLACK FADED"];
18+
0 cutFadeOut 9999999;
19+
20+
//Error handling and junk..
21+
if (isNil "_this") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
22+
if (_this isEqualType "") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
23+
if (count _this isEqualTo 0) exitWith {[] call SOCK_fnc_insertPlayerInfo;};
24+
if ((_this select 0) isEqualTo "Error") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
25+
if (!(getPlayerUID player isEqualTo (_this select 0))) exitWith {[] call SOCK_fnc_dataQuery;};
26+
27+
//Lets make sure some vars are not set before hand.. If they are get rid of them, hopefully the engine purges past variables but meh who cares.
28+
if (!isServer && (!isNil "life_adminlevel" || !isNil "life_coplevel" || !isNil "life_donorlevel")) exitWith {
29+
[profileName,getPlayerUID player,"VariablesAlreadySet"] remoteExecCall ["SPY_fnc_cookieJar",RSERV];
30+
[profileName,format ["Variables set before client initialization...\nlife_adminlevel: %1\nlife_coplevel: %2\nlife_donorlevel: %3",life_adminlevel,life_coplevel,life_donorlevel]] remoteExecCall ["SPY_fnc_notifyAdmins",RCLIENT];
31+
sleep 0.9;
32+
failMission "SpyGlass";
33+
};
34+
35+
//Parse basic player information.
36+
CASH = _this select 2;
37+
BANK = _this select 3;
38+
CONST(life_adminlevel,(_this select 4));
39+
if (LIFE_SETTINGS(getNumber,"donor_level") isEqualTo 1) then {
40+
CONST(life_donorlevel,(_this select 5));
41+
} else {
42+
CONST(life_donorlevel,0);
43+
};
44+
45+
//Loop through licenses
46+
if !((_this select 6) isEqualTo []) then {
47+
{missionNamespace setVariable [(_x select 0),(_x select 1)];} forEach (_this select 6);
48+
};
49+
50+
//Parse side specific information.
51+
switch (playerSide) do {
52+
case west: {
53+
CONST(life_coplevel,(_this select 7));
54+
CONST(life_medicLevel,0);
55+
life_blacklisted = _this select 9;
56+
if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
57+
life_hunger = ((_this select 10) select 0);
58+
life_thirst = ((_this select 10) select 1);
59+
player setDamage ((_this select 10) select 2);
60+
};
61+
};
62+
63+
case civilian: {
64+
life_is_arrested = _this select 7;
65+
CONST(life_coplevel, 0);
66+
CONST(life_medicLevel, 0);
67+
life_houses = _this select (_count - 3);
68+
if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
69+
life_hunger = ((_this select 9) select 0);
70+
life_thirst = ((_this select 9) select 1);
71+
player setDamage ((_this select 9) select 2);
72+
};
73+
74+
//Position
75+
if (LIFE_SETTINGS(getNumber,"save_civilian_position") isEqualTo 1) then {
76+
life_civ_position = [_this select 10,_this select 11];
77+
if !(life_civ_position isEqualTo []) then {
78+
if (life_civ_position distance (getMarkerPos "respawn_civilian") < 300) then {life_civ_position = []};
79+
};
80+
};
81+
82+
{
83+
_house = nearestObject [(call compile format ["%1",(_x select 0)]), "House"];
84+
life_vehicles pushBack _house;
85+
} forEach life_houses;
86+
87+
life_gangData = _this select (_count - 2);
88+
if !(life_gangData isEqualTo []) then {
89+
[] spawn life_fnc_initGang;
90+
};
91+
[] spawn life_fnc_initHouses;
92+
};
93+
94+
case independent: {
95+
CONST(life_medicLevel,(_this select 7));
96+
CONST(life_coplevel,0);
97+
if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
98+
life_hunger = ((_this select 9) select 0);
99+
life_thirst = ((_this select 9) select 1);
100+
player setDamage ((_this select 9) select 2);
101+
};
102+
};
103+
};
104+
105+
life_gear = _this select 8;
106+
[true] call life_fnc_loadGear;
107+
108+
if !((_this select (_count - 1)) isEqualTo []) then {
109+
{life_vehicles pushBack _x;} forEach (_this select (_count - 1));
110+
};
111+
112+
life_session_completed = true;

0 commit comments

Comments
 (0)