# Installation

Requirements

* oxmysql - <https://github.com/overextended/oxmysql>
* ox\_lib -  <https://github.com/overextended/ox_lib>
* ox\_target - <https://github.com/overextended/ox_target>

## Database

```sql
CREATE TABLE `g_duty` (
	`identifier` VARCHAR(46) NOT NULL COLLATE 'utf8mb4_general_ci',
	`job` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`player_name` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`last_duty` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`total_duty_time` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
	`grade_name` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci'
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;
```

#### How to Create offduty / onduty jobs / grades example

```sql
-- Jobs Table
-- Format: (job_name, label, whitelisted)
-- job_name: Unique identifier for the job.
-- label: Display name for the job.
-- whitelisted: 0 for non-whitelisted, 1 for whitelisted (restricted access).
INSERT INTO `jobs` (`name`, `label`, `whitelisted`) VALUES
	-- job 1 
	('offpolice', 'Off Duty Police', 0),
	('police', 'LSPD', 0),
	-- job 2 
	('offambulance', 'Off Duty Doctor', 0),
	('ambulance', 'LSMD', 0),



-- Job Grades Table
-- Each job_name should have a corresponding off-duty version (e.g., 'police' and 'offpolice').
-- Format: (id, job_name, grade, name, label, salary, skin_male, skin_female)
-- id: Unique identifier for each grade entry.
-- job_name: The name of the job associated with this grade.
-- grade: The rank level within the job (e.g., 0, 1, 2).
-- name: Internal identifier for the grade.
-- label: Display name for the grade.
-- salary: The salary for the grade level.
-- skin_male, skin_female: JSON objects defining male and female skins for the grade (use '{}' if not defined).
INSERT INTO `job_grades` (`id`, `job_name`, `grade`, `name`, `label`, `salary`, `skin_male`, `skin_female`) VALUES
	-- grade 1
	(1, 'police', 3, 'advance', 'Advance', 1000, '{}', '{}'),
	(2, 'offpolice', 3, 'advanced', 'Advance OFF DUTY', 20, '{}', '{}'),
	-- grade 2
	(3, 'police', 2, 'constable', 'Constable', 0, '{}', '{}'),
	(4, 'offpolice', 2, 'constable', 'Constable OFF DUTY', 10, '{}', '{}'),
	

```


---

# 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-duty/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.
