Français Bouton pour tout déposer à l'ATM

  • Auteur de la discussion Auteur de la discussion I'm the Boss
  • Date de début Date de début

I'm the Boss

Leader
Membre du personnel
2/1/20
701
3
44
1 100
Cette modification de l'ATM (ou DAB) vous permettra d'ajouter un bouton pour déposer entièrement l'argent que vous possédez sur vous.
-----------------------------------------------------------------------------​

Installation :

1. Rendez-vous dans le dossier dialog / function. Dans ce dossier vous allez créer un nouveau fichier et le nommer fn_bankDepositAll.sqf. Et rajouter ce code à l'intérieur:
Code:
#include "..\..\script_macros.hpp"
/*
    File: fn_bankDepositAll.sqf
    Author: Bryan "Tonic" Boardwine
    
    Description: ajout d'un bouton pour déposer tout son argent à l'ATM.
*/
if(CASH isEqualTo 0) exitWith {hint "Vous n'avez pas d'argent à déposer!"};

private "_pockets";

_pockets = CASH;

BANK = BANK + _pockets;
CASH = CASH - _pockets;

hint format[localize "STR_ATM_DepositAllSuccess"];
[] call life_fnc_atmMenu;
[6] call SOCK_fnc_updatePartial;

2. Aller ensuite dans votre Functions.hpp (à la racine de votre mission) et ajoutez ce code dans la class Dialog_Controls :

Code:
class bankDepositAll {};

3. Rendez-vous maintenant dans le dossier dialog et ouvrez le bank.hpp et remplacer ce dernier par celui-ci :

Code:
class Life_atm_management {
    idd = 2700;
    name= "life_atm_menu";
    movingEnable = 0;
    enableSimulation = 1;
   
    class controlsBackground {
        class Life_RscTitleBackground: Life_RscText {
            colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
            idc = -1;
            x = 0.35;
            y = 0.2;
            w = 0.3;
            h = (1 / 25);
        };
 
        class MainBackground: Life_RscText {
            colorBackground[] = {0, 0, 0, 0.7};
            idc = -1;
            x = 0.35;
            y = 0.2 + (11 / 250);
            w = 0.3;
            h = 0.704 - (22 / 250);
        };
    };
 
    class controls {
        class CashTitle: Life_RscStructuredText {
            idc = 2701;
            text = "";
            x = 0.39;
            y = 0.26;
            w = 0.3;
            h = .14;
        };
 
        class Title: Life_RscTitle {
            colorBackground[] = {0, 0, 0, 0};
            idc = -1;
            text = "$STR_ATM_Title";
            x = 0.35;
            y = 0.2;
            w = 0.6;
            h = (1 / 25);
        };
 
        class WithdrawButton: Life_RscButtonMenu {
            idc = -1;
            text = "$STR_ATM_Withdraw";
            colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
            onButtonClick = "[] call life_fnc_bankWithdraw";
            x = 0.425;
            y = 0.46;
            w = (6.25 / 40);
            h = (1 / 25);
        };
 
        class DepositButton: Life_RscButtonMenu {
            idc = -1;
            text = "$STR_ATM_Deposit";
            colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
            onButtonClick = "[] call life_fnc_bankDeposit";
            x = 0.425;
            y = 0.512;
            w = (6.25 / 40);
            h = (1 / 25);
        };
 
        class DepositAllButton: Life_RscButtonMenu {
            idc = -1;
            text = "TOUT DEPOSER";
            colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
            onButtonClick = "[] call life_fnc_bankDepositAll";
            x = 0.425;
            y = 0.564;
            w = (6.25 / 40);
            h = (1 / 25);
        };
 
        class moneyEdit: Life_RscEdit {
            idc = 2702;
            text = "1";
            sizeEx = 0.030;
            x = 0.4;
            y = 0.41;
            w = 0.2;
            h = 0.03;
        };
 
        class PlayerList: Life_RscCombo {
            idc = 2703;
            x = 0.4;
            y = 0.632;
            w = 0.2;
            h = 0.03;
        };
 
        class TransferButton: Life_RscButtonMenu {
            idc = -1;
            text = "$STR_ATM_Transfer";
            colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
            onButtonClick = "[] call life_fnc_bankTransfer";
            x = 0.425;
            y = 0.682;
            w = (6.25 / 40);
            h = (1 / 25);
        };
 
        class GangWithdraw : TransferButton {
            idc = 2705;
            text = "$STR_ATM_WithdrawGang";
            colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
            onButtonClick = "[] call life_fnc_gangWithdraw";
            x = 0.365;
            y = 0.752;
            w = 0.275;
        };
 
        class GangDeposit : TransferButton {
            idc = 2706;
            text = "$STR_ATM_DepositGang";
            colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
            onButtonClick = "[] call life_fnc_gangDeposit";
            x = 0.365;
            y = 0.804;
            w = 0.275;
        };
 
        class CloseButtonKey: Life_RscButtonMenu {
            idc = -1;
            text = "$STR_Global_Close";
            onButtonClick = "closeDialog 0;";
            x = 0.35;
            y = 0.864;
            w = (6.25 / 40);
            h = (1 / 25);
        };
    };
};

Ce tutoriel est terminé.