# sv\_utils

## Notify

```lua
function SQ_Notify(src, msg)
    -- Default: ESX (client event)
    TriggerClientEvent("squizzy-carrent:clientNotify", src, msg)

    -- ox_lib (server-side):
    -- TriggerClientEvent("ox_lib:notify", src, { description = msg, type = "inform", duration = 4000 })

    -- QB-Core:
    -- TriggerClientEvent("QBCore:Notify", src, msg, "primary", 4000)
end
```

## Money check

```lua
function SQ_HasMoney(xPlayer, amount, paymentType)
    -- Default: ESX
    if paymentType == "bank" then
        return xPlayer.getAccount("bank").money >= amount
    else
        return xPlayer.getMoney() >= amount
    end

    -- QB-Core:
    --[[
    local Player = QBCore.Functions.GetPlayer(xPlayer.source)
    if paymentType == "bank" then
        return Player.PlayerData.money["bank"] >= amount
    else
        return Player.PlayerData.money["cash"] >= amount
    end
    ]]
end
```

## Money Removal

```lua
function SQ_RemoveMoney(xPlayer, amount, paymentType)
    -- Default: ESX
    if paymentType == "bank" then
        xPlayer.removeAccountMoney("bank", amount)
    else
        xPlayer.removeMoney(amount)
    end

    -- QB-Core:
    --[[
    local Player = QBCore.Functions.GetPlayer(xPlayer.source)
    if paymentType == "bank" then
        Player.Functions.RemoveMoney("bank", amount)
    else
        Player.Functions.RemoveMoney("cash", amount)
    end
    ]]
end
```


---

# 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://varixcode.gitbook.io/varixcode/varixcode-series/vlrixcode-carrent/exports-and-events/sv_utils.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.
