{"id":21457758,"url":"https://github.com/brycecanyoncounty/bcc-society","last_synced_at":"2025-03-17T04:10:43.792Z","repository":{"id":263938945,"uuid":"891852368","full_name":"BryceCanyonCounty/bcc-society","owner":"BryceCanyonCounty","description":"The ultimate script for managing societies in RedM","archived":false,"fork":false,"pushed_at":"2024-11-23T17:39:22.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T13:32:57.744Z","etag":null,"topics":["cfx","lua","redm"],"latest_commit_sha":null,"homepage":"https://bcc-scripts.com/","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BryceCanyonCounty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-21T04:16:33.000Z","updated_at":"2024-11-23T17:38:48.000Z","dependencies_parsed_at":"2024-11-21T05:34:21.726Z","dependency_job_id":null,"html_url":"https://github.com/BryceCanyonCounty/bcc-society","commit_stats":null,"previous_names":["brycecanyoncounty/bcc-society"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BryceCanyonCounty%2Fbcc-society","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BryceCanyonCounty%2Fbcc-society/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BryceCanyonCounty%2Fbcc-society/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BryceCanyonCounty%2Fbcc-society/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BryceCanyonCounty","download_url":"https://codeload.github.com/BryceCanyonCounty/bcc-society/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243971193,"owners_count":20376784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cfx","lua","redm"],"created_at":"2024-11-23T06:06:52.147Z","updated_at":"2025-03-17T04:10:43.755Z","avatar_url":"https://github.com/BryceCanyonCounty.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BCC-Society\n\u003e Welcome to **BCC-Society**, the ultimate script for managing societies in RedM! Thank you for your support!\n\n## Features\n- **Simple Configuration**: Easily customize your society setup.\n- **Effortless Translations**: Translate the script into different languages with ease.\n- **Highly Modular**: Each society is created with its own settings, minimizing the need for extensive configuration.\n- **Admin Management Menu**: Conveniently manage your society through an intuitive menu.\n- **Developer Exports**: Export data for further customization and analysis.\n- **Webhooks**: Stay connected with society and admin updates through webhooks.\n- **Safety and Security**: Built-in features ensure the safety and security of your society.\n- **Seamless Experience**: No need to relog, except for society deletion.\n- **Society Inventories**: Manage inventories for your society.\n- **Upgradeable Inventories**: Set Upgrades for inventories during society creation, that players can buy in thier menu later.\n- **Named Societies**: Give your society a unique name.\n- **Togglable Blip**: Easily toggle the blip for your society.\n- **Ledger System**: Keep track of society finances, store, and withdraw money with a ledger system.\n- **Employee Management**: Hire and manage employees for your society.\n- **Rank System**: Implement a rank system within your society.\n- **Payment System**: Manage payments within your society.\n- **Billing Command**: Easily handle billing within your society.\n- **Taxes**: Implement a tax system within your society.\n- **Version Checking**: Version Checking to keep you upto date!\n- **Society Jobs**: Each society has its own job that you set during creation, or change in the admin menu. Job Grade is set for each society Rank so each rank has its own job grade that the owner or employee with the manage rank permission can set/change.\n- **Toggle Society Jobs Duty**: Society jobs can be setup to allow for toggling being on and off duty(Not all jobs, just society jobs).\n\n# Requirements:\n- VORP CORE\n- VORP INVENTORY\n- BCC-Utils version 1.0.9 and above\n- Feather Menu: https://github.com/FeatherFramework/feather-menu/releases\n- VORP CHARACTER\n\n# Society API\n\nThe Society API provides functionality for managing society data in a RedM environment. This API supports operations like retrieving society information, managing employees, handling society finances, and verifying job roles, offering a robust solution for society-related management.\n\n## Setup\n\nThe `SocietyAPI` is globally accessible within the script and can be retrieved using:\n```lua\nexports(\"getSocietyAPI\", function() return SocietyAPI end)\n```\n\n## Features\n\n1. **Society Management**: Retrieve and manage society details, employees, ranks, and ledger information.\n2. **Employee Management**: Manage employee roles, check rank permissions, and retrieve rank details.\n3. **Financial Operations**: Add or deduct funds from the society ledger.\n4. **Miscellaneous Functions**: Retrieve all societies a character owns or is employed in, list all societies, and verify player job status.\n\n## API Methods\n\n### Society Management\n\n- **`SocietyAPI:GetSociety(societyId)`**  \n  Retrieves a society object by its ID, which provides access to various functions for managing the society.\n\n    ```lua\n    local society = SocietyAPI:GetSociety(societyId)\n    if society then\n        local info = society:GetSocietyInfo()\n        print(info)\n    end\n    ```\n\n### Employee Management\n\n- **`society:GetSocietyEmployees()`**  \n  Fetches all employees associated with the society.\n\n    ```lua\n    local employees = society:GetSocietyEmployees()\n    if employees then\n        for _, employee in ipairs(employees) do\n            print(employee.employee_name)\n        end\n    end\n    ```\n\n- **`society:CheckRankPermissions(rankName)`**  \n  Checks the permissions for a given rank within the society.\n\n    ```lua\n    local rankInfo = society:CheckRankPermissions(\"Manager\")\n    if rankInfo then\n        print(\"Permissions:\", rankInfo.permissions)\n    end\n    ```\n\n### Financial Management\n\n- **`society:AddMoneyToLedger(amount)`**  \n  Adds funds to the society's ledger.\n\n    ```lua\n    society:AddMoneyToLedger(1000)\n    ```\n\n- **`society:RemoveMoneyFromLedger(amount)`**  \n  Deducts funds from the society's ledger.\n\n    ```lua\n    society:RemoveMoneyFromLedger(500)\n    ```\n\n### Miscellaneous Functions\n\n- **`SocietyAPI.MiscAPI:GetAllSocietiesCharOwns(charIdentifier)`**  \n  Retrieves all societies owned by a character.\n\n    ```lua\n    local ownedSocieties = SocietyAPI.MiscAPI:GetAllSocietiesCharOwns(charIdentifier)\n    if ownedSocieties then\n        for _, society in ipairs(ownedSocieties) do\n            print(society.business_id, society.business_name)\n        end\n    end\n    ```\n\n- **`SocietyAPI.MiscAPI:GetAllSocietiesCharIsEmployedAt(charIdentifier)`**  \n  Fetches all societies where a character is employed.\n\n    ```lua\n    local employedSocieties = SocietyAPI.MiscAPI:GetAllSocietiesCharIsEmployedAt(charIdentifier)\n    if employedSocieties then\n        for _, society in ipairs(employedSocieties) do\n            print(society.business_id)\n        end\n    end\n    ```\n\n- **`SocietyAPI.MiscAPI:CheckIfPlayerHasJobAndIsOnDuty(jobName, playerSource)`**  \n  Verifies if a player has a specific job and is currently on duty.\n\n    ```lua\n    local isOnDuty = SocietyAPI.MiscAPI:CheckIfPlayerHasJobAndIsOnDuty(\"Police\", playerSource)\n    print(\"Is On Duty:\", isOnDuty)\n    ```\n\n## Example Usage\n\n```lua\n-- Retrieve a society and get its information\nlocal society = SocietyAPI:GetSociety(1)\nif society then\n    print(society:GetSocietyInfo())\n\n    -- Add funds to the ledger\n    society:AddMoneyToLedger(500)\n\n    -- Retrieve employees\n    local employees = society:GetSocietyEmployees()\n    if employees then\n        for _, employee in ipairs(employees) do\n            print(employee.employee_name)\n        end\n    end\nend\n\n-- Check all societies a character owns\nlocal charIdentifier = 1234\nlocal ownedSocieties = SocietyAPI.MiscAPI:GetAllSocietiesCharOwns(charIdentifier)\nif ownedSocieties then\n    for _, soc in ipairs(ownedSocieties) do\n        print(soc.business_id, soc.business_name)\n    end\nend\n```\n\nThe Society API streamlines society management, making it easier to handle society operations in RedM scripts.\n\n## Special thanks\nThanks to Jake for the base of this script.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrycecanyoncounty%2Fbcc-society","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrycecanyoncounty%2Fbcc-society","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrycecanyoncounty%2Fbcc-society/lists"}