# FİSHİNG

<div align="left"><figure><img src="/files/Y3v8KTQQEEU41YUlaHTC" alt=""><figcaption></figcaption></figure></div>

**Daily Tasks** 🎣

Take on exciting daily challenges to boost your fishing skills and earn exclusive rewards! Each day, receive a fresh set of tasks designed to test your angling abilities and add variety to your fishing adventures.

* **Unique Challenges**: Complete specific tasks, like catching certain types of fish or achieving a high catch count within a time limit.
* **Reward System**: Earn special items, XP, or in-game currency by completing tasks, making each day’s efforts worthwhile.
* **Progress Tracking**: Stay motivated by tracking your daily accomplishments and progress towards your fishing goals.

Keep your fishing journey exciting and rewarding every day with **Daily Tasks**!

```
Add these items in qb-core/shared/items.lua
```

```
['tuna'] = {['name'] = 'tuna', ['label'] = 'Tuna', ['weight'] = 10000, ['type'] = 'item', ['image'] = 'tuna.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['titanium_rod'] = {['name'] = 'titanium_rod', ['label'] = 'Titanium rod', ['weight'] = 450, ['type'] = 'item', ['image'] = 'titanium_rod.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['basic_rod'] = {['name'] = 'basic_rod', ['label'] = 'Fishing rod', ['weight'] = 250, ['type'] = 'item', ['image'] = 'basic_rod.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['anchovy'] = {['name'] = 'anchovy', ['label'] = 'Anchovy', ['weight'] = 20, ['type'] = 'item', ['image'] = 'anchovy.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['shark'] = {['name'] = 'shark', ['label'] = 'Shark', ['weight'] = 7500, ['type'] = 'item', ['image'] = 'shark.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['mahi_mahi'] = {['name'] = 'mahi_mahi', ['label'] = 'Mahi Mahi', ['weight'] = 3500, ['type'] = 'item', ['image'] = 'mahi_mahi.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['trout'] = {['name'] = 'trout', ['label'] = 'Trout', ['weight'] = 750, ['type'] = 'item', ['image'] = 'trout.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['salmon'] = {['name'] = 'salmon', ['label'] = 'Salmon', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'salmon.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['red_snapper'] = {['name'] = 'red_snapper', ['label'] = 'Red Snapper', ['weight'] = 2500, ['type'] = 'item', ['image'] = 'red_snapper.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['piranha'] = {['name'] = 'piranha', ['label'] = 'Piranha', ['weight'] = 1500, ['type'] = 'item', ['image'] = 'piranha.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['graphite_rod'] = {['name'] = 'graphite_rod', ['label'] = 'Graphite rod', ['weight'] = 350, ['type'] = 'item', ['image'] = 'graphite_rod.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['worms'] = {['name'] = 'worms', ['label'] = 'Worms', ['weight'] = 10, ['type'] = 'item', ['image'] = 'worms.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['haddock'] = {['name'] = 'haddock', ['label'] = 'Haddock', ['weight'] = 500, ['type'] = 'item', ['image'] = 'haddock.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['grouper'] = {['name'] = 'grouper', ['label'] = 'Grouper', ['weight'] = 3500, ['type'] = 'item', ['image'] = 'grouper.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' }, ['artificial_bait'] = {['name'] = 'artificial_bait', ['label'] = 'Artificial bait', ['weight'] = 30, ['type'] = 'item', ['image'] = 'artificial_bait.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
```

```
Import this in your database:ESX
```

```
INSERT INTO items (name, label, weight) VALUES ('graphite_rod', 'Graphite rod', 350), ('grouper', 'Grouper', 3500), ('mahi_mahi', 'Mahi Mahi', 3500), ('basic_rod', 'Fishing rod', 250), ('haddock', 'Haddock', 500), ('artificial_bait', 'Artificial bait', 30), ('trout', 'Trout', 750), ('red_snapper', 'Red Snapper', 2500), ('shark', 'Shark', 7500), ('anchovy', 'Anchovy', 20), ('salmon', 'Salmon', 1000), ('tuna', 'Tuna', 10000), ('piranha', 'Piranha', 1500), ('worms', 'Worms', 10), ('titanium_rod', 'Titanium rod', 450) ;
```

These functions simplify item removal and addition, adapting seamlessly to different frameworks. Configuring these directly in the `Config` allows for effortless adjustments to match your framework setup.

Inventory Management Functions

**`Remove` Function**

This function removes a specified amount of an item from a player’s inventory. The behavior adapts based on the configured framework (QBCore or other):

```
Remove = function(Player, Item, Amount)
    if Config.Framework == "QBCore" or Config.Framework == "OLDQBCore" then
        return Player.Functions.RemoveItem(Item, Amount)
    else
        return Player.removeInventoryItem(Item, Amount)
    end
end
```

* **QBCore & OLDQBCore**: Calls `Player.Functions.RemoveItem`.
* **Other Frameworks**: Uses `Player.removeInventoryItem` for compatibility.

**`Add` Function**

This function adds a specified amount of an item to a player’s inventory. Like the `Remove` function, it adjusts based on the active framework:

```
Add = function(Player, Item, Amount)
    if Config.Framework == "QBCore" or Config.Framework == "OLDQBCore" then
        return Player.Functions.AddItem(Item, tonumber(Amount))
    else
        return Player.addInventoryItem(Item, tonumber(Amount))
    end
end
```

#### Why This Approach?

By structuring these item management functions in `Config`, you gain flexibility for future updates and compatibility across frameworks.

Here's an engaging English explanation for your configuration options:

***

### Configuration Overview

Customize your FiveM fishing experience through this config file, adjusting everything from framework type to item drop rates.

#### Key Settings

* **Framework**: Choose between `QBCore`, `ESX`, `OLDQBCore`, or `NewESX` based on your server’s setup.
* **Webhook**: Set a URL here to send fishing-related logs or updates directly to your Discord.
* **Token**: For bot integration, use your Discord bot token from [Discord Developer Applications](https://discord.com/developers/applications).

#### Interaction Text

These options define the text displayed when players interact with specific NPCs or points of interest:

* **Sea Interaction**: `"sea"`, showing `[E] Engage with the Fishing Store` to guide players to your fishing hub.
* **Boat Rental**: `"boat"`, showing `[E] Access Premium Boat Rental Services` to offer premium experiences.

#### Fishing Rods

<figure><img src="/files/q51g8j9VSRB1ulC1aTHz" alt=""><figcaption></figcaption></figure>

Each rod type provides a different drop rate for catching fish. Adjust these values to set probabilities, adding variety and rewards:

* **Basic Rod** (`basic_rod`): Drop rate of `0.2`, meaning there's a chance of doubling the catch.
* **Graphite Rod** (`graphite_rod`): Drop rate of `0.3`, offering a higher probability for extra catches.
* **Titanium Rod** (`titanium_rod`): Drop rate of `0.4`, maximizing the chances for multiple catches with each reel.

```
InteractionText = {
    sea = "[E] Engage with the Fishing Store",  -- Text for interacting with the Fishing Store NPC
    boat = "[E] Access Premium Boat Rental Services"  -- Text for accessing Boat Rental services
},

Rod = {
    ['basic_rod'] = {
        drop = 0.2, -- Basic Rod: 0.2 drop rate, occasionally gives a double catch
    },
    ['graphite_rod'] = {
        drop = 0.3, -- Graphite Rod: 0.3 drop rate, higher chance of multiple catches
    },
    ['titanium_rod'] = {
        drop = 0.4, -- Titanium Rod: 0.4 drop rate, highest chance of catching multiple fish
    }
}
```

* **Framework compatibility** (supports multiple frameworks),
* **Webhook and token** for Discord integration,
* **Interaction texts** to guide players, and
* **Rod drop rates** to manage fishing rewards.

Setting Up NPCs, Fishing Zones, and Shop Items in the Fishing Script

This title reflects the configuration of various elements, like NPC models, fishing zones, and the shopping options, providing clarity for users diving into specific settings.

<figure><img src="/files/VLP1j2vgFkDQpo97oNXC" alt=""><figcaption></figcaption></figure>

```
Config = {
    ped = {  -- Configuration for NPCs in fishing areas
        ['sea'] = {
            key = 'sea',  -- Unique identifier for this NPC type
            model = `s_m_m_cntrybar_01`,  -- NPC model type
            account = 'money',  -- Account type used for transactions with this NPC
            blip = {  -- Blip settings for map display
                name = 'Fishing Store',  -- Blip name displayed on the map
                sprite = 356,  -- Blip icon
                color = 74,  -- Blip color code
                scale = 0.75  -- Blip scale size
            },
            locations = {  -- Locations for spawning the Fishing Store NPC
                vector4(-2081.93, 2613.63, 2.08, 110.98),
                vector4(-1492.3639, -939.2579, 9.2140, 144.0305)
            }
        },
    },

    Zone = {  -- Configuration for different fishing zones
        -- Coral Reef Zone
        {
            blip = {
                name = 'Coral Reef',  -- Zone name displayed on the map
                sprite = 317,  -- Icon for Coral Reef zone
                color = 24,  -- Color code for Coral Reef blip
                scale = 0.6  -- Scale size for the blip
            },
            locations = {  -- Coordinates for the Coral Reef zone
                vector3(-1774.0654, -1796.2740, 0.0),
                vector3(2482.8589, -2575.6780, 0.0)
            },
            radius = 250.0,  -- Radius of the zone
            minLevel = 1,  -- Minimum player level required to fish in this zone
            waitTime = { min = 5, max = 10 },  -- Wait time range for catching fish
            includeOutside = true,  -- Allows fishing outside the main radius
            message = { 
                enter = 'You have entered a coral reef.',  -- Entry message
                exit = 'You have left the coral reef.'  -- Exit message
            },
            fishList = {  -- Types of fish available in Coral Reef
                { name = 'mahi_mahi', price = 1500 },
                { name = 'red_snapper', price = 1750 }
            }
        },
        -- Deep Waters Zone
        {
            blip = {
                name = 'Deep Waters',  -- Zone name displayed on the map
                sprite = 317,  
                color = 29, 
                scale = 0.6  
            },
            locations = {  
                vector3(-4941.7964, -2411.9146, 0.0),
            },
            radius = 1000.0,  
            minLevel = 3,  
            waitTime = { min = 20, max = 40 },  
            includeOutside = false,  
            message = { 
                enter = 'You have entered deep waters.', 
                exit = 'You have left deep waters.' 
            },
            fishList = {  
                { name = 'grouper', price = 1300 },
                { name = 'tuna', price = 1800 },
                { name = 'shark', price = 2000 }
            }
        },
        -- Swamp Zone
        {
            blip = {
                name = 'Swamp',  
                sprite = 317,  
                color = 56,  
                scale = 0.6  
            },
            locations = {  
                vector3(-2188.1182, 2596.9348, 0.0),
            },
            radius = 200.0,  
            minLevel = 2,  
            waitTime = { min = 10, max = 20 },  
            includeOutside = true,  
            message = { 
                enter = 'You have entered a swamp.', 
                exit = 'You have left the swamp.' 
            },
            fishList = {  
                { name = 'grouper', price = 1300 },
                { name = 'tuna', price = 3800 },
                { name = 'shark', price = 7000 },
                { name = 'mahi_mahi', price = 1500 },
                { name = 'haddock', price = 4500 },
                { name = 'salmon', price = 1500 },
            }
        }        
    },
    
    outside = {  -- Configuration for fishing outside designated zones
        waitTime = { min = 15, max = 25 },  -- Wait time range outside zones
        fishList = {  -- Available fish outside designated zones
            { name = 'grouper', price = 1300 },
            { name = 'tuna', price = 3800 },
            { name = 'shark', price = 7000 },
            { name = 'mahi_mahi', price = 1500 },
            { name = 'haddock', price = 4500 },
            { name = 'salmon', price = 1500 },
        },
        message = {  
            enter = 'You are now fishing outside special zones.',  
            exit = 'You have stopped fishing outside special zones.'  
        }
    },

    shopping = {  -- Shop configuration for rods and baits
        -- Silver Rod
        {
            id = 7,
            name = "SILVER ROD",  -- Display name for the item
            description = "A basic rod for casual fishing.",  -- Description of the item
            price = 100000,  -- Item price
            quantity = 1,  -- Default quantity
            image = "./assets/img/item/basic_rod.png",  -- Path to item image
            model = 'basic_rod',  -- Model used in gameplay
        },
        -- Piranha Bait
        {
            id = 1,
            name = "PIRANHA BAIT",  
            description = "A rare bait known to attract piranhas.",  
            price = 100000000,  
            quantity = 1,  
            image = "./assets/img/item/piranha.png",  
            model = 'piranha',  
        },
        -- Shark Bait
        {
            id = 2,
            name = "SHARK BAIT",  
            description = "Special bait used for attracting sharks.",  
            price = 100000,  
            quantity = 1,  
            image = "./assets/img/item/shark.png",  
            model = 'shark',  
        },
        -- Other baits with similar structure...
    }
}
```

<div align="left"><figure><img src="/files/LBzln05cg5W2aa2rKDae" alt=""><figcaption></figcaption></figure></div>

## Rank Update Command - Level Command Documentation

This command allows administrators to set or update a player’s rank in the game, managing player ranks by updating a JSON file (`playerlist.json`) where player information is stored. Only admins can use this command, and if a non-admin attempts to execute it, they will receive an error message.

### Command Usage:

* **Syntax:** `/level [newRank]`
* **Arguments:** `newRank` (Numeric value representing the player's new rank)
* **Access:** Admin Only
* **Purpose:** Sets or updates a player's rank, storing the new rank in `playerlist.json`

### Process Overview:

1. **Admin Validation**:
   * The command checks if the player is an admin using `notAdmin(source)`.
   * If they are **not** an admin, they will see: `Error: You are not an admin.` and the command stops here.
2. **Data Retrieval**:
   * If the user is an admin, their data is retrieved based on the framework (ESX, NewESX, QBCore).
3. **Rank Update**:
   * If the player exists in `playerlist.json`, their rank is updated.
   * If not, the player's data (rank, avatar, title, etc.) is added to the file.
4. **Data Save**:
   * Updated data is saved to `playerlist.json`. If the save is successful, the player receives: `Rank Update: Your rank has been set to [newRank]`

### Error Handling:

* **Save Error**: If data fails to save, the console logs `Failed to save updated data to playerlist.json`
* **Identifier Issue**: If no identifier is found, the console warns `Warning: No identifier found for player.`
* **Data Retrieval Failure**: If player data retrieval fails, the console logs `Could not retrieve player data for player ID: [playerId]`
* **Invalid Input**: If the rank or player ID is invalid, the command logs `Invalid rank or player ID.`

This command allows for efficient, secure rank management while ensuring only admins can make rank updates.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eyestore.gitbook.io/documentation/packages/fishing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
