Skip to content

🗒 MDT

Documentation relating to the jo_mdt.

1. Installation

jo_mdt works on all frameworks compatible with jo_libs (the list).

To install jo_mdt :

  • Download the library: jo_libs
  • Unzip the folder and drop it in your resource folder
  • Download jo_mdt from your keymaster
  • Unzip the folder and drop it in your resource folder
  • Add this ensure in your server.cfg
    • ensure jo_libs
    • ensure jo_mdt

Congratulation, the MDT script is ready to be used!

WARNING

Be sure you have oxmysql ensure in your server.cfg

TIP

The script automatically creates all necessary database tables during its initial startup.

For RedEM:RP (old)

Add this Shared functions in redemrp_inventory/server/sv_main.lua

lua
  end
  return data
end

function SharedInventoryFunctions.addItemLocker(name, amount, meta, lockerId) 
  if not Locker[lockerId] then Locker[lockerId] = {} end
  return addItemLocker(name, amount, meta, lockerId) 
end
function SharedInventoryFunctions.getLocker(lockerId) 
  return PrepareToOutput(Locker[lockerId]) 
end

----=======================SHARED FUNCTIONS  ================================
For RedEM:RP (2023)

Add this Shared functions in redemrp_inventory/server/main.lua

lua
  end
  return data
end

function SharedInventoryFunctions.addItemStash(source, name, amount, meta, stashId) 
    if not Stash[stashId] then Stash[stashId] = {} end
    addItemStash(source, name, amount, meta, stashId) 
end
function SharedInventoryFunctions.getStash(stashId) 
    return PrepareToOutput(Stash[stashId]) 
end

RegisterServerEvent("redemrp_inventory:deleteInv",

Congratulation, the MDT script is ready to be used!

2. Usage

  • If you set Config.openingMode = "item"

Go to one of the sheriff station to get your MDT. Use the MDT item to open it.

  • If you set Config.openingMode = "command"

Use /mdtto open the MDT

3. Script configuration

Loading configuration...

4. For developers

Actions

Actions are the new way to modify how the script works or add new features. These actions are event that occurs at a specific point in time during the execution of the script. But contrary to events, actions are synchronous.

Filters

Filters are the new way to modify data used by the script added in the v1.2.0. These filters are fired at a specific point in time during the execution of the script. But contrary to events, filters are synchronous.

Client canOpenMDT

Fires before open the MDT

lua
---@param canOpen - boolean
exports.jo_mdt:registerFilter('canOpenMDT', function(canOpen)
	return canOpen
end)

Client updateLangForNUI

Fires before update the NUI Lang

lua
---@param Lang - table: list of lang strings
exports.jo_mdt:registerFilter('updateLangForNUI', function(Lang)
	return Lang
end)

Server canGetMDT

Fires before give the MDT to the player

lua
---@param canGet - boolean
---@param source - integer: server ID of the player
---@param stationKey - integer: key of the station from Config.stations
exports.jo_mdt:registerFilter('canGetMDT', function(canGet,source,stationKey)
	return canGet
end)

Server canManageFileLocker

Fires before open the file cabinet

lua
---@param canManage - boolean
---@param source - integer: server ID of the player
exports.jo_mdt:registerFilter('canManageFileLocker', function(canManage,source)
	return canManage
end)

Last updated: