# Hooks

Yeah, there aren't a lot of hooks. If you need more hooks, then feel free to create a ticket on [gmodstore](https://www.gmodstore.com/market/view/retro-s-screengrabber-easily-capture-your-players-screen).

## RSC.OnCaptureStarted

```rust
RSC.OnCaptureStarted( request: CaptureRequest )
```

Called when a new [capture request](https://pika-soft.gitbook.io/rsc/api/classes/capturerequest) has successfully started.

```lua
-- Example of using RSC.OnCaptureStarted
hook.Add("RSC.OnCaptureStarted", "LogEveryCapture", function(request)
    local receiver = request:GetReceivers()[1]:GetName() or "SERVER"
    local victim = request:GetVictim():GetName()
    print(("%s started capture of %s"):format(receiver, victim))
end)
```

## RSC.OnConfigUpdated

```rust
RSC.OnConfigUpdated()
```

Called when `rsc/config.lua` updated or (on clientside) it called when client receives config from a server in runtime.

```lua
-- Example of using RSC.OnConfigUpdated
hook.Add("RSC.OnConfigUpdated", "GetServerLanguage", function()
    print("Current server language:", RSC.Config.DefaultLanguage)
end)
```
