English [BankingSystem] How to adapt BRINKS script from TOM to the BankingSystem

  • Auteur de la discussion Auteur de la discussion Robert
  • Date de début Date de début

Robert

TP-Shop Team
Membre du personnel
Developer
29/12/19
7
1
6
100
Hi,
Here is a tutorial to adapt the Brinks script from Tom to the BankingSystem.
1- Depack your PBO @TheProgrammer/addons/banking_system.pbo.
2- Go to the folder banking_system/client/atm/money.
3- In your file fn_atm_withdraw.sqf find line 19(by default) :

Code:
Développer Réduire Copier
 if (_amount > life_atmbank) exitWith {hint (['STR_NOT_ENOUGH_MONEY','The_Programmer_BankingSystem','BankingSystem_localization'] call theprogrammer_core_fnc_localize)};

And add :

Code:
Développer Réduire Copier
_TOMFCZ_BRINKS_EXIT = false;
_TOMFCZ_BRINKS_enablesystem = getNumber(missionConfigFile >> "TOMFCZ_BRINKS_V2" >> "enable_system");
_TOMFCZ_BRINKS_maxatm = getNumber (missionConfigFile >> "TOMFCZ_BRINKS_V2" >> "max_atm");
if (_TOMFCZ_BRINKS_enablesystem isEqualTo 1) then {
    _TOMFCZ_BRINKS_atm = cursorObject;
    _TOMFCZ_BRINKS_atmoney = _TOMFCZ_BRINKS_atm getVariable ["TOMFCZ_ATM_MONEY", 0];

    if (_amount > _TOMFCZ_BRINKS_atmoney) then {
        _TOMFCZ_BRINKS_EXIT = true;
        hint parseText format ["<t color='#e74c3c'>Le distributeur contient seulement $%1</t>", [_TOMFCZ_BRINKS_atmoney] call life_fnc_numberText];
    } else {
        _TOMFCZ_BRINKS_atmoney = _TOMFCZ_BRINKS_atmoney - _amount;
        _TOMFCZ_BRINKS_atm setVariable ["TOMFCZ_ATM_MONEY", _TOMFCZ_BRINKS_atmoney, true];
        _TOMFCZ_BRINKS_marker = ["MARKER_", _TOMFCZ_BRINKS_atm] joinString "";
        if (_TOMFCZ_BRINKS_atmoney >= _TOMFCZ_BRINKS_maxatm) then { _TOMFCZ_BRINKS_marker setMarkerColor "ColorGreen" } else { _TOMFCZ_BRINKS_marker setMarkerColor "ColorRed" };
    };
};
if (_TOMFCZ_BRINKS_EXIT) exitWith {};

4 - in your file fn_atm_deposit.sqf find line 17 (par défaut) :

Code:
Développer Réduire Copier
if (_value > life_cash) exitWith {hint localize "STR_ATM_NotEnoughCash"};

And add :

Code:
Développer Réduire Copier
_TOMFCZ_BRINKS_EXIT = false;
_TOMFCZ_BRINKS_enablesystem = getNumber(missionConfigFile >> "TOMFCZ_BRINKS_V2" >> "enable_system");
_TOMFCZ_BRINKS_maxatm = getNumber (missionConfigFile >> "TOMFCZ_BRINKS_V2" >> "max_atm");
if (_TOMFCZ_BRINKS_enablesystem isEqualTo 1) then {
    _TOMFCZ_BRINKS_atm = cursorObject;
    _TOMFCZ_BRINKS_atmoney = _TOMFCZ_BRINKS_atm getVariable ["TOMFCZ_ATM_MONEY", 0];
    _TOMFCZ_BRINKS_atmoney = _TOMFCZ_BRINKS_atmoney + _value;
    _TOMFCZ_BRINKS_atm setVariable ["TOMFCZ_ATM_MONEY", _TOMFCZ_BRINKS_atmoney, true];
    _TOMFCZ_BRINKS_marker = ["MARKER_", _TOMFCZ_BRINKS_atm] joinString "";
    if (_TOMFCZ_BRINKS_atmoney >= _TOMFCZ_BRINKS_maxatm) then { _TOMFCZ_BRINKS_marker setMarkerColor "ColorGreen" } else { _TOMFCZ_BRINKS_marker setMarkerColor "ColorRed" };
};

5- Repack your PBO.
 
  • Love
Les réactions: Barney "Wish" Ross
Activité
Pour l'instant, il n'y a personne ici