Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Altis_Life.Altis/config/Config_Master.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ class Life_Settings {
bank_civ = 3000; //Amount of cash in bank for new civillians
bank_med = 6500; //Amount of cash in bank for new medics

paycheck_cop = 500; //Payment for cops
paycheck_cop = [500,550,600,650,700,750,800,850]; //Payment for cops, increases with rank [rank 0, rank 1, rank 2, etc.]
paycheck_civ = 350; //Payment for civillians
paycheck_med = 450; //Payment for medics
paycheck_med = [450,500,550,600,650,700]; //Payment for medics, increases with rank [rank 0, rank 1, rank 2, etc.]
Copy link

@ghost ghost Jun 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, another one of those "the engine gut us again" things.
I noticed that my cops got $0 as paycheck and suddenly their bank accounts were also at $0. This reminded me of the pickupMoney bug where CASH got nil at some point - and sure it's the same issue here. I tested quite a bit, but in the end it came down to that for what ever reason paycheck_cop and paycheck_med are neither an array nor a number but rather a text (I tested this by unrolling the LIFE_SETTINGS macro and tested with isArray, isNumber and isText to see what it really was I got returned - not sure if this would had been possible by using typeName or such).
Then I looked at the other arrays in the config and spotted the issue: In the config an array has to be defined with the brackets after the variable name and the values have to be enclosed in curly braces:

paycheck_cop[] = { 500, 550, 600, 650, 700, 750, 800, 850 };
paycheck_med[] = { 450, 500, 550, 600, 650, 700 };

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Should be fixed in the latest commit.


paycheck_period = 5; //Scaled in minutes
bank_transferTax = .05; //Tax that player pays when transferring money from ATM. Tax = Amount * multiplier
Expand Down
3 changes: 2 additions & 1 deletion Altis_Life.Altis/core/fn_initCiv.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ civ_spawn_3 = nearestObjects[getMarkerPos "civ_spawn_3", _spawnBuildings,350];
civ_spawn_4 = nearestObjects[getMarkerPos "civ_spawn_4", _spawnBuildings,350];

waitUntil {!(isNull (findDisplay 46))};
life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_civ");
if (life_is_alive && !life_is_arrested) then {
/* Spawn at our last position */
player setVehiclePosition [life_civ_position, [], 0, "CAN_COLLIDE"];
Expand All @@ -36,4 +37,4 @@ if (life_is_alive && !life_is_arrested) then {
};
};
};
life_is_alive = true;
life_is_alive = true;
10 changes: 8 additions & 2 deletions Altis_Life.Altis/core/fn_initCop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ if (!(str(player) in ["cop_1","cop_2","cop_3","cop_4"])) then {
};
};


player setVariable ["rank",(FETCH_CONST(life_coplevel)),true];
private _rank = FETCH_CONST(life_coplevel);
private _paychecks = LIFE_SETTINGS(getArray,"paycheck_cop");
if (count _paychecks isEqualTo 1) then {
life_paycheck = _paychecks select 0;
} else {
life_paycheck = _paychecks select _rank;
};
player setVariable ["rank",_rank,true];
[] 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.
7 changes: 7 additions & 0 deletions Altis_Life.Altis/core/fn_initMedic.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ if ((FETCH_CONST(life_medicLevel)) < 1 && (FETCH_CONST(life_adminlevel) isEqualT
sleep 35;
};

private _rank = FETCH_CONST(life_medicLevel);
private _paychecks = LIFE_SETTINGS(getArray,"paycheck_med");
if (count _paychecks isEqualTo 1) then {
life_paycheck = _paychecks select 0;
} else {
life_paycheck = _paychecks select _rank;
};
[] 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.
3 changes: 0 additions & 3 deletions Altis_Life.Altis/core/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,13 @@ waitUntil {life_session_completed};

switch (playerSide) do {
case west: {
life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_cop");
[] call life_fnc_initCop;
};
case civilian: {
life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_civ");
[] call life_fnc_initCiv;
(group player) deleteGroupWhenEmpty true;
};
case independent: {
life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_med");
[] call life_fnc_initMedic;
};
};
Expand Down