esx_documents converted for QBCore. Special Thanks to https://github.com/apoiat/ESX_Documents for creating the resource / script. All Rights reserved to him! I do not give any support for that! Change translations in client and server file
Introducing Documents, a great roleplaying addition script for fivem servers using the qbcore framework. This script provides creation, signing, copying and displaying of documents to enrich players' roleplaying experience. Basically you have two type of documents:
-
Public documents
- Affirmation form
- Witness testimony
- Vehicle convey statement
- Debt statement towards citizen
- Debt clearance decleration
These are accessible by everyone and are mostly documents required by services or other jobs to be filled and signed by you for some purpose.
-
Job specific documents
- [police] Special parking permit
- [police] Gun permit
- [police] Clean citizen criminal record
- [ambulance] Medical report - pathology
- [ambulance] Medical report - psychology
- [ambulance] Medical report - eye specialist
- [ambulance] Marijuana use permit
- [avocat - lawyer] Legal services contract
These are documents available only to assigned jobs and consist of documents that need to be filled and signed by people working that specific job. Examples are licenses, reports, permits
The following document functions are available
- Create
- Sign
- Show
- Give Copy
- Delete
- Public documents
- Job specific documents
- Custom documents creation
- Localization (en)
- QBCore framework
Important note: Make sure your resource folder name is os-documents. Anything else will make the script malfunction.
Download https://github.com/BobyTheDev/os-documents
Rename folder to os-documents
Put it in the [standalone] or [qb]
directory
Import qb_documentss.sql
in your database
Add this in your server.cfg :
start os-documents
Unless specified otherwise (in the config file) the hotkey assigned for the documents menu is "DEL". Releasing it will open up the main menu. From there you can chose to access publicly available documents, job-specific documents or your saved documents. The menu is pretty straightforward. This script comes with some common premade forms for you but if you want to create your own check out the following section.
Each document is assigned to a specific category. This category can be public for everyone or a job name to be accessible only by citizens in that specific job. Each document consists of a headerTitle, headerSubtitle and elements. headerTitle and headerSubtitle are self explanatory. Elements are the fields which a user fills in, in a document. An element, so far, can either be input or textarea. Each element has the following properties:
- can_be_empty : true/false which means a user can submit the form without filling that specific element
- can_be_edited : true/false which means a user can edit this element's content. Usefull for documents with static values.
So let's see an example. Let's say we want to create a witness testimony document. This can be filled by anyone so we put it in the public section. Also we want the citizen to fill in the date of occurence and his testimony. Hence we have: