Add Your MDT

The script by default supports the following MDTs for checking for felonies:

  • Aljuniers MDT

  • LB-Tablet

If you would like to add your MDT to the list you will need to add that logic to the `checkCriminalRecord()` in the sever.lua file near line 33.

local function checkCriminalRecord(citizenID)

    local result = nil

    if SVConfig.MDT == 'al_mdt' then
        result = MySQL.query.await("SELECT * FROM `mdt_criminal_record` WHERE input LIKE '%Felony%' AND TYPE = 'Arrest' and  identifier = ?", { citizenID })
    elseif SVConfig.MDT == 'lb-tablet' then
        result = MySQL.query.await("SELECT * from `lbtablet_police_cases_charges` where offence_id IN (select id from `lbtablet_police_offences` where class = 'felony') and criminal = ?", { citizenID })
    -- YOU WOULD ADD YOUR MDT SUPPOORT HERE USING A NEW ELSEIF
    -- YOU WILL NEED TO WRITE THE QUERY YOURSELF   

    else
        TriggerClientEvent('cornerstone_sellshop:client:sendNotify', src, 'error', 'Your MDT is not supported, you will need to add support or disable felony check')   
    end

    if result[1] then
        return true
    else
         return false
    end
end

Last updated