
All checks were successful
Build / Build (push) Successful in 26s
This commit refactors how organization funds and reputation are handled, updates task completion logic to use the new organization functions, and modifies player saving to include organization data. Additionally, it introduces string serialization/deserialization and fixes a player save loop. * **Organization Funds and Reputation:** Replaces direct server calls for handling funds and reputation with calls to the new organization functions (`EFUNC(org,addFunds)` and `EFUNC(org,addReputation)`). This centralizes fund and reputation management within the organization store. * **Task Completion Logic:** Updates task completion functions (`fnc_destroy.sqf`, `fnc_attack.sqf`, `fnc_hostage.sqf`, `fnc_hvt.sqf`, `fnc_defuse.sqf`) to use the new organization functions for adding funds and reputation upon task success or failure. Also adds notifications to inform the player of reputation and fund changes. * **Player Saving:** Modifies the player saving function (`fnc_playerDBSave.sqf`) to include the player's organization ID in the saved data. * **String Serialization/Deserialization:** Adds `serializeString` and `deserializeString` PREP macros to `XEH_PREP.hpp` and uses them in `fnc_handleOrgLoad.sqf` and `fnc_create.sqf` to handle special characters in organization and member names. * **Player Save Loop Fix:** Removes unnecessary brackets from the `call FUNC(playerDBSave)` in `fnc_playerSaveLoop.sqf`. * **Organization Purchase Verification:** Adds organization ownership verification to `fnc_handlePurchase.sqf` to ensure only the owner can make purchases using organization funds. * **Player Initialization:** Updates `fnc_initPlayer.sqf` to retrieve and set the player's organization upon initialization.
43 lines
1.4 KiB
Plaintext
43 lines
1.4 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Author: J. Schmidt
|
|
* Removes an asset from an organization's inventory.
|
|
* Deletes the specified asset based on its type and unique identifier.
|
|
*
|
|
* 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 |