Minor adjustments

This commit is contained in:
ElPumpo
2020-01-19 16:44:22 +01:00
parent 7cf3036154
commit ecb553f23c
2 changed files with 44 additions and 56 deletions
+8 -13
View File
@@ -32,7 +32,6 @@ function OpenAmbulanceActionsMenu()
end
function OpenMobileAmbulanceActionsMenu()
ESX.UI.Menu.CloseAll()
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_ambulance_actions', {
@@ -40,8 +39,7 @@ function OpenMobileAmbulanceActionsMenu()
align = 'top-left',
elements = {
{label = _U('ems_menu'), value = 'citizen_interaction'}
}
}, function(data, menu)
}}, function(data, menu)
if data.current.value == 'citizen_interaction' then
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', {
title = _U('ems_menu_title'),
@@ -51,8 +49,7 @@ function OpenMobileAmbulanceActionsMenu()
{label = _U('ems_menu_small'), value = 'small'},
{label = _U('ems_menu_big'), value = 'big'},
{label = _U('ems_menu_putincar'), value = 'put_in_vehicle'}
}
}, function(data, menu)
}}, function(data, menu)
if isBusy then return end
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
@@ -60,11 +57,9 @@ function OpenMobileAmbulanceActionsMenu()
if closestPlayer == -1 or closestDistance > 1.0 then
ESX.ShowNotification(_U('no_players'))
else
if data.current.value == 'revive' then
revivePlayer(closestPlayer)
elseif data.current.value == 'small' then
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
if quantity > 0 then
local closestPlayerPed = GetPlayerPed(closestPlayer)
@@ -195,7 +190,7 @@ Citizen.CreateThread(function()
-- Ambulance Actions
for k,v in ipairs(hospital.AmbulanceActions) do
local distance = GetDistanceBetweenCoords(playerCoords, v, true)
local distance = #(playerCoords - v)
if distance < Config.DrawDistance then
DrawMarker(Config.Marker.type, v, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.Marker.x, Config.Marker.y, Config.Marker.z, Config.Marker.r, Config.Marker.g, Config.Marker.b, Config.Marker.a, false, false, 2, Config.Marker.rotate, nil, nil, false)
@@ -209,7 +204,7 @@ Citizen.CreateThread(function()
-- Pharmacies
for k,v in ipairs(hospital.Pharmacies) do
local distance = GetDistanceBetweenCoords(playerCoords, v, true)
local distance = #(playerCoords - v)
if distance < Config.DrawDistance then
DrawMarker(Config.Marker.type, v, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.Marker.x, Config.Marker.y, Config.Marker.z, Config.Marker.r, Config.Marker.g, Config.Marker.b, Config.Marker.a, false, false, 2, Config.Marker.rotate, nil, nil, false)
@@ -223,7 +218,7 @@ Citizen.CreateThread(function()
-- Vehicle Spawners
for k,v in ipairs(hospital.Vehicles) do
local distance = GetDistanceBetweenCoords(playerCoords, v.Spawner, true)
local distance = #(playerCoords - v.Spawner)
if distance < Config.DrawDistance then
DrawMarker(v.Marker.type, v.Spawner, 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)
@@ -237,7 +232,7 @@ Citizen.CreateThread(function()
-- Helicopter Spawners
for k,v in ipairs(hospital.Helicopters) do
local distance = GetDistanceBetweenCoords(playerCoords, v.Spawner, true)
local distance = #(playerCoords - v.Spawner)
if distance < Config.DrawDistance then
DrawMarker(v.Marker.type, v.Spawner, 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)
@@ -251,7 +246,7 @@ Citizen.CreateThread(function()
-- Fast Travels
for k,v in ipairs(hospital.FastTravels) do
local distance = GetDistanceBetweenCoords(playerCoords, v.From, true)
local distance = #(playerCoords - v.From)
if distance < Config.DrawDistance then
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)
@@ -266,7 +261,7 @@ Citizen.CreateThread(function()
-- Fast Travels (Prompt)
for k,v in ipairs(hospital.FastTravelsPrompt) do
local distance = GetDistanceBetweenCoords(playerCoords, v.From, true)
local distance = #(playerCoords - v.From)
if distance < Config.DrawDistance then
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)
+36 -43
View File
@@ -2,7 +2,7 @@ Config = {}
Config.DrawDistance = 100.0
Config.Marker = { type = 1, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false }
Config.Marker = {type = 1, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false}
Config.ReviveReward = 700 -- revive reward, set to 0 if you don't want it enabled
Config.AntiCombatLog = true -- enable anti-combat logging?
@@ -10,11 +10,8 @@ Config.LoadIpl = true -- disable if you're using fivem-ipl or
Config.Locale = 'fr'
local second = 1000
local minute = 60 * second
Config.EarlyRespawnTimer = 2 * minute -- Time til respawn is available
Config.BleedoutTimer = 10 * minute -- Time til the player bleeds out
Config.EarlyRespawnTimer = 60000 * 1 -- time til respawn is available
Config.BleedoutTimer = 60000 * 10 -- time til the player bleeds out
Config.EnablePlayerManagement = false
@@ -26,7 +23,7 @@ Config.RemoveItemsAfterRPDeath = true
Config.EarlyRespawnFine = false
Config.EarlyRespawnFineAmount = 5000
Config.RespawnPoint = { coords = vector3(341.0, -1397.3, 32.5), heading = 48.5 }
Config.RespawnPoint = {coords = vector3(341.0, -1397.3, 32.5), heading = 48.5}
Config.Hospitals = {
@@ -51,11 +48,11 @@ Config.Hospitals = {
{
Spawner = vector3(307.7, -1433.4, 30.0),
InsideShop = vector3(446.7, -1355.6, 43.5),
Marker = { type = 36, x = 1.0, y = 1.0, z = 1.0, r = 100, g = 50, b = 200, a = 100, rotate = true },
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(297.2, -1429.5, 29.8), heading = 227.6, radius = 4.0 },
{ coords = vector3(294.0, -1433.1, 29.8), heading = 227.6, radius = 4.0 },
{ coords = vector3(309.4, -1442.5, 29.8), heading = 227.6, radius = 6.0 }
{coords = vector3(297.2, -1429.5, 29.8), heading = 227.6, radius = 4.0},
{coords = vector3(294.0, -1433.1, 29.8), heading = 227.6, radius = 4.0},
{coords = vector3(309.4, -1442.5, 29.8), heading = 227.6, radius = 6.0}
}
}
},
@@ -64,10 +61,10 @@ Config.Hospitals = {
{
Spawner = vector3(317.5, -1449.5, 46.5),
InsideShop = vector3(305.6, -1419.7, 41.5),
Marker = { type = 34, x = 1.5, y = 1.5, z = 1.5, r = 100, g = 150, b = 150, a = 100, rotate = true },
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.5, -1465.1, 46.5), heading = 142.7, radius = 10.0 },
{ coords = vector3(299.5, -1453.2, 46.5), heading = 142.7, radius = 10.0 }
{coords = vector3(313.5, -1465.1, 46.5), heading = 142.7, radius = 10.0},
{coords = vector3(299.5, -1453.2, 46.5), heading = 142.7, radius = 10.0}
}
}
},
@@ -75,53 +72,53 @@ Config.Hospitals = {
FastTravels = {
{
From = vector3(294.7, -1448.1, 29.0),
To = { coords = vector3(272.8, -1358.8, 23.5), 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 }
To = {coords = vector3(272.8, -1358.8, 23.5), 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}
},
{
From = vector3(275.3, -1361, 23.5),
To = { coords = vector3(295.8, -1446.5, 28.9), 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 }
To = {coords = vector3(295.8, -1446.5, 28.9), 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}
},
{
From = vector3(247.3, -1371.5, 23.5),
To = { coords = vector3(333.1, -1434.9, 45.5), heading = 138.6 },
Marker = { type = 1, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false }
To = {coords = vector3(333.1, -1434.9, 45.5), heading = 138.6},
Marker = {type = 1, x = 1.5, y = 1.5, z = 0.5, r = 102, g = 0, b = 102, a = 100, rotate = false}
},
{
From = vector3(335.5, -1432.0, 45.50),
To = { coords = vector3(249.1, -1369.6, 23.5), 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 }
To = {coords = vector3(249.1, -1369.6, 23.5), 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}
},
{
From = vector3(234.5, -1373.7, 20.9),
To = { coords = vector3(320.9, -1478.6, 28.8), heading = 0.0 },
Marker = { type = 1, x = 1.5, y = 1.5, z = 1.0, r = 102, g = 0, b = 102, a = 100, rotate = false }
To = {coords = vector3(320.9, -1478.6, 28.8), heading = 0.0},
Marker = {type = 1, x = 1.5, y = 1.5, z = 1.0, r = 102, g = 0, b = 102, a = 100, rotate = false}
},
{
From = vector3(317.9, -1476.1, 28.9),
To = { coords = vector3(238.6, -1368.4, 23.5), heading = 0.0 },
Marker = { type = 1, x = 1.5, y = 1.5, z = 1.0, r = 102, g = 0, b = 102, a = 100, rotate = false }
To = {coords = vector3(238.6, -1368.4, 23.5), heading = 0.0},
Marker = {type = 1, x = 1.5, y = 1.5, z = 1.0, r = 102, g = 0, b = 102, a = 100, rotate = false}
}
},
FastTravelsPrompt = {
{
From = vector3(237.4, -1373.8, 26.0),
To = { coords = vector3(251.9, -1363.3, 38.5), 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 },
To = {coords = vector3(251.9, -1363.3, 38.5), 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},
Prompt = _U('fast_travel')
},
{
From = vector3(256.5, -1357.7, 36.0),
To = { coords = vector3(235.4, -1372.8, 26.3), 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 },
To = {coords = vector3(235.4, -1372.8, 26.3), 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},
Prompt = _U('fast_travel')
}
}
@@ -130,41 +127,37 @@ Config.Hospitals = {
}
Config.AuthorizedVehicles = {
ambulance = {
{ model = 'ambulance', label = 'Ambulance Van', price = 5000}
{model = 'ambulance', label = 'Ambulance Van', price = 5000}
},
doctor = {
{ model = 'ambulance', label = 'Ambulance Van', price = 4500}
{model = 'ambulance', label = 'Ambulance Van', price = 4500}
},
chief_doctor = {
{ model = 'ambulance', label = 'Ambulance Van', price = 3000}
{model = 'ambulance', label = 'Ambulance Van', price = 3000}
},
boss = {
{ model = 'ambulance', label = 'Ambulance Van', price = 2000}
{model = 'ambulance', label = 'Ambulance Van', price = 2000}
}
}
Config.AuthorizedHelicopters = {
ambulance = {},
doctor = {
{ model = 'buzzard2', label = 'Nagasaki Buzzard', price = 150000 }
{model = 'buzzard2', label = 'Nagasaki Buzzard', price = 150000}
},
chief_doctor = {
{ model = 'buzzard2', label = 'Nagasaki Buzzard', price = 150000 },
{ model = 'seasparrow', label = 'Sea Sparrow', price = 300000 }
{model = 'buzzard2', label = 'Nagasaki Buzzard', price = 150000},
{model = 'seasparrow', label = 'Sea Sparrow', price = 300000}
},
boss = {
{ model = 'buzzard2', label = 'Nagasaki Buzzard', price = 10000 },
{ model = 'seasparrow', label = 'Sea Sparrow', price = 250000 }
{model = 'buzzard2', label = 'Nagasaki Buzzard', price = 10000},
{model = 'seasparrow', label = 'Sea Sparrow', price = 250000}
}
}