#include "..\script_component.hpp" /* * Function: forge_client_org_fnc_create * Author: J. Schmidt * * Description: * Creates a new organization for a player * * Arguments: * 0: _ownerUID - Player UID * 1: _ownerName - Player name (unused, gets name from player object) * 2: _name - Organization name * 3: _initialFunds - Initial funds for the org (Optional, default: 0) * 4: _initialReputation - Initial reputation for the org (Optional, default: 0) * * Return Value: * Organization data or nil on failure */ params [ ["_ownerUID", "", [""]], ["_name", "", [""]], ["_initialFunds", 0, [0]], ["_initialReputation", 0, [0]] ]; if (_ownerUID == "" || _name == "") exitWith { TRACE_2("Invalid parameters for organization creation",_ownerUID,_name); nil }; private _store = call FUNC(verifyOrgStore); // The createOrg method in the store already handles: // - Checking if player already has an organization // - Creating the organization with basic data // - Adding the owner as a member // - Saving to database private _orgData = _store call ["createOrg", [_ownerUID, _name, _initialFunds, _initialReputation]]; if (isNil "_orgData") then { TRACE_2("Failed to create organization",_name,_ownerUID); } else { TRACE_2("Organization created successfully",_name,_ownerUID); }; // Return the organization data _orgData