Skip to content

Cyntaax/fivem-fishing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License


FiveM Fishing


· Report Bug · Request Feature

About The Project

product-screenshot

Getting Started

Simply download the Latest Release, place into your resources directory and start!

Prerequisites

To get this resource working properly for your exact use, you will have to configure the functionality for giving a player an item.

Server Exports


SetGivePlayerItem(source: number, item: string, amount: number)

  • This export will be used to overwrite the functionality of giving a player an item. For example -
---
exports.fishing:SetGivePlayerItem(function(source, item, amount)
  TriggerEvent('myInventory:givePlayerItem', source, item, amount)
end)

Configuration

Configuration is to be set in the config.json and should match the following format. There can be an infinite amount of lures and catches.

The key cooresponds to keys found here

{
  "key": "PERIOD",
  "lures": [
    {
      "name": "lure_basic_01",
      "label": "Basic Lure",
      "catches": [
        {
          "name": "small_fish_01",
          "label": "Small Fish",
          "prob": 10
        }
      ]
    }
  ]
}

A small explaination of the prob property. It is the probability to which a player can catch that item, it is relational between all catches.

Prob examples

{
  "key": "PERIOD",
  "lures": [
    {
      "name": "lure_basic_01",
      "label": "Basic Lure",
      "catches": [
        {
          "name": "small_fish_01",
          "label": "Small Fish",
          "prob": 10
        },
        {
          "name": "medium_fish_01",
          "label": "Medium Fish",
          "prob": 5
        }
      ]
    }
  ]
}

In the above example we have 2 catches. The first has a probability of 10 the second has a probability of 5. The system will create a pool of 15 items. (sum of the probability of all catches). This pool will contain 10 entries of small_fish_01 and 5 entries of medium_fish_01 meaning that there is a 67% chance of getting a small fish and a 33% chance of getting a medium fish.

Additional Exports

Server


SetLureForPlayer(source, lure)

  • Running this function will equip the specified lure for a player

Client


SetShowMessage(message: string, messageType: string)

  • Use this to replace the functionality of displaying messages (i.e. you are using some REALLY cool notification system that is just so much better than the native)

e.g.

exports.fishing:SetShowMessage(function(message, messageType)
  TriggerEvent('mycoolsystem:showNotification', message)
end)

SetOnTestingProgress(progress: number)

  • Use this export to replace the function that runs whenever the progress is updated for the test to see if a player can fish (i.e. you are using some OTHER REALLY COOL progress bar system that is so much better than the native)
  • This will be called every frame while the testing is in progress

SetTestingComplete(result: boolean)

  • This function will be fired when the testing has completed, along with the result specifying whether or not the test was successful

SetOnFishCaught(fish: string, cb: fun(): void)

  • This function will be fired once a player has caught a fish. Do with it what you will. The cb MUST be called for the process to continue.

SetOnCatchPending()

  • This function will be called every frame while a catch is pending. The default functionality is to just display a prompt at the top left to reel in. Change this to your liking.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'chore: added some amazing feature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Cyntaax - @cyntaax - [email protected]

Project Link: https://github.com/cyntaax/fivem-fishing