> For the complete documentation index, see [llms.txt](https://mdev-scripts.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mdev-scripts.gitbook.io/docs/assets-and-guides/staff-duty-script/how-to-install.md).

# how to install

1. Download the [dependencies](/docs/assets-and-guides/staff-duty-script/dependencys.md) and make sure they are properly installed.
2. Download mdev-staffduty from your [keymaster](https://keymaster.fivem.net/asset-grants), extract it to the resources folder and ensure it inside server.cfg after all of the dependencies.
3. Configure the script to your liking and make sure to your webhooks in webhooks.lua&#x20;
4. Restart your server and enjoy!

## How to use this script?

#### Export <a href="#export" id="export"></a>

```
if exports["mdev-staffduty"] and not exports["mdev-staffduty"]:inDienst(playerId) then
	TriggerClientEvent('esx:showNotification', playerId, 'You are not in staffduty', 5000)
	return
end
```

#### Example <a href="#voorbeeld" id="voorbeeld"></a>

Go to: es\_extended/server/functions.lua&#x20;

```
	RegisterCommand(name, function(playerId, args, rawCommand)
		local command = Core.RegisteredCommands[name]

		if not command.allowConsole and playerId == 0 then
			print(('[^3WARNING^7] ^5%s'):format(_U('commanderror_console')))
		else
			local xPlayer, error = ESX.GetPlayerFromId(playerId), nil
			
			if exports["mdev-staffduty"] and not exports["mdev-staffduty"]:inDienst(playerId) then
				TriggerClientEvent('esx:showNotification', playerId, 'You are not in staffduty', 5000)
				return
			end

			if command.suggestion then
				if command.suggestion.validate then
					if #args ~= #command.suggestion.arguments then
						error = _U('commanderror_argumentmismatch', #args, #command.suggestion.arguments)
					end
				end
```
