Players

If the exports are active and the sync is also active, the sync is preferred and the exports are deactivated.

Configure in config.sync.lua

Make sure that in Config.Sync the entry active is set to true and in Types the Users is set to true.

Config.Sync is now SyncSettings.MainData

after script restart it should import all users to your police and medic MDT.

Add data to the sync

  1. Open the sync_functions.lua with any ide (notepad++, visual studio code)

    1. /server/sync/files.lua

  2. Search in the file the FormatData function for your Framework

    1. ESX : myMDT_core_sync.files.FormatData_ESX

    2. QB: myMDT_core_sync.files.FormatData_QB

Examples

The Important part is now where the curly brackets from the return

if your players/users table stores the size of the users than you simply need to add this like following:

size = inputData.size added

on the left hand is the column name/key from myMDT_core, on the right side is the column from your players/users table.

Never touch this keys : id, player_id, fromsystem

Available Keys

  • alias

  • sex

  • phone

  • size

  • birth

  • eyecolor

  • haircolor

  • blood_type

  • weight

  • allergies

  • known_illnesses

Format Birthdate

If your table doesn’t store the birthdate in the format YYYY-MM-DD you can use the function convertDateForMDT

Usage for DD.MM.YYYY

myMDT_core_sync.files.convertDateForMDT(<here date>, ".", "dd.mm.yyyy")

Usage for YYYY/MM/DD

myMDT_core_sync.files.convertDateForMDT(<here date>, "/", "yyyy/mm/dd")

Usage for YYYY/DD/MM

myMDT_core_sync.files.convertDateForMDT(<here date>, "/", "yyyy/dd/mm")

If the Birthdate is in a wrong format the Javascript will throw an error and will not display the birth

Last updated