# xakra\_boats

## Requirements

* [oxmysq](https://github.com/VORPCORE/oxmysql)
* [vorp\_menu](https://github.com/VORPCORE/vorp_menu)
* [vorp\_core](https://github.com/VORPCORE/vorp-core-lua)
* [vorp\_inventory](https://github.com/VORPCORE/vorp_inventory-v2)
* [lockpick](https://github.com/XakraD/lockpick)

***

## Installation

1. Copy the script into a folder (to choose) from the 'resources' folder.
2. Add 'ensure xakra\_boats' in the 'Resources.cfg' document
3. Check the config.lua file and configure to adapt the script, change the language, add ports, the ship list and prices, etc...
4. The script automatically creates the necessary tables when it starts. If the table already exists, you can add the missing columns using the sql/boats.lsq file.

***

## Config & Framework

<details open>

<summary>config</summary>

config.lua

{% code expandable="true" %}

```lua
Config = {}

Config.defaultlang = 'es'

Config.Align = 'top-left' -- align to menu

Config.BuyWebhook = ''
Config.CraftWebhook = ''
Config.SellWebhook = ''
Config.GiveWebhook = ''
Config.CustomWebhook = ''
Config.RenameWebhook = ''
Config.InventoryWebhook = ''

-- KEYS: https://github.com/femga/rdr3_discoveries/tree/master/Controls
Config.KeyOpenMenu = 0x760A9C6F -- Key to open the menu
Config.KeyAnchor = 0x760A9C6F -- Key to anchor boat
Config.KeyPush = 0xF63A17F9 -- Key to push boat
Config.KeyDrive = 0x5966D52A -- Key to drive boat
Config.KeyInventory = 0xE2473BF0 -- Key to open inventory boat
Config.KeyAddCoal = 0x3B24C470 -- Key to add coal to the boat
Config.KeyTransport = 0x3B24C470	-- Key to transport the boat or false
Config.KeyIncreaseMaxSpeed = 0x911CB09E	-- UP ARROW
Config.KeyLowerMaxSpeed = 0x4403F97F	-- DOWN ARROW

Config.KeyMoreZoom = 0x3076E97C -- MOUSE SCROLL UP
Config.KeyLessZoom = 0x8BDE7443 -- MOUSE SCROLL DOWN

Config.DisableSeaLimit = true	-- true/false Enable or disable the sea limit to prevent boats from sinking

Config.PopulationBoats = false	-- true (Will spawn ships of npcs in the water) or false (Disable spawn of npcs ships in the water)

Config.ColorBlips = 'green'    -- Choose the color of the the blips and boats ['yellow', 'white', 'green', 'blue', 'red', 'purple', 'orange', 'pink', 'grey']

Config.DockBoats = {
	Enable = true,	-- Players will only be able to undock the ship at the port where it was last docked.
	Tax = 10,	-- true (Tax for teleporting the boat to the current port) or false
}	

Config.MaxBoats = {
    Enable = true,  -- Enable (true) or disable (false) limit
    Amount = 3, -- Maximum number of boats for players
    Jobs = {    -- List of jobs that will have different limits
        { Job = 'freighter', Amount = 5 },
        -- { Job = 'example', Amount = 10 },
    },
}

Config.SystemCoal = {
	Enable = true,	-- Enable or disable the coal system
	Align = { x = 0.7, y = 0.95 },	-- Total coal position (min 0.0/ max 1.0)
	DrawSpriteColor = { r = 0, g = 128, b = 0, alpha = 190 },    -- Minigame icon color
	DrawIcon = { textureDict = 'inventory_items_mp', textureName = 'provision_coal' },	-- Texture dict and name or false
	ConsumptionSpeed = 3,	-- number (Fuel consumption multiplier based on speed)
	Boats = {	-- List of maximum quantity of fuel for boats
		boatsteam02x = 100,
		keelboat = 240,
		turbineboat = 500,
		ship_nbdGuama = 500,
		ship_nbdGuama2 = 500,
		tugboat2 = 500,
		horseBoat = 500,
		-- smuggler02 = 500,
		-- ship_guama02 = 500,
	},
	Items = {	-- Items needed to add coal to ships and the amount of coal
		{ label = 'Carbón', name = 'coal', amount = 50 },
		-- { name = 'example', amount = 100 },
	},
}

Config.Ports = { -- ADD NEW PORT
	{
		name = 'Puerto de Annesburg', -- Name for blip
		blip = { enable = true, sprite = 1106719664}, -- enable/disable blip, and hash blip
		posSpawn = vector4(3038.82, 1364.50, 41.28, 161.33), -- Coords X,Y,Z and H for spawn boat
		OpenCoords = vector3(3034.38, 1369.28, 42.64),	-- vector3 (Coordinates to open the port menu)
		-- Jobs = {    -- List of jobs that will be able to access to por menu
		-- 	'boatman',
		-- },
		-- buyJobs = {    -- List of jobs that will be able to access to buy boats [Remove list so all players can buy]
		-- 	'buyboatman',
		-- },
		-- craftJobs = {    -- List of jobs that will be able to access to crafting boats [Remove list so all players can craft]
		-- 	'craftboatman',
		-- },
		npc = {
			pos = vector4(3034.38, 1369.28, 42.64, 72.66), -- Npc and port position
			model = 'A_M_M_ASBBOATCREW_01', -- Npc model
			outfit = 1,	-- outfit or false
			scenario = 'WORLD_HUMAN_CLIPBOARD',	-- Scenario name or false
		},
	},
    {
		name = 'Puerto de Van Horn', -- Name for blip
		blip = { enable = true, sprite = 1106719664}, -- enable/disable blip, and hash blip
		posSpawn = vector4(3009.48, 543.25, 40.19, 267.14), -- Coords X,Y,Z and H for spawn boat
		OpenCoords = vector3(2987.55, 537.06, 43.48),	-- vector3 (Coordinates to open the port menu)
		-- Jobs = {    -- List of jobs that will be able to access to por menu
		-- 	'boatman',
		-- },
		-- buyJobs = {    -- List of jobs that will be able to access to buy boats [Remove list so all players can buy]
		-- 	'buyboatman',
		-- },
		-- craftJobs = {    -- List of jobs that will be able to access to crafting boats [Remove list so all players can craft]
		-- 	'craftboatman',
		-- },
		npc = {
			pos = vector4(2987.55, 537.06, 43.48, 97.11), -- Npc position
			model = 'A_M_M_ASBBOATCREW_01', -- Npc model
			outfit = 2,	-- outfit or false
			scenario = 'WORLD_HUMAN_CLIPBOARD',	-- Scenario name or false
		},
    },
    {
		name = 'Puerto de Saint Denis', -- Name for blip
		blip = { enable = true, sprite = 1106719664}, -- enable/disable blip, and hash blip
        posSpawn = vector4(2950.77, -1257.6, 41.28, -86.0), -- Coords X,Y,Z and H for spawn boat
		OpenCoords = vector3(2951.27, -1249.93, 42.41),	-- vector3 (Coordinates to open the port menu)
		-- Jobs = {    -- List of jobs that will be able to access to por menu
		-- 	'boatman',
		-- },
		-- buyJobs = {    -- List of jobs that will be able to access to buy boats [Remove list so all players can buy]
		-- 	'buyboatman',
		-- },
		-- craftJobs = {    -- List of jobs that will be able to access to crafting boats [Remove list so all players can craft]
		-- 	'craftboatman',
		-- },
		npc = {
			pos = vector4(2951.27, -1249.93, 42.41, 104.69), -- Npc position
			model = 'A_M_M_ASBBOATCREW_01', -- Npc model
			outfit = 3,	-- outfit or false
			scenario = 'WORLD_HUMAN_CLIPBOARD',	-- Scenario name or false
		},
    },
	{
		name = 'Puerto de Blackwater', -- Name for blip
		blip = { enable = true, sprite = 1106719664}, -- enable/disable blip, and hash blip
        posSpawn = vector4(-685.95, -1251.08, 41.28, -89.0), -- Coords X,Y,Z and H for spawn boat
		OpenCoords = vector3(-681.65, -1242.98, 43.12),	-- vector3 (Coordinates to open the port menu)
		-- Jobs = {    -- List of jobs that will be able to access to por menu
		-- 	'boatman',
		-- },
		-- buyJobs = {    -- List of jobs that will be able to access to buy boats [Remove list so all players can buy]
		-- 	'buyboatman',
		-- },
		-- craftJobs = {    -- List of jobs that will be able to access to crafting boats [Remove list so all players can craft]
		-- 	'craftboatman',
		-- },
		npc = {
			pos = vector4(-681.65, -1242.98, 43.12, 102.02), -- Npc position
			model = 'A_M_M_ASBBOATCREW_01', -- Npc model
			outfit = 4,	-- outfit or false
			scenario = 'WORLD_HUMAN_CLIPBOARD',	-- Scenario name or false
		},
    },
}

Config.GiveBoats = true	-- true/false enable or disable players being able to give ships to other players

Config.SellPercentage = 50 -- number (x/100 percentage of the store price when selling) or false (disable selling boats)

Config.Custom = { -- List of items required for each mod
    Tints = { -- TINT
        Currency = {
            label = '$',
            type = 0,   -- 0 = money, 1 = gold, 2 = rol
            typec = 'money',   -- 'money', 'gold', or 'rol'
            amount = 20,
        },
        Items = {
            { label = 'Soft Wood', item = 'wood', amount = 2 },
            -- { label = 'Example 1', item = 'iron', amount = 5 },
            -- { label = 'Example 2', item = 'wood', amount = 10 },
        },
	},
	Extras = { -- EXTRAS
        Currency = {
            label = '$',
            type = 0,   -- 0 = money, 1 = gold, 2 = rol
            typec = 'money',   -- 'money', 'gold', or 'rol'
            amount = 30,
        },
        Items = {
            { label = 'Soft Wood', item = 'wood', amount = 2 },
            -- { label = 'Example 1', item = 'iron', amount = 5 },
            -- { label = 'Example 2', item = 'wood', amount = 10 },
        },
	},
	Liveries = { -- LIVERIES
        Currency = {
            label = '$',
            type = 0,   -- 0 = money, 1 = gold, 2 = rol
            typec = 'money',   -- 'money', 'gold', or 'rol'
            amount = 10,
        },
        Items = {
            { label = 'Soft Wood', item = 'wood', amount = 1 },
            -- { label = 'Example 1', item = 'iron', amount = 5 },
            -- { label = 'Example 2', item = 'wood', amount = 10 },
        },
	},
	LanternPropsets = { -- LANTERN PROPSETS
        Currency = {
            label = '$',
            type = 0,   -- 0 = money, 1 = gold, 2 = rol
            typec = 'money',   -- 'money', 'gold', or 'rol'
            amount = 35,
        },
        Items = {
            { label = 'Soft Wood', item = 'wood', amount = 1 },
            { label = 'Iron Ore', item = 'iron', amount = 1 },
            -- { label = 'Example 1', item = 'iron', amount = 5 },
            -- { label = 'Example 2', item = 'wood', amount = 10 },
        },
	},
	Propsets = { -- PROPSETS
        Currency = {
            label = '$',
            type = 0,   -- 0 = money, 1 = gold, 2 = rol
            typec = 'money',   -- 'money', 'gold', or 'rol'
            amount = 35,
        },
        Items = {
            { label = 'Soft Wood', item = 'wood', amount = 1 },
            { label = 'Hard Wood', item = 'hwood', amount = 1 },
            -- { label = 'Example 1', item = 'iron', amount = 5 },
            -- { label = 'Example 2', item = 'wood', amount = 10 },
        },
	},
	BoilerUpgrade1 = {
		Currency = {
			label = '$',
			type = 0,   -- 0 = money, 1 = gold, 2 = rol
			typec = 'money',   -- 'money', 'gold', or 'rol'
			amount = 50,
		},
		Items = {
			{ label = 'Iron Ore', item = 'iron', amount = 5 },
			-- { label = 'Example 1', item = 'iron', amount = 5 },
			-- { label = 'Example 2', item = 'wood', amount = 10 },
		},
	},
	BoilerUpgrade2 = {
		Currency = {
			label = '$',
			type = 0,   -- 0 = money, 1 = gold, 2 = rol
			typec = 'money',   -- 'money', 'gold', or 'rol'
			amount = 100,
		},
		Items = {
			{ label = 'Iron Ore', item = 'iron', amount = 10 },
			-- { label = 'Example 1', item = 'iron', amount = 5 },
			-- { label = 'Example 2', item = 'wood', amount = 10 },
		},
	},
	BoilerUpgrade3 = {
		Currency = {
			label = '$',
			type = 0,   -- 0 = money, 1 = gold, 2 = rol
			typec = 'money',   -- 'money', 'gold', or 'rol'
			amount = 150,
		},
		Items = {
			{ label = 'Iron Ore', item = 'iron', amount = 20 },
			-- { label = 'Example 1', item = 'iron', amount = 5 },
			-- { label = 'Example 2', item = 'wood', amount = 10 },
		},
	},
	-- BoilerUpgrade4 = {
	-- 	Currency = {
	-- 		label = '$',
	-- 		type = 0,   -- 0 = money, 1 = gold, 2 = rol
	-- 		typec = 'money',   -- 'money', 'gold', or 'rol'
	-- 		amount = 150,
	-- 	},
	-- 	Items = {
	-- 		{ label = 'Iron Ore', item = 'iron', amount = 20 },
	-- 		-- { label = 'Example 1', item = 'iron', amount = 5 },
	-- 		-- { label = 'Example 2', item = 'wood', amount = 10 },
	-- 	},
	-- },
}

Config.ShareBoatCommand = 'shareboat'	-- Command to share the inventory of the docked boat
Config.DelShareBoatCommand = 'delshareboat'	-- Command to remove inventory sharing from the docked boat

Config.Inventory = {
	Lockpick = {
		Enable = true,	-- true/false to enable or disable lockpick to steal boats from other players
		Item = 'lockpick',	-- Name of the item used to use the lockpick minigame
		ExecuteCommand = 'testigo Se ha visto a una persona ganzuar un barco',  -- 'witness command' or false
		JobsRequired = {
			amount = 1, -- number of players with one of the required jobs from the list
			jobs = {    -- List of jobs required to use the lock pick
			    'sheriff',
			    'police',
			},
		},
		JobsNotRequired = { -- Jobs that will have full permissions (.job)
			'sheriff',
			'police',
		},
		GroupsNotRequired = {  -- Groups that will have full permissions (.group)
			'admin',
			-- 'example',
		},
	},
	Blacklist = {
		'opium',
		'WEAPON_SNIPERRIFLE_CARCANO',
	},
	MaxItems = {
		iron = 100,
		wood = 150,
	},
	MaxItemsModels = {
		canoe = {
			iron = 10,
			wood = 20,
		},
		-- example = {
		-- 	iron = 50,
		-- 	wood = 40,
		-- },
	},
	DisableWeapons = false,
}

Config.StorageCapacity = {	-- List of boats and their capacity
	canoe = 50,
	canoeTreeTrunk = 50,
	pirogue2 = 50,
	pirogue = 50,
	rowboat = 200,
	rowboatSwamp02 = 200,
	rowboatSwamp = 200,
	rcBoat = 200,
	skiff = 200,
	boatsteam02x = 400,
	keelboat = 400,
	turbineboat = 700,
	ship_nbdGuama = 700,
	ship_nbdGuama2 = 700,
	tugboat2 = 700,
	horseBoat = 700,
	smuggler02 = 700,
	ship_guama02 = 700,
}

Config.Speeds = {	-- Speeds of boats (Only works with boatsteam02x and keelboat)
	Unit = 'knots',	-- 'km', 'mph' or 'knots'
	Boats = {
		boatsteam02x = {
			Default = -50, -- min -100 | defualt 0 | + 0 increase speed
			BoilerUpgrades = {
				[1] = 50,	--  Category customization updgrade level the Config.Custom.BoilerUpgrade1
				[2] = 50,	--  Category customization updgrade level the Config.Custom.BoilerUpgrade2
				[3] = 50,	--  Category customization updgrade level the Config.Custom.BoilerUpgrade3
				-- [4] = 50,	--  Category customization updgrade level the Config.Custom.BoilerUpgrade4
			},
		},
		keelboat = {
			Default = -50, -- min -100 | defualt 0 | + 0 increase speed
			BoilerUpgrades = {
				[1] = 50,	--  Category customization updgrade level the Config.Custom.BoilerUpgrade1
				[2] = 50,	--  Category customization updgrade level the Config.Custom.BoilerUpgrade2
				[3] = 50,	--  Category customization updgrade level the Config.Custom.BoilerUpgrade3
				-- [4] = 50,	--  Category customization updgrade level the Config.Custom.BoilerUpgrade4
			},
		},
	},
}
```

{% endcode %}

crafts.lua

{% code expandable="true" %}

```lua
BoatCraftings = {
    { 
		label = 'Canoe',	-- Name of the boat that will appear in the menu
		model = 'canoe',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
			{ item = 'wood', amount = 1, label = 'Madera blanda' },
			{ item = 'hwood', amount = 1, label = 'Madera dura' },
		},
	},
    {
		label = 'Log Canoe',	-- Name of the boat that will appear in the menu
		model = 'canoeTreeTrunk',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
			{ item = 'wood', amount = 1, label = 'Madera blanda' },
			{ item = 'hwood', amount = 1, label = 'Madera dura' },
		},
	},
    {
		label = 'Pirogue 1',	-- Name of the boat that will appear in the menu
		model = 'pirogue2',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
			{ item = 'wood', amount = 1, label = 'Madera blanda' },
			{ item = 'hwood', amount = 1, label = 'Madera dura' },
		},
	},
    { 
		label = 'Pirogue 2',	-- Name of the boat that will appear in the menu
		model = 'pirogue',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
			{ item = 'wood', amount = 1, label = 'Madera blanda' },
			{ item = 'hwood', amount = 1, label = 'Madera dura' },
		},
	},
    { 
		label = 'Rowboat',	-- Name of the boat that will appear in the menu
		model = 'rowboat',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
            { item = 'wood', amount= 2, label = 'Madera blanda' },
            { item = 'hwood', amount= 2, label = 'Madera dura' },
            { item = 'iron', amount= 2, label = 'Hierro' },
        },
	},
    { 
		label = 'Rowboat 2',	-- Name of the boat that will appear in the menu
		model = 'rowboatSwamp02',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
            { item = 'wood', amount= 2, label = 'Madera blanda' },
            { item = 'hwood', amount= 2, label = 'Madera dura' },
            { item = 'iron', amount= 2, label = 'Hierro' },
        },
    },
    { 
		label = 'Rowboat 3',	-- Name of the boat that will appear in the menu
		model = 'rowboatSwamp',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
            { item = 'wood', amount= 2, label = 'Madera blanda' },
            { item = 'hwood', amount= 2, label = 'Madera dura' },
            { item = 'iron', amount= 2, label = 'Hierro' },
        },
	},
	{ 
		label = 'Mini Submarine',	-- Name of the boat that will appear in the menu
		model = 'rcBoat',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
            { item = 'wood', amount= 2, label = 'Madera blanda' },
            { item = 'hwood', amount= 2, label = 'Madera dura' },
            { item = 'iron', amount= 2, label = 'Hierro' },
        },
	},
    { 
		label = 'Skiff',	-- Name of the boat that will appear in the menu
		model = 'skiff',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
            { item = 'wood', amount= 2, label = 'Madera blanda' },
            { item = 'hwood', amount= 2, label = 'Madera dura' },
            { item = 'iron', amount= 2, label = 'Hierro' },
        },
	},
	{ 
		label = 'Steam Boat',	-- Name of the boat that will appear in the menu
		model = 'boatsteam02x',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
            { item = 'wood', amount= 2, label = 'Madera blanda' },
            { item = 'hwood', amount= 2, label = 'Madera dura' },
            { item = 'iron', amount= 2, label = 'Hierro' },
        },
	},
    { 
		label = 'Large Steam Boat',	-- Name of the boat that will appear in the menu
		model = 'keelboat',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
            { item = 'wood', amount= 2, label = 'Madera blanda' },
            { item = 'hwood', amount= 2, label = 'Madera dura' },
            { item = 'iron', amount= 2, label = 'Hierro' },
        },
	},
	{ 
		label = 'Turbine Boat',	-- Name of the boat that will appear in the menu
		model = 'turbineboat',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
			{ item = 'wood', amount = 4, label = 'Madera blanda' },
			{ item = 'hwood', amount = 4, label = 'Madera dura' },
			{ item = 'iron', amount = 4, label = 'Hierro' },
        },
	},
	{
		label = 'Guarma Boat 1',	-- Name of the boat that will appear in the menu
		model = 'ship_nbdGuama',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
			{ item = 'wood', amount = 4, label = 'Madera blanda' },
			{ item = 'hwood', amount = 4, label = 'Madera dura' },
			{ item = 'iron', amount = 4, label = 'Hierro' },
        },
	},
	{
		label = 'Guarma Boat 2',	-- Name of the boat that will appear in the menu
		model = 'ship_nbdGuama2',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
			{ item = 'wood', amount = 4, label = 'Madera blanda' },
			{ item = 'hwood', amount = 4, label = 'Madera dura' },
			{ item = 'iron', amount = 4, label = 'Hierro' },
        },
	},
	{ 
		label = 'Tugboat',	-- Name of the boat that will appear in the menu
		model = 'tugboat2',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
			{ item = 'wood', amount = 4, label = 'Madera blanda' },
			{ item = 'hwood', amount = 4, label = 'Madera dura' },
			{ item = 'iron', amount = 4, label = 'Hierro' },
        },
	},
	{ 
		label = 'Horse Boat',	-- Name of the boat that will appear in the menu
		model = 'horseBoat',	-- Boat model for spawn
		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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
        craft = {
			{ item = 'wood', amount = 4, label = 'Madera blanda' },
			{ item = 'hwood', amount = 4, label = 'Madera dura' },
			{ item = 'iron', amount = 4, label = 'Hierro' },
        },
	},
	-- {	-- SKIN BUG
		-- label = 'Naval Boat',	-- Name of the boat that will appear in the menu
		-- model = 'smuggler02',	-- Boat model for spawn
		-- 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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
	-- }, 
	-- {	-- DRIVE BUG
		-- label = 'Guarma Boat',	-- Name of the boat that will appear in the menu
		-- model = 'ship_guama02',	-- Boat model for spawn
		-- 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
		-- currency = {
		--     type = { 0, 'money' },   -- 0 = money, 1 = gold, 2 = rol
		--     amount = false,   -- number (currency required to craft) or false (no money required)
		--     label = '$',    -- notification text
		-- },
	-- },
}
```

{% 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>

client.lua

{% code expandable="true" %}

```lua
TriggerEvent('vorp_menu:getData',function(cb)
    MenuData = cb
end)

TriggerEvent("getCore", function(core)
    VORPcore = core
end)

function NotifyLeft(title, subtitle, dict, icon , time, color)
    VORPcore.NotifyLeft(title, subtitle, dict, icon , time, color)
end

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

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

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

-- Events to obtain or Take items from vorp_inventory (saved in the database)
ReloadEvent = 'vorp_inventory:ReloadClanInventory'  -- 'vorp_inventory:ReloadClanInventory'  / 'vorp_inventory:ReloadHideoutInventory' / 'vorp_inventory:ReloadCustomInventory'
OpenEvent = 'vorp_inventory:OpenClanInventory'  -- 'vorp_inventory:OpenClanInventory' / 'vorp_inventory:OpenHideoutInventory' / 'vorp_inventory:OpenCustomInv'
function openInventory(name, inv, capacity, id)
    TriggerEvent(ReloadEvent, json.encode({itemList = inv, action = 'setSecondInventoryItems'}))
    TriggerEvent(OpenEvent, name, name, capacity)
end

InventoryImg = 'vorp_inventory/html/img/items/'
```

{% endcode %}

server.lua

{% code expandable="true" %}

```lua
TriggerEvent("getCore", function(core)
    VORPcore = core
end)

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

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

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

function GetCharacter(source)
    -- .money
    -- .gold
    -- .identifier
    -- .charIdentifier
    -- .job
    -- .firstname
    -- .lastname
    return VORPcore.getUser(source).getUsedCharacter
end

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

function removeCurrency(source, currency, amount)
    local Character = GetCharacter(source)
    Character.removeCurrency(currency, amount) -- Remove money 1000 | 0 = money, 1 = gold, 2 = rol
end

function addCurrency(source, currency, amount)
    local Character = GetCharacter(source)
    Character.addCurrency(currency, amount) -- Add money 1000 | 0 = money, 1 = gold, 2 = rol
end

function getItemCount(source, callback, item, metadata)
    return exports.vorp_inventory:getItemCount(source, callback, item, metadata)
end

function subItem(source, item, amount, metadata, callback)
    exports.vorp_inventory:subItem(source, item, amount, metadata, callback)
end

-- Events to obtain or Take items from vorp_inventory (saved in the database)
MoveEvent = 'syn_clan:MoveToClan'   -- 'syn_clan:MoveToClan' / 'syn_underground:MoveToHideout' / 'vorp_inventory:MoveToCustom'
TakeEvent = 'syn_clan:TakeFromClan' -- 'syn_clan:TakeFromClan' / 'syn_underground:TakeFromHideout' / 'vorp_inventory:TakeFromCustom'
ReloadEvent = 'vorp_inventory:ReloadClanInventory'  -- 'vorp_inventory:ReloadClanInventory'  / 'vorp_inventory:ReloadHideoutInventory' / 'vorp_inventory:ReloadCustomInventory'
OpenEvent = 'vorp_inventory:OpenClanInventory'  -- 'vorp_inventory:OpenClanInventory' / 'vorp_inventory:OpenHideoutInventory' / 'vorp_inventory:OpenCustomInv'
function openInventory(source, name, inv, capacity, id)
    TriggerClientEvent(ReloadEvent, source, json.encode({itemList = inv, action = 'setSecondInventoryItems'}))
    TriggerClientEvent(OpenEvent, source, name, name, capacity)
end

function CloseInv(source, invId)
    exports.vorp_inventory:closeInventory(source, invId)
end

function AddWebhook(title, webhook, description, color, name, logo, footerlogo, avatar)
    VORPcore.AddWebhook(title, webhook, description, color, name, logo, footerlogo, avatar)
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_boats.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.
