Giter Site home page Giter Site logo

kac5a / k5_documents Goto Github PK

View Code? Open in Web Editor NEW
73.0 9.0 40.0 4.79 MB

A FiveM script that let's your players manage personal and official documents.

Home Page: https://discord.gg/WmANgpdrgZ

Lua 21.66% JavaScript 8.53% HTML 1.91% TypeScript 67.82% CSS 0.08%
esx esx-legacy fivem qb-core

k5_documents's Introduction

K5 Documents

K5 Skillcheck

This is a FREE and open Fivem script that lets you and your players create and give out official documents to other players based on their job and rank.

❗❗❗ This script used Project Error's fivem-react-boilerplate-lua project to create the UI. Huge thanks for them, and please check out their other projects on Project Error Discord. ❗❗❗

Demo

Watch the demo here: YouTube

Help

If you need any help, you can check out my Discord

Download & Installation

Using Git

cd resources

git clone https://github.com/kac5a/k5_documents.git [scripts]/k5_documents

Manually

Installation

  • Run the included k5_documents.sql file on your database

  • Add this in your server.cfg:

ensure k5_documents

Config

There are two config files that you have to check. The first one is in the root folder called config.lua. This file contains some translatable texts that show up in the ESX UI.

The other one is located in web/build/config.js This JavaScript file contains most of the configuration that you need. In the AVAILABLE_JOBS array you have to define the jobs names (storen in your database) that can access the Issued Documents, and Document Templates section.

Only specified grades can access and edit the templates, that is shown in the demo video. These grades can be configurated in the same config.js file.

You can also change colors and texts if you scroll down in the config.

Document logo

You have the ability to add custom logos for documents created by different jobs. You can use a link, or a local file aswell. It is recommended to use local files, so the loading time is minimal for these images. Be sure to format the logo properly:

{
    job: 'mechanic',
    templateGrades: [4],
    logo: '/web/build/mechaniclogo.jpg',
}

Add your local files in the web/build/ folder.

Citizen Documents

These documents are available for everyone without a job restriction. You can edit these templates in the web/build/config.js file like this:

{
    const CITIZEN_TEMPLATES = [
      {
        id: 'citizen_contract',
        documentName: 'My Citizen Contract',
        documnetDescription:
          'This is a document for everyone to use.',
        fields: [
          {
            name: 'Firstname',
            value: '',
          },
          {
            name: 'Lastname',
            value: '',
          },
          {
            name: 'Valid Until',
            value: '',
          },
        ],
        infoName: 'INFORMATION',
        infoTemplate: '',
      },
      {
        id: 'fun_document',
        documentName: 'Totally valid legal document',
        documnetDescription:
          'This is definetly a real document, for real. Like, just look at it',
        fields: [
          {
            name: 'Firstname',
            value: '',
          },
          {
            name: 'Lastname',
            value: '',
          },
          {
            name: 'Valid Until',
            value: '',
          },
        ],
        infoName: 'INFORMATION',
        infoTemplate: 'So this guy is basically robbed me. Arrest him!!!',
      },
    ]
}

Server side document creation

You can call the k5_documents:createServerDocument server event with a single data parameter. This will create a copy to the specified document and give it to the players "My Documents" table.

Example to add a vehicle purchase document:

TriggerServerEvent('k5_documents:createServerDocument', {
    name = "Vehicle Purchase Document",
    description = "This is an official purchase document",
    fields = {
        {
            name = "Firstname",
            value = result.firstname
        },
        {
            name = "Lastname",
            value = result.lastname
        },
        {
            name = "Vehicle Type",
            value = GetDisplayNameFromVehicleModel(GetHashKey(vehicleData.model))
        },
        {
            name = "Plate Number",
            value = generatedPlate
        }
    },
    infoName = "INFORMATION",
    infoValue = "This vehicle was purchased by ".. result.firstname .. " " .. result.lastname .. ".\nThis paper is an official document that proves the original owner of the vehicle.",
    isCopy = true ,
    issuer = {
        firstname = "Simeon",
        lastname = "Yetarian",
        birthDate = "1954. 05. 26.",
        jobName = "Dealership Owner"
    }
})

More information can be found in the server.lua file.

⚛ React

If you are a React developer, or you'd like to edit the React parts, you can do that too. Make sure you delete the current web/build folder first.

Install the node packages:

npm install

To run in developer mode:

npm run start:game

Please note, that this will not copy the config.js file from src/public, you have to manually copy it into the web/build folder

If you're done, delete the web/build folder again, and run:

npm run build

Last Words

Feel free to fork this repository and edit the script as much as you'd like. This script is free to use and share. If you find anyone selling this for money, please contact me.

k5_documents's People

Contributors

kac5a avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

k5_documents's Issues

Undefined

When I click the "issued documents" something pop up on f8 is says
Script : k5_documents : nui undefined (@k5_documents/web/build/static/js/main.cf5684f4.js :2)
Script : k5_documents : nui true (@k5_documents/web/build/static/js/main.cf5684f4.js :2)
how can i fix it :(

Turn documents into separate items

I think it would be really great if all documents had an item created for them,
this would make the overall roleplay experience better and more realistic.
I also believe this would make working with documents simpler and it would also bring more possibilities,
such as being able to lose a document, give it to someone to look at, etc.

Feature Requests

Hello, loving the script and have a lot of plans for it, but I have a few requests that could send this to the next level.

Signing: I would like to have a document template that as a business owner I can send to a player for them to fill out and sign. This document is then shown in my clipboard as signed so I have a copy of it. (Example: liability waiver for a business hosting a fight night. They can have a document made to hand out to have people sign for the businesses records. This goes hand in hand with my next request)

Business Sharing: I would like documents that are filled out by a business to be viewable by the other employees (extra bonus is grade controlled for viewing)

Citizen Template Logo: I would like to be able to define a logo image in the citizen templates instead of it always using the city logo.
https://cdn.puppetzmedia.com/eA9NJuyk.png

[feature request] Document as Item

Hey, the script currently already has the option to pass on the copy of documents.

Would it therefore also be possible to make documents directly visible for all owners of a specific job?
Or is it also possible to add the possibility to create a document as an item, so that this can then be passed on to other players?

error message in the console

get an error message in the console

"ERROR: This script supports only ESX and QBCore frameworks, but none of these frameworks are present. Unfortunately, you cannot use this script."

Sorry, but there's no 1.2.2 release yet.

[ script:k5_documents] =========================================================================================================================
[ script:k5_documents] | K5 Documents                                                                                                          |
[ script:k5_documents] | New version available on GitHub: 1.2.1 -> 1.2.2                                                                       |
[ script:k5_documents] | Update: Added config to disable command                                                                               |
[ script:k5_documents] =========================================================================================================================

[feature request] Co-sign ability

Hey,

We are looking to make use of this for our servers loan business to have physical evidence of a loan agreement. However as it only allows for one signature at the moment it would not be possible for us to do this.

would it be possible for the option of requiring the second party to also be able to sign the document with their agreeing signature

[suggestion] Create NPWD app

First of all great work with this resource! And thanks for providing this for free.

A small suggestion that would be awesome: create a way to use this on the NPWD phone. As you guys already are using PE's boilerplate it could be a quick thing :)

kind regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.