# Installation

1. Download the purchased resource from [keymaster](https://keymaster.fivem.net/asset-grants) - the official site of fivem with purchased resources.
2. Unzip the  `g-redeem-code`
3. Create a Folder - In your resources directory, create a new folder and name it `[g-scripts]`if it has not already been created.
4. Drag `g-redeem-code` in to `[g-scripts]`

## Arrangement

Add this line in your <mark style="color:red;">server.cfg</mark> file

```
ensure [g-scripts]
```

#### Add this line into your <mark style="color:red;">server.cfg</mark>

This line determines who can access the main panel to manage, create, or send redeem codes.

```properties
add_ace group.admin createredeem.openmenu allow
```

## Database Sql

{% tabs %}
{% tab title="g\_redeem\_code" %}

```sql
CREATE TABLE `g_redeem_code` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`redeem_code` VARCHAR(255) NOT NULL COLLATE 'utf8mb4_general_ci',
	`createdBy` VARCHAR(255) NOT NULL COLLATE 'utf8mb4_general_ci',
	`createdAt` DATETIME NOT NULL DEFAULT current_timestamp(),
	`updatedAt` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(),
	`expiryDate` DATETIME NULL DEFAULT NULL,
	`creatorIdentifier` VARCHAR(255) NOT NULL COLLATE 'utf8mb4_general_ci',
	`usage_limit` INT(11) NULL DEFAULT NULL,
	`remainingUses` INT(11) NULL DEFAULT '0',
	`expired` TINYINT(1) NULL DEFAULT '0',
	`enable` TINYINT(1) NULL DEFAULT '1',
	`claimed_redeem` TINYINT(1) NULL DEFAULT '0',
	`items` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb4_bin',
	`type` VARCHAR(50) NULL DEFAULT 'redeem' COLLATE 'utf8mb4_general_ci',
	`receiver_identifier` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`receiver_name` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	PRIMARY KEY (`id`) USING BTREE,
	UNIQUE INDEX `redeem_code` (`redeem_code`) USING BTREE,
	CONSTRAINT `items` CHECK (json_valid(`items`))
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1
;

```

{% endtab %}

{% tab title="g\_redeem\_log" %}

```sql
CREATE TABLE `g_redeem_log` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`identifier` VARCHAR(46) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`redeem_code` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`name` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1
;

```

{% 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://grootdev.gitbook.io/groot-development/assets/g-redeem-code/installation.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.
