# User

### On user connect

This event is **triggered** when a user is connecting to the server.&#x20;

{% tabs %}
{% tab title="playerID" %}
The server id of the user who is connecting to the server.
{% endtab %}

{% tab title="playerLicense" %}
The **r\*** license of the user who is connecting.
{% endtab %}

{% tab title="playerRank" %}
The rank of the user who is connecting.
{% endtab %}

{% tab title="isPlayerNew" %}
A **bool** of is it the first time the player is connecting to this server?
{% endtab %}
{% endtabs %}

```lua
AddEventHandler('__WOSA:SERVER:USER_CONNECTING', function(playerID, playerLicense, playerRank, isPlayerNew)

end)
```

### On user leave

This event is **triggered** when a user is leaving the server.

{% tabs %}
{% tab title="playerID" %}
The server id of the user who is connecting to the server.
{% endtab %}

{% tab title="playerLicense" %}
The **r\*** license of the user who is connecting.
{% endtab %}

{% tab title="playerRank" %}
The rank of the user who is connecting.
{% endtab %}

{% tab title="leaveReason" %}
The reason why the user left, by the system.
{% endtab %}
{% endtabs %}

```lua
AddEventHandler('__WOSA:SERVER:USER_LEAVING', function(playerID, playerLicense, playerRank, leaveReason)

end)
```
