# Functions

### client/custom/functions/alerts.lua

```lua
---Sends an alert to the police (usually used for dispatches)
---@param coords vector3|vector4
---@param data table
function SendAlertToPolice(coords, data)

end
```

### client/custom/functions/open.lua

```lua
function CanOpenMenu()
    local ped = PlayerPedId()

    -- your custom functions to open menu (coma status/handcuff/is in any vehicle etc)
    if IsPedInAnyVehicle(ped, true) then
        return false
    end

    return true
end
```

### server/custom/functions/open.lua

```lua
---Is the player allowed to open the menu?
---@param identifier string|number
---@return boolean allowed
function canOpenMenu(identifier)
    if identifier then
        -- you can implement your custom code here (such as coma status, handcuffs, etc.)
        return true
    end

    return false
end
```

### server/custom/functions/rewards.lua

```lua
---Gives the rewards to a player after succeeding a mission
---@param identifier string|number
---@param money number
function GiveMissionRewards(identifier, money)
    local source = Framework.GetSourceFromIdentifier(identifier)
    Framework.AddMoney(identifier, money, 'Mission-Reward')
    Notify(
        source,
        Lang.notify['receive_money_from_mission'].message:format(money),
        Lang.notify['receive_money_from_mission'].type
    )
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://docs.redutzu.com/resources/gang-activities/guides/functions.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.
