client/addons/org/functions/fnc_addMember.sqf
Jacob Schmidt d474b3676a
All checks were successful
Build / Build (push) Successful in 28s
Refactor: Standardize function descriptions and variable handling
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.
2025-05-25 11:30:26 -05:00

43 lines
1.3 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Adds a new member to an organization if added by the owner
*
* Arguments:
* 0: Player UID <STRING> - Unique identifier of the player to add
* 1: Player Name <STRING> - Display name of the player to add
*
* Return Value:
* Success <BOOLEAN> - True if member was added successfully, false otherwise
*
* Example:
* ["76561198012345678", "John Doe"] call forge_client_org_fnc_addMember
*
* Public: Yes
*/
params [["_uid", "", [""]], ["_name", "", [""]]];
// Validate input parameters
if (_uid == "" || _name == "") exitWith {
["Invalid parameters for organization invitation", "error", 5, "right"] call forge_client_misc_fnc_notify;
false
};
// Get the organization store interface
private _store = call FUNC(verifyOrgStore);
// Add the member to the organization
// This will validate ownership permissions and handle database updates
private _result = _store call ["addMember", [_uid, _name]];
// Provide feedback based on success or failure
if (_result) then {
[format ["%1 added to organization", _name], "success", 5, "right"] call forge_client_misc_fnc_notify;
} else {
["Failed to add member to organization", "error", 5, "right"] call forge_client_misc_fnc_notify;
};
// Return the result for further operations
_result