DH | MOT

Requirments

  • TMC Framework

Installation

  1. Download DHMot from your keymaster

  2. Place it into your RESOURCES folder

  3. "ensure DHMot" in your server.cfg

Item

Add the item to your "core/sharedgta.lua" fil

["motpaper"] = {
        ["label"] = "MOT Certificate",
        ["weight"] = 0,
        ["type"] = "item",
        ["image"] = "insuranceimage.webp",
        ["unique"] = true,
        ["stackable"] = true,
        ["useable"] = true,
        ["shouldClose"] = false,
        ["description"] = "Vehicle MOT Certificate"
    },
    

Inventory Metadata

You need to add this to your "inventory/config.lua" Config.ItemDescriptionFormatters

['motpaper'] = function(itemInfo)
            return string.format('<p> <strong>Plate: </strong><span>%s</span> <br/> <strong>Issued: </strong><span>%s</span> <br/> <strong>Expiry Date: </strong><span>%s</span> <br/> <strong>Approved By: </strong><span>%s</span> <br/> <strong>Comment: </strong><span>%s</span></p>',
                itemInfo.plate,
                itemInfo.issued,
                itemInfo.expiry,
                itemInfo.approvedBy,
                itemInfo.comment
            )
        end,

SQL

insert this SQL into your Database

CREATE TABLE IF NOT EXISTS DHMot (
    id INT AUTO_INCREMENT PRIMARY KEY,
    owner VARCHAR(50) NOT NULL,
    plate VARCHAR(50) NOT NULL,
    valid BOOLEAN NOT NULL,
    date DATE NOT NULL
);

Radial Menu

add this to your "radialmenu/config.lua" where your other police actions are. Make sure to add "police:checkMot" as a subMenu to the police actions

['police:checkMot'] = {
        title = "MOT",
        icon = "car-wrench",
        iconCategory = 'solid',
        functionName = "MOT:Client:OpenMOTMenu",
        enableMenu = function()
            return not isDead 
        end,
    },

Last updated