🚒Player Owned Yachts

Introduction

This script adds the ability for your players to have the chance to buy their very own private yacht

Features of Player Owned Yachts:

  • Ability to Change The Livery on Yacht.

  • Ability to Change the Light Color on the Yacht.

  • Ability for Players to share keys with friends .

  • Ability for Players to Sell their yacht to a friend.

  • Each Yacht has a boat and helicopter garage (this simply saves and retrieves the vehicle stored)

  • Each Yacht has its own outfit section for players to change outfits (requires supported clothing resource).

  • Each Yacht has its own storage space which can be configured in config (requires supported inventory resource).

This is compatible with the following inventory systems:

This is compatible with the following clothing systems:


Installation

You must have cfx-gabz-yachts resource already purchased and installed

  • Download the power_yachts from Keymaster

  • Run the .sql file in your database.

  • Add the files to your resources folder

  • Ensure that the resource file will start (either ensure your resource in the server.cfg or inside a folder which is started on server start)

  • Edit the config file to your needs

  • Restart your server


Configuration

Select the tab below for your framework to see the configuration options available.

-- QBCore Support 
enableQBCore = true

-- ESX Support
enableESX = false

-- Purchase Price of Yacht
purchasePrice = 5000000

-- Target Support 
-- Supported Resources: ox_target, qb-target
enableTarget = true

-- Resource Used for Inventories
-- Supported Resources: ox_inventory, qb-inventory, qs-inventory, chezza-inventory
inventoryResource = 'qb-inventory'

-- Max Storage In The Yacht Stash
storageAmount = 1000000

-- config to toggleProps for Renewed-Weaponscarry on enter and exit.
renewedWeapons = false

-- Enable Yacht Bartender
enableBartender = true
-- The list of items the bartender will sell
bartenderInventory = {
 {name = 'Bottle Of Beer', item = 'beer', price = 10},
}

-- Resource Used for Clothing
-- Supported Resources: rcore_clothes, illenium_appearance, qb-clothing
clothingResource = 'illenium_appearance'

-- How many days should the yacht be left before it is removed if no one has entered it?
-- Example if set to 14, the yacht will be removed if no one has entered it in 14 days
enableExpiry = true
expireDays = 14

-- This enables support for JG-Garages (not working atm)
useJGGarages = false

-- Enable JG-TextUI for Garages
useJGTextUI = true

Editable files

functions.lua

Inventory Compatibility

If you would like to edit the inventory functions, you can edit them in the functions.lua file. Default functions are as follows:

function openStorage(stashId)
 if inventoryResource == 'ox_inventory' then 
  exports.ox_inventory:openInventory('stash', {id = stashId, owner = false})
 end 

 if inventoryResource == 'chezza-inventory' then 
  TriggerEvent('inventory:openStorage', "Stash", stashId, storageAmount, 1000)
 end 

 if inventoryResource == 'quasar-inventory' then 
  local other = {}
  other.maxweight = storageAmount
  other.slots = 50 
  TriggerServerEvent("inventory:server:OpenInventory", "stash", stashId, other)
  TriggerEvent("inventory:client:SetCurrentStash", stashId)
 end

 if inventoryResource == 'qb-inventory' then 
  TriggerServerEvent("inventory:server:OpenInventory", "stash", stashId, {maxweight = storageAmount, slots = 250})
  TriggerEvent("inventory:client:SetCurrentStash", stashId)
 end
end

Clothing compatibility

If you would like to edit the clothing functions, you can edit them in the functions.lua file. Default functions are as follows:

function openClothingOutfits()
 if clothingResource == 'rcore_clothes' then
  TriggerEvent("rcore_clothes:openOutfits") 
 end

 if clothingResource == 'illenium_appearance' then
  TriggerEvent('illenium-appearance:client:openOutfitMenu')
 end
end

Last updated

Was this helpful?