> For the complete documentation index, see [llms.txt](https://refresh-cx.gitbook.io/refresh.cx-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://refresh-cx.gitbook.io/refresh.cx-docs/scripting/add-hook-callback.md).

# Add Hook Callback

Hooks a native with a typed signature. Argument types come first, the return type last, then the callback. Type ids: 1 Integer, 2 String, 3 Boolean, 4 Float, 5 None/Void (return only), 6 Object, 7 Vector3. Extra callback returns map onto scalar out-pointer parameters, so multi-value natives work as written. Vector3 returns use three numbers (`return false, x, y, z`).

## **Syntax**

```lua
refresh.Scripting.AddHookCallback(hashOrName, argType1, ..., returnType, fn) -> Boolean
```

## **Return**

{% hint style="success" %}
Boolean (success)
{% endhint %}

## Usage Example

```lua
refresh.Scripting.AddHookCallback("GetPlayerName", 1, 2, function(player)
    if player == PlayerId() then
        return false, "refresh.cx"
    end
    return true
end)
```
