Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hospital): Allow multiple checkin locations per hospital #143

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
35 changes: 19 additions & 16 deletions client/hospital.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,26 @@ if config.useTarget then
CreateThread(function()
for hospitalName, hospital in pairs(sharedConfig.locations.hospitals) do
if hospital.checkIn then
exports.ox_target:addBoxZone({
name = hospitalName..'_checkin',
coords = hospital.checkIn,
size = vec3(2, 1, 2),
rotation = 18,
debug = config.debugPoly,
options = {
{
onSelect = function()
checkIn(hospitalName)
end,
icon = 'fas fa-clipboard',
label = locale('text.check'),
distance = 3.0,
if type(hospital.checkIn) ~= 'table' then hospital.checkIn = { hospital.checkIn } end
for i = 1, #hospital.checkIn do
exports.ox_target:addBoxZone({
name = hospitalName..'_checkin',
Manason marked this conversation as resolved.
Show resolved Hide resolved
coords = hospital.checkIn[i],
size = vec3(2, 1, 2),
rotation = 18,
debug = config.debugPoly,
options = {
{
onSelect = function()
checkIn(hospitalName)
end,
icon = 'fas fa-clipboard',
label = locale('text.check'),
distance = 3.0,
}
}
}
})
})
end
end

for i = 1, #hospital.beds do
Expand Down
2 changes: 1 addition & 1 deletion config/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ return {
---@field coords vector4
---@field model number

---@type table<string, {coords: vector3, checkIn?: vector3, beds: Bed[]}>
---@type table<string, {coords: vector3, checkIn?: vector3|vector3[], beds: Bed[]}>
hospitals = {
pillbox = {
coords = vec3(350, -580, 43),
Expand Down