> For the complete documentation index, see [llms.txt](https://gcmoddoc.gitbook.io/gcmod/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gcmoddoc.gitbook.io/gcmod/resources/vip-system/how-to-use.md).

# How to use

On this page, we will explain how you should use the resource.

### Default commands

/vipmenu: Open vip menu (Configurable in Config.lua).

/code: Redeem a code (Configurable in Config.lua).

### Deployment to other resources

To stretch the VIP data of a user we can do it using the following exports:

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

```lua
local vip = exports['gcm_vips']:getVip()

print(vip)
-- This returns false if the user does not have an active VIP and if they do, it returns the name of the VIP EJ: vip_diamond.
```

{% endtab %}

{% tab title="Server Side" %}

```lua
local vip = exports['gcm_vips']:getVip(source) -- The only difference with the client is that in this we need to pass the user ID.

print(vip)
-- This returns false if the user does not have an active VIP and if they do, it returns the name of the VIP EJ: vip_diamond
```

{% endtab %}
{% endtabs %}

If you need help on how to use this data in your resources, do not hesitate to request support.

### Export to give vip status

This export returns true if the VIP was delivered and false if the user has an active VIP.

```lua
-- If you need the vip to be lifetime, put the days in 0
exports['gcm_vips']:giveVipUser(src, vip_type, days)
```

Example use

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

```lua
if exports['gcm_vips']:giveVipUser(src, vip_type, days) then
    -- The vip has delivered or edited successfully
else
    -- The user have a diferent vip an not have been delivered
end
```

{% endtab %}
{% endtabs %}

### Export to get days remaining

Return the days remaining of a vip, if is lifetime return 'lifetime' or false if not vip

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

```lua
local days = exports['gcm_vips']:getDaysRemaining(src)
```

{% endtab %}
{% endtabs %}
