ngd-jobduty/client/client.lua

22 lines
618 B
Lua
Raw Normal View History

2023-10-28 21:27:53 -05:00
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 == 'police' then
TriggerServerEvent('QBCore:ToggleDuty')
TriggerServerEvent('ngd-policeduty:Server:Log')
end
end)
CreateThread(function()
TriggerEvent('chat:addSuggestion', Config.ChatSuggestion, Config.ChatSuggestionM, {})
end)