# Installation

## Dependencies

<details>

<summary>QBCore</summary>

You will need the latest version of [qb-core](https://github.com/qbcore-framework/qb-core).

* Extract the contents of the archive to your resources folder.
* Start the resource near the top of your resources in your server.cfg.

</details>

### Installing the resource

* Make sure you have the [dependencies](#dependencies) listed above installed.
* Extract the contents of the archive to your resources folder.
* Add item to shared items.lua

  ```lua
      registerkey1                 = { name = 'registerkey1',     label = 'Key',              weight = 100, type = 'item', image = 'key.png',    unique = true, useable = true, shouldClose = true, combinable = nil, description = '' },
      registerkey2                 = { name = 'registerkey2',     label = 'Key',              weight = 100, type = 'item', image = 'key.png',    unique = true, useable = true, shouldClose = true, combinable = nil, description = '' },
      srecuritycard                = { name = 'srecuritycard',     label = 'Security Card',   weight = 100, type = 'item', image = 'srecuritycard.png',    unique = true, useable = true, shouldClose = true, combinable = nil, description = '' },
  ```
* If you are using qb-shops and want to animate the Default NPC handsup, then add this to qb-shops/client/client.lua :

```lua
local function loadAnimDict(dict)
    while (not HasAnimDictLoaded(dict)) do
        RequestAnimDict(dict)
        Wait(5)
    end
end

RegisterNetEvent("zat-storerobbery:client:ToggleNPCAnim", function()
    local animDict = "missminuteman_1ig_2"
    local anim = "handsup_base"
    loadAnimDict("missminuteman_1ig_2")
    for k, v in pairs(Config.Locations) do
        if #(GetEntityCoords(PlayerPedId())-vector3(v["coords"].x, v["coords"].y, v["coords"].z)) <= 20.0 then
            if IsEntityPlayingAnim(ShopPed[k], animDict, anim, 3) then
                ClearPedTasks(ShopPed[k])
                TaskStartScenarioInPlace(ShopPed[k], v["scenario"], 0, true)
            else
                ClearPedTasks(ShopPed[k])
                TaskPlayAnim(ShopPed[k], animDict, anim, 8.0, 8.0, -1, 50, 0, false, false, false)
            end
        end
    end
end)
```

* If you want the alarm sound and sound effects :&#x20;
  * Download [interact-sound](https://github.com/plunkettscott/interact-sound) from Github.
  * Addthe .ogg files inside \[sounds] into interact-sound\client\html\sounds.
* &#x20;Add this to your inventory js :&#x20;

```html
else if (itemData.name == "srecuritycard") {
    $(".item-info-title").html("<p>" + itemData.label + "</p>"); 
    $(".item-info-description").html("<p> Code: " + itemData.info.code + "</p>");   
}
```

* Doorlocks :&#x20;
  * &#x20;QB : add the doorlock.lua  into qb-doorlock\configs
  * &#x20;OX : add the SQL into ox\_doorlock TABLE&#x20;

    &#x20;IMPORTANT : Change the IDs to avoid duplicated door IDS
* Ensure zat-storerobbery.
* If you are using GABZ 247Mlo then :&#x20;
  * ensure zat - ltddoors
* If you are using FM SUPERMARKET Mlo then :&#x20;
  * ensure zat-mfsupermaketdoors
  * zat-ltddoors
* If you are not using any Mlo then :
  * ensure zat - ltddoors
  * ensure zat-247doors


---

# 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://zat-scripts.gitbook.io/zat-scripts/qbcore/store-robbery/installation.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.
