ngd-jobduty/client/client.lua

25 lines
759 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)
2023-10-29 13:12:53 -05:00
if Config.UseCommand then
RegisterCommand(Config.Command, function()
if PlayerData.job and PlayerData.job.name == Config.PoliceJob or PlayerData.job and PlayerData.job.type == Config.PoliceJobType then
TriggerServerEvent('QBCore:ToggleDuty')
TriggerServerEvent('ngd-policeduty:Server:Log')
end
end)
2023-10-28 21:27:53 -05:00
2023-10-29 13:12:53 -05:00
CreateThread(function()
TriggerEvent('chat:addSuggestion', Config.ChatSuggestion, Config.ChatSuggestionM, {})
end)
end