> For the complete documentation index, see [llms.txt](https://poseidon-2.gitbook.io/poseidon-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://poseidon-2.gitbook.io/poseidon-docs/dependencies/pos-core/config-examples/overrides.lua.md).

# overrides.lua

```lua
Config.FunctionOverrides = {
    -- -- Money Management Functions
    
    -- -- Give money to a player
    -- -- Arguments: source (number), amount (number)
    -- -- Returns: nothing
    -- GiveMoney = function(source, amount)
    --     print(string.format("Custom: Giving %d money to player %d", amount, source))
    --     -- Your custom implementation here
    --     -- Example: Add bonus money or log transactions
    --     -- TriggerEvent('esx:getSharedObject', function(ESX)
    --     --     local xPlayer = ESX.GetPlayerFromId(source)
    --     --     xPlayer.addMoney(amount * 1.1) -- Give 10% bonus
    --     -- end)
    -- end,
    
    -- -- Remove money from a player
    -- -- Arguments: source (number), amount (number)
    -- -- Returns: nothing
    -- RemoveMoney = function(source, amount)
    --     print(string.format("Custom: Removing %d money from player %d", amount, source))
    --     -- Your custom implementation here
    --     -- Example: Add tax or fees
    --     -- local actualAmount = amount * 1.05 -- Add 5% tax
    -- end,
    
    -- -- Get player's money amount
    -- -- Arguments: source (number)
    -- -- Returns: number (money amount)
    -- GetMoney = function(source)
    --     print(string.format("Custom: Getting money for player %d", source))
    --     -- Your custom implementation here
    --     -- Should return a number representing the player's money
    --     return 5000 -- Example: Always return 5000 for testing
    -- end,
    
    -- -- Get player's gold amount
    -- -- Arguments: source (number)
    -- -- Returns: number (gold amount)
    -- GetGold = function(source)
    --     print(string.format("Custom: Getting gold for player %d", source))
    --     -- Your custom implementation here
    --     return 250 -- Example: Always return 250 gold
    -- end,
    
    -- -- Character Information Functions
    
    -- -- Get player's first name
    -- -- Arguments: source (number)
    -- -- Returns: string (first name)
    -- GetFirstName = function(source)
    --     print(string.format("Custom: Getting first name for player %d", source))
    --     -- Your custom implementation here
    --     return "John" -- Example: Always return "John"
    -- end,
    
    -- -- Get player's last name
    -- -- Arguments: source (number)
    -- -- Returns: string (last name)
    -- GetLastName = function(source)
    --     print(string.format("Custom: Getting last name for player %d", source))
    --     -- Your custom implementation here
    --     return "Doe" -- Example: Always return "Doe"
    -- end,
    
    -- -- Get player's character ID
    -- -- Arguments: source (number)
    -- -- Returns: string/number (character identifier)
    -- GetCharacterId = function(source)
    --     print(string.format("Custom: Getting character ID for player %d", source))
    --     -- Your custom implementation here
    --     return "CHAR_" .. source -- Example: Return "CHAR_1", "CHAR_2", etc.
    -- end,
    
    -- -- Get player's character group
    -- -- Arguments: source (number)
    -- -- Returns: string (group name)
    -- GetCharacterGroup = function(source)
    --     print(string.format("Custom: Getting character group for player %d", source))
    --     -- Your custom implementation here
    --     return "citizen" -- Example: Always return "citizen"
    -- end,
    
    -- -- Job Management Functions
    
    -- -- Set player's job
    -- -- Arguments: source (number), job (string), grade (number)
    -- -- Returns: nothing
    -- SetJob = function(source, job, grade)
    --     print(string.format("Custom: Setting job %s (grade %d) for player %d", job, grade, source))
    --     -- Your custom implementation here
    --     -- Example: Log job changes or add restrictions
    -- end,
    
    -- -- Get player's job name
    -- -- Arguments: source (number)
    -- -- Returns: string (job name)
    -- GetJob = function(source)
    --     print(string.format("Custom: Getting job for player %d", source))
    --     -- Your custom implementation here
    --     return "unemployed" -- Example: Always return "unemployed"
    -- end,
    
    -- -- Get player's job grade
    -- -- Arguments: source (number)
    -- -- Returns: number (job grade)
    -- GetJobGrade = function(source)
    --     print(string.format("Custom: Getting job grade for player %d", source))
    --     -- Your custom implementation here
    --     return 0 -- Example: Always return grade 0
    -- end,
    
    -- -- Player State Functions
    
    -- -- Revive a player
    -- -- Arguments: source (number)
    -- -- Returns: nothing
    -- RevivePlayer = function(source)
    --     print(string.format("Custom: Reviving player %d", source))
    --     -- Your custom implementation here
    --     -- Example: Add custom revive effects or notifications
    --     -- TriggerClientEvent('custom:revive', source)
    -- end,
    
    -- -- Check if player is dead
    -- -- Arguments: source (number)
    -- -- Returns: boolean (true if dead, false if alive)
    -- IsDead = function(source)
    --     print(string.format("Custom: Checking if player %d is dead", source))
    --     -- Your custom implementation here
    --     return false -- Example: Always return false (alive)
    -- end,
    
    -- -- Check if player is online
    -- -- Arguments: source (number)
    -- -- Returns: boolean (true if online, false if offline)
    -- IsOnline = function(source)
    --     print(string.format("Custom: Checking if player %d is online", source))
    --     -- Your custom implementation here
    --     return true -- Example: Always return true
    -- end,
    
    -- -- Inventory Management Functions
    
    -- -- Check if player can carry an item
    -- -- Arguments: source (number), item (string), amount (number)
    -- -- Returns: boolean (true if can carry, false if cannot)
    -- CanCarryItem = function(source, item, amount)
    --     print(string.format("Custom: Checking if player %d can carry %d x %s", source, amount, item))
    --     -- Your custom implementation here
    --     return true -- Example: Always allow carrying items
    -- end,
    
    -- -- Add item to player inventory
    -- -- Arguments: source (number), item (string), amount (number), metadata (table, optional)
    -- -- Returns: nothing
    -- AddItem = function(source, item, amount, metadata)
    --     print(string.format("Custom: Adding %d x %s to player %d", amount, item, source))
    --     if metadata then
    --         print("Metadata:", json.encode(metadata))
    --     end
    --     -- Your custom implementation here
    -- end,
    
    -- -- Remove item from player inventory
    -- -- Arguments: source (number), item (string), amount (number), metadata (table, optional)
    -- -- Returns: nothing
    -- RemoveItem = function(source, item, amount, metadata)
    --     print(string.format("Custom: Removing %d x %s from player %d", amount, item, source))
    --     if metadata then
    --         print("Metadata:", json.encode(metadata))
    --     end
    --     -- Your custom implementation here
    -- end,
    
    -- -- Get item count in player inventory
    -- -- Arguments: source (number), item (string)
    -- -- Returns: number (item count)
    -- GetItemCount = function(source, item)
    --     print(string.format("Custom: Getting count of %s for player %d", item, source))
    --     -- Your custom implementation here
    --     return 5 -- Example: Always return 5
    -- end,
    
    -- -- Get specific item from player inventory
    -- -- Arguments: source (number), item (string), metadata (table, optional)
    -- -- Returns: table (item data) or nil
    -- GetItem = function(source, item, metadata)
    --     print(string.format("Custom: Getting item %s for player %d", item, source))
    --     -- Your custom implementation here
    --     return {
    --         name = item,
    --         label = "Custom Item",
    --         amount = 1,
    --         info = metadata or {},
    --         weight = 1.0
    --     }
    -- end,
    
    -- -- Get all items in player inventory
    -- -- Arguments: source (number)
    -- -- Returns: table (array of item data)
    -- GetInventory = function(source)
    --     print(string.format("Custom: Getting inventory for player %d", source))
    --     -- Your custom implementation here
    --     return {
    --         {
    --             weight = 1.0,
    --             item = "bread",
    --             label = "Bread",
    --             count = 3
    --         },
    --         {
    --             weight = 0.5,
    --             item = "water",
    --             label = "Water Bottle",
    --             count = 2
    --         }
    --     }
    -- end,
    
    -- -- Get all available items in the game
    -- -- Arguments: none
    -- -- Returns: table (all items with their data)
    -- GetAllItems = function()
    --     print("Custom: Getting all items")
    --     -- Your custom implementation here
    --     return {
    --         bread = {
    --             item = "bread",
    --             label = "Fresh Bread"
    --         },
    --         water = {
    --             item = "water",
    --             label = "Clean Water"
    --         }
    --     }
    -- end,
    
    -- -- Item Metadata Functions
    
    -- -- Get item metadata
    -- -- Arguments: source (number), item (string)
    -- -- Returns: table (metadata) or nil
    -- GetItemMetadata = function(source, item)
    --     print(string.format("Custom: Getting metadata for item %s from player %d", item, source))
    --     -- Your custom implementation here
    --     return {
    --         durability = 100,
    --         custom_data = "example"
    --     }
    -- end,
    
    -- -- Set item metadata
    -- -- Arguments: source (number), id (string), metadata (table), amount (number)
    -- -- Returns: nothing
    -- SetItemMetadata = function(source, id, metadata, amount)
    --     print(string.format("Custom: Setting metadata for item %s for player %d", id, source))
    --     print("New metadata:", json.encode(metadata))
    --     -- Your custom implementation here
    -- end,
    
    -- -- Register usable item
    -- -- Arguments: item (string), trigger (function)
    -- -- Returns: nothing
    -- RegisterUsable = function(item, trigger)
    --     print(string.format("Custom: Registering usable item %s", item))
    --     -- Your custom implementation here
    --     -- Example: Add custom use restrictions or effects
    -- end,
    
    -- -- Weapon Functions
    
    -- -- Add weapon to player
    -- -- Arguments: source (number), weapon (string), amount (number)
    -- -- Returns: nothing
    -- AddWeapon = function(source, weapon, amount)
    --     print(string.format("Custom: Adding %d x %s weapon to player %d", amount, weapon, source))
    --     -- Your custom implementation here
    -- end,
    
    -- -- Check if player can carry weapons
    -- -- Arguments: source (number), item (string), amount (number)
    -- -- Returns: boolean (true if can carry, false if cannot)
    -- CanCarryWeapons = function(source, item, amount)
    --     print(string.format("Custom: Checking if player %d can carry %d x %s weapon", source, amount, item))
    --     -- Your custom implementation here
    --     return true -- Example: Always allow carrying weapons
    -- end,
    
    -- -- Custom Inventory Functions
    
    -- -- Get custom inventory contents
    -- -- Arguments: id (string)
    -- -- Returns: table (inventory contents)
    -- GetCustomInventory = function(id)
    --     print(string.format("Custom: Getting custom inventory %s", id))
    --     -- Your custom implementation here
    --     return {
    --         {
    --             name = "example_item",
    --             amount = 1,
    --             info = {},
    --             label = "Example Item",
    --             weight = 1.0
    --         }
    --     }
    -- end,
    
    -- -- Register a custom inventory
    -- -- Arguments: data (table with id, name, limit)
    -- -- Returns: nothing
    -- RegisterInventory = function(data)
    --     print(string.format("Custom: Registering inventory %s with limit %d", data.id, data.limit))
    --     -- Your custom implementation here
    -- end,
    
    -- -- Update inventory limit
    -- -- Arguments: id (string), limit (number)
    -- -- Returns: nothing
    -- UpdateInventoryLimit = function(id, limit)
    --     print(string.format("Custom: Updating inventory %s limit to %d", id, limit))
    --     -- Your custom implementation here
    -- end,
    
    -- -- Open inventory for player
    -- -- Arguments: source (number), id (string)
    -- -- Returns: nothing
    -- OpenInventory = function(source, id)
    --     print(string.format("Custom: Opening inventory %s for player %d", id, source))
    --     -- Your custom implementation here
    -- end,
    
    -- -- Close inventory for player
    -- -- Arguments: source (number), inventory (string)
    -- -- Returns: nothing
    -- CloseInventory = function(source, inventory)
    --     print(string.format("Custom: Closing inventory %s for player %d", inventory, source))
    --     -- Your custom implementation here
    -- end,
    
    -- -- Check if inventory is registered
    -- -- Arguments: id (string)
    -- -- Returns: boolean (true if registered, false if not)
    -- IsInventoryRegistered = function(id)
    --     print(string.format("Custom: Checking if inventory %s is registered", id))
    --     -- Your custom implementation here
    --     return true -- Example: Always return true
    -- end,
    
    -- -- Unregister inventory
    -- -- Arguments: id (string)
    -- -- Returns: nothing
    -- UnregisterInventory = function(id)
    --     print(string.format("Custom: Unregistering inventory %s", id))
    --     -- Your custom implementation here
    -- end,
    
    -- -- Utility Functions
    
    -- -- Get item image path
    -- -- Arguments: none
    -- -- Returns: string (path to item images)
    -- GetItemImagePath = function()
    --     print("Custom: Getting item image path")
    --     -- Your custom implementation here
    --     return "nui://custom_inventory/html/images" -- Example: Custom path
    -- end,
    
    -- -- Get player identifier
    -- -- Arguments: source (number)
    -- -- Returns: string (player identifier) or nil
    -- GetIdentifier = function(source)
    --     print(string.format("Custom: Getting identifier for player %d", source))
    --     -- Your custom implementation here
    --     return "steam:custom_identifier_" .. source -- Example: Custom identifier format
    -- end,
    
    -- -- Get user group/permissions
    -- -- Arguments: source (number)
    -- -- Returns: string (group name) or nil
    -- GetUserGroup = function(source)
    --     print(string.format("Custom: Getting user group for player %d", source))
    --     -- Your custom implementation here
    --     return "admin" -- Example: Always return "admin"
    -- end,
    
    -- -- Get character IDs for an identifier
    -- -- Arguments: identifier (string)
    -- -- Returns: table (array of character IDs)
    -- GetCharacterIds = function(identifier)
    --     print(string.format("Custom: Getting character IDs for identifier %s", identifier))
    --     -- Your custom implementation here
    --     return {"char1", "char2", "char3"} -- Example: Return sample character IDs
    -- end,
    
    -- -- Get player clothes/appearance
    -- -- Arguments: source (number)
    -- -- Returns: table (clothes data)
    -- GetClothes = function(source)
    --     print(string.format("Custom: Getting clothes for player %d", source))
    --     -- Your custom implementation here
    --     return {
    --         hat = {hash = 12345, tint = 0},
    --         shirt = {hash = 54321, tint = 1},
    --         pants = {hash = 98765, tint = 2}
    --     } -- Example: Return sample clothes data
    -- end,

--     GetGold = function (source)
--         return 0
--     end,
--     GiveGold = function (source, amount)
--         return
--     end,

--     RemoveGold = function (source, amount)
--         return
--     end,
}
```


---

# 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, and the optional `goal` query parameter:

```
GET https://poseidon-2.gitbook.io/poseidon-docs/dependencies/pos-core/config-examples/overrides.lua.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
