# Server-Side Events

## fg:BanHandler

{% code overflow="wrap" %}

```
fg:BanHandler(BanId: number, data: object, additional_info: string, screenshot_url: string)
```

{% endcode %}

### Example Of Code

{% code overflow="wrap" %}

```lua
AddEventHandler("fg:BanHandler", function(BanId, data, additional_info, screenshot_url)
    print("Player Banned (".. data.name .."), BanId (".. tostring(BanId) .."), Reason: ".. data.reason) 
end)
```

{% endcode %}

## fg:NewUpdate

{% code overflow="wrap" %}

```
fg:NewUpdate(OldVersion: string, NewVersion: string)
```

{% endcode %}

### Example Of Code

```lua
AddEventHandler("fg:NewUpdate", function(OldVersion, NewVersion)
    print("[fiveguard] Fiveguard New Update, version: "..NewVersion)
    -- code to restart fiveguard resource
    ExecuteCommand("refresh")
    ExecuteCommand("ensure fiveguard_script_name") 
end)
```
