> For the complete documentation index, see [llms.txt](https://docs.vames-store.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vames-store.com/outdated/vms_documents/guides/adding-new-documents.md).

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