ngd-jobduty/client/client.lua
2023-10-28 20:19:53 -07:00

22 lines
626 B
Lua

local QBCore = exports['qb-core']:GetCoreObject()
local PlayerData = {}
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
PlayerData = QBCore.Functions.GetPlayerData()
end)
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
PlayerData = {}
end)
RegisterCommand(Config.Command, function()
if PlayerData.job and PlayerData.job.name == Config.PoliceJob then
TriggerServerEvent('QBCore:ToggleDuty')
TriggerServerEvent('ngd-policeduty:Server:Log')
end
end)
CreateThread(function()
TriggerEvent('chat:addSuggestion', Config.ChatSuggestion, Config.ChatSuggestionM, {})
end)