669 B
669 B
Function: HasRecipeBook(player, recipe_id)
Description:
Return's true if the player has a recipe book that matches the recipe_id.
Parameters:
player
(Spawn) - Spawn object representingplayer
.recipe_id
(uint32) - Integer valuerecipe_id
.
Returns: True if the player has a recipe book with the recipe of recipe_id included. Otherwise false.
Example:
-- From SpawnScripts/Generic/GenericCraftingTrainer.lua
function HasBooks(Spawn)
local has_books = true
--check if the player has certain recipe books
if not HasRecipeBook(Spawn, artisan_ess_1) and not HasItem(Spawn, artisan_ess_1, 1) then
has_books = false
end