From 7d6dbc900b066575cb18ae01153052f5469e5c0b Mon Sep 17 00:00:00 2001 From: Edward Date: Fri, 5 Jun 2020 00:33:44 +0200 Subject: [PATCH 1/3] paycheckRework --- Altis_Life.Altis/config/Config_Master.hpp | 4 ++-- Altis_Life.Altis/core/fn_initCiv.sqf | 3 ++- Altis_Life.Altis/core/fn_initCop.sqf | 10 ++++++++-- Altis_Life.Altis/core/fn_initMedic.sqf | 7 +++++++ Altis_Life.Altis/core/init.sqf | 3 --- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Altis_Life.Altis/config/Config_Master.hpp b/Altis_Life.Altis/config/Config_Master.hpp index de540767d..5b0750c87 100644 --- a/Altis_Life.Altis/config/Config_Master.hpp +++ b/Altis_Life.Altis/config/Config_Master.hpp @@ -125,9 +125,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.] paycheck_period = 5; //Scaled in minutes bank_transferTax = .05; //Tax that player pays when transferring money from ATM. Tax = Amount * multiplier diff --git a/Altis_Life.Altis/core/fn_initCiv.sqf b/Altis_Life.Altis/core/fn_initCiv.sqf index 3d8ef9e55..4fa86eac9 100644 --- a/Altis_Life.Altis/core/fn_initCiv.sqf +++ b/Altis_Life.Altis/core/fn_initCiv.sqf @@ -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"]; @@ -36,4 +37,4 @@ if (life_is_alive && !life_is_arrested) then { }; }; }; -life_is_alive = true; \ No newline at end of file +life_is_alive = true; diff --git a/Altis_Life.Altis/core/fn_initCop.sqf b/Altis_Life.Altis/core/fn_initCop.sqf index 16f057c07..737fe800d 100644 --- a/Altis_Life.Altis/core/fn_initCop.sqf +++ b/Altis_Life.Altis/core/fn_initCop.sqf @@ -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. diff --git a/Altis_Life.Altis/core/fn_initMedic.sqf b/Altis_Life.Altis/core/fn_initMedic.sqf index 1edfe0672..448536c18 100644 --- a/Altis_Life.Altis/core/fn_initMedic.sqf +++ b/Altis_Life.Altis/core/fn_initMedic.sqf @@ -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. diff --git a/Altis_Life.Altis/core/init.sqf b/Altis_Life.Altis/core/init.sqf index 72c1e26e7..18d76526b 100644 --- a/Altis_Life.Altis/core/init.sqf +++ b/Altis_Life.Altis/core/init.sqf @@ -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; }; }; From cbc04a753a4bcb1e222b645de23b8a9b31265edb Mon Sep 17 00:00:00 2001 From: Edward Date: Tue, 9 Jun 2020 23:10:38 +0200 Subject: [PATCH 2/3] fixes array in config --- Altis_Life.Altis/config/Config_Master.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Altis_Life.Altis/config/Config_Master.hpp b/Altis_Life.Altis/config/Config_Master.hpp index dfda339fe..4a977dea5 100644 --- a/Altis_Life.Altis/config/Config_Master.hpp +++ b/Altis_Life.Altis/config/Config_Master.hpp @@ -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,550,600,650,700,750,800,850]; //Payment for cops, increases with rank [rank 0, rank 1, rank 2, etc.] + 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,500,550,600,650,700]; //Payment for medics, increases with rank [rank 0, rank 1, rank 2, etc.] + paycheck_med[] = { 450, 500, 550, 600, 650, 700 }; //Payment for medics, increases with rank [rank 0, rank 1, rank 2, etc.] paycheck_period = 5; //Scaled in minutes bank_transferTax = .05; //Tax that player pays when transferring money from ATM. Tax = Amount * multiplier From 8a016cb16980da9733c0a21468ac1dcf6505d1da Mon Sep 17 00:00:00 2001 From: Edward Date: Tue, 9 Jun 2020 23:12:12 +0200 Subject: [PATCH 3/3] Fix comment --- Altis_Life.Altis/config/Config_Master.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Altis_Life.Altis/config/Config_Master.hpp b/Altis_Life.Altis/config/Config_Master.hpp index 4a977dea5..8010b06f7 100644 --- a/Altis_Life.Altis/config/Config_Master.hpp +++ b/Altis_Life.Altis/config/Config_Master.hpp @@ -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, 550, 600, 650, 700, 750, 800, 850 }; //Payment for cops, increases with rank [rank 0, rank 1, rank 2, etc.] + 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, 500, 550, 600, 650, 700 }; //Payment for medics, increases with rank [rank 0, rank 1, rank 2, etc.] + paycheck_med[] = { 450, 500, 550, 600, 650, 700 }; //Payment for medics, increases with rank {rank 0, rank 1, rank 2, etc.} paycheck_period = 5; //Scaled in minutes bank_transferTax = .05; //Tax that player pays when transferring money from ATM. Tax = Amount * multiplier