> For the complete documentation index, see [llms.txt](https://libertycode.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://libertycode.gitbook.io/docs/lc_adminmenu/player-functions.md).

# Player functions

If you are a developer, you can add custom player functions to our admin menu. You can do that in `bridge/[your framework]/player_actions/actions_list.lua` file.

### Example

<div align="left"><figure><img src="/files/cIT56JtLf7peOApTOWKc" alt="" width="375"><figcaption></figcaption></figure></div>

{% code title="bridge/\[your framework]/player\_actions/actions\_list.lua" %}

```lua
---@class PlayerAction
---@field label string
---@field permission? string
---@field args? PlayerActionArgument[]
---@field onClick fun(player, args)

---@class PlayerActionArgument
---@field label? string
---@field placeholder? string Only for "text" inputs
---@field type 'text' | 'number' | 'range'
---@field value? string | number You can set default value
---@field min? number
---@field max? number
---@field step? number Only for "range" inputs

---@type PlayerAction[]
return {
  ...,
  {
    label = 'Give Item',
    permission = 'give_item',
    args = {
      {
        label = 'Item name',
        placeholder = 'bread',
        type = 'text'
      },
      {
        label = 'Amount',
        type = 'range',
        value = 1,
        min = 1,
        max = 250
      }
    },
    onClick = function(player, args)
      --[[
        args[1] - Item name
        args[2] - Amount
      ]]
    
      if #args[1] == 0 then
        return false, 'Invalid item name'
      end

      local attempt_give_item = lib.callback.await('lc_admin:player_actions:esx:attemptGiveItem', 100, player.source, args[1], args[2])
      if not attempt_give_item then
        return false, 'Invalid item name'
      end

      return true
    end
  },
  {
    label = 'Custom action',
    onClick = function(player)
      print(json.encode(player, {indent=true}))
      TriggerServerEvent('example:customAction', player)
    end
  }
}
```

{% endcode %}
