
All checks were successful
Build / Build (push) Successful in 28s
This commit refactors several client-side functions to improve code consistency and readability. - Standardizes function descriptions by removing redundant "Function: forge_client..." prefixes and "[Description]" sections, focusing on concise descriptions of the function's purpose. - Updates variable handling in arsenal functions to use GVAR and EGVARS for default values, improving consistency and reducing code duplication. - Removes the bank init function as it is no longer needed. - Adds a done variable to the preinit file.
42 lines
1.3 KiB
Plaintext
42 lines
1.3 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Author: IDSolutions
|
|
* Removes an asset from an organization's inventory
|
|
*
|
|
* Arguments:
|
|
* 0: Asset Type <STRING> - Type of asset (vehicle, building, etc.)
|
|
* 1: Asset ID <STRING> - Unique identifier of the asset to remove
|
|
*
|
|
* Return Value:
|
|
* Success <BOOLEAN> - True if asset was removed successfully, false otherwise
|
|
*
|
|
* Example:
|
|
* ["vehicle", "B_MRAP_01_F_1234567890"] call forge_client_org_fnc_removeAsset
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params [["_assetType", "", [""]], ["_assetId", "", [""]]];
|
|
|
|
// Validate input parameters
|
|
if (_assetType isEqualTo "" || _assetId isEqualTo "") exitWith {
|
|
["Invalid parameters for removing asset", "error", 5, "right"] call forge_client_misc_fnc_notify;
|
|
false
|
|
};
|
|
|
|
// Get the organization store interface
|
|
private _store = call FUNC(verifyOrgStore);
|
|
|
|
// Remove the asset from the organization's inventory
|
|
private _result = _store call ["removeAsset", [_assetType, _assetId]];
|
|
|
|
// Provide feedback based on success or failure
|
|
if (_result) then {
|
|
[format ["Asset removed successfully: %1", _assetId], "success", 5, "right"] call forge_client_misc_fnc_notify;
|
|
} else {
|
|
[format ["Failed to remove asset: %1", _assetId], "error", 5, "right"] call forge_client_misc_fnc_notify;
|
|
};
|
|
|
|
// Return the result for further operations
|
|
_result |