AP Scripts Documentation
  • AP Scripts Documentation
  • Scripts
    • AP Court
    • AP Government
    • AP Documents
    • AP AddonJob
    • AP Questionnaire
  • Recommended Phone
  • Script Snippets
  • Phone Integrations
Powered by GitBook
On this page
  • QBCore INSTALLATION
  • SUPPORTED MENU & DIALOG SCRIPTS
  • SUPPORTED INVENTORYS WITH METADATA
  • STEP BY STEP
  • SQL
  • DOCUMENT EXAMPLE
  • INVENTORY ADDITIONS
  • ESX INSTALLATION
  • SUPPORTED MENU & DIALOG SCRIPTS
  • SUPPORTED INVENTORYS WITH METADATA
  • STEP BY STEP
  • SQL
  • DOCUMENT EXAMPLE
  • INVENTORY ADDITIONS
  1. Scripts

AP Documents

Documentation & support for AP Documents.

PreviousAP GovernmentNextAP AddonJob

Last updated 1 year ago

QBCore INSTALLATION

SUPPORTED MENU & DIALOG SCRIPTS

Here are the supported scripts for the menu and dialog preconfigured for the documents script. menu.lua which is located in the client folder of the documents script is fully editable, which means you can configure it with another menu/dialog script you might use if you don't use the supported ones.

Supported Menu/Dialogs
Links
Description

QB-MENU & QB-INPUT

This normally is included in the QBCore install so check if you have before downloading.

SUPPORTED INVENTORYS WITH METADATA

Here are the supported inventories which the document script uses, you can set the inventory you use in the config file, make sure you use one of these inventories before you buy the script.

Supported Inventories
Links
Free/Paid

QB Inventory

FREE

Quasar Inventory

PAID

lj Inventory

FREE

OX Inventory

FREE

If you use an inventory which supports metadata and want it supported with the script then open a ticket in the AP Scripts discord and we will look at adding the support to it.

STEP BY STEP

  1. Extract ap-documents.zip file.

  2. Inset SQL file into your database.

  3. Setup your config file with how you want it, make sure you enable the correct inventory that you have including menu/dialog.

SQL

Please note, there is an SQL file. You will need to import it in order for the script to run. You can open the respective SQL file, copy the queries and execute/run them in your database manually (my personal preferred way) or you can import the file.

Manual SQL Entries
CREATE TABLE IF NOT EXISTS `ap_documents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `documentid` varchar(50) DEFAULT NULL,
  `identifier` varchar(100) DEFAULT NULL,
  `document` longtext DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `catergory` varchar(60) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

DOCUMENT EXAMPLE

["Subpoena"] = { -- This will be the label displayed in the creation of a document, this can include spaces.
    type = "create", -- Do not edit this.
    restriction = {job = {enable = true, jobs = { -- To enable a jobs restriction set enable to true.
      ["police"] = "all", -- Set the job name as the key and the value set to "all" for all grades to make the document.
      ["ambulance"] = {0, 4, 5}, -- With this one the value can also be grade restricted by setting the grades in the table format with a comma for each grade.
    }}, gang = {enable = false, gangs = { -- To enable a gang restriction set enable to true.
      [""] = {0}, -- Same as the jobs above.
    }}, citizenid = {enable = false, id = { -- To enable a citizenid restriction set enable to true.
      "", "", -- inside the string add the citizenid you want to restrict this too.
    }}},
    title = "", -- Title of document.
    logo = "", -- Link for logo on the top left of the document.
    from = "", -- Who the document is from.
    description = "", -- description of the document.
    disclaimer = "", -- Disclaimer of the document.
    information = {
      { id = "i1", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "i2", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "i3", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "i4", label = "", type = "text_input", placement = "", required = "true", value = "" },
    },
    -- The id has to be in multiples of e.g(i1/i2/i3/i4/i5/i6/i7/i8/i9/i10) You can't have more then 10 input boxes.
    -- The label is the label of the input box.
    -- The type can only be "text_input", text input is a small box.
    -- Placement is the text inside the input box explaining what the person needs to input.
    -- Required is whether the the person is required to fill in the input box or not, use "true" or "false".
    -- The value needs to be an empty string do not add anything in there.
    extended_information = {
      { id = "e1", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "e2", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "e3", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "e4", label = "", type = "text_area", placement = "", required = "true", value = "" },
      { id = "e5", label = "", type = "text_area", placement = "", required = "true", value = "" },
    }, 
    -- The id has to be in multiples of e.g(e1/e2/e3/e4/e5/e6/e7/e8/e9/e10) You can't have more then 10 input boxes.
    -- The label is the label of the input box.
    -- The type can be either "text_input" or "text_area", text input is a small box and text area is a bigger box.
    -- Placement is the text inside the input box explaining what the person needs to input.
    -- Required is whether the the person is required to fill in the input box or not, use "true" or "false".
    -- The value needs to be an empty string do not add anything in there.   
    terms_and_conditions = {
      {label = ""}, -- You can add as many different types of labels as you like, for example i have added two.
      {label = ""}, -- You can add as many different types of labels as you like, for example i have added two.
    },
    sign = "" -- Do not edit this.
},

INVENTORY ADDITIONS

#1 - Add These to your QB inventory

qb-inventory\html\js\app.js - Add the example below in the correct place like the example image. Make sure to set QB to true in the ap-documents config.

} else if (itemData.name == "document") {
    $(".item-info-title").html("<p>" + "Document" + "</p>");
    $(".item-info-description").html(
        "<p><strong>Document ID: </strong><span>" +
        itemData.info.documentidentifier +
        "</span></p><p><strong>Document Name: </strong><span>" +
        itemData.info.documentname +
        "</span></p><p><strong>Creator: </strong><span>" +
        itemData.info.documentcreator +
        "</span></p>"
    );

#1 - Add These to Quasar inventory

qs-inventory\config\config_metadata.js - Add the example below in the correct place like the example image. Make sure to set QB to true in the ap-documents config.

      } else if (itemData.name == "document") {
            $(".item-info-title").html("<p>" + itemData.label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Document ID: </strong><span>" +
                itemData.info.documentidentifier +
                "</span></p><p><strong>Document Name: </strong><span>" +
                itemData.info.documentname +
                "</span></p><p><strong>Creator: </strong><span>" +
                itemData.info.documentcreator +
                "</span></p>"
            );

#1 - Add These to lj inventory

lj-inventory\html\js\app.js - Add the example below in the correct place like the example image. Make sure to set QB to true in the ap-documents config.

        } else if (itemData.name == "document") {
            $(".item-info-title").html("<p>" + "Document" + "</p>");
            $(".item-info-description").html(
                "<p><strong>Document ID: </strong><span>" +
                itemData.info.documentidentifier +
                "</span></p><p><strong>Document Name: </strong><span>" +
                itemData.info.documentname +
                "</span></p><p><strong>Creator: </strong><span>" +
                itemData.info.documentcreator +
                "</span></p>"
            );

#1 - Add These to your OX inventory

No Changes are needed to be done for the Ox inventory, just add the items to ox_inventory\data\items.lua. Make sure to set OX to true in the ap-documents config.

    ['document'] = {
        label = 'Document',
        weight = 1,
        consume = 0,
        stack = false,
        close = true,
        description = nil
    },

    ['emptydocuments'] = {
        label = 'Blank Documents',
        weight = 1,
        consume = 0,
        stack = true,
        close = true,
        description = nil
    },

    ['portablecopier'] = {
        label = 'Portable Document Copier',
        weight = 1,
        consume = 0,
        stack = true,
        close = false,
        description = nil
    },

ESX INSTALLATION

SUPPORTED MENU & DIALOG SCRIPTS

Here are the supported scripts for the menu and dialog preconfigured for the documents script. menu.lua which is located in the client folder of the documents script is fully editable, which means you can configure it with another menu/dialog script you might use if you don't use the supported ones.

Supported Menu/Dialogs
Links
Description

OX-LIBS

Ox Libs is a single resource which handles lots of amazing features.

NH KEYBOARD & CONTEXT

NH context and keyboard are one of the most used scripts for its menu and dialog system.

ZF DIALOG

ZF Dialog is just like NH keyboard with a different style.

If your using Ox menu/dialog then make sure to uncomment the ox libs in the fxmanifest.lua

SUPPORTED INVENTORYS WITH METADATA

Here are the supported inventories which the document script uses, you can set the inventory you use in the config file, make sure you use one of these inventories before you buy the script.

Supported Inventory's
Links
Free/Paid

OX Inventory

FREE

Quasar Inventory

PAID

ModFreaks Inventory

PAID

If you use an inventory which supports metadata and want it supported with the script then open a ticket in the AP Scripts discord and we will look at adding the support to it.

STEP BY STEP

  1. Extract ap-documents.zip file.

  2. Inset SQL file into your database.

  3. Setup your config file with how you want it, make sure you enable the correct inventory that you have including menu/dialog.

  4. Setup the documents you want to add in the shared/documents.lua file, click here for examples.

SQL

Please note, there is an SQL file. You will need to import it in order for the script to run. You can open the respective SQL file, copy the queries and execute/run them in your database manually (my personal preferred way) or you can import the file.

Manual SQL Entries
CREATE TABLE IF NOT EXISTS `ap_documents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `documentid` varchar(50) DEFAULT NULL,
  `identifier` varchar(100) DEFAULT NULL,
  `document` longtext DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `catergory` varchar(60) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

DOCUMENT EXAMPLE

["Subpoena"] = { -- This will be the label displayed in the creation of a document, this can include spaces.
    type = "create", -- Do not edit this.
    restriction = {job = {enable = true, jobs = { -- To enable a jobs restriction set enable to true.
      ["police"] = "all", -- Set the job name as the key and the value set to "all" for all grades to make the document.
      ["ambulance"] = {0, 4, 5}, -- With this one the value can also be grade restricted by setting the grades in the table format with a comma for each grade.
    }}, citizenid = {enable = false, id = { -- To enable a citizenid restriction set enable to true.
      "", "", -- inside the string add the citizenid you want to restrict this too.
    }}},
    title = "", -- Title of document.
    logo = "", -- Link for logo on the top left of the document.
    from = "", -- Who the document is from.
    description = "", -- description of the document.
    disclaimer = "", -- Disclaimer of the document.
    information = {
      { id = "i1", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "i2", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "i3", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "i4", label = "", type = "text_input", placement = "", required = "true", value = "" },
    },
    -- The id has to be in multiples of e.g(i1/i2/i3/i4/i5/i6/i7/i8/i9/i10) You can't have more then 10 input boxes.
    -- The label is the label of the input box.
    -- The type can only be "text_input", text input is a small box.
    -- Placement is the text inside the input box explaining what the person needs to input.
    -- Required is whether the the person is required to fill in the input box or not, use "true" or "false".
    -- The value needs to be an empty string do not add anything in there.
    extended_information = {
      { id = "e1", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "e2", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "e3", label = "", type = "text_input", placement = "", required = "true", value = "" },
      { id = "e4", label = "", type = "text_area", placement = "", required = "true", value = "" },
      { id = "e5", label = "", type = "text_area", placement = "", required = "true", value = "" },
    }, 
    -- The id has to be in multiples of e.g(e1/e2/e3/e4/e5/e6/e7/e8/e9/e10) You can't have more then 10 input boxes.
    -- The label is the label of the input box.
    -- The type can be either "text_input" or "text_area", text input is a small box and text area is a bigger box.
    -- Placement is the text inside the input box explaining what the person needs to input.
    -- Required is whether the the person is required to fill in the input box or not, use "true" or "false".
    -- The value needs to be an empty string do not add anything in there.   
    terms_and_conditions = {
      {label = ""}, -- You can add as many different types of labels as you like, for example i have added two.
      {label = ""}, -- You can add as many different types of labels as you like, for example i have added two.
    },
    sign = "" -- Do not edit this.
},

INVENTORY ADDITIONS

#1 - Add These to your OX inventory

ox_inventory\modules\items\client.lua - Add the example below at the bottom of the client file. Make sure to set OX to true in the ap-documents config.

--- DOCUMENTS STUFF ------
Item('document', function(data, slot)
  ox_inventory:useItem(data, function(data)
    if data ~= nil then
      TriggerServerEvent('ap-documents:server:useItemDocument', data)
    end
  end)
end)
  
Item('emptydocuments', function(data, slot)
  ox_inventory:useItem(data, function(data)
    if data ~= nil then
      TriggerServerEvent('ap-documents:server:showEmptyDocuments')
    end
  end)
end)

#2 - Add These to your OX inventory

ox_inventory\data\items.lua - Add the example below at the bottom of the items file.

    ['document'] = {
        label = 'Document',
        weight = 1,
        consume = 0,
        stack = false,
        close = true,
        description = nil
    },

    ['emptydocuments'] = {
        label = 'Blank Documents',
        weight = 1,
        consume = 0,
        stack = true,
        close = true,
        description = nil
    },

    ['portablecopier'] = {
        label = 'Portable Document Copier',
        weight = 1,
        consume = 0,
        stack = true,
        close = false,
        description = nil
    },

#1 - Add the items to your database.

No Changes are needed to be done for the ModFreaks inventory, just add the items to your Database. Make sure to set MF to true in the ap-documents config.

INSERT IGNORE INTO `items` (`name`, `label`) VALUES
  ('document', 'Document'),
  ('emptydocuments', 'Blank Documents'),
  ('portablecopier', 'Portable Document Copier')
;

#1 - Add These to Quasar inventory

qs-inventory\config\config_metadata.js - Add the example below at the bottom of the config file. Make sure to set QS to true in the ap-documents config.

      } else if (itemData.name == "document") {
            $(".item-info-title").html("<p>" + itemData.label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Document ID: </strong><span>" +
                itemData.info.documentidentifier +
                "</span></p><p><strong>Document Name: </strong><span>" +
                itemData.info.documentname +
                "</span></p><p><strong>Creator: </strong><span>" +
                itemData.info.documentcreator +
                "</span></p>"
            );

#2 - Add These to Quasar inventory

qs-core\config\config_items.lua - Add the example below at the bottom of the items file.

    ["document"] = {
        ["name"] = "document",
        ["label"] = "Document",
        ["weight"] = 1,
        ["type"] = "item",
        ["image"] = "document.png",
        ["unique"] = true,
        ["useable"] = true,
        ["shouldClose"] = true,
        ["combinable"] = nil,
        ["description"] = ""
    },

    ["emptydocuments"] = {
        ["name"] = "emptydocuments",
        ["label"] = "Blank Documents",
        ["weight"] = 1,
        ["type"] = "item",
        ["image"] = "emptydocuments.png",
        ["unique"] = true,
        ["useable"] = true,
        ["shouldClose"] = true,
        ["combinable"] = nil,
        ["description"] = ""
    },

    ["portablecopier"] = {
        ["name"] = "portablecopier",
        ["label"] = "Portable Document Copier",
        ["weight"] = 1,
        ["type"] = "item",
        ["image"] = "portablecopier.png",
        ["unique"] = true,
        ["useable"] = false,
        ["shouldClose"] = false,
        ["combinable"] = nil,
        ["description"] = ""
    },

Setup the documents you want to add in the shared/documents.lua file, click for examples.

here
Menu Link
Input Link
Link
Link
Link
Link
Link
Context Link
Keyboard Link
Link
Link
Link
Link
Example
Example
Example
Example
Example
Example
Heidi SQL Example
Example
Example
|
Tebex Link
Script Showcase