QBCore Advanced & In
You decide how much to pay.
Package Description
# A Fishing Script for QBCore Framework
- Make sure to use the latest version of PolyZone and QBCore
- USES FIVEM ESCROW ENCRYPTION
You are able to customize the config and other files that allow you to customize the notifications
- This has been tested as of 11/5/23
- Preview: https://youtu.be/Sw07EMR5xuc
Changelog:
- v 2.3:
- Update README with inputs for latest version of QBCore scripts
- v 2.2:
- Add discord logging option
- v 2.1:
- Add Language Translation options in config
- v 2.0:
- - Add options for Third-Eye selling to peds
- - Sell all fish at once
- - Optional illegal fish gives markedbills
- - Add more exposed lua code to allow for more customization
- v 1.2:
- Add exposed lua code to allow for custom notifications
- Add config value for renamed qb-core
- v 1.1:
- Add stress removal when fishing
- Prevent animation glitching out of fishing while continuing to collect fish
- Adjust fishing config time and min-max catch values
## Dependencies :
QB Framework - https://github.com/qbcore-framework/qb-core
PolyZone - https://github.com/mkafrin/PolyZone
(OPTIONAL) QB Skillbar https://github.com/qbcore-framework/qb-skillbar.git
(OPTIONAL) QB-Target https://github.com/qbcore-framework/qb-target
## Add your own fishing items
### Config allows for easy additions and modifications to existing items
Comes with over 2 dozen, ready to use, fish, turtles, sharks, and more creatures
You can specify to use smaller fish that you catch with fish bait, and use them as bait for bigger fish
Config how many fish you can catch at once, per type. You can catch just one if you like, or catch multiple at a time
```
Config.Catchables = {
['fish'] = {
itemName = 'fish', -- item name from items.lua
canBeUsedAsBait = false, -- if true then ['useable'] = true in items.lua
baitType = nil, -- if canBeUsedAsBait, what type of bait is it: live, turtle, shark
eatsBait = 'none', -- what is the minimum tier bait this can be caught with
sellZone = 1, -- which fishing zone to sell to? 1, 2, 3
minSell = 85, -- minimum it can sell for
maxSell = 110, -- maximum it can sell for
minCatch = 1, -- min you can catch at once
maxCatch = 1, -- max you can catch at once
},
['crawdad'] = {
itemName = 'crawdad',
canBeUsedAsBait = true,
baitType = 'turtle', -- can be caught and used later as bait to catch turtles
eatsBait = 'fish',
sellZone = 1,
minSell = 30,
maxSell = 100,
minCatch = 2,
maxCatch = 4,
},
}
```
## Add your own bait ONLY items
### Allows for easy addition and modification of items that cannot be caught, but can be used as bait
```
Config.BaitItems = {
['fishbait'] = {
itemName = 'fishbait',
type = 'fish',
},
['turtlebait'] = {
itemName = 'turtlebait',
type = 'turtle',
},
['grubs'] = {
itemName = 'grubs',
type = 'live',
},
}
```
## Add your own fishing rods
### Allows for additions and modification of new fishing rods
You can modify how likely the rods are to break when catching larger fish/turtles/sharks
```
Config.FishingRods = {
['fishingrod'] = {
name = 'fishingrod', -- name of the item
breakChance = 0, -- break chance modifier
},
['magnumxlrod'] = {
name = 'magnumxlrod',
breakChance = -25, -- minus 25 percent chance to break
},
['valuecastrod'] = {
name = 'valuecastrod',
breakChance = 45, -- plus 45 percent chance to break (you can make this purchasable with other scripts and price it lower)
}
}
```
## Custom selling zones
### Create different locations around the map to sell the things you catch
[Optional]
If you want to use qb-target, add the following to the Config.TargetModels in qb-target > init.lua
```
["qb-fishing"] = {
models = {
"s_m_m_cntrybar_01", "s_m_m_ccrew_01", "s_m_m_gaffer_01"
},
options = {
{
type = "client",
event = "qb-fishing:client:StartSelling",
icon = "fa-solid fa-fish",
label = "Sea Creature Sales"
}
},
distance = 2.5,
},
```
## Catch fish from different customized zones
### Specify which fish can be caught where
Configurable zones that allow for customizing what fish can be caught in each zone.
E.x. You can specify that only sharks can be caught in deep water and nothing else, or you can catch anything but sharks and turtles in small lakes
## Catches with different types of bait:
### Regular fish bait
Can be used to catch a variety of fish
### Live bait
Includes: grubs, mealworms, guppies, nightcrawlers, and shrimp
Some fish eat only live bait and will refuse other bait
### Turtle bait
Includes: Turtle bait, crawdads, and frogs
Turtles will only be caught if using this bait, but you also have a chance to catch any fish that eats live bait too
### Shark bait
Use any turtle to equip it as shark bait
Sharks will only bite when a turtle is attached, or you can catch fish that eat live bait if a shark doesn't bite
## Boat anchor
### Come with usable boat anchor item
Use the anchor while driving any vehicle of class "boat" (14) to freeze it in place, and use again to unfreeze
This will allow you to sit in one place and not drift out to sea while fishing on a boat
## Usable fishing knife for crafting/cutting fish
### Combine knife with a fish in inventory to create edible sushi
Crafting is done with QBCore item dragging in inventory, can be customized to use any type of fish
Just change the ['combinable'] = {accept = {'fish'} ... to
['combinable'] = {accept = {'fish', 'trout', 'largemouthbass'}
[Optional]
If you would like to add these items to your qb-shops scripts add this to
qb-shops > config.lua > Config.Products >
```
['shopname'] = {
{name = 'fishingrod', price = 500, amount = 50, info = {}, type = 'item'},
{name = 'valuecastrod', price = 100, amount = 50, info = {}, type = 'item'},
{name = 'magnumxlrod', price = 1000, amount = 50, info = {}, type = 'item'},
{name = 'fishbait', price = 10, amount = 250, info = {}, type = 'item'},
{name = 'turtlebait', price = 50, amount = 250, info = {}, type = 'item'},
{name = 'fishingknife', price = 2, amount = 250, info = {}, type = 'item'},
{name = 'camp_grill', price = 2, amount = 250, info = {}, type = 'item'},
{name = 'mealworms', price = 15, amount = 250, info = {}, type = 'item'},
{name = 'nightcrawlers', price = 15, amount = 250, info = {}, type = 'item'},
{name = 'grubs', price = 15, amount = 250, info = {}, type = 'item'},
{name = 'anchor', price = 5000, amount = 10, info = {}, type = 'item'},
}
```
## Upload images:
Drag images from the images folder to qb-inventory/html/images
## Insert into #qb-core - Shared.lua
```
QBShared.Items = {
-- Fishing
['fish'] = {['name'] = 'fish', ['label'] = 'Fish', ['weight'] = 250, ['type'] = 'item', ['image'] = 'fish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Generic Fish'},
['grouper'] = {['name'] = 'grouper', ['label'] = 'Grouper', ['weight'] = 300, ['type'] = 'item', ['image'] = 'grouper.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Grouper Fish'},
['largemouthbass'] = {['name'] = 'largemouthbass', ['label'] = 'Largemouth Bass', ['weight'] = 600, ['type'] = 'item', ['image'] = 'largemouthbass.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Largemouth Bass Fish'},
['marlin'] = {['name'] = 'marlin', ['label'] = 'Marlin', ['weight'] = 600, ['type'] = 'item', ['image'] = 'marlin.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Nemo?'},
['trout'] = {['name'] = 'trout', ['label'] = 'Trout', ['weight'] = 600, ['type'] = 'item', ['image'] = 'trout.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Trout'},
['shrimp'] = {['name'] = 'shrimp', ['label'] = 'Shrimp', ['weight'] = 5, ['type'] = 'item', ['image'] = 'shrimp.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A small shrimp, can be used as bait'},
['caimon'] = {['name'] = 'caimon', ['label'] = 'Caimon', ['weight'] = 400, ['type'] = 'item', ['image'] = 'caimon.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A type of alligator'},
['frog'] = {['name'] = 'frog', ['label'] = 'Frog', ['weight'] = 50, ['type'] = 'item', ['image'] = 'frog.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Frog, good source of live bait'},
['carp'] = {['name'] = 'carp', ['label'] = 'Carp', ['weight'] = 100, ['type'] = 'item', ['image'] = 'carp.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Carp'},
['catfish'] = {['name'] = 'catfish', ['label'] = 'Catfish', ['weight'] = 500, ['type'] = 'item', ['image'] = 'catfish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Catfish'},
['perch'] = {['name'] = 'perch', ['label'] = 'Perch', ['weight'] = 200, ['type'] = 'item', ['image'] = 'perch.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Perch'},
['bluegill'] = {['name'] = 'bluegill', ['label'] = 'Blue gill', ['weight'] = 150, ['type'] = 'item', ['image'] = 'bluegill.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Blue Gill'},
['rainbowtrout'] = {['name'] = 'rainbowtrout', ['label'] = 'Rainbow Trout', ['weight'] = 450, ['type'] = 'item', ['image'] = 'rainbowtrout.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Rainbow Trout'},
['piranha'] = {['name'] = 'piranha', ['label'] = 'Piranha', ['weight'] = 100, ['type'] = 'item', ['image'] = 'piranha.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Piranha'},
['smallmouthbass'] = {['name'] = 'smallmouthbass', ['label'] = 'Smallmouth Bass', ['weight'] = 200, ['type'] = 'item', ['image'] = 'smallmouthbass.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Smallmouth Bass'},
['salmon'] = {['name'] = 'salmon', ['label'] = 'Salmon', ['weight'] = 150, ['type'] = 'item', ['image'] = 'salmon.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Salmon'},
['crawdad'] = {['name'] = 'crawdad', ['label'] = 'Crawdad', ['weight'] = 50, ['type'] = 'item', ['image'] = 'crawdad.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Crawdad, used as turtle bait'},
['bullfrog'] = {['name'] = 'bullfrog', ['label'] = 'Bullfrog', ['weight'] = 250, ['type'] = 'item', ['image'] = 'bullfrog.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Bullfrog'},
['goldfish'] = {['name'] = 'goldfish', ['label'] = 'Goldfish', ['weight'] = 15, ['type'] = 'item', ['image'] = 'goldfish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Gold fish'},
['chinookfish'] = {['name'] = 'chinookfish', ['label'] = 'Chinook Fish', ['weight'] = 100, ['type'] = 'item', ['image'] = 'chinookfish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Chinook Fish'},
['crappie'] = {['name'] = 'crappie', ['label'] = 'Crappie', ['weight'] = 100, ['type'] = 'item', ['image'] = 'crappie.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Crappie'},
['guppies'] = {['name'] = 'guppies', ['label'] = 'Guppies', ['weight'] = 2, ['type'] = 'item', ['image'] = 'guppies.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Some Guppies, good live bait'},
['northernpike'] = {['name'] = 'northernpike', ['label'] = 'Northern Pike', ['weight'] = 100, ['type'] = 'item', ['image'] = 'northernpike.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Northern Pike'},
['walleye'] = {['name'] = 'walleye', ['label'] = 'Walleye', ['weight'] = 100, ['type'] = 'item', ['image'] = 'walleye.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Walleye'},
['drumfish'] = {['name'] = 'drumfish', ['label'] = 'Drumfish', ['weight'] = 100, ['type'] = 'item', ['image'] = 'drumfish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Drum Fish'},
['angelfish'] = {['name'] = 'angelfish', ['label'] = 'Angel fish', ['weight'] = 100, ['type'] = 'item', ['image'] = 'angelfish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'An Angel in disguise'},
['angler'] = {['name'] = 'angler', ['label'] = 'Angler', ['weight'] = 100, ['type'] = 'item', ['image'] = 'angler.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Angler'},
['butterflyfish'] = {['name'] = 'butterflyfish', ['label'] = 'Butterfly Fish', ['weight'] = 100, ['type'] = 'item', ['image'] = 'butterflyfish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Butterfly fish, cannot fly and is not butter'},
['clownfish'] = {['name'] = 'clownfish', ['label'] = 'Clown Fish', ['weight'] = 70, ['type'] = 'item', ['image'] = 'clownfish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Nemo?'},
['lionfish'] = {['name'] = 'lionfish', ['label'] = 'Lion Fish', ['weight'] = 100, ['type'] = 'item', ['image'] = 'lionfish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Lion Fish'},
['seahorse'] = {['name'] = 'seahorse', ['label'] = 'Sea Horse', ['weight'] = 50, ['type'] = 'item', ['image'] = 'seahorse.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Lost Land Horse'},
['dori'] = {['name'] = 'dori', ['label'] = 'Dori', ['weight'] = 100, ['type'] = 'item', ['image'] = 'dori.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Who?'},
['triggerfish'] = {['name'] = 'triggerfish', ['label'] = 'Trigger Fish', ['weight'] = 1500, ['type'] = 'item', ['image'] = 'triggerfish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Trigger Shark'},
['tang'] = {['name'] = 'tang', ['label'] = 'Tang', ['weight'] = 350, ['type'] = 'item', ['image'] = 'tang.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Tang'},
['surgeonfish'] = {['name'] = 'surgeonfish', ['label'] = 'Surgeon Fish', ['weight'] = 350, ['type'] = 'item', ['image'] = 'surgeonfish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Surgeon Fish'},
['wrasse'] = {['name'] = 'wrasse', ['label'] = 'Wrasse', ['weight'] = 250, ['type'] = 'item', ['image'] = 'wrasse.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Wrasse'},
['eel'] = {['name'] = 'eel', ['label'] = 'eel', ['weight'] = 250, ['type'] = 'item', ['image'] = 'eel.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'An eel, zap'},
['mealworms'] = {['name'] = 'mealworms', ['label'] = 'mealworms', ['weight'] = 2, ['type'] = 'item', ['image'] = 'mealworms.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Some mealworms, good for bait'},
['nightcrawlers'] = {['name'] = 'nightcrawlers', ['label'] = 'nightcrawlers', ['weight'] = 2, ['type'] = 'item', ['image'] = 'nightcrawlers.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Some nightcrawlers, good for bait'},
['grubs'] = {['name'] = 'grubs', ['label'] = 'Grubs', ['weight'] = 2, ['type'] = 'item', ['image'] = 'grubs.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Some grubs, good for bait'},
['turtle'] = {['name'] = 'turtle', ['label'] = 'Turtle', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'turtle.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Sea turtle, sharks favorite snack'},
['softshellturtle'] = {['name'] = 'softshellturtle', ['label'] = 'Soft Shell Turtle', ['weight'] = 500, ['type'] = 'item', ['image'] = 'softshellturtle.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Soft Shell Turtle, can be used as shark bait'},
['snappingturtle'] = {['name'] = 'snappingturtle', ['label'] = 'Snapping Turtle', ['weight'] = 750, ['type'] = 'item', ['image'] = 'snappingturtle.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Watch your fingers, nice snack for sharks'},
['shark'] = {['name'] = 'shark', ['label'] = 'Shark', ['weight'] = 1500, ['type'] = 'item', ['image'] = 'shark.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Great White Shark'},
['lemonshark'] = {['name'] = 'lemonshark', ['label'] = 'Lemon Shark', ['weight'] = 1500, ['type'] = 'item', ['image'] = 'lemonshark.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Lemon Shark, sour.'},
['sandshark'] = {['name'] = 'sandshark', ['label'] = 'Sand Shark', ['weight'] = 1500, ['type'] = 'item', ['image'] = 'sandshark.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Sand Shark'},
['tigershark'] = {['name'] = 'tigershark', ['label'] = 'Tiger Shark', ['weight'] = 1500, ['type'] = 'item', ['image'] = 'tigershark.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'A Tiger Shark'},
['fishbait'] = {['name'] = 'fishbait', ['label'] = 'Fish Bait', ['weight'] = 2, ['type'] = 'item', ['image'] = 'fishbait.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Used to lure fish'},
['turtlebait'] = {['name'] = 'turtlebait', ['label'] = 'Turtle Bait', ['weight'] = 5, ['type'] = 'item', ['image'] = 'turtlebait.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Used to lure turtles'},
['fishingrod'] = {['name'] = 'fishingrod', ['label'] = 'Fishing Rod', ['weight'] = 500, ['type'] = 'item', ['image'] = 'fishingrod.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Used to catch fish'},
['valuecastrod'] = {['name'] = 'valuecastrod', ['label'] = 'Value Cast Rod', ['weight'] = 350, ['type'] = 'item', ['image'] = 'valuecastrod.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Cheap and dirty'},
['magnumxlrod'] = {['name'] = 'magnumxlrod', ['label'] = 'Magnum XL Rod', ['weight'] = 750, ['type'] = 'item', ['image'] = 'magnumxlrod.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'More reliable and sturdy'},
['fishingknife'] = {['name'] = 'fishingknife', ['label'] = 'Fillet Knife', ['weight'] = 5, ['type'] = 'item', ['image'] = 'fishingknife.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = {accept = {'fish'}, reward = 'cutfish', anim = nil}, ['description'] = 'A knife to cut fish'},
['cutfish'] = {['name'] = 'cutfish', ['label'] = 'Sushi', ['weight'] = 50, ['type'] = 'item', ['image'] = 'cutfish.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Some cut fish'},
['anchor'] = {['name'] = 'anchor', ['label'] = 'Anchor', ['weight'] = 1500, ['type'] = 'item', ['image'] = 'anchor.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Locks boats in place'},
}
```
## Insert into qb-smallresources > config.lua
```
Config.Consumables = {
eat = { -- default food items
['sandwich'] = math.random(35, 54), -- example
-- ...
["cutfish"] = math.random(35,54),
},
}
```
## ONLY NEEDED IN OLDER VERSION OF qb-smallresources
# Insert into qb-smallresources/server/consumables.lua
```
QBCore.Functions.CreateUseableItem("cutfish", function(source, item)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.Functions.RemoveItem(item.name, 1, item.slot) then
TriggerClientEvent("consumables:client:Eat", src, item.name)
end
end)
```