Skip to content

Instantly share code, notes, and snippets.

@rdlh
Last active April 16, 2025 15:37
Show Gist options
  • Save rdlh/bc7d5b9c1a3d62e1fc2dc47c1bb796a0 to your computer and use it in GitHub Desktop.
Save rdlh/bc7d5b9c1a3d62e1fc2dc47c1bb796a0 to your computer and use it in GitHub Desktop.
Knid MDT - LUA Documentation

MDT

Configs :

Key Description
Config.Url URL of your MDT
Config.SecretKey Your service secret key, ask Knid to get it
Config.Command Command to open MDT
Config.Key Keyboard key to open MDT be default
Config.AnimationEnabled Enable tablet animation
Config.PropEnabled Enable tablet prop
Config.IsAllowed(source, callback) A function that should return a boolean to allow or deny MDT opening
Config.UserIsNotAllowed(source) A function called when the citizen is not allowed to open MDT

Client side exports:

exports['knid-mdt']:open()
exports['knid-mdt']:close()
exports['knid-mdt']:opened()

Events :

Client side events you can trigger
mdt:client:open
mdt:client:close

API :

People API :

Create a citizen
--- @param params table
---   @param params.identifier string
---   @param params.name string
---   @param params.birthdate string optional
---   @param params.job string optional
---   @param params.phone string optional
---   @param params.state string optional
--- @param callback function
--- @return void

exports['knid-mdt']:api().people.create(params, callback)
Update a citizen
--- @param identifier string
--- @param params table
---   @param params.name string
---   @param params.birthdate string optional
---   @param params.job string optional
---   @param params.phone string optional
---   @param params.state string optional
--- @param callback function
--- @return void

exports['knid-mdt']:api().people.update(identifier, params, callback)

People's vehicles API :

Update a vehicle
--- @param identifier string
--- @param params table
---   @param params.plate string
---   @param params.model string
--- @param callback function
--- @return nil

exports['knid-mdt']:api().people.vehicles.create(identifier, params, callback)

People's licenses API :

Create a license
--- @param identifier string
--- @param kind string [voiture | moto | bateau | hélicoptère | avion | PPA 0 | PPA 1 | PPA 2 | PPA 3 | PPA 4]
--- @param callback function
--- @return nil

exports['knid-mdt']:api().people.licenses.create(identifier, type, callback)
Delete a license
--- @param identifier string
--- @param kind string [voiture | moto | bateau | hélicoptère | avion | PPA 0 | PPA 1 | PPA 2 | PPA 3 | PPA 4]
--- @param callback function
--- @return nil

exports['knid-mdt']:api().people.licenses.delete(identifier, type, callback)

Vehicles API :

Update vehicle owner
--- @param plate  string
--- @param newOwner  string (Should be the identifier of the new owner of the vehicle)
--- @param callback  function
--- @return nil

exports['knid-mdt']:api().vehicles.update(plate, newOwner, callback)
Delete a vehicle
--- @param plate  string
--- @param callback  function
--- @return nil

exports['knid-mdt']:api().vehicles.delete(plate, callback)

Agents service API :

Start agent service
--- @param service string (Should be the name of the Service (case sensitive), ex: 'LSPD')
--- @param identifier string (Should be the DISCORD ID of the agent)
--- @param callback function
--- @return nil

exports['knid-mdt']:api().agents.service.start(identifier, service, callback)
End agent service
--- @param service string (Should be the name of the Service (case sensitive), ex: 'LSPD')
--- @param identifier string (Should be the DISCORD ID of the agent)
--- @param callback function
--- @return nil

exports['knid-mdt']:api().agents.service.stop(identifier, service, callback)

Dispatch API :

Create a call
--- @param service string (Should be the name of the Service (case sensitive), ex: 'LSPD')
--- @param id string (The ID of your call in your in-game dispatch system)
--- @param title string
--- @param place string
--- @param callback function
--- @return nil

exports['knid-mdt']:api().dispatch.calls.create(service, id, title, place, callback)
Delete a call
--- @param service string (Should be the name of the Service (case sensitive), ex: 'LSPD')
--- @param id string (The ID of your call in your in-game dispatch system)
--- @param callback function
--- @return nil

exports['knid-mdt']:api().dispatch.calls.delete(service, id, callback)
@usertoz
Copy link

usertoz commented Apr 16, 2025

hi, where can i buy knid-mdt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment