# How to use

### 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gcmoddoc.gitbook.io/gcmod/resources/vip-system/how-to-use.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
