Creating new document
This section will show you step-by-step how to properly register a new document.
Taking advantage of these steps will ensure that your document is prepared as expected.
1. Create your document theme
Open PSD file: Launch Adobe Photoshop and open the
id_card.psd
file, or if you don't have the aforementioned program, use the one you have and import an already finished file, such asid_card.png
or use an already created document background, in which case go to 2. Document registration.Customize content: You can change the colors or modify the entire layout.
Save Changes: After editing, save the document background in PNG format for use in the script.
Upload png: Upload your new .png file to vms_documentsv2/html/images/
2. Document registration
To ensure the document is functional, you need to register it in config.lua
. Let's create a weapon license document as an example. This license will contain information fields such as the individual's first name, last name, and height. To achieve this, open the config.lua
file and locate Config.Documents
. Then, create a new document object with the relevant details.
Open config.lua: This file holds configurations for documents and makes them useable.
Create a New Document: Inside
Config.Documents
, add a unique entry using the template provided. For example:
Adjust all parameters for the document and create an item in your inventory.
3. Introduction of new player data information
SV.getDocumentsData
obtains information from the data
you have implemented in the section of the Create a New Document enter new parameters if any have been added.
As a reminder what the current data
looks like from the added weapon_license
:
For this document we need firstName
, lastName
, ssn
and height
.
Open config.server.lua: Find
SV.getDocumentsData
in your config.server.luaFind missing values: For this you need to check what data is missing that we need from the
data
, we are looking forfirstName
, if there isfirstName
, we do not need to enter anything, the same withlastName
,ssn
, if there is noheight
for example, you should enter it.
After entering the new information in SV.getDocumentsData
, we need to enter it in SV.getPlayerData
as well, since that's what the function references.
4. Introduction of new player licenses information
SV.getDocumentsLicense
obtains information from the licenses
you have implemented in the section Create a New Document enter new parameters if any have been added.
As a reminder of what the current licenses
look like from the added weapon_license
:
For this document we need a weapon
.
Open config.server.lua: Find
SV.getDocumentsLicense
in your config.server.luaFind missing values: For this you need to check what licenses are missing, which we need from licenses, we are looking for
weapon
, if there is one, we do not need to enter anything, but if there is noweapon
license, you need to enter it.
5. Customizing the displayed data
What is metadata.js and how to understand it?
Metadata in vms_documentsV2 is divided into 4 types: data
, data2
, signature
and document_name
.
data
: document content - information displayed.
data2
: badge second content next to photo
signature
: Handwrite font signature visible on the document.
document_name
: Document name displayed at the top of the document.
Open metadata.js
Register a new document: You need to enter the data to be displayed on the document
6. Result
Last updated