Skip to content

Commit

Permalink
Update 1.0.6 - Added support for qb-target and qtarget
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhaddil committed Nov 19, 2024
1 parent 6c2f2ec commit cce2bc7
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 15 deletions.
58 changes: 44 additions & 14 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,50 @@ function CanAccessInsurance()
end

function TargetingBoxZone(name, coords, x, y, z, list1, list2, list3)
exports.ox_target:addBoxZone({
coords = vec3(coords),
size = vec3(x, y, z),
rotation = 0,
debug = false,
drawSprite = true,
options = {
list1,

list2,

list3,
}
})
if not coords or (not coords.x and not coords.z) then
print("Error: coordenadas no definidas o incorrectas.")
return
end

local adjustedCoords = coords

if coords.w then
adjustedCoords = vector3(coords.x, coords.y, coords.z - 1)
else
adjustedCoords = vector3(coords.x, coords.y, coords.z - 1)
end

if Config.UseOxTarget then
exports.ox_target:addBoxZone({
coords = vec3(coords),
size = vec3(x, y, z),
rotation = 0,
debug = false,
drawSprite = true,
options = {
list1,

list2,

list3,
}
})
else
exports[Config.TargetName]:AddBoxZone(name, adjustedCoords, x, y, {
name = name,
heading = 0,
debugPoly = false,
minZ = adjustedCoords.z - (z / 2),
maxZ = adjustedCoords.z + (z / 2),
}, {
options = {
list1,
list2,
list3,
},
distance = Config.TargetDistance
})
end
end

CreateThread(function()
Expand Down
3 changes: 3 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Config.Locations = {

Config.FrameWork = 'esx' -- Select the framework being used: 'esx' for ESX Framework or 'qb' for QBCore Framework.
Config.UseOXNotifications = true -- Enable or disable OX Notifications. If 'true', it will use OX notifications; otherwise, it will use the default notification system for the framework.
Config.UseOxTarget = true -- Enables or disables the use of the OxTarget system.
Config.TargetName = '' -- Specifies the name of the target resource. Only needed if using qb-target or qtarget. Leave it empty if using OxTarget.
Config.TargetDistance = 7.0 -- Sets the maximum interaction distance for targeting.

Config.Account = 'money' -- Choose the account type for transactions: 'bank' to use the player's bank account or 'money' to use cash.
Config.OnlyAllowedJobs = false -- Enable or disable restricted access to the insurance menu. If 'true', only specific jobs can access. If 'false', everyone can access.
Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ lua54 'yes'

author 'Muhaddil'
description 'Simple Medical Insurance Script'
version 'v1.0.5'
version 'v1.0.6'

shared_script 'config.lua'
client_script 'client.lua'
Expand Down

0 comments on commit cce2bc7

Please sign in to comment.