# HRTasks

## Preview

{% embed url="<https://www.youtube.com/watch?pp=ygUHSFJUYXNrcw==&v=yQ8an480dQ0>" %}

## Dependencies

* [HRLib](broken://pages/Ep5kSHLO83LleEO9rVP4)
* [ox\_target](https://overextended.dev/ox_target)
* [ox\_inventory](https://overextended.dev/ox_inventory)
* [Ox](https://overextended.dev/ox_core)/[ESX](https://documentation.esx-framework.org/)/[QBCore](https://docs.qbcore.org/qbcore-documentation) framework

## Installation

* Purchase HRTasks, download it and move it to your resources folder
* Download all the dependencies for the script and move them in your resources folder
* Install the dependencies from their documentations and configure everything
* Write this in your `server.cfg`

<pre class="language-tsconfig"><code class="lang-tsconfig"><strong>start HRLib
</strong><strong>start framework # here you have to write the neccessary lines for starting the framework and its dependencies
</strong><strong>start ox_target
</strong><strong>start ox_inventory
</strong><strong>start HRTasks
</strong></code></pre>

* Restart your server

## Config Preview

```lua
local config = {}

config.language = 'en'

config.enableItemReward = true -- This enables or disables the item reward for each task and like that if you disable it, you're not supposted to use ox_inventory

config.rewardsAccount = 'bank' -- 'bank' or 'cash'

config.clickDistance = 0.5

config.tasksPer100Players = 10

config.checkTimeout = 30000 -- The check for existing tasks

config.blipSettings = {
    sprite = 161,
    colour = 38,
    label = 'Task To Do'
}

config.propsBlipsSettings = {
    sprite = 1,
    colour = 3
}

config.peds = {
    `s_m_m_autoshop_01`,
    `s_m_m_ammucountry`,
    `s_m_m_cntrybar_01`
}

config.petBoxSettings = {
    model = `prop_cs_cardbox_01`,
    offsetCoords = vector3(0.1748702178096, 0.1352829627836, -0.22197255511198), -- Use tgiann-attachproptoplayereditor to set this (equivalent of "position" in the print of the tgiann-attachproptoplayereditor)
    rotation = vector3(153.16755687187, 53.414436959572, -10.302079416484) -- Use tgiann-attachproptoplayereditor to set this
    -- Animation for tgiann-attachproptoplayereditor: 'anim@heists@box_carry@', 'idle'
}

config.tasks = {
    {
        type = 'searchProps',
        reward = {
            moneyReward = 500,
            itemReward = {
                { name = 'bread', chance = 20 }
            }
        },
        ifNotDoneTax = 50,
        minProps = 2,
        dialog = {
            pedName = 'Freddie Hubbard',
            questionLabel = 'Hi! Mind if you can help me with collecting my parts?',
            agreeLabel = 'Yes',
            disagreeLabel = 'No'
        },
        target = {
            startConversationLabel = 'Talk to the person',
            finishTaskLabel = 'Finish the task',
            cancelTaskLabel = 'Cancel Task'
        },
        propsBlipLabel = 'Particle',
        props = {
            {
                model = `prop_car_ignition`,
                locations = {
                    vector4(-382.5960, -269.5207, 33.6839, 50.2009),
                    vector4(-364.6120, -282.1701, 32.4082, 226.5830)
                }
            },
            {
                model = `p_car_keys_01`,
                locations = {
                    vector4(-386.3222, -266.9285, 33.9480, 54.0754)
                }
            },
            {
                model = `prop_rub_carpart_05`,
                locations = {
                    vector4(-390.0739, -264.2125, 34.2148, 54.0978)
                }
            },
            {
                model = `prop_rub_carpart_02`,
                locations = {
                    vector4(-393.9236, -261.3197, 34.4804, 51.9666)
                }
            },
            {
                model = `prop_rub_carpart_04`,
                locations = {
                    vector4(-398.3510, -257.7803, 34.7846, 51.4838)
                }
            },
            {
                model = `prop_rub_carpart_03`,
                locations = {
                    vector4(-402.0865, -254.4405, 35.0657, 52.9104)
                }
            }
        },
        pedLocations = {
            vector4(-377.4457, -276.4481, 33.2399, 323.3493)
        },
    },
    {
        type = 'searchPet',
        reward = {
            moneyReward = 300,
            itemReward = {
                { name = 'bread', chance = 20 }
            }
        },
        ifNotDoneTax = 50,
        petsModels = {
            `a_c_husky`,
            `a_c_pug`,
            `a_c_cat_01`
        },
        dialog = {
            pedName = 'Freddie Hubbard',
            questionLabel = 'Hello! Can you help me find my pet against payback?',
            agreeLabel = 'Yes',
            disagreeLabel = 'No'
        },
        target = {
            startConversationLabel = 'Talk to the person',
            finishTaskLabel = 'Finish the task',
            cancelTaskLabel = 'Cancel Task'
        },
        pedLocations = {
            vector4(-329.1118, -311.0046, 29.8969, 322.8829)
        },
        petLocations = {
            vector4(-313.6682, -296.2060, 29.9579, 300.5041)
        }
    }
}
```

The config is set by default with all the positions and other settings just like in the video


---

# 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://hrscripts.gitbook.io/hrscripts-documentation/resources/hrtasks.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.
