Skip to content
This repository was archived by the owner on Sep 24, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions bt-target/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ Citizen.CreateThread(function()
TriggerEvent("chat:removeSuggestion", "/-playerTarget")
end)

local WHITELISTED_EVENTS = {
["niko:pickupbike"] = true,
}

function IsEventWhitelisted(edata)
return WHITELISTED_EVENTS[edata] or false
end

if Config.ESX then
Citizen.CreateThread(function()
while ESX == nil do
Expand Down Expand Up @@ -128,13 +136,18 @@ end
--NUI CALL BACKS

RegisterNUICallback('selectTarget', function(data, cb)
local allowed = IsEventWhitelisted(data.event)
print(allowed)
SetNuiFocus(false, false)

success = false

targetActive = false

TriggerEvent(data.event)
if allowed == true then
TriggerEvent(data.event)
else
--Trigger discord log, ect
end
end)

RegisterNUICallback('closeTarget', function(data, cb)
Expand Down