Skip to content
This repository was archived by the owner on Sep 24, 2021. It is now read-only.
Open
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions bt-target/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ function playerTargetEnable()
if GetEntityType(entity) ~= 0 then
for _, model in pairs(Models) do
if _ == GetEntityModel(entity) then
if Models[_]["job"] == nil then Models[_]["job"] = { "all" } end -- Nil check for Job default to ALL if undefined
for k , v in ipairs(Models[_]["job"]) do
if v == "all" or v == PlayerJob.name then
if ((v == "all") or (PlayerJob and v == PlayerJob.name)) then -- Added Nil Check for PlayerJob
if _ == GetEntityModel(entity) then
if #(plyCoords - coords) <= Models[_]["distance"] then

Expand Down Expand Up @@ -80,8 +81,9 @@ function playerTargetEnable()

for _, zone in pairs(Zones) do
if Zones[_]:isPointInside(coords) then
if Zones[_]["targetoptions"]["job"] == nil then Zones[_]["targetoptions"]["job"] = { "all" } end -- Nil check for Job default to ALL if undefined
for k , v in ipairs(Zones[_]["targetoptions"]["job"]) do
if v == "all" or v == PlayerJob.name then
if ((v == "all") or (PlayerJob and v == PlayerJob.name)) then -- Added Nil Check for PlayerJob
if #(plyCoords - Zones[_].center) <= zone["targetoptions"]["distance"] then

success = true
Expand Down
1 change: 0 additions & 1 deletion bt-target/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Config = {}

Config.ESX = true


-- Return an object in the format
-- {
-- name = job name
Expand Down
2 changes: 1 addition & 1 deletion bt-target/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fx_version 'adamant'
fx_version 'cerulean'

game 'gta5'

Expand Down
4 changes: 2 additions & 2 deletions bt-target/html/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $(document).on('mousedown', (event) => {
if (element.id.split("-")[0] === 'target') {
let TargetData = $("#"+element.id).data('TargetData');

$.post('http://bt-target/selectTarget', JSON.stringify({
$.post('https://' + GetParentResourceName() + '/selectTarget', JSON.stringify({
event: TargetData,
}));

Expand All @@ -55,7 +55,7 @@ $(document).on('keydown', function() {
case 27: // ESC
$(".target-label").html("");
$('.target-wrapper').hide();
$.post('http://bt-target/closeTarget');
$.post('https://' + GetParentResourceName() + '/closeTarget');
break;
}
});