# Exports and Events

## OpenCalendar

With following export you can Open Calendar

{% tabs %}
{% tab title="Client Side" %}

```lua
exports['p_adventcalendar']:OpenCalendar()

TriggerEvent('p_adventcalendar:OpenCalendar')
```

{% endtab %}
{% endtabs %}

***

## UpdateTask

You can use this export or event to update player task.

{% tabs %}
{% tab title="Client Side" %}

* day `number (It's important, task will update only if currentDay is equal to day in argument)`
* count `number`

```lua
TriggerServerEvent('p_adventcalendar:UpdateTask', day, count)
```

{% endtab %}

{% tab title="Server Side" %}

* playerId `number`
* day `number (It's important, task will update only if currentDay is equal to day in argument)`
* count `number`

```lua
exports['p_adventcalendar']:UpdateTask(playerId, day, count)
```

{% endtab %}
{% endtabs %}

### Example of Usage

{% tabs %}
{% tab title="Client Side" %}

```lua
local day = 1 -- Update task for day 1
local count = 1 -- Add 1 to current day task

TriggerServerEvent('p_adventcalendar:UpdateTask', day, count)
```

{% endtab %}

{% tab title="Second Tab" %}

```lua
local playerId = 1 -- replace with existing player id
local day = 1 -- Update task for day 1
local count = 1 -- Add 1 to current day task

exports['p_adventcalendar']:UpdateTask(playerId, day, count)
```

{% endtab %}
{% endtabs %}
