> For the complete documentation index, see [llms.txt](https://xcore.gitbook.io/xcore-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xcore.gitbook.io/xcore-docs/multijob/exports/server.md).

# SERVER

Exported functions can be called from other server-side scripts using `exports.xcore_multijob:<functionName>(...)`.

#### 1. Add a job to a character

```lua
exports.xcore_multijob:AddJob(charid, playername, jobname, jobgrade)
-- Adds a job to the character (charid) with the specified name and grade.
```

#### 2. Remove a job from a character

```lua
exports.xcore_multijob:DelJob(charid, jobname)
-- Removes a job from the character (charid) by job name.
```

#### 3. Get the number of jobs for a character

```lua
local count = exports.xcore_multijob:CountJobs(charid)
-- Returns the number of saved jobs for the character (charid).
```

#### 4. Get all jobs for a character

```lua
local jobs = exports.xcore_multijob:GetCharJobs(charid)
-- Returns a table of all jobs for the character (charid).
```

#### 5. Get all jobs (job grades)

```lua
local jobs = exports.xcore_multijob:GetJobs()
-- Returns a table of all jobs and their grades.
```

#### 6. Get all organizations (jobs)

```lua
local orgs = exports.xcore_multijob:GetJobsOrg()
-- Returns a table of all organizations.
```

#### 7. Check if a job exists for a character

```lua
local exists = exports.xcore_multijob:DoesJobExist(charid, jobname, jobgrade)
-- Returns true/false if the character (charid) has the specific job and grade saved.
```

#### 8. Add or update job slots for a player

```lua
exports.xcore_multijob:AddOrUpdateSlots(license, slots)
-- Adds or updates the number of slots for a player by license.
```

#### 9. Get job slots for a player

```lua
local slots = exports.xcore_multijob:GetSlots(license)
-- Returns the number of slots for a player by license.
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://xcore.gitbook.io/xcore-docs/multijob/exports/server.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
