Assigns an entity as a crafting bench. Returns a boolean indicating success.
-- Returns:result = { success: boolean -- Indicates if the entity was successfully assigned as a bench message: string -- The result message}-- Example Usage:local result = exports['nextgenfivem_crafting']:setEntityAsBench(entity, 'police')
Removes an entity from being a crafting bench. Returns a boolean indicating success.
-- Returns:result = { success: boolean -- Indicates if the entity was successfully removed as a bench message: string -- The result message}-- Example Usage:local result = exports['nextgenfivem_crafting']:removeEntityAsBench(entity)
Assigns a coordinate as a crafting bench. Returns a boolean indicating success.
-- Returns:result = { success: boolean, id: string -- The bench ID remove: function -- Function to remove the bench}-- Example Usage:local result = exports['nextgenfivem_crafting']:setCoordAsBench( vector4(0.0, 0.0, 0.0, 0.0), 'police', 1 -- Optional routing bucket)
-- Returns:result = { success: boolean, rows: table, -- Array of bench location objects pageCount: number -- Total number of pages}-- Example Usage:local result = exports['nextgenfivem_crafting']:getBenchLocations({ columnFilters = {}, -- Optional: Table of column filters orderColumn = 'created_at', -- Required: Column to order by orderDirection = 'ASC', -- Required: Order direction (ASC or DESC) count = 10, -- Required: Number of items per page offset = 0 -- Required: Offset for pagination})
-- Returns:result = { success: boolean, rows: table, -- Array of bench type objects pageCount: number -- Total number of pages}-- Example Usage:local result = exports['nextgenfivem_crafting']:getBenchTypes({ columnFilters = {}, -- Optional: Table of column filters orderColumn = 'name', -- Required: Column to order by orderDirection = 'ASC', -- Required: Order direction (ASC or DESC) count = 10, -- Required: Number of items per page offset = 0 -- Required: Offset for pagination})
-- Returns:result = { success: boolean, benchType: table -- The bench type object}-- Example Usage:local result = exports['nextgenfivem_crafting']:getBenchType('bench-type-uuid')
-- Returns:result = { success: boolean, uuid: string -- The UUID of the created bench type}-- Example Usage:local result = exports['nextgenfivem_crafting']:createBenchType({ name = 'police', -- Required: Bench type name model = 'default', -- Required: Model name fullAccess = false, -- Required: Whether the bench has full access to all categories createdBy = 'identifier', -- Optional: Creator identifier access = { -- Optional: Array of access rules (only if fullAccess is false) { identifier = 'police', selectedRanks = { 'officer', 'sergeant' } -- Optional: Array of rank strings } }, categories = { -- Optional: Array of categories (only if fullAccess is false) { categoryId = 'category-uuid', isDefaultDenied = false, -- Whether to deny all recipes by default recipes = { 'recipe-uuid-1', 'recipe-uuid-2' } -- Array of recipe UUIDs } }})
-- Returns:result = { success: boolean, blueprints: table, -- Array of blueprint objects nextPage: number, -- Next page number or nil pageCount: number -- Total number of pages}-- Example Usage:local result = exports['nextgenfivem_crafting']:fetchBlueprints({ page = 1, -- Optional: page number search = 'pistol' -- Optional: search term})
Retrieves recipes for a specific category with pagination.
-- Returns:result = { success: boolean, recipes: table, -- Array of recipe objects hasMore: boolean, -- Whether there are more recipes nextPage: number, -- Next page number or nil totalRecipes: number, -- Total number of recipes currentPage: number -- Current page number}-- Example Usage:local result = exports['nextgenfivem_crafting']:getCategoryRecipes({ category = 'weapons', page = 1, -- Optional: page number (default: 1) limit = 20 -- Optional: items per page (default: 20, max: 100)})
Retrieves a paginated list of items from the inventory system.
-- Returns:result = { success: boolean, items: table, -- Array of item objects nextPage: number, -- Next page number or nil pageCount: number -- Total number of pages}-- Example Usage:local result = exports['nextgenfivem_crafting']:fetchItems({ page = 1, -- Optional: page number search = 'pistol' -- Optional: search term})