Skip to content

paycheckRework #710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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.}

cash_pickup_limit = 100000;

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