SkilledOne 1 Posted December 20, 2016 Report Share Posted December 20, 2016 This tutorial has been lost from the forums going down and I found how to do it on another Altis development forum to which I'm translating it for here. ================= Original Post By: Sergueiii ================= Tutorial on how to Separate Civilian and Police Cash & Bank Account *Remember to re-pack @life_server\addons\life_server folder after making these changes. ================= Step 1: Go to your life_server\Functions\MySQL\fn_insertRequest.sqf and modify this: _query = format ["INSERT INTO players (pid, name, cash, bankacc, aliases, cop_licenses, med_licenses, civ_licenses, civ_gear, cop_gear, med_gear) VALUES('%1', '%2', '%3', '%4', '%5','""[]""','""[]""','""[]""','""[]""','""[]""','""[]""')", _uid, _name, _money, _bank, _alias ]; To: _query = format ["INSERT INTO players (pid, name, cash, bankacc, westcash, westbankacc, aliases, cop_licenses, med_licenses, civ_licenses, civ_gear, cop_gear, med_gear) VALUES('%1', '%2', '%3', '%4', '%5', '%6', '%7', '""[]""','""[]""','""[]""','""[]""','""[]""','""[]""')", _uid, _name, _money, _bank, _money, //added for westcash _bank, //added for westbankacc _alias ]; === Step 2: Go to your life_server\Functions\MySQL\fn_queryRequest.sqf and modify this: case west: {format ["SELECT pid, name, cash, bankacc, adminlevel, donorlevel, cop_licenses, coplevel, cop_gear, blacklist, cop_stats, playtime FROM players WHERE pid='%1'",_uid];}; To: case west: {format ["SELECT pid, name, westcash, westbankacc, adminlevel, donorlevel, cop_licenses, coplevel, cop_gear, blacklist, cop_stats, playtime FROM players WHERE pid='%1'",_uid];}; === Step 3: Go to your life_server\Functions\MySQL\fn_updatePartial.sqf and modify this: case 1: { _value = [_this,2,0,[0]] call BIS_fnc_param; _value = [_value] call DB_fnc_numberSafe; _query = format ["UPDATE players SET bankacc='%1' WHERE pid='%2'",_value,_uid]; }; To: case 1: { _value = [_this,2,0,[0]] call BIS_fnc_param; _value = [_value] call DB_fnc_numberSafe; switch (_side) do { case civilian: {_query = format ["UPDATE players SET bankacc='%1' WHERE pid='%2'",_value,_uid];}; case west: {_query = format ["UPDATE players SET westbankacc='%1' WHERE pid='%2'",_value,_uid];}; case independent: {_query = format ["UPDATE players SET bankacc='%1' WHERE pid='%2'",_value,_uid];}; }; }; === Step 4: Go to your life_server\Functions\MySQL\fn_updatePartial.sqf and modify this: case 6: { _value1 = [_this,2,0,[0]] call BIS_fnc_param; _value2 = [_this,4,0,[0]] call BIS_fnc_param; _value1 = [_value1] call DB_fnc_numberSafe; _value2 = [_value2] call DB_fnc_numberSafe; _query = format ["UPDATE players SET cash='%1', bankacc='%2' WHERE pid='%3'",_value1,_value2,_uid]; }; To: case 6: { _value1 = [_this,2,0,[0]] call BIS_fnc_param; _value2 = [_this,4,0,[0]] call BIS_fnc_param; _value1 = [_value1] call DB_fnc_numberSafe; _value2 = [_value2] call DB_fnc_numberSafe; switch (_side) do { case civilian: {_query = format ["UPDATE players SET cash='%1', bankacc='%2' WHERE pid='%3'",_value1,_value2,_uid];}; case west: {_query = format ["UPDATE players SET westcash='%1', westbankacc='%2' WHERE pid='%3'",_value1,_value2,_uid];}; case independent: {_query = format ["UPDATE players SET cash='%1', bankacc='%2' WHERE pid='%3'",_value1,_value2,_uid];}; }; }; === Step 5: Go to your life_server\Functions\MySQL\fn_updateRequest.sqf and modify this: switch (_side) do { case west: {_query = format ["UPDATE players SET name='%1', cash='%2', bankacc='%3', cop_gear='%4', cop_licenses='%5', cop_stats='%6', playtime='%7' WHERE pid='%8'",_name,_cash,_bank,_gear,_licenses,_stats,_playtime_update,_uid];}; case civilian: {_query = format ["UPDATE players SET name='%1', cash='%2', bankacc='%3', civ_licenses='%4', civ_gear='%5', arrested='%6', civ_stats='%7', civ_alive='%8', civ_position='%9', playtime='%10' WHERE pid='%11'",_name,_cash,_bank,_licenses,_gear,[_this select 8] call DB_fnc_bool,_stats,[_alive] call DB_fnc_bool,_position,_playtime_update,_uid];}; case independent: {_query = format ["UPDATE players SET name='%1', cash='%2', bankacc='%3', med_licenses='%4', med_gear='%5', med_stats='%6', playtime='%7' WHERE pid='%8'",_name,_cash,_bank,_licenses,_gear,_stats,_playtime_update,_uid];}; }; To: switch (_side) do { case west: {_query = format ["UPDATE players SET name='%1', westcash='%2', westbankacc='%3', cop_gear='%4', cop_licenses='%5', cop_stats='%6', playtime='%7' WHERE pid='%8'",_name,_cash,_bank,_gear,_licenses,_stats,_playtime_update,_uid];}; case civilian: {_query = format ["UPDATE players SET name='%1', cash='%2', bankacc='%3', civ_licenses='%4', civ_gear='%5', arrested='%6', civ_stats='%7', civ_alive='%8', civ_position='%9', playtime='%10' WHERE pid='%11'",_name,_cash,_bank,_licenses,_gear,[_this select 8] call DB_fnc_bool,_stats,[_alive] call DB_fnc_bool,_position,_playtime_update,_uid];}; case independent: {_query = format ["UPDATE players SET name='%1', cash='%2', bankacc='%3', med_licenses='%4', med_gear='%5', med_stats='%6', playtime='%7' WHERE pid='%8'",_name,_cash,_bank,_licenses,_gear,_stats,_playtime_update,_uid];}; }; === Step 6: Go to your Altis_Life.Altis\core\fn_initCop.sqf and ADD this: if (life_westbankcount <= 1) then { BANK = 200000; // Change this value to change the starting money life_westbankcount = life_westbankcount + 1; }; RIGHT ABOVE: player setVariable["rank",(FETCH_CONST(life_coplevel)),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. === Step 7: Go to your Altis_Life.Altis\core\configuration.sqf and ADD this: life_westbankcount = 0; AT THE END OF: ***************************** ****** Backend Variables ***** ***************************** */ life_query_time = time; life_action_delay = time; life_trunk_vehicle = objNull; life_session_completed = false; life_garage_store = false; life_session_tries = 0; life_net_dropped = false; life_siren_active = false; life_clothing_filter = 0; life_clothing_uniform = -1; life_redgull_effect = time; life_is_processing = false; life_bail_paid = false; life_impound_inuse = false; life_action_inUse = false; life_spikestrip = ObjNull; life_knockout = false; life_interrupted = false; life_respawned = false; life_removeWanted = false; life_action_gathering = false; tawvd_addon_disable = true; life_god = false; life_frozen = false; life_save_gear = []; life_container_activeObj = ObjNull; life_disable_getIn = false; life_disable_getOut = false; life_admin_debug = false; life_preview_3D_vehicle_cam = objNull; life_preview_3D_vehicle_object = objNull; life_preview_light = objNull; life_pos_exist = false; life_pos_attach = []; life_civ_position = []; life_markers = false; === Step 7: Execute the following on your MySQL database for the players table: ALTER TABLE `players` ADD `westcash` int(100) NOT NULL DEFAULT '0' AFTER bankacc; ALTER TABLE `players` ADD `westbankacc` int(100) NOT NULL DEFAULT '0' AFTER westcash; === Quote Link to post Share on other sites
Antoseven8 0 Posted December 21, 2016 Report Share Posted December 21, 2016 what use this script, you can explain it better? Quote Link to post Share on other sites
ρhantom 5 Posted December 21, 2016 Report Share Posted December 21, 2016 2 hours ago, Antoseven8 said: what use this script, you can explain it better? Bank account balance and on-hand cash for the civilian side is separate from that of the west side. One use is so that people don't money farm as a cop and have that money when they play civ. 2 Quote Link to post Share on other sites
SkilledOne 1 Posted December 22, 2016 Author Report Share Posted December 22, 2016 13 hours ago, ρhantom said: Bank account balance and on-hand cash for the civilian side is separate from that of the west side. One use is so that people don't money farm as a cop and have that money when they play civ. Thanks for answering this for me Quote Link to post Share on other sites
Sergueiii' 1 Posted December 24, 2016 Report Share Posted December 24, 2016 @SkilledOne thank you for credits, appreciate that BTW for the ones who don't know the use of life_westbankcount, the default way of life for giving starting money isn't working at all with these modifications. If anyone has a better method, please PM me ! Best regards. 1 Quote Link to post Share on other sites
SkilledOne 1 Posted December 25, 2016 Author Report Share Posted December 25, 2016 11 hours ago, Sergueiii' said: @SkilledOne thank you for credits, appreciate that BTW for the ones who don't know the use of life_westbankcount, the default way of life for giving starting money isn't working at all with these modifications. If anyone has a better method, please PM me ! Best regards. Anytime my man, thanks for the original tutorial after the one was lost on here. Quote Link to post Share on other sites
HeWhoMustNotBeNamed 1 Posted January 4, 2017 Report Share Posted January 4, 2017 I got a Problem, every time when someone rejoin as a Police he have 200.000$ and not the money he had even if he had more or less money. Can someone help me? Quote Link to post Share on other sites
[L.O.G]『CrankFamily』H0li' 0 Posted January 4, 2017 Report Share Posted January 4, 2017 As its written in the code, you have to change, in your fn_initCop.sqf, the amount (BANK = BANK + the amount) Quote Link to post Share on other sites
Uber Killer LIVE => 0 Posted January 10, 2017 Report Share Posted January 10, 2017 how can i get like a different bank account for medics ? Quote Link to post Share on other sites
DZG™ | DubStepMad 3 Posted January 11, 2017 Report Share Posted January 11, 2017 Just added this, will test tomorrow on 4.4r3 to see if it works. Quote Link to post Share on other sites
Mike Black 4 Posted January 14, 2017 Report Share Posted January 14, 2017 Have a question. What is the amount? What I have to write there? Mike Quote Link to post Share on other sites
DZG™ | DubStepMad 3 Posted January 14, 2017 Report Share Posted January 14, 2017 I am having an issue, doesn't seem to work for v4.4r3 (error below) http://images.akamai.steamusercontent.com/ugc/89344377316328421/6109A3C716111A3D21E250BB6FE09198B139CB20/ It constantly says this and won't let me do anything. Quote Link to post Share on other sites
[TWS] The Vaiil 6 Posted January 15, 2017 Report Share Posted January 15, 2017 33 minutes ago, DZG™ | DubStepMad said: I am having an issue, doesn't seem to work for v4.4r3 (error below) http://images.akamai.steamusercontent.com/ugc/89344377316328421/6109A3C716111A3D21E250BB6FE09198B139CB20/ It constantly says this and won't let me do anything. You fucked up somewhere, also post logs will help lol. Quote Link to post Share on other sites
DZG™ | DubStepMad 3 Posted January 15, 2017 Report Share Posted January 15, 2017 4 minutes ago, [TWS] The Vaiil said: You fucked up somewhere, also post logs will help lol. This is the only error I have in the RPT log and the EXTDB 2 logs have nothing 0:01:23 "extDB2: Protocol Error: [0,""Error Statement Exception""]" Quote Link to post Share on other sites
Mike Black 4 Posted January 16, 2017 Report Share Posted January 16, 2017 When i reconnect to my server I have every time 200.000 on my bank what can I do? I know that this is written above but I don't know what I should insert for the amount Quote Link to post Share on other sites
DZG™ | DubStepMad 3 Posted January 17, 2017 Report Share Posted January 17, 2017 16 hours ago, Mike Black said: When i reconnect to my server I have every time 200.000 on my bank what can I do? I know that this is written above but I don't know what I should insert for the amount Change it to the following to this and you will have to give any new cop money via either jason_000 admin panel or MYSQL Workbench (Temp fix only!) if (life_westbankcount <= 1) then { life_westbankcount = life_westbankcount + 1; }; Quote Link to post Share on other sites
Mike Black 4 Posted January 17, 2017 Report Share Posted January 17, 2017 (edited) Ok and an Permanent fix? Or are there any other possible ways to set the money for new persons? Edited January 17, 2017 by Mike Black Quote Link to post Share on other sites
LowOesiii was tun??? 0 Posted January 26, 2017 Report Share Posted January 26, 2017 Yeah, how we can fix that? Quote Link to post Share on other sites
TulparHAN 2 Posted January 27, 2017 Report Share Posted January 27, 2017 What exactly is this Are you a screen display shooter? Quote Link to post Share on other sites
Tangowordwide 2 Posted March 13, 2017 Report Share Posted March 13, 2017 On 15/01/2017 at 0:35 AM, DZG™ | DubStepMad said: This is the only error I have in the RPT log and the EXTDB 2 logs have nothing 0:01:23 "extDB2: Protocol Error: [0,""Error Statement Exception""]" The fix is change the pid to playerid life_server files only! fn_insertRequest.sqf fn_queryRequest.sqf fn_updatePartial.sqf fn_updateRequest.sqf 1 Quote Link to post Share on other sites
armagod 17 Posted March 28, 2017 Report Share Posted March 28, 2017 if (life_westbankcount <= 1) then { BANK = 200000; // Change this value to change the starting money life_westbankcount = life_westbankcount + 1; }; this is not needed if run on a fresh install as it resets the money every time a cop reconnects.. i added everything except this and works fine Quote Link to post Share on other sites
Killian D. 0 Posted April 3, 2017 Report Share Posted April 3, 2017 works for v5.0? Quote Link to post Share on other sites
Evolocity 0 Posted October 5, 2017 Report Share Posted October 5, 2017 (edited) Confirmed working 5.0 if (life_westbankcount <= 1) then { BANK = 200000; // Change this value to change the starting money life_westbankcount = life_westbankcount + 1; }; no need for this part though just set the startmoney in Config_Master and remove this. Edited October 5, 2017 by Evolocity Quote Link to post Share on other sites
Johnny Bravo 0 Posted October 23, 2017 Report Share Posted October 23, 2017 I've noticed that when a player spawns in as a civilian, it adds the civilian starting bank to the civilian bank, but also adds it to the westbank as well. I know they only have access to the one side but shouldn't the other side remain as "0" until they actually log in as a cop or something ? Quote Link to post Share on other sites
JeedZzZ 0 Posted November 3, 2017 Report Share Posted November 3, 2017 (edited) good Edited November 3, 2017 by JeedZzZ Quote Link to post Share on other sites