Jump to content

SkilledOne

Members
  • Content Count

    11
  • Joined

  • Last visited

Posts posted by SkilledOne

  1. 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.

  2. 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;

    ===

  3. Those in this community in the old days may remember me, I've been known as Brendan Allen by my youtube channels:

    https://www.youtube.com/channel/UCtZ466HLzD46qxiSK-AZTKw

    https://www.youtube.com/channel/UCNk0AIBm4r08TY3tgfRrI0g

    I've posted some tutorials and fixes for scripts on the forums a long time ago, some stuff like Jail Time for 3.1.2, and I fixed the crafting for Altis Life 4.0 and a few other things.

    I've been gone for quite some time and it's a shame to see this site has been raided and left dry.

    I wanted to check in, re-register and say hi again!

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.