Retrieves a table containing the player's blueprints.
-- Example Usage:
local blueprints = exports[ 'nextgenfivem_crafting' ]: getPlayerBlueprints (src)
Grants a blueprint to a player. Returns a boolean indicating success.
-- Example Usage:
local success = exports[ 'nextgenfivem_crafting' ]: givePlayerBlueprint (src, 'pistol' )
Prop Type Default number
- string
-
Removes a blueprint from a player. Returns a boolean indicating success.
-- Example Usage:
local success = exports[ 'nextgenfivem_crafting' ]: removePlayerBlueprint (src, 'pistol' )
Prop Type Default number
- string
-
Retrieves the player's current crafting level.
-- Example Usage:
local level = exports[ 'nextgenfivem_crafting' ]: getPlayerLevel (src)
Sets the player's global crafting level. Returns a boolean indicating success.
-- Example Usage:
local success = exports[ 'nextgenfivem_crafting' ]: setPlayerLevel (src, 10 )
Prop Type Default number
- number
-
Sets the player's level for a specific crafting category. Returns a boolean indicating success.
-- Example Usage:
local success = exports[ 'nextgenfivem_crafting' ]: setPlayerCategoryLevel (src, 'weapons' , 5 )
Prop Type Default number
- string
- number
-
Gives a player a portable crafting bench item. Returns a boolean indicating success.
-- Example Usage:
local success = exports[ 'nextgenfivem_crafting' ]: givePortableItem (src, 'police' )
Prop Type Default number
- string
-
Assigns an entity as a crafting bench. Returns a result table.
-- 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' )
Prop Type Default number
- string
-
Removes an entity from being a crafting bench. Returns a result table.
-- 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 result table with a remove function.
-- 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
)
Prop Type Default vector4
- string
- number
-
Retrieves a table containing the models for all crafting benches.
-- Returns:
[ key : string] = {
title : string,
model : string,
centerOffset : vector4,
scale : number
}
-- Example Usage:
local models = exports[ 'nextgenfivem_crafting' ]: getBenchModels ()
Retrieves a paginated list of bench locations.
-- 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
})
Retrieves a single bench location by ID.
-- Returns:
result = {
success : boolean,
benchLocation : table -- The bench location object
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: getBenchLocation ( 'bench-uuid' )
Creates a new bench location.
-- Returns:
result = {
success : boolean,
uuid : string -- The UUID of the created bench location
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: createBenchLocation ({
benchType = 'bench-type-uuid' ,
location = { x = 0.0 , y = 0.0 , z = 0.0 , w = 0.0 },
isPortable = false ,
createdBy = 'identifier'
})
Updates an existing bench location.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: updateBenchLocation ({
uuid = 'bench-uuid' ,
benchType = 'bench-type-uuid' ,
location = { x = 0.0 , y = 0.0 , z = 0.0 , w = 0.0 },
isPortable = false
})
Deletes a bench location by ID.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: deleteBenchLocation ( 'bench-uuid' )
Retrieves a paginated list of bench types.
-- 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 = {},
orderColumn = 'name' ,
orderDirection = 'ASC' ,
count = 10 ,
offset = 0
})
Retrieves a single bench type by ID.
-- Returns:
result = {
success : boolean,
benchType : table -- The bench type object
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: getBenchType ( 'bench-type-uuid' )
Retrieves all locations for a specific bench type.
-- Returns:
result = {
success : boolean,
locations : table -- Array of bench location objects
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: getBenchTypeLocations ( 'bench-type-uuid' )
Retrieves available access identifiers from the framework.
-- Returns:
result = {
success : boolean,
identifiers : table -- Array of access identifiers
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: getAccessIdentifiers ()
Creates a new bench type.
-- Returns:
result = {
success : boolean,
uuid : string -- The UUID of the created bench type
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: createBenchType ({
name = 'police' ,
model = 'default' ,
fullAccess = false ,
createdBy = 'identifier' ,
access = {
{
identifier = 'police' ,
selectedRanks = { 'officer' , 'sergeant' }
}
},
categories = {
{
categoryId = 'category-uuid' ,
isDefaultDenied = false ,
recipes = { 'recipe-uuid-1' , 'recipe-uuid-2' }
}
}
})
Updates an existing bench type.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: updateBenchType ({
uuid = 'bench-type-uuid' ,
name = 'police' ,
model = 'default' ,
fullAccess = false ,
access = {
{
identifier = 'police' ,
selectedRanks = { 'officer' , 'sergeant' }
}
},
categories = {
{
categoryId = 'category-uuid' ,
isDefaultDenied = false ,
recipes = { 'recipe-uuid-1' , 'recipe-uuid-2' }
}
}
})
Deletes a bench type by ID.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: deleteBenchType ( 'bench-type-uuid' )
Retrieves the total count of blueprints, optionally filtered by search term.
-- Returns:
number -- Total count of blueprints
-- Example Usage:
local total = exports[ 'nextgenfivem_crafting' ]: getTotalBlueprints ( 'pistol' )
Retrieves a paginated list of blueprints.
-- 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 ,
search = 'pistol'
})
Retrieves a single blueprint by ID.
-- Returns:
result = {
success : boolean,
blueprint : table -- The blueprint object
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: getBlueprint ( 'blueprint-uuid' )
Creates a new blueprint.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: createBlueprint ({
label = 'Pistol Blueprint' ,
description = 'A blueprint for crafting pistols' ,
uses = 1
})
Updates an existing blueprint.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: updateBlueprint ({
uuid = 'blueprint-uuid' ,
label = 'Pistol Blueprint' ,
description = 'A blueprint for crafting pistols' ,
uses = 1
})
Deletes a blueprint by ID.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: deleteBlueprint ({
uuid = 'blueprint-uuid'
})
Retrieves all crafting categories.
-- Returns:
result = {
success : boolean,
categories : table -- Array of category objects
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: getCategories ()
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 ,
limit = 20
})
Creates a new crafting category.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: createCategory ({
title = 'Weapons' ,
description = 'Weapon crafting category' ,
icon = 'fa-gun' ,
image = 'weapons.png'
})
Updates an existing category.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: updateCategory ({
uuid = 'category-uuid' ,
title = 'Weapons' ,
description = 'Weapon crafting category' ,
icon = 'fa-gun' ,
image = 'weapons.png'
})
Deletes a category by ID.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: deleteCategory ({
uuid = 'category-uuid'
})
Retrieves all ingredients for a specific recipe.
-- Returns:
result = {
success : boolean,
ingredients : table -- Array of ingredient objects
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: fetchRecipeIngredients ( 'recipe-uuid' )
Retrieves all blueprints required for a specific recipe.
-- Returns:
result = {
success : boolean,
blueprints : table -- Array of blueprint objects
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: fetchRecipeBlueprints ( 'recipe-uuid' )
Retrieves a single recipe by ID.
-- Returns:
result = {
success : boolean,
recipe : table -- The recipe object
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: getRecipe ( 'recipe-uuid' )
Creates a new recipe.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: createRecipe ({
title = 'Pistol' ,
description = 'A standard pistol' ,
category = 'category-uuid' ,
requiredLevel = 5 ,
requiredCategoryLevel = 3 ,
craftingTime = 10 ,
xpReward = 25 ,
propModel = 'prop_pistol' ,
propRot = { x = 0.0 , y = 0.0 , z = 0.0 },
propOffset = { x = 0.0 , y = 0.0 , z = 0.0 },
cooldownLimit = 5 ,
cooldownWindow = 60 ,
ingredients = {
{ item = 'iron' , count = 5 },
{ item = 'steel' , count = 2 }
},
results = {
{ item = 'pistol' , count = 1 , metadata = {} }
},
blueprints = {
{ blueprintId = 'blueprint-uuid' }
}
})
Updates an existing recipe.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: updateRecipe ({
uuid = 'recipe-uuid' ,
title = 'Pistol' ,
description = 'A standard pistol' ,
requiredLevel = 5 ,
requiredCategoryLevel = 3 ,
craftingTime = 10 ,
xpReward = 25 ,
propModel = 'prop_pistol' ,
propRot = { x = 0.0 , y = 0.0 , z = 0.0 },
propOffset = { x = 0.0 , y = 0.0 , z = 0.0 },
cooldownLimit = 5 ,
cooldownWindow = 60 ,
ingredients = {
{ item = 'iron' , count = 5 },
{ item = 'steel' , count = 2 }
},
results = {
{ item = 'pistol' , count = 1 , metadata = {} }
},
blueprints = {
{ blueprintId = 'blueprint-uuid' }
}
})
Deletes a recipe by ID.
-- Returns:
result = {
success : boolean
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: deleteRecipe ({
uuid = 'recipe-uuid'
})
Updates the order of a recipe within a category or moves it to a different category.
-- Returns:
result = {
success : boolean,
message : string -- Optional error message
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: updateRecipeOrder ({
recipe = 'recipe-uuid' ,
fromCategory = 'category-uuid' ,
toCategory = 'category-uuid' ,
newIndex = 1
})
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 ,
search = 'pistol'
})
Retrieves a single item by name.
-- Returns:
result = {
success : boolean,
item : table -- The item object
}
-- Example Usage:
local result = exports[ 'nextgenfivem_crafting' ]: getItem ( 'pistol' )