Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e1034d
commit b4dbaeb
Showing
38 changed files
with
940 additions
and
1 deletion.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
[extras]/wasabi_fishing/Inventory_Items/ESX/ox_inventory.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
-- Place in ox_inventory/data/items.lua | ||
['tuna'] = { | ||
label = 'Tuna', | ||
weight = 650, | ||
stack = true, | ||
close = false, | ||
}, | ||
|
||
['salmon'] = { | ||
label = 'Salmon', | ||
weight = 350, | ||
stack = true, | ||
close = false, | ||
}, | ||
|
||
['trout'] = { | ||
label = 'Trout', | ||
weight = 250, | ||
stack = true, | ||
close = false, | ||
}, | ||
|
||
['anchovy'] = { | ||
label = 'Anchovy', | ||
weight = 50, | ||
stack = true, | ||
close = false, | ||
}, | ||
|
||
['fishbait'] = { | ||
label = 'Fish Bait', | ||
weight = 50, | ||
stack = true, | ||
close = false, | ||
}, | ||
|
||
['fishingrod'] = { | ||
label = 'Fishing Rod', | ||
weight = 800, | ||
stack = true, | ||
close = true, | ||
}, |
8 changes: 8 additions & 0 deletions
8
[extras]/wasabi_fishing/Inventory_Items/ESX/sql/wasabi_fishing_limit.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
INSERT INTO `items` (`name`, `label`, `limit`) VALUES | ||
('fishingrod', 'Fishing Rod', 20), | ||
('fishbait', 'Fish Bait', 20), | ||
('anchovy', 'Anchovy', 20), | ||
('trout', 'Trout', 20), | ||
('salmon', 'Salmon', 20), | ||
('tuna', 'Tuna', 40) | ||
; |
8 changes: 8 additions & 0 deletions
8
[extras]/wasabi_fishing/Inventory_Items/ESX/sql/wasabi_fishing_weight.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
INSERT INTO `items` (`name`, `label`, `weight`) VALUES | ||
('fishingrod', 'Fishing Rod', 20), | ||
('fishbait', 'Fish Bait', 20), | ||
('anchovy', 'Anchovy', 20), | ||
('trout', 'Trout', 20), | ||
('salmon', 'Salmon', 20), | ||
('tuna', 'Tuna', 40) | ||
; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.03 KB
[extras]/wasabi_fishing/Inventory_Items/InventoryImages/fishingrod.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- Add to qb-core/shared/items.lua | ||
['fishingrod'] = {['name'] = 'fishingrod', ['label'] = 'Fishing Rod', ['weight'] = 250, ['type'] = 'item', ['image'] = 'fishingrod.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Use this with bait to catch fish.'}, | ||
['fishbait'] = {['name'] = 'fishbait', ['label'] = 'Fishing Bait', ['weight'] = 5, ['type'] = 'item', ['image'] = 'fishbait.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = true, ['description'] = 'With a fishing rod this can catch some fish.'}, | ||
['anchovy'] = {['name'] = 'anchovy', ['label'] = 'Anchovy', ['weight'] = 35, ['type'] = 'item', ['image'] = 'anchovy.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = true, ['description'] = 'A breed of fish.'}, | ||
['trout'] = {['name'] = 'trout', ['label'] = 'Trout', ['weight'] = 85, ['type'] = 'item', ['image'] = 'trout.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = true, ['description'] = 'A breed of fish.'}, | ||
['salmon'] = {['name'] = 'salmon', ['label'] = 'Salmon', ['weight'] = 125, ['type'] = 'item', ['image'] = 'salmon.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = true, ['description'] = 'A breed of fish.'}, | ||
['tuna'] = {['name'] = 'tuna', ['label'] = 'Tuna', ['weight'] = 225, ['type'] = 'item', ['image'] = 'tuna.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = true, ['description'] = 'A breed of fish.'}, |
42 changes: 42 additions & 0 deletions
42
[extras]/wasabi_fishing/Inventory_Items/QBCore/ox_inventory.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
-- Place in ox_inventory/data/items.lua | ||
['tuna'] = { | ||
label = 'Tuna', | ||
weight = 650, | ||
stack = true, | ||
close = false, | ||
}, | ||
|
||
['salmon'] = { | ||
label = 'Salmon', | ||
weight = 350, | ||
stack = true, | ||
close = false, | ||
}, | ||
|
||
['trout'] = { | ||
label = 'Trout', | ||
weight = 250, | ||
stack = true, | ||
close = false, | ||
}, | ||
|
||
['anchovy'] = { | ||
label = 'Anchovy', | ||
weight = 50, | ||
stack = true, | ||
close = false, | ||
}, | ||
|
||
['fishbait'] = { | ||
label = 'Fish Bait', | ||
weight = 50, | ||
stack = true, | ||
close = false, | ||
}, | ||
|
||
['fishingrod'] = { | ||
label = 'Fishing Rod', | ||
weight = 800, | ||
stack = true, | ||
close = true, | ||
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# wasabi_fishing | ||
|
||
This resource was created as a free interactive fishing script for ESX/QBCore servers. | ||
|
||
## Features | ||
- Out of the box compatible with ESX and QBCore | ||
- Optimized 0.00ms usage on idle | ||
- Skill-check based success | ||
- Full animations and props | ||
- Chance of fishing rod breaking upon failing skill-check(Can be changed in config) | ||
- Configurable random wait time for getting bite on line | ||
- Configurable fishing rewards(4 by default included) | ||
- Configurable prices to sell fishing rewards | ||
- Configurable skill-check difficulty per fishing reward | ||
- Ability to fish from boat, pier, or anywhere with a body of water | ||
- No job requirement | ||
- Fully configurable fish buyer to sell fish | ||
|
||
## Dependencies | ||
- es_extended OR qb-core | ||
- ox_lib - https://github.com/overextended/ox_lib/releases | ||
|
||
|
||
## Installation | ||
|
||
- Make sure you have dependencies | ||
|
||
- Make sure items are added to server(Check `Inventory_Items` directory for images/examples | ||
|
||
- Put script in your `resources` directory | ||
|
||
- Add `ensure wasabi_fishing` in your `server.cfg` (*After* dependencies) | ||
|
||
### Extra Information | ||
- Make sure `ox_lib` starts before `wasabi_fishing` | ||
- Inventory images included in the `Inventory_Items/InventoryImages` directory | ||
- You must add the item `fishingrod` and `fishbait` to one of your in-game shops or have a place for your players to obtain. | ||
|
||
## Preview | ||
https://www.youtube.com/watch?v=kLLPGJIK3Q0 | ||
|
||
|
||
# Support | ||
<a href='https://discord.gg/79zjvy4JMs'>![Discord Banner 2](https://discordapp.com/api/guilds/1025493337031049358/widget.png?style=banner2)</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
-----------------For support, scripts, and more---------------- | ||
--------------- https://discord.gg/wasabiscripts ------------- | ||
--------------------------------------------------------------- | ||
if GetResourceState('es_extended') ~= 'started' then return end | ||
ESX = exports['es_extended']:getSharedObject() | ||
Framework, PlayerLoaded, PlayerData = 'esx', nil, {} | ||
|
||
RegisterNetEvent('esx:playerLoaded', function(xPlayer) | ||
PlayerData = xPlayer | ||
PlayerLoaded = true | ||
end) | ||
|
||
RegisterNetEvent('esx:onPlayerSpawn', function() | ||
TriggerEvent('wasabi_bridge:onPlayerSpawn') | ||
end) | ||
|
||
AddEventHandler('esx:onPlayerDeath', function(data) | ||
TriggerEvent('wasabi_bridge:onPlayerDeath') | ||
end) | ||
|
||
RegisterNetEvent('esx:onPlayerLogout', function() | ||
table.wipe(PlayerData) | ||
PlayerLoaded = false | ||
end) | ||
|
||
RegisterNetEvent('esx:setJob', function(job) | ||
PlayerData.job = job | ||
end) | ||
|
||
AddEventHandler('onResourceStart', function(resourceName) | ||
if GetCurrentResourceName() ~= resourceName or not ESX.PlayerLoaded then return end | ||
PlayerData = ESX.GetPlayerData() | ||
PlayerLoaded = true | ||
end) | ||
|
||
AddEventHandler('esx:setPlayerData', function(key, value) | ||
if GetInvokingResource() ~= 'es_extended' then return end | ||
PlayerData[key] = value | ||
end) | ||
|
||
function HasGroup(filter) | ||
local type = type(filter) | ||
|
||
if type == 'string' then | ||
if PlayerData.job.name == filter then | ||
return PlayerData.job.name, PlayerData.job.grade | ||
end | ||
else | ||
local tabletype = table.type(filter) | ||
|
||
if tabletype == 'hash' then | ||
local grade = filter[PlayerData.job.name] | ||
|
||
if grade and grade <= PlayerData.job.grade then | ||
return PlayerData.job.name, PlayerData.job.grade | ||
end | ||
elseif tabletype == 'array' then | ||
for i = 1, #filter do | ||
if PlayerData.job.name == filter[i] then | ||
return PlayerData.job.name, PlayerData.job.grade | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
if GetResourceState('es_extended') ~= 'started' then return end | ||
ESX = exports['es_extended']:getSharedObject() | ||
Framework = 'esx' | ||
|
||
function GetPlayer(source) | ||
return ESX.GetPlayerFromId(source) | ||
end | ||
|
||
function KickPlayer(source, reason) | ||
local player = GetPlayer(source) | ||
return player.kick(reason) | ||
end | ||
|
||
function HasGroup(source, filter) | ||
local player = GetPlayer(source) | ||
local type = type(filter) | ||
|
||
if type == 'string' then | ||
if player.job.name == filter then | ||
return player.job.name, player.job.grade | ||
end | ||
else | ||
local tabletype = table.type(filter) | ||
|
||
if tabletype == 'hash' then | ||
local grade = filter[player.job.name] | ||
|
||
if grade and grade <= player.job.grade then | ||
return player.job.name, player.job.grade | ||
end | ||
elseif tabletype == 'array' then | ||
for i = 1, #filter do | ||
if player.job.name == filter[i] then | ||
return player.job.name, player.job.grade | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
function GetIdentifier(source) | ||
local xPlayer = ESX.GetPlayerFromId(source) | ||
return xPlayer.identifier | ||
end | ||
|
||
function GetName(source) | ||
local xPlayer = ESX.GetPlayerFromId(source) | ||
return xPlayer.getName() | ||
end | ||
|
||
function RegisterUsableItem(item, cb) | ||
ESX.RegisterUsableItem(item, cb) | ||
end | ||
|
||
function HasItem(source, item) | ||
local player = GetPlayer(source) | ||
local item = player.getInventoryItem(item) | ||
if item ~= nil then | ||
return item.count | ||
else | ||
return 0 | ||
end | ||
end | ||
|
||
function AddItem(source, item, count, slot, metadata) | ||
local player = GetPlayer(source) | ||
return player.addInventoryItem(item, count, metadata, slot) | ||
end | ||
|
||
function RemoveItem(source, item, count, slot, metadata) | ||
local player = GetPlayer(source) | ||
player.removeInventoryItem(item, count, metadata, slot) | ||
end | ||
|
||
function AddMoney(source, type, amount) | ||
if type == 'cash' then type = 'money' end | ||
local player = GetPlayer(source) | ||
player.addAccountMoney(type, amount) | ||
end | ||
|
||
function RemoveMoney(source, type, amount) | ||
if type == 'cash' then type = 'money' end | ||
local player = GetPlayer(source) | ||
player.removeAccountMoney(type, amount) | ||
end |
Oops, something went wrong.