> For the complete documentation index, see [llms.txt](https://fivestar-development.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fivestar-development.gitbook.io/docs/scripts/fivestar-helpmenu/how-to-install.md).

# How to Install

FiveStar Script

### Set player job (optional)

If you want to set permission for categories or data, <mark style="color:green;">you must return the player job in this function</mark>

{% tabs %}
{% tab title="Load player job" %}
{% code title="config.lua - line 19 - 27" %}

```lua
PlayerJobNow = function() ---@alias If you want to set permission for handles or data, you must return the player job in this function
    if GetResourceState("es_extended") == "started" then
        local data = exports['es_extended']:getSharedObject().PlayerData
        return { Name = data.job.name, Rank = data.job.grade }
    elseif GetResourceState("qb-core") == "started" then
        local data = exports['qb-core']:GetCoreObject().Functions.GetPlayerData()
        return { Name = data.job.name, Rank = data.job.grade.level }
    end
end,
```

{% endcode %}
{% endtab %}

{% tab title="Update player job" %}
{% code title="client/config.lua - line 5 - 13" %}

```lua
if GetResourceState("es_extended") == "started" then
    RegisterNetEvent('esx:setJob', function(data, lastJob) ---@alias To update player data jobs
        UpdateJob({Name = data.name, Rank = data.grade})
    end)
elseif GetResourceState("qb-core") == "started" then
    AddEventHandler('QBCore:Client:OnJobUpdate', function(job) ---@alias To update player data jobs
        UpdateJob({Name = job.name, Rank = job.grade})
    end)
end
```

{% endcode %}
{% endtab %}

{% tab title="Set permission on categories " %}

<pre class="language-lua" data-title="config.lua - table Config.Head"><code class="lang-lua">ActiveTags = { ---@alias tag name, access permission, style button | index one is default 
    ["faq"] = { Permission = "everyone" }, ---@alias Index is default | Permission: All players - Style: background blue
    ["vehicle"] = { Permission = "everyone" },
    ["jobs"] = { Permission = "everyone" },
    ["report"] = { Permission = "everyone" },
    ["keybind"] = { Permission = "everyone" },
    ["weapon"] = { Permission = "everyone" },
    ["police"] = {Permission = {Name = "police", Rank = 3}, Style = "background: #5865F4;" }, ---@alias job level example(3) and above
    ["medic"] = {Permission = {Name = "ambulance", Rank = 1}, Style = "background: #416CAD;" }, ---@alias job level example(1) and above
    ["mechanic"] = {Permission = {Name = "mecano", Rank = 2}, Style = "background: #AC902B;" } ---@alias job level example(2) and above
<strong>    ...
</strong><strong>},
</strong></code></pre>

{% endtab %}

{% tab title="Set permission on data" %}
{% code title="config.lua - table Config.Body" %}

```lua
{
    Title = "How to become a police officer?",
    Text = "To become a police officer, you need to join the police force via the recruitment center. You must be level 2 and above to apply.",
    StatusOpen = false,
    TagsAccess = {"police"},
    Profile = "?",
    Permission = { ---@param "everyone" | { Name = "police", Rank = 15 } ---@alias job level example(3)
        Name = "police",
        Rank = 1
    },
    Button = {
        StatusOpen = false,
        Text = 'Apply Now',
        Style = "background: #5865F4;",
        Url = "https://twitchfarsi.com/"
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
