# xakra\_sellnpc

## Requirements

* [vorp\_core](https://github.com/VORPCORE/vorp-core-lua)
* [vorp\_inventory](https://github.com/VORPCORE/vorp_inventory-v2)

***

## Installation

1. Copy the script into a folder (to choose) from the 'resources' folder.
2. Add 'ensure xakra\_sellnpc' in the 'Resources.cfg' document
3. Configure the 'config.lua' to adapt the script to your server.

***

## Config & Framework

<details open>

<summary>config</summary>

config.lua

{% code expandable="true" %}

```lua
Config = {}

Config.Language = 'en'	-- 'es'/'en'/...

Config.KeySell = 0x5415BE48	-- G | Key or false (disable prompt when aiming)

Config.OnDuty = false	-- use function 'OnDuty' in 'framework/server.lua'

Config.ExecuteCommand = 'alertpolice'	-- text command (Automatic command that will be executed to notify) or false
Config.Notify = 'Several civilians have seen a subject selling illegal things'	-- Text used in Notify and NotifyJobs notifications in framework/server.lua
Config.NotifySell = 'all'	-- ['sell'] = Notify only when selling / ['notsell'] =  Notify only when the npc does not want to sell / ['all'] = Notify both
Config.NotifyBlip = { 
	enable = true,	-- true (Enable blip on notify) or false (Disable blip on notify)
	sprite = 'blip_mg_five_finger_fillet', -- BLIPS: https://github.com/femga/rdr3_discoveries/tree/master/useful_info_from_rpfs/textures/blips
	radius = 100.0, -- number (Blip radius size)
	time = 600, -- seconds (Witness blip time)
	color = 'BLIP_MODIFIER_MP_COLOR_8'	-- BLIP COLORS: https://github.com/femga/rdr3_discoveries/tree/master/useful_info_from_rpfs/blip_modifiers
}

Config.NPCsBlacklist = {	-- List of peds models that do not appear in the sell prompt
	'S_M_M_AmbientSDPolice_01',
	-- 'example',
}

Config.SellItems = {	-- Sell items anywhere (without location)
	name = 'General',	-- id for item limits and name that will appear in the webhook
	Fight =  50,	--  number (probability = X/100) or false
	-- JobsToSell = {	-- List of jobs that can be sell to npcs or false
	-- 	'seller',
	-- 	-- 'example',
	-- },
	HoursToSell = {
		Enable = false,	-- true (enable) or false (disable) horary to sell to npcs
		Start = 8,	-- Time to start selling
		End = 20,	-- Time the sale ends and the prompt will not appear
	},
	JobsRequired = {
		Amount = 0,	-- Number of workers required
		Jobs = {	-- Name of required jobs
			-- 'police',
			'sheriff',
		},
	},
	items = {
		{
			item = 'water', 	-- Name of the item to sell
			label = 'Water',	-- Label of the item to sell
			probability = false,	-- Probability of selling the item (X/100) or false (can always be sold)
			notify = false,	-- Probability to notify police of sale (number X/100) and police required or to disable set to false
			quantity = { 1, 2 },	-- number or { min_x, max_x } (Quantity of items to sell)
			limit = { Global = false, Player = false },	-- number (Number of times the item can be sold at this location) or false
			Objects = {
				Player = { Model = 'p_moneybag01x', Offset = vector3(0.03, -0.03, -0.09), Rotation = vector3(60.0, 56.0, 161.0) },
				NPC = { Model = 's_inv_moneyclip01x', Offset = vector3(0.1, 0.05, -0.06), Rotation = vector3(247.0, 102.0, 13.0) },
			},
			-- JobsToSell = {	-- List of jobs that can be sell to npcs or false
			-- 	'seller',
			-- 	-- 'example',
			-- },
			-- JobsRequired = {
			-- 	Amount = 2,	-- Number of workers required
			-- 	Jobs = {	-- Name of required jobs
			-- 		-- 'police',
			-- 		'sheriff',
			-- 	},
			-- },

			exchange = {	-- List of items or currency you will receive for the sale
				{	-- ITEM
					label = 'Soft wood',	-- Notification item label
					item = 'wood',	-- Item name
					receive = 1,	-- number or { min_x, max_x } (Number of items you will receive)
				},
				{	-- CURRENCY
					label = '$',	-- Notification item label
					currency = 0,	-- 0 = money, 1 = gold, 2 = rol
					receive = 1,	-- number or { min_x, max_x } (Amount of money that the player will receive)
				},
			},
		},
		{
			item = 'meat', 	-- Name of the item to sell
			label = 'Meat',	-- Label of the item to sell
			probability = 80,	-- Probability of selling the item (X/100) or false (can always be sold)
			notify = 75,	-- Probability to notify police of sale (number X/100) and police required or to disable set to false
			quantity = 1,	-- number or { min_x, max_x } (Quantity of items to sell)
			limit = { Global = false, Player = false },	-- number (Number of times the item can be sold at this location) or false
			Objects = {
				Player = { Model = 'p_moneybag01x', Offset = vector3(0.03, -0.03, -0.09), Rotation = vector3(60.0, 56.0, 161.0) },
				NPC = { Model = 's_inv_moneyclip01x', Offset = vector3(0.1, 0.05, -0.06), Rotation = vector3(247.0, 102.0, 13.0) },
			},
			-- JobsToSell = {	-- List of jobs that can be sell to npcs or false
			-- 	'seller',
			-- 	-- 'example',
			-- },
			-- JobsRequired = {
			-- 	Amount = 2,	-- Number of workers required
			-- 	Jobs = {	-- Name of required jobs
			-- 		-- 'police',
			-- 		'sheriff',
			-- 	},
			-- },
			
			exchange = {	-- List of items or currency you will receive for the sale
				{	-- CURRENCY
					label = '$',	-- Notification item label
					currency = 0,	-- 0 = money, 1 = gold, 2 = rol
					receive = { 0.5, 0.75 },	-- number or { min_x, max_x } (Amount of money that the player will receive)
				},
			},
		},
	
		{
			item = 'iron', 	-- Name of the item to sell
			label = 'Iron',	-- Label of the item to sell
			probability = 80,	-- Probability of selling the item (X/100) or false (can always be sold)
			notify = 75,	-- Probability to notify police of sale (number X/100) and police required or to disable set to false
			quantity = 1,	-- number or { min_x, max_x } (Quantity of items to sell)
			limit = { Global = false, Player = false },	-- number (Number of times the item can be sold at this location) or false
			Objects = {
				Player = { Model = 'p_moneybag01x', Offset = vector3(0.03, -0.03, -0.09), Rotation = vector3(60.0, 56.0, 161.0) },
				NPC = { Model = 's_inv_moneyclip01x', Offset = vector3(0.1, 0.05, -0.06), Rotation = vector3(247.0, 102.0, 13.0) },
			},
			-- JobsToSell = {	-- List of jobs that can be sell to npcs or false
			-- 	'seller',
			-- 	-- 'example',
			-- },
			-- JobsRequired = {
			-- 	Amount = 2,	-- Number of workers required
			-- 	Jobs = {	-- Name of required jobs
			-- 		-- 'police',
			-- 		'sheriff',
			-- 	},
			-- },
			
			exchange = {	-- List of items or currency you will receive for the sale
				{	-- CURRENCY
					label = '$',	-- Notification item label
					currency = 0,	-- 0 = money, 1 = gold, 2 = rol
					receive = 5,	-- number or { min_x, max_x } (Amount of money that the player will receive)
				},
				{	-- ITEM
					label = 'Soft wood',	-- Notification item label
					item = 'wood',	-- Item name
					receive = { 1, 2 },	-- number or { min_x, max_x } (Number of items you will receive)
				},
			},
		},
	},
}

Config.LocationsSellItems = {
	{
		name = 'Valentine',	-- id for item limits and name that will appear in the webhook
		location = { coords = vector3(-275.51, 716.64, 113.65), radius = 300.0 },
		Fight =  50,	--  number (probability = X/100) or false
		JobsToSell = {	-- List of jobs that can be sell to npcs or false
			'seller',
			-- 'example',
		},
		HoursToSell = {
			Enable = true,	-- true (enable) or false (disable) horary to sell to npcs
			Start = 8,	-- Time to start selling
			End = 20,	-- Time the sale ends and the prompt will not appear
		},		
		JobsRequired = {
			Amount = 2,	-- Number of workers required
			Jobs = {	-- Name of required jobs
				-- 'police',
				'sheriff',
			},
		},
		items = {
			{
				item = 'wood', 	-- Name of the item to sell
				label = 'Soft wood',	-- Label of the item to sell
				probability = false,	-- Probability of selling the item (X/100) or false (can always be sold)
				notify = false,	-- Probability to notify police of sale (number X/100) and police required or to disable set to false
				quantity = 1,	-- number or { min_x, max_x } (Quantity of items to sell)
				limit = { Global = false, Player = false },	-- number (Number of times the item can be sold at this location) or false
				Objects = {
					Player = { Model = 'p_moneybag01x', Offset = vector3(0.03, -0.03, -0.09), Rotation = vector3(60.0, 56.0, 161.0) },
					NPC = { Model = 's_inv_moneyclip01x', Offset = vector3(0.1, 0.05, -0.06), Rotation = vector3(247.0, 102.0, 13.0) },
				},
				-- JobsToSell = {	-- List of jobs that can be sell to npcs or false
				-- 	'seller',
				-- 	-- 'example',
				-- },
				-- JobsRequired = {
				-- 	Amount = 2,	-- Number of workers required
				-- 	Jobs = {	-- Name of required jobs
				-- 		-- 'police',
				-- 		'sheriff',
				-- 	},
				-- },
				
				exchange = {	-- List of items or currency you will receive for the sale
					{	-- CURRENCY
						label = '$',	-- Notification item label
						currency = 0,	-- 0 = money, 1 = gold, 2 = rol
						receive = 2,	-- number or { min_x, max_x } (Amount of money that the player will receive)
					},
				},
			},
			{
				item = 'hwood', 	-- Name of the item to sell
				label = 'Hard wood',	-- Label of the item to sell
				probability = 50,	-- Probability of selling the item (X/100) or false (can always be sold)
				notify = false,	-- Probability to notify police of sale (number X/100) and police required or to disable set to false
				quantity = 1,	-- number or { min_x, max_x } (Quantity of items to sell)
				limit = { Global = false, Player = false },	-- number (Number of times the item can be sold at this location) or false
				Objects = {
					Player = { Model = 'p_moneybag01x', Offset = vector3(0.03, -0.03, -0.09), Rotation = vector3(60.0, 56.0, 161.0) },
					NPC = { Model = 's_inv_moneyclip01x', Offset = vector3(0.1, 0.05, -0.06), Rotation = vector3(247.0, 102.0, 13.0) },
				},
				-- JobsToSell = {	-- List of jobs that can be sell to npcs or false
				-- 	'seller',
				-- 	-- 'example',
				-- },
				-- JobsRequired = {
				-- 	Amount = 2,	-- Number of workers required
				-- 	Jobs = {	-- Name of required jobs
				-- 		-- 'police',
				-- 		'sheriff',
				-- 	},
				-- },
				
				exchange = {	-- List of items or currency you will receive for the sale
					{	-- CURRENCY
						label = '$',	-- Notification item label
						currency = 0,	-- 0 = money, 1 = gold, 2 = rol
						receive = 1,	-- number or { min_x, max_x } (Amount of money that the player will receive)
					},
				},
			},
		},
	},
	{
		name = 'Rhodes',	-- id for item limits and name that will appear in the webhook
		location = { coords = vector3(1327.77, -1236.19, 77.8), radius = 300.0 },
		Fight =  50,	--  number (probability = X/100) or false
		-- JobsToSell = {	-- List of jobs that can be sell to npcs or false
		-- 	'seller',
		-- 	-- 'example',
		-- },
		-- HoursToSell = {
		-- 	Enable = true,	-- true (enable) or false (disable) horary to sell to npcs
		-- 	Start = 8,	-- Time to start selling
		-- 	End = 20,	-- Time the sale ends and the prompt will not appear
		-- },		
		-- JobsRequired = {
		-- 	Amount = 2,	-- Number of workers required
		-- 	Jobs = {	-- Name of required jobs
		-- 		-- 'police',
		-- 		'sheriff',
		-- 	},
		-- },
		items = {
			{
				item = 'beer', 	-- Name of the item to sell
				label = 'Beer',	-- Label of the item to sell
				probability = 90,	-- Probability of selling the item (X/100) or false (can always be sold)
				notify = false,	-- Probability to notify police of sale (number X/100) and police required or to disable set to false
				quantity = 1,	-- number or { min_x, max_x } (Quantity of items to sell)
				limit = { Global = false, Player = false },	-- number (Number of times the item can be sold at this location) or false
				Objects = {
					Player = { Model = 'p_moneybag01x', Offset = vector3(0.03, -0.03, -0.09), Rotation = vector3(60.0, 56.0, 161.0) },
					NPC = { Model = 's_inv_moneyclip01x', Offset = vector3(0.1, 0.05, -0.06), Rotation = vector3(247.0, 102.0, 13.0) },
				},
				-- JobsToSell = {	-- List of jobs that can be sell to npcs or false
				-- 	'seller',
				-- 	-- 'example',
				-- },
				-- JobsRequired = {
				-- 	Amount = 2,	-- Number of workers required
				-- 	Jobs = {	-- Name of required jobs
				-- 		-- 'police',
				-- 		'sheriff',
				-- 	},
				-- },
				
				exchange = {	-- List of items or currency you will receive for the sale
					{	-- CURRENCY
						label = '$',	-- Notification item label
						currency = 0,	-- 0 = money, 1 = gold, 2 = rol
						receive = 1.50,	-- number or { min_x, max_x } (Amount of money that the player will receive)
					},
				},
			},
			{
				item = 'whisky', 	-- Name of the item to sell
				label = 'Whisky',	-- Label of the item to sell
				probability = 40,	-- Probability of selling the item (X/100) or false (can always be sold)
				notify = false,	-- Probability to notify police of sale (number X/100) and police required or to disable set to false
				quantity = 1,	-- number or { min_x, max_x } (Quantity of items to sell)
				limit = { Global = false, Player = false },	-- number (Number of times the item can be sold at this location) or false
				Objects = {
					Player = { Model = 'p_moneybag01x', Offset = vector3(0.03, -0.03, -0.09), Rotation = vector3(60.0, 56.0, 161.0) },
					NPC = { Model = 's_inv_moneyclip01x', Offset = vector3(0.1, 0.05, -0.06), Rotation = vector3(247.0, 102.0, 13.0) },
				},
				-- JobsToSell = {	-- List of jobs that can be sell to npcs or false
				-- 	'seller',
				-- 	-- 'example',
				-- },
				-- JobsRequired = {
				-- 	Amount = 2,	-- Number of workers required
				-- 	Jobs = {	-- Name of required jobs
				-- 		-- 'police',
				-- 		'sheriff',
				-- 	},
				-- },
				
				exchange = {	-- List of items or currency you will receive for the sale
					{	-- CURRENCY
						label = '$',	-- Notification item label
						currency = 0,	-- 0 = money, 1 = gold, 2 = rol
						receive = 1,	-- number or { min_x, max_x } (Amount of money that the player will receive)
					},
				},
			},
		},
	},
}
```

{% endcode %}

crafts.lua

{% code expandable="true" %}

```lua
Webhooks = {
    Sell = '',
    NotSell = '',
    NotHaveItem = '',
}
```

{% endcode %}

stores.lua

{% code expandable="true" %}

```lua
BoatsStores = {
    { 
		label = 'Canoe',	-- Name of the boat that will appear in the menu
		model = 'canoe',	-- Boat model for spawn
		money = 100,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
    {
		label = 'Log Canoe',	-- Name of the boat that will appear in the menu
		model = 'canoeTreeTrunk',	-- Boat model for spawn
		money = 125,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
    {
		label = 'Pirogue 1',	-- Name of the boat that will appear in the menu
		model = 'pirogue2',	-- Boat model for spawn
		money = 150,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
    { 
		label = 'Pirogue 2',	-- Name of the boat that will appear in the menu
		model = 'pirogue',	-- Boat model for spawn
		money = 150,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
    { 
		label = 'Rowboat',	-- Name of the boat that will appear in the menu
		model = 'rowboat',	-- Boat model for spawn
		money = 200,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
    { 
		label = 'Rowboat 2',	-- Name of the boat that will appear in the menu
		model = 'rowboatSwamp02',	-- Boat model for spawn
		money = 200,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
    { 
		label = 'Rowboat 3',	-- Name of the boat that will appear in the menu
		model = 'rowboatSwamp',	-- Boat model for spawn
		money = 200,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
	{ 
		label = 'Mini Submarine',	-- Name of the boat that will appear in the menu
		model = 'rcBoat',	-- Boat model for spawn
		money = 200,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
    { 
		label = 'Skiff',	-- Name of the boat that will appear in the menu
		model = 'skiff',	-- Boat model for spawn
		money = 215,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
	{ 
		label = 'Steam Boat',	-- Name of the boat that will appear in the menu
		model = 'boatsteam02x',	-- Boat model for spawn
		money = 300,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = 2,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
    { 
		label = 'Large Steam Boat',	-- Name of the boat that will appear in the menu
		model = 'keelboat',	-- Boat model for spawn
		money = 330,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = 2,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
	{ 
		label = 'Turbine Boat',	-- Name of the boat that will appear in the menu
		model = 'turbineboat',	-- Boat model for spawn
		money = 900,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = 5,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
	{
		label = 'Guarma Boat 1',	-- Name of the boat that will appear in the menu
		model = 'ship_nbdGuama',	-- Boat model for spawn
		money = 900,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
	{
		label = 'Guarma Boat 2',	-- Name of the boat that will appear in the menu
		model = 'ship_nbdGuama2',	-- Boat model for spawn
		money = 900,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = 5,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
	{ 
		label = 'Tugboat',	-- Name of the boat that will appear in the menu
		model = 'tugboat2',	-- Boat model for spawn
		money = 900,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = 5,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
	{ 
		label = 'Horse Boat',	-- Name of the boat that will appear in the menu
		model = 'horseBoat',	-- Boat model for spawn
		money = 900,	-- number (Money to buy the boat) or false (disable buying with money)
		gold = 5,	-- number (Gold to buy the boat) or false (disable buying with gold)
		rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	},
	-- {	-- SKIN BUG
		-- label = 'Naval Boat',	-- Name of the boat that will appear in the menu
		-- model = 'smuggler02',	-- Boat model for spawn
		-- money = 900,	-- number (Money to buy the boat) or false (disable buying with money)
		-- gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		-- rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		-- locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	-- }, 
	-- {	-- DRIVE BUG
		-- label = 'Guarma Boat',	-- Name of the boat that will appear in the menu
		-- model = 'ship_guama02',	-- Boat model for spawn
		-- money = 900,	-- number (Money to buy the boat) or false (disable buying with money)
		-- gold = false,	-- number (Gold to buy the boat) or false (disable buying with gold)
		-- rol = false,	-- number (Rol to buy the boat) or false (disable buying with rol)
		-- locations = { 'all' },	-- Name of the locations or 'all'
		-- jobs = {	-- Job list, remove or set to false for all players to access
			-- 'example1',
			-- 'example2',
		-- },
		-- Comps = 'Text copied from the mods column of the boates table',    -- List of customizations
	-- },
}
```

{% endcode %}

</details>

<details open>

<summary>framework</summary>

server.lua

{% code expandable="true" %}

```lua
local VORPcore = exports.vorp_core:GetCore()

local VORPInv = exports.vorp_inventory:vorp_inventoryApi()

function NotifyTip(source, text, time)
    VORPcore.NotifyTip(source, text, time)
end

function NotifyObjective(source, text, time)
    VORPcore.NotifyObjective(source, text, time)
end

function NotifyAvanced(source, title, dict, icon, color, time)
    VORPcore.NotifyAvanced(source, title, dict, icon, color, time)
end

function GetCharacter(source)
    -- .charIdentifier
    -- .job
    return VORPcore.getUser(source).getUsedCharacter
end

function GetCharacterJob(source)
    return Player(source).state.Character and Player(source).state.Character.Job 
end

function getItemCount(source, item, metadata)
    return VORPInv.getItemCount(source, item, metadata)
end

function subItem(source, item, amount)
    VORPInv.subItem(source, item, amount)
end

function addItem(source, item, amount, metadata)
    VORPInv.addItem(source, item, amount, metadata)
end

function addCurrency(source, currency, amount)
    local Character = GetCharacter(source)
    Character.addCurrency(currency, amount)
end

function AddWebhook(title, webhook, description, color, name, logo, footerlogo, avatar)
    VORPcore.AddWebhook(title, webhook, description, color, name, logo, footerlogo, avatar)
end

function Notify(LocationName) -- Notification that will only be executed 1 time
    -- TriggerEvent('ExampleNotify')
end

function NotifyJobs(source, LocationName) -- Individual notification to players who have the required job
    TriggerClientEvent('chatMessage', source, LocationName, {255, 0, 0}, Config.Notify)
    NotifyObjective(source, Config.Notify, 10000)
    -- TriggerClientEvent('ExampleNotify', source)
end

function OnDuty(job)
    local players = exports["syn_society"]:GetPlayersOnDuty(job)
    return #players    -- number
end

function CheckToSell(source, SellItem)    -- Check before selling
    -- SellItem = List of items in the 'config.lua' file

    -- ### VORP SKILLS ###
        -- local Character = GetCharacter(source)

        -- if Character.skills and Character.skills.SellerNPC and SellItem.LvlRequired then
        --     if Character.skills.SellerNPC.Level < SellItem.LvlRequired then
        --         return false
        --     end
        -- end
    -- ##################

    return true
end

function ReceiveAmount(source, amount, type, SellItem)    -- Modifies the amount the player receives when selling (For example using experience system)
    -- amount = Amount of money or items
    -- type = Type of receive ('money', 'item')
    -- SellItem = List of items in the 'config.lua' file

    -- ### VORP SKILLS ###
        -- local Character = GetCharacter(source)

        -- if Character.skills and Character.skills.SellerNPC then
        --     if type == 'money' then
        --         local SkillsLevel = { -- Percentage increase 
        --             [1] = 0.02,
        --             [2] = 0.05,
        --             [3] = 0.08,
        --             [4] = 0.14,
        --             [5] = 0.20,
        --         }

        --         amount = amount * (amount * SkillsLevel[Character.skills.SellerNPC.Level])

        --     elseif type == 'item' then
        --         local SkillsLevel = { -- Percentage increase 
        --             [1] = 2,
        --             [2] = 3,
        --             [3] = 4,
        --             [4] = 5,
        --             [5] = 5,
        --         }

        --         amount = amount * SkillsLevel[Character.skills.SellerNPC.Level]
        --     end
        -- end
    -- ##################

    return amount
end

function EndToSell(source, SellItem)    -- After finishing selling
    -- SellItem = List of items in the 'config.lua' file

    -- ### VORP SKILLS ###
        -- local Character = GetCharacter(source)

        -- if Character.skills and SellItem.LvlRequired then
        --     if not Character.skills.SellerNPC or Character.skills.SellerNPC.Level < Character.skills.SellerNPC.MaxLevel then
        --         Character.setSkills('SellerNPC', data.xp)
        --     end
        -- end
    -- ##################

    return true
end
```

{% endcode %}

</details>


---

# Agent Instructions: 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://xakra-scripts.gitbook.io/xakra-scripts-docs/redm-docs/xakra_sellnpc.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.
