> For the complete documentation index, see [llms.txt](https://docs.redutzu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redutzu.com/resources/gang-activities/guides/functions.md).

# 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
```
