#include "..\script_component.hpp" /* * Function: forge_client_org_fnc_addMember * Author: IDSolutions * * [Description] * Adds a new member to an organization. Only the organization owner can add members. * The new member will be assigned the default "member" role. * * Arguments: * 0: Player UID - Unique identifier of the player to add * 1: Player Name - Display name of the player to add * * Return Value: * Success - 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