> For the complete documentation index, see [llms.txt](https://zloma-scripts.gitbook.io/zloma-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zloma-scripts.gitbook.io/zloma-scripts/zloma_core-free/contributing.md).

# Contributing

zloma\_core is designed to be easily extensible. Every wrapper file has clear comments showing exactly where to add new systems.

***

## Adding a New System

### 1. Add Detection

In `shared/config.lua`, find the relevant `Detect*()` function and add an `elseif`:

```lua
-- Example: adding a new inventory
function ZlomaCore.DetectInventory()
    -- ... existing systems ...
    elseif GetResourceState('your-inventory') == 'started' then
        return 'your-inventory'
    end
end
```

Also add the name to the `Config.Manual` comment for that category.

### 2. Implement Functions

Add `elseif` blocks in the appropriate wrapper file:

**Inventory** → `server/inventory.lua` (HasItem, GetItemCount, AddItem, RemoveItem, GetInventory)

**Keys** → `client/keys.lua` (GiveKeys, RemoveKeys, HasKeys)

**Notifications** → `client/notifications.lua` (Notify)

**Fuel** → `client/fuel.lua` + `server/fuel.lua` (GetVehicleFuel, SetVehicleFuel)

**Billing** → `server/billing.lua` (SendBill, GetBills)

**Target** → `client/target.lua` (AddEntity, AddBoxZone, etc.)

**Society** → `server/framework.lua` (GetSocietyMoney, AddSocietyMoney, RemoveSocietyMoney)

### 3. Test

* Install the target resource on a test server
* Set `ZlomaCore.Config.Debug = true`
* Verify detection works
* Test each function you implemented

### 4. Submit

Create a Pull Request on [GitHub](https://github.com/ZlomaScripts/zloma_core) with:

* Detection code
* Implementation
* Brief description of the system and its exports

***

## Example: Adding a New Inventory

```lua
-- 1. shared/config.lua → DetectInventory()
elseif GetResourceState('cool-inventory') == 'started' then
    return 'cool-inventory'

-- 2. server/inventory.lua → HasItem()
elseif InventoryType == 'cool-inventory' then
    return exports['cool-inventory']:HasItem(source, item) >= count

-- 3. server/inventory.lua → AddItem()
elseif InventoryType == 'cool-inventory' then
    success = exports['cool-inventory']:AddItem(source, item, count, metadata)

-- 4. server/inventory.lua → RemoveItem()
elseif InventoryType == 'cool-inventory' then
    success = exports['cool-inventory']:RemoveItem(source, item, count)

-- 5. server/inventory.lua → GetInventory()
elseif InventoryType == 'cool-inventory' then
    items = exports['cool-inventory']:GetPlayerItems(source)
```

That's it — 5 lines across 2 files to add full inventory support.

***

## Code Style

* Use `ZlomaCore.Debug()` for debug messages, never raw `print()`
* Wrap external calls in `pcall` when possible
* Return `false`/`nil`/`0` on failure, never throw errors
* Follow existing naming conventions


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zloma-scripts.gitbook.io/zloma-scripts/zloma_core-free/contributing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
