> For the complete documentation index, see [llms.txt](https://wert-dev.gitbook.io/wert-dev-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wert-dev.gitbook.io/wert-dev-docs/products/qbox/wert-blackmarket-phone.md).

# Wert Blackmarket Phone

## <mark style="background-color:orange;">INSTALLATION</mark>

1 - Upload the script folder to the location of your resources

2 - Don't forget to check that your target system and polyzone script are working

3 - Do not forget to add all the sql files contained in the folder to your database

4 - Don't forget to add the item code found below to your item list

5 - Please add wertblackmarket metadata row in your qbx\_core/server/player.lua For example photo (For the level system)

```lua
playerData.metadata.wertblackmarketlevel = playerData.metadata.wertblackmarketlevel or 0
```

\
![](/files/yhJNi0FVTCPSjOkJJzxu)

6 - **Installation successful, have a good funs**

## <mark style="background-color:purple;">ITEM</mark>

( If u use ox\_inventory please convert ox\_inventory item format )

````lua
```lua
["blackmarket_phone"] = {
		["name"] = "blackmarket_phone",
		["label"] = "Blackmarket Phone",
		["weight"] = 0,
		["type"] = "item",
		["image"] = "blackmarket_phone.png",
		["unique"] = true,
		["useable"] = true,
		["shouldClose"] = true,
		["combinable"] = nil,
		["description"] = "A Phone"
	},
```
````

<figure><img src="/files/VN5hYEk9ia4kEeq7MBZW" alt=""><figcaption><p>ITEM IMAGE IF YOU WANT USE ANOTHER IMAGE</p></figcaption></figure>

&#x20;

## <mark style="color:blue;">LEVEL MAIL TRIGGER</mark>

If you are going to send the email to grant a level, you can use this code.

```lua
-- Level mail example
-- Client side
TriggerServerEvent('wert-blackmarket:server:level-mail')

-- If you want create a addon code for the add level
-- Server side code
RegisterNetEvent('exampleaddlevelwertblackmarket', function()
    local src = source
    local ply = QBCore.Functions.GetPlayer(src)
    if not ply then return end
    ply.Functions.SetMetaData("wertblackmarketlevel", 100) -- 100 Example level if you want change your think
end)
```

## <mark style="color:green;background-color:yellow;">CLIENT EXPORTS</mark>

```lua
-- Checked phone open state (boolean)
local blackmarketphoneopenstate = exports['wert-blackmarket']:PhoneOpen()
if blackmarketphoneopenstate then
    -- return : true
    print("Phone open")
else
    -- return : false
    print("Phone close")
end
```

```lua
-- Get illegal doctors table
local illegaldoctors = exports['wert-blackmarket']:illegaldoctors()
for k,v in pairs(illegaldoctors) do
    if v then
        local id = k
        local doctornpc = v.npc
        local level = v.seviye
        print(id, doctornpc, level)
    end
end
```

## <mark style="color:green;background-color:yellow;">SERVER EXPORTS</mark>

```lua
-- All accounts datas
local allusers = exports['wert-blackmarket']:GetAllAccounts()
for k,v in pairs(allusers) do
    if v then
        local output = {
            citizenid = v.citizenid,
            password = v.password,
            accountid = v.accountid,
            mail = v.mail
        }
    end
end
```

```lua
-- All accounts wallet data
local allwallets = exports['wert-blackmarket']:GetAllWalletData()
for k,v in pairs(allwallets) do
    if v then
        local output = {
            accountid = k,
            money = tonumber(v.money),
            history = v.history
        }
    end
end
```

```lua
-- Find player citizenid from accountid
local targetcitizenid = exports['wert-blackmarket']:FindPhoneAccountByCitizenid(accountid)
if targetcitizenid  then
    print(targetcitizenid) -- Citizenid 
end
```

```lua
-- Get target accountid money
local accountmoney = exports['wert-blackmarket']:GetAccountMoney(accountid)
if accountmoney then
    print(accountmoney) -- Accountmoney
end
```

```lua
-- Add money target accountid
exports['wert-blackmarket']:AddMoneyFromAccount(accountid, addmoney, addhistory)
```

```lua
-- Remove money target accountid
exports['wert-blackmarket']:RemoveMoneyFromAccount(accountid, removemoney, addhistory)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://wert-dev.gitbook.io/wert-dev-docs/products/qbox/wert-blackmarket-phone.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
