
This commit refines the event handling for both admin and bank functionalities, ensuring better clarity and consistency in logging. Key changes include: - Updated event names in admin handling to follow a consistent naming convention. - Improved parameter handling in admin event functions, ensuring validation checks are in place. - Enhanced logging messages to provide clearer context regarding the source of events and actions taken. - Introduced bank event handling for deposit, transfer, withdrawal, and balance inquiries, with appropriate validation and logging. These changes aim to improve the maintainability and readability of the codebase while ensuring robust event management.
30 lines
1.3 KiB
Plaintext
30 lines
1.3 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
{
|
|
private _configName = configName(_x);
|
|
private _className = (missionConfigFile >> "CfgBanks" >> "banks" >> _configName >> "className") call BFUNC(getCfgData);
|
|
private _pos = (missionConfigFile >> "CfgBanks" >> "banks" >> _configName >> "pos") call BFUNC(getCfgData);
|
|
private _dir = (missionConfigFile >> "CfgBanks" >> "banks" >> _configName >> "dir") call BFUNC(getCfgData);
|
|
private _type = (missionConfigFile >> "CfgBanks" >> "banks" >> _configName >> "type") call BFUNC(getCfgData);
|
|
|
|
if (_type == "object") then {
|
|
private _bank = createSimpleObject [_className, [0, 0, 0]];
|
|
|
|
_bank setPosATL _pos;
|
|
_bank setDir _dir;
|
|
_bank allowDamage false;
|
|
_bank setVariable ["isBank", true, true];
|
|
} else {
|
|
private _group = createGroup civilian;
|
|
private _bank = _group createUnit [_className, [0, 0, 0], [], 0, "NONE"];
|
|
|
|
_bank disableAI "MOVE";
|
|
_bank setPosATL _pos;
|
|
_bank setDir _dir;
|
|
_bank allowDamage false;
|
|
_bank setVariable ["isBank", true, true];
|
|
_bank setVariable ["BIS_enableRandomization", false];
|
|
};
|
|
|
|
diag_log text format ["[FORGE::Server::Bank::initBank] ClassName: '%1' Pos: '%2' Dir: '%3'", _className, _pos, _dir];
|
|
} forEach ("true" configClasses (missionConfigFile >> "CfgBanks" >> "banks")); |