🐟Documentation

All information you need for use the script

Setup your framework

Config

Config.Framework = "ESX"

SQL

INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('fishing_rod','Fishing Rod','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('fishbait','fish bait','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('turtlebait','turtle bait','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('carp','Carp','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('koi','Koi','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('goldfish','Goldfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('popeye_goldfish','Pop-eyed goldfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('ranchu_goldfish','Ranchu goldfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('killifish','Killifish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('crawfish','Crawfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('gar','Gar','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('tadpole','Tadpole','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('catfish','Catfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('giant_snakehead','Giant snakehead','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('bitterling','Bitterling','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('pale_chub','Pale chub','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('crucian_carp','Crucian Carp','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('dace','Dace','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('soft_turtle','Soft-shelled turtle','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('freshwater_goby','Freshwater Goby','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('loach','Loach','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('bluegill','Bluegill','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('yellow_perch','Yellow perch','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('black_bass','Black bass','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('tilapia','Tilapia','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('pond_smelt','Pond smelt','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('sweetfish','Sweetfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('cherry_salmon','Cherry salmon','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('char','Char','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('golden_trout','Golden Trout','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('stringfish','Stringfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('salmon','Salmon','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('king_salmon','King salmon','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('mitten_crab','Mitten crab','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('guppy','Guppy','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('nibble_fish','Nibble fish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('angelfish','Angelfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('betta','Betta','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('neon_tetra','Neon tetra','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('rainbowfish','Rainbowfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('arowana','Arowana','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('dorado','Dorado','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('arapaima','Arapaima','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('saddled','Saddled bichir','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('sturgeon','Sturgeon','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('snapping_turtle','Snapping turtle','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('piranha','Piranha','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('sea_butterfly','Sea butterfly','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('sea_horse','Sea horse','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('clown_fish','Clown fish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('surgeon_fish','Surgeonfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('butterfly_fish','Butterfly fish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('napoleonfish','Napoleonfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('zebra_turkeyfish','Zebra turkeyfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('blowfish','Blowfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('puffer_fish','Puffer fish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('anchovy','Anchovy','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('horse_mackerel','Horse mackerel','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('barred_knifejaw','Barred knifejaw','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('sea_bass','Sea bass','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('red_snapper','Red snapper','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('dab','Dab','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('olive_flounder','Olive Flounder','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('squid','Squid','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('moray_eel','Moray eel','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('ribbon_eel','Ribbon eel','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('tuna','Tuna','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('blue_marlin','Blue marlin','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('trevally','Giant trevally','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('mahimahi','Mahi-mahi','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('sunfish','Ocean sunfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('ray','ray','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('saw_shark','Saw shark','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('hammer_shark','Hammer shark','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('white_shark','Great white shark','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('whale_shark','Whale shark','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('suckerfish','Suckerfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('football_fish','Football fish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('oarfish','oarfish','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('barreleye','Barreleye','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('coelacanth','Coelacanth','1','0','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('trash','Trash','1','0','1');

Usage

Use the fishing rod item

Shop

Only available for ESX and QBCore

-- With open time, the shop will be open between the hours set in the table
Config.UseOpenTime = true    -- true or false
Config.OpenTime = {7, 22}    -- 0 to 23

Fish

The chance is calculated by the following formula:

chance = math.random(1, 100) <= chance

EXEMPLE : For the SEA, if the chance is 50, they will catch a sardine. If the chance is 66, they will catch a tuna.

You have to add the catch with max chance on the top of the list.

Trash is the default catch for non fishing zone, like the sewer

Exemple Create new fish that named "Red fish"

config.lua
Config.sellFishPrice = {
    { label = Strings['redFish'],    value = 'redFish',     price = 50 },
}

-- Red fish found in river and lac
-- We add in 
Config.zone = {
	{
		--"LAC"
		{
			{ fish = "redFish",	chance = 80 },
		}
	},
	{
		--"RIVER"
		{
			{ fish = "redFish",	chance = 60 },
		}
	}
}
strings.lua
Strings = {
    ['redFish']    = 'Red fish',
}
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('fishing_rod','Canne à pêche','1','0','1');

Notification

You can add your notification system Just replace with your type for client = "error" / "success" / "inform"

type for server = "error" / "success"

config.lua
Config.ClientNotification = function(msg, type)
	if Config.Framework == "ESX" then
		ESX.ShowNotification(msg, false, false, 140)
	elseif Config.Framework == "QB" then
		local QBCore = exports['qb-core']:GetCoreObject()
		QBCore.Functions.Notify(msg, type)
	end
end

Config.ServerNotification = function(source, msg, type)
	if Config.Framework == "ESX" then
		TriggerClientEvent('esx:showNotification', source, msg, type)
	elseif Config.Framework == "QB" then
		TriggerClientEvent("QBCore:Notify", source, msg)
	end
end

Minigame

You can add your own minigame for fishing

config.lua
-- Put your code here if you want to add challeng to caugth a fish
-- Just return true for success or false for failure
-- Exemple with https://github.com/i-kulgu/ik-skillbar
function EndFishing()
	local res = exports["ik-skillbar"]:StartBar(3000)
	if not res then
		return false
	else
		return true
	end
end

Last updated