# Adding new documents

For a example we add a police badge<br>

**@vms\_documents/server/server.lua** search function **showDocument**, and we adding a new elseif

{% code title="lines :63 -> :71" %}

```lua

elseif type == "id_weapon" then
    playerInfo = {
        ['firstname'] = result[1].firstname,
        ['lastname'] = result[1].lastname,
        ['dob'] = result[1].dateofbirth,
        ['sex'] = result[1].sex,
        ['weapon'] = getLicense(src, "weapon"),
    }
elseif type == "police_badge" then -- unique of type
    playerInfo = { --here we fetch the things we want to be displayed on the document
        ['firstname'] = result[1].firstname, -- It must be because it is required in every document by JS by default
        ['lastname'] = result[1].lastname, -- It must be because it is required in every document by JS by default
        ['dob'] = result[1].dateofbirth, -- It must be because it is required in every document by JS by default
        ['sex'] = result[1].sex,
        ['grade'] = xPlayer.job.grade_label
    }
end
```

{% endcode %}

**@vms\_documents/config.lua** search a **`Config.Documents`**, and we adding a new table named by unique type from server side

```lua
Config.Documents = {
    [...]
    
    ["police_badge"] = {
        item = nil,
        color = "#d92b2b", -- https://htmlcolors.com/google-color-picker
        animation = {"random@atmrobberygen", "a_atm_mugging"}, -- if the player is to have an animation, we type {animDict, animName}
        animationTimeout = 2500, -- time of animation
        header = "POLICE BADGE", -- header on the ui of document
        icon = "local_police", -- icon on the ui of document (https://fonts.google.com/icons)
        notifyText = "You showed a badge.", -- notification to player
     },
 }

```

**@vms\_documents/html/app.js** search eventListener from **`message`**, and we adding a new if to action open

```javascript
if (data.type == "police_badge") {
    $("#info-3").html(`Sex`) // Here a name of infos
    $("#infoDescription-3").css("color", `${data.documentOptions.color}`)
    $("#infoDescription-3").html(`${data.documentInfos.sex}`)
    $("#info-4").html(`Grade name`) // Here a name of infos
    $("#infoDescription-4").css("color", `${data.documentOptions.color}`)
    $("#infoDescription-4").html(`${data.documentInfos.grade}`) // and we adding here a grade
}
```


---

# 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://docs.vames-store.com/outdated/vms_documents/guides/adding-new-documents.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.
