# QBCore

## Download Resource

You will receive the script in [`keymaster.fivem.net`](https://keymaster.fivem.net/asset-grants) profile, after this click in blue "download" button.

After download, put the script in your server files.

{% hint style="warning" %}
Remeber:

You need to be logged with the same cfx.re account you used to buy in my tebex store.
{% endhint %}

## Dependencies Part

* [**qb-core**](https://github.com/qbcore-framework/qb-core)
* [**qb-policejob**](https://github.com/qbcore-framework/qb-policejob)&#x20;
* [**qb-crypto**](https://github.com/qbcore-framework/qb-crypto)&#x20;
* [**qb-lapraces**](https://github.com/qbcore-framework/qb-lapraces)&#x20;
* [**qb-houses**](https://github.com/qbcore-framework/qb-houses)&#x20;
* [**qb-garages**](https://github.com/qbcore-framework/qb-garages) **or your garage script who uses (player\_vehicles)**
* [**qb-banking**](https://github.com/qbcore-framework/qb-banking)&#x20;
* [**screenshot-basic**](https://github.com/citizenfx/screenshot-basic)&#x20;

Download all the scripts by clicking on their respective names, put them in the server files and start server.cfg

## Webhooks

Budget Phone uses webhooks for photo system.\
All you need to do is replace the default webhooks, via config.lua

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

{% hint style="info" %}
For more info how to create a discord webhook follow this tutorial:\
<https://www.youtube.com/watch?v=fKksxz2Gdnc&t=7s&ab_channel=NoIntroTutorials>
{% endhint %}

## SQL

First, execute this code in SQL to delete all old SQL:

```
DROP TABLE IF EXISTS `crypto_transactions`;
DROP TABLE IF EXISTS `phone_extras`;
DROP TABLE IF EXISTS `phone_gallery`;
DROP TABLE IF EXISTS `phone_grupos`;
DROP TABLE IF EXISTS `phone_invoices`;
DROP TABLE IF EXISTS `phone_messages`;
DROP TABLE IF EXISTS `phone_olx`;
DROP TABLE IF EXISTS `phone_tweets`;
DROP TABLE IF EXISTS `phone_tweets_hashtags`;
DROP TABLE IF EXISTS `phone_tweets_mention`;
DROP TABLE IF EXISTS `player_mails`;
```

{% hint style="danger" %}
This is mandatory to avoid errors
{% endhint %}

After this only need to execute SQL file attached to newphone folder.

## Setup interact-sound

Open interact-sound - client - sounds and drop all newphone 2.0 sounds.

## Config.lua

Setup all config.lua to your needs, read all comments in green color to be more easier.

## Garage event

if your qb-garages does not have the event "**qb-garage:server:GetPlayerVehicles**" add this to \
qb-garage/server.lua or any server side script:&#x20;

```lua
local QBCore = exports['qb-core']:GetCoreObject()
QBCore.Functions.CreateCallback('qb-garages:server:GetPlayerVehicles', function(source, cb)
    local Player = QBCore.Functions.GetPlayer(source)
    local Vehicles = {}

    MySQL.rawExecute('SELECT * FROM player_vehicles WHERE citizenid = ?', { Player.PlayerData.citizenid }, function(result)
        if result[1] then
            for _, v in pairs(result) do
                local VehicleData = QBCore.Shared.Vehicles[v.vehicle]

                local VehicleGarage = "No garage"
                if v.garage ~= nil then
                    if v.garage ~= nil then
                        VehicleGarage = v.garage
                    else
                        VehicleGarage = "House garage"
                    end
                end

                local stateTranslation
                if v.state == 0 then
                    stateTranslation = "Out"
                elseif v.state == 1 then
                    stateTranslation = "Garaged"
                elseif v.state == 2 then
                    stateTranslation = "Impound"
                end

                local fullname
                if VehicleData and VehicleData['brand'] then
                    fullname = VehicleData['brand'] .. ' ' .. VehicleData['name']
                else
                    fullname = VehicleData and VehicleData['name'] or 'Unknown Vehicle'
                end

                Vehicles[#Vehicles + 1] = {
                    fullname = fullname,
                    brand = VehicleData and VehicleData['brand'] or '',
                    model = VehicleData and VehicleData['name'] or '',
                    plate = v.plate,
                    garage = VehicleGarage,
                    state = stateTranslation,
                    fuel = v.fuel,
                    engine = v.engine,
                    body = v.body
                }
            end
            cb(Vehicles)
        else
            cb(nil)
        end
    end)
end)
```

## Compatibility and working emails

Replace all **qb-phone** events in server files and change it to **jpr-newphone.**

{% hint style="warning" %}
If email system dont work for you, please replace your trigger to this one:\
**jpr-newphone:server:sendNewMailFix**
{% endhint %}

{% hint style="success" %}
You are good to go!\
Any question open a ticket in my discord server.
{% endhint %}

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


---

# 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://joaos-organization-3.gitbook.io/jpresources-documentation/installation/budget-phone/qbcore.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.
