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

chore: patch for rebuilding the healthcare system #872

Merged
merged 5 commits into from
Oct 31, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,6 @@ CreateThread(function()
end
end
end

-- Fast Travels (Prompt)
for k, v in ipairs(hospital.FastTravels) do
local distance = #(playerCoords - v.From)

if distance < Config.DrawDistance then
sleep = 0
DrawMarker(v.Marker.type, v.From, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Marker.x, v.Marker.y, v.Marker.z, v.Marker.r, v.Marker.g, v.Marker.b, v.Marker.a, false, false, 2, v.Marker.rotate, nil, nil, false)

if distance < v.Marker.x then
isInMarker, currentHospital, currentPart, currentPartNum = true, hospitalNum, "FastTravels", k
end
end
end
end

-- Logic for exiting & entering markers
Expand Down Expand Up @@ -303,12 +289,6 @@ AddEventHandler("bpt_ambulancejob:hasEnteredMarker", function(hospital, part, pa
CurrentAction = part
CurrentActionMsg = TranslateCap("helicopter_prompt")
CurrentActionData = { hospital = hospital, partNum = partNum }
elseif part == "FastTravels" then
local travelItem = Config.Hospitals[hospital][part][partNum]

CurrentAction = part
CurrentActionMsg = travelItem.Prompt
CurrentActionData = { to = travelItem.To.coords, heading = travelItem.To.heading }
end

ESX.TextUI(CurrentActionMsg)
Expand Down Expand Up @@ -337,31 +317,13 @@ CreateThread(function()
OpenVehicleSpawnerMenu("car", CurrentActionData.hospital, CurrentAction, CurrentActionData.partNum)
elseif CurrentAction == "Helicopters" then
OpenVehicleSpawnerMenu("helicopter", CurrentActionData.hospital, CurrentAction, CurrentActionData.partNum)
elseif CurrentAction == "FastTravels" then
FastTravel(CurrentActionData.to, CurrentActionData.heading)
end

CurrentAction = nil
end
end

local playerCoords, letSleep = GetEntityCoords(PlayerPedId()), true

for hospitalNum, hospital in pairs(Config.Hospitals) do
-- Fast Travels
for k, v in ipairs(hospital.FastTravels) do
local distance = #(playerCoords - v.From)

if distance < Config.DrawDistance then
sleep = 0
DrawMarker(v.Marker.type, v.From, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, v.Marker.x, v.Marker.y, v.Marker.z, v.Marker.r, v.Marker.g, v.Marker.b, v.Marker.a, false, false, 2, v.Marker.rotate, nil, nil, false)

if distance < v.Marker.x then
FastTravel(v.To.coords, v.To.heading)
end
end
end
end
Wait(sleep)
end
end)
Expand Down Expand Up @@ -438,38 +400,6 @@ function OpenCloakroomMenu()
end)
end

function OpenPharmacyMenu()
local elements = {
{ unselectable = true, icon = "fas fa-pills", title = TranslateCap("pharmacy_menu_title") },
}

for k, v in pairs(Config.PharmacyItems) do
elements[#elements + 1] = {
icon = "fas fa-pills",
title = v.title,
item = v.item,
}
end

ESX.OpenContext("right", elements, function(menu, element)
local elements2 = {
{ unselectable = true, icon = "fas fa-pills", title = element.title },
{ title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to buy.." },
{ icon = "fas fa-check-double", title = "Confirm", val = "confirm" },
}

ESX.OpenContext("right", elements2, function(menu2, element2)
local amount = menu2.eles[2].inputValue
if Config.Debug then
print("[^2INFO^7] Attempting to Give Item - ^5" .. tostring(element.item) .. "^7")
end
TriggerServerEvent("bpt_ambulancejob:giveItem", element.item, amount)
end, function(menu)
OpenPharmacyMenu()
end)
end)
end

RegisterNetEvent("bpt_ambulancejob:heal")
AddEventHandler("bpt_ambulancejob:heal", function(healType, quiet)
local playerPed = PlayerPedId()
Expand Down
52 changes: 14 additions & 38 deletions server-data/resources/[bpt_addons]/bpt_ambulancejob/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,68 +33,44 @@ Config.Hospitals = {
CentralLosSantos = {

Blip = {
coords = vector3(292.05, -582.39, 43.18),
coords = vector3(338.716492, -1394.439575, 32.498169),
sprite = 61,
scale = 1.2,
color = 2,
},

AmbulanceActions = {
vector3(301.925293, -598.549438, 42.282104),
vector3(346.589020, -1428.435181, 31.936279),
},

Vehicles = {
{
Spawner = vector3(338.123077, -575.947266, 28.791260),
InsideShop = vector3(320.756042, -548.004395, 28.740601),
Spawner = vector3(390.356049, -1436.822021, 29.431519),
InsideShop = vector3(393.784607, -1442.624146, 29.397827),
Marker = { type = 36, x = 1.0, y = 1.0, z = 1.0, r = 100, g = 50, b = 200, a = 100, rotate = true },
SpawnPoints = {
{ coords = vector3(328.021973, -576.553833, 28.791260), heading = 227.6, radius = 4.0 },
{ coords = vector3(402.989014, -1426.417603, 29.448364), heading = 227.6, radius = 4.0 },
},
},
},

Helicopters = {
{
Spawner = vector3(352.04, -588.39, 74.16),
InsideShop = vector3(352.04, -588.39, 74.16),
Spawner = vector3(299.419769, -1454.004395, 46.500366),
InsideShop = vector3(299.419769, -1454.004395, 46.500366),
Marker = { type = 34, x = 1.5, y = 1.5, z = 1.5, r = 100, g = 150, b = 150, a = 100, rotate = true },
SpawnPoints = {
{ coords = vector3(352.04, -588.39, 74.16), heading = 142.7, radius = 10.0 },
{ coords = vector3(299.419769, -1454.004395, 46.500366), heading = 142.7, radius = 10.0 },
},
},
},

FastTravels = {
-- roof access (ok)
{
From = vector3(329.393402, -601.081299, 42.282104),
To = { coords = vector3(341.076935, -581.604370, 74.150879), heading = 0.0 },
Marker = { type = 1, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false },
},

-- DW main
{
From = vector3(339.454956, -584.175842, 73.150879),
To = { coords = vector3(331.371429, -595.424194, 43.282104), heading = 0.0 },
Marker = { type = 1, x = 2.0, y = 2.0, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false },
},

-- Garage dw
{
From = vector3(327.217590, -603.560425, 42.282104),
To = { coords = vector3(339.283508, -584.479126, 28.791260), heading = 0.0 },
Marker = { type = 1, x = 2.0, y = 2.0, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false },
},

-- Garage up
{
From = vector3(340.892303, -580.378052, 27.791260),
To = { coords = vector3(332.175812, -595.569214, 43.282104), heading = 0.0 },
Marker = { type = 1, x = 2.0, y = 2.0, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false },
Spawner = vector3(313.120880, -1465.661499, 46.500366),
InsideShop = vector3(313.120880, -1465.661499, 46.500366),
Marker = { type = 34, x = 1.5, y = 1.5, z = 1.5, r = 100, g = 150, b = 150, a = 100, rotate = true },
SpawnPoints = {
{ coords = vector3(313.120880, -1465.661499, 46.500366), heading = 142.7, radius = 10.0 },
},
},

-- Roof access end
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ Config = {
radius = 1.0,
},
{
coords = vector3(311.314301, -565.213196, 43.282104),
coords = vector3(365.432983, -1384.470337, 32.413940),
jobs = { "ambulance" },
blip = false,
recipes = { "bandage", "marijuana", "marijuana_extract", "medikit" },
Expand Down
4 changes: 2 additions & 2 deletions server-data/resources/[esx]/es_extended/server/onesync.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function ESX.OneSync.SpawnVehicle(model, coords, heading, properties, cb)
local xPlayer = ESX.OneSync.GetClosestPlayer(coords, 300)
ESX.GetVehicleType(vehicleModel, xPlayer.id, function(vehicleType)
if vehicleType then
local createdVehicle = CreateVehicleServerSetter(vehicleModel, vehicleType, coords, heading)
local createdVehicle = CreateVehicleServerSetter(vehicleModel, vehicleType, coords.x, coords.y, coords.z, heading)
if not DoesEntityExist(createdVehicle) then
return error("Unfortunately, this vehicle has not spawned")
end
Expand All @@ -116,7 +116,7 @@ function ESX.OneSync.SpawnObject(model, coords, heading, cb)
end
local objectCoords = type(coords) == "vector3" and coords or vector3(coords.x, coords.y, coords.z)
CreateThread(function()
local entity = CreateObject(model, objectCoords, true, true)
local entity = CreateObject(model, objectCoords.x, objectCoords.y, objectCoords.z, true, true, false)
while not DoesEntityExist(entity) do
Wait(50)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ end)
RegisterNetEvent("skinchanger:loadClothes")
AddEventHandler("skinchanger:loadClothes", function(_, clothes)
local playerPed = PlayerPedId()
local outfit = convertClothes(clothes)
local outfit = ConvertClothes(clothes)
exports["fivem-appearance"]:setPedComponents(playerPed, outfit.Components)
exports["fivem-appearance"]:setPedProps(playerPed, outfit.Props)
end)
Expand Down

Large diffs are not rendered by default.

31 changes: 15 additions & 16 deletions server-data/resources/[maps]/gabz_mrpd/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
fx_version 'bodacious'
game 'gta5'
fx_version("bodacious")
game("gta5")

author 'GABZ'
description 'MRPD'
version '1.0.1'
author("GABZ")
description("MRPD Police Map ")
version("1.0.2")

this_is_a_map 'yes'
this_is_a_map("yes")

data_file("TIMECYCLEMOD_FILE")("gabz_mrpd_timecycle.xml")
data_file("INTERIOR_PROXY_ORDER_FILE")("interiorproxies.meta")

data_file 'TIMECYCLEMOD_FILE' 'gabz_mrpd_timecycle.xml'
data_file 'INTERIOR_PROXY_ORDER_FILE' 'interiorproxies.meta'
files({
"gabz_mrpd_timecycle.xml",
"interiorproxies.meta",
})

files {
'gabz_mrpd_timecycle.xml',
'interiorproxies.meta'
}

client_script {
"gabz_mrpd_entitysets.lua"
}
client_script({
"gabz_mrpd_entitysets.lua",
})
10 changes: 5 additions & 5 deletions server-data/resources/[ox]/ox_inventory/data/stashes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ return {
},

{
coords = vec3(306.606598, -601.569214, 43.282104),
coords = vec3(361.767029, -1384.127441, 32.413940),
target = {
loc = vec3(306.606598, -601.569214, 43.282104),
loc = vec3(361.767029, -1384.127441, 32.413940),
length = 0.6,
width = 1.8,
heading = 340,
minZ = 43.34,
maxZ = 44.74,
label = "Open personal locker",
label = "Apri il deposito Aziendale",
},
name = "emslocker",
label = "Personal Locker",
owner = true,
label = "Deposito Aziendale",
owner = false,
slots = 70,
weight = 70000,
groups = { ["ambulance"] = 0 },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
Config = {}
Config.Shops = {
["ambulance"] = { -- Job name
label = "Hospital Shop",
label = "Farmacia Ospedaliera",
blip = {
enabled = true,
coords = vec3(309.415375, -561.784607, 43.282104),
coords = vec3(362.492310, -1381.938477, 32.413940),
sprite = 61,
color = 8,
scale = 0.7,
string = "ambulance",
},
locations = {
stash = {
string = "[E] - Access Inventory",
coords = vec3(309.415375, -561.784607, 43.282104),
string = "[E] - Deposito vendita",
coords = vec3(362.492310, -1381.938477, 32.413940),
range = 3.0,
},
shop = {
string = "[E] - Access Shop",
coords = vec3(308.782410, -592.061523, 43.282104),
string = "[E] - Punto di acquisto",
coords = vec3(358.971436, -1391.380249, 32.413940),
range = 4.0,
},
},
}, -- Copy and paste this shop to create more
},

["ammu"] = {
label = "Ammunation Shop",
Expand Down
Loading