Here, you'll discover all the handy exports for this asset. Please take the time to read through each step and example carefully to grasp how they function. We advise against using these exports if you're not an experienced developer.
open
This export opens the MDT interface for a specific player.
This export verifies if a player has the job necessary to open the MDT.
exports['redutzu-mdt']:isAllowed(source)
Here's how you can utilize this export:
RegisterCommand('example', function(source)local allowed = exports['redutzu-mdt']:isAllowed(source)if allowed then-- Do something if the player is allowed to open the MDTendend, false)
isJobWhitelisted
This export checks if at least one job is whitelisted.
exports['redutzu-mdt']:isJobWhitelisted(jobs) -- table or string
Here's how you can utilize this export:
RegisterNetEvent('dispatchEvent', function(data)local isWhitelisted = exports['redutzu-mdt']:isJobWhitelisted(data.jobs)if isWhitelisted then-- data.jobs includes one of the whitelisted jobs from Config.WhitelistedJobsendend)
hasPermission
This export verifies if a player has a specific permission.
RegisterCommand('status', function(source)local status = exports['redutzu-mdt']:GetOfficerStatus(source) -- 0, 1, 2, 3-- if you are using this code inside the MDT you can do:local statusName = Config.Statuses[status]?.labelprint('Current status: ' .. statusName )end, false)
RegisterCommand('change_status', function(source,args)local status = args[1] -- must be 0, 1, 2 or 3 exports['redutzu-mdt']:SetOfficerStatus(source, status)end, false)
IsDuty
This export indicates whether the player is on duty or not.