Minor changes

This commit is contained in:
ElPumpo
2019-10-27 00:12:36 +02:00
parent 19d6e032af
commit 88b284f925
10 changed files with 57 additions and 42 deletions
+13 -14
View File
@@ -1,6 +1,6 @@
local CurrentAction, CurrentActionMsg, CurrentActionData = nil, '', {}
local HasAlreadyEnteredMarker, LastHospital, LastPart, LastPartNum
local IsBusy = false
local isBusy = false
local spawnedVehicles, isInShopMenu = {}, false
function OpenAmbulanceActionsMenu()
@@ -53,7 +53,7 @@ function OpenMobileAmbulanceActionsMenu()
{label = _U('ems_menu_putincar'), value = 'put_in_vehicle'}
}
}, function(data, menu)
if IsBusy then return end
if isBusy then return end
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
@@ -63,7 +63,7 @@ function OpenMobileAmbulanceActionsMenu()
if data.current.value == 'revive' then
IsBusy = true
isBusy = true
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
if quantity > 0 then
@@ -100,7 +100,7 @@ function OpenMobileAmbulanceActionsMenu()
ESX.ShowNotification(_U('not_enough_medikit'))
end
IsBusy = false
isBusy = false
end, 'medikit')
@@ -114,7 +114,7 @@ function OpenMobileAmbulanceActionsMenu()
if health > 0 then
local playerPed = PlayerPedId()
IsBusy = true
isBusy = true
ESX.ShowNotification(_U('heal_inprogress'))
TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true)
Citizen.Wait(10000)
@@ -123,7 +123,7 @@ function OpenMobileAmbulanceActionsMenu()
TriggerServerEvent('esx_ambulancejob:removeItem', 'bandage')
TriggerServerEvent('esx_ambulancejob:heal', GetPlayerServerId(closestPlayer), 'small')
ESX.ShowNotification(_U('heal_complete', GetPlayerName(closestPlayer)))
IsBusy = false
isBusy = false
else
ESX.ShowNotification(_U('player_not_conscious'))
end
@@ -142,7 +142,7 @@ function OpenMobileAmbulanceActionsMenu()
if health > 0 then
local playerPed = PlayerPedId()
IsBusy = true
isBusy = true
ESX.ShowNotification(_U('heal_inprogress'))
TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true)
Citizen.Wait(10000)
@@ -151,7 +151,7 @@ function OpenMobileAmbulanceActionsMenu()
TriggerServerEvent('esx_ambulancejob:removeItem', 'medikit')
TriggerServerEvent('esx_ambulancejob:heal', GetPlayerServerId(closestPlayer), 'big')
ESX.ShowNotification(_U('heal_complete', GetPlayerName(closestPlayer)))
IsBusy = false
isBusy = false
else
ESX.ShowNotification(_U('player_not_conscious'))
end
@@ -379,7 +379,7 @@ Citizen.CreateThread(function()
end
elseif ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'ambulance' and not IsDead then
elseif ESX.PlayerData.job ~= nil and ESX.PlayerData.job.name == 'ambulance' and not isDead then
if IsControlJustReleased(0, Keys['F6']) then
OpenMobileAmbulanceActionsMenu()
end
@@ -566,10 +566,10 @@ function StoreNearbyVehicle(playerCoords)
local vehicleId = vehiclePlates[foundNum]
local attempts = 0
ESX.Game.DeleteVehicle(vehicleId.vehicle)
IsBusy = true
isBusy = true
Citizen.CreateThread(function()
while IsBusy do
while isBusy do
Citizen.Wait(0)
drawLoadingText(_U('garage_storing'), 255, 255, 255, 255)
end
@@ -596,7 +596,7 @@ function StoreNearbyVehicle(playerCoords)
end
end
IsBusy = false
isBusy = false
ESX.ShowNotification(_U('garage_has_stored'))
else
ESX.ShowNotification(_U('garage_has_notstored'))
@@ -774,7 +774,7 @@ function OpenShopMenu(elements, restoreCoords, shopCoords)
menu2.close()
end)
end, function(data, menu)
end, function(data, menu)
isInShopMenu = false
ESX.UI.Menu.CloseAll()
@@ -849,7 +849,6 @@ function drawLoadingText(text, red, green, blue, alpha)
SetTextScale(0.0, 0.5)
SetTextColour(red, green, blue, alpha)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextCentre(true)
+19 -19
View File
@@ -10,9 +10,9 @@ Keys = {
["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
}
local FirstSpawn, PlayerLoaded = true, false
local firstSpawn, PlayerLoaded = true, false
IsDead = false
isDead = false
ESX = nil
Citizen.CreateThread(function()
@@ -41,14 +41,14 @@ AddEventHandler('esx:setJob', function(job)
end)
AddEventHandler('playerSpawned', function()
IsDead = false
isDead = false
if FirstSpawn then
if firstSpawn then
exports.spawnmanager:setAutoSpawn(false) -- disable respawn
FirstSpawn = false
firstSpawn = false
ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(isDead)
if isDead and Config.AntiCombatLog then
ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(shouldDie)
if shouldDie and Config.AntiCombatLog then
while not PlayerLoaded do
Citizen.Wait(1000)
end
@@ -57,6 +57,8 @@ AddEventHandler('playerSpawned', function()
RemoveItemsAfterRPDeath()
end
end)
else
TriggerServerEvent('esx_ambulancejob:onPlayerSpawn')
end
end)
@@ -71,7 +73,7 @@ Citizen.CreateThread(function()
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName('STRING')
AddTextComponentSubstringPlayerName(_U('hospital'))
AddTextComponentSubstringPlayerName(_U('blip_hospital'))
EndTextCommandSetBlipName(blip)
end
end)
@@ -81,7 +83,7 @@ Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsDead then
if isDead then
DisableAllControlActions(0)
EnableControlAction(0, Keys['G'], true)
EnableControlAction(0, Keys['T'], true)
@@ -93,7 +95,7 @@ Citizen.CreateThread(function()
end)
function OnPlayerDeath()
IsDead = true
isDead = true
ESX.UI.Menu.CloseAll()
TriggerServerEvent('esx_ambulancejob:setDeathStatus', true)
@@ -147,7 +149,7 @@ function StartDistressSignal()
Citizen.CreateThread(function()
local timer = Config.BleedoutTimer
while timer > 0 and IsDead do
while timer > 0 and isDead do
Citizen.Wait(2)
timer = timer - 30
@@ -155,7 +157,6 @@ function StartDistressSignal()
SetTextScale(0.45, 0.45)
SetTextColour(185, 185, 185, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
BeginTextCommandDisplayText('STRING')
@@ -167,7 +168,7 @@ function StartDistressSignal()
Citizen.CreateThread(function()
Citizen.Wait(1000 * 60 * 5)
if IsDead then
if isDead then
StartDistressSignal()
end
end)
@@ -195,7 +196,6 @@ function DrawGenericTextThisFrame()
SetTextScale(0.0, 0.5)
SetTextColour(255, 255, 255, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextCentre(true)
@@ -229,7 +229,7 @@ function StartDeathTimer()
Citizen.CreateThread(function()
-- early respawn timer
while earlySpawnTimer > 0 and IsDead do
while earlySpawnTimer > 0 and isDead do
Citizen.Wait(1000)
if earlySpawnTimer > 0 then
@@ -238,7 +238,7 @@ function StartDeathTimer()
end
-- bleedout timer
while bleedoutTimer > 0 and IsDead do
while bleedoutTimer > 0 and isDead do
Citizen.Wait(1000)
if bleedoutTimer > 0 then
@@ -251,7 +251,7 @@ function StartDeathTimer()
local text, timeHeld
-- early respawn timer
while earlySpawnTimer > 0 and IsDead do
while earlySpawnTimer > 0 and isDead do
Citizen.Wait(0)
text = _U('respawn_available_in', secondsToClock(earlySpawnTimer))
@@ -263,7 +263,7 @@ function StartDeathTimer()
end
-- bleedout timer
while bleedoutTimer > 0 and IsDead do
while bleedoutTimer > 0 and isDead do
Citizen.Wait(0)
text = _U('respawn_bleedout_in', secondsToClock(bleedoutTimer))
@@ -297,7 +297,7 @@ function StartDeathTimer()
DrawText(0.5, 0.8)
end
if bleedoutTimer < 1 and IsDead then
if bleedoutTimer < 1 and isDead then
RemoveItemsAfterRPDeath()
end
end)
+3 -1
View File
@@ -36,7 +36,6 @@ Locales['br'] = {
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'Hôspital',
['revive_inprogress'] = 'Reanimação em andamento',
['revive_complete'] = 'você ressuscitou ~y~%s~s~',
['revive_complete_award'] = 'você ressuscitou ~y~%s~s~, ~g~$%s~s~',
@@ -87,4 +86,7 @@ Locales['br'] = {
['not_enough_medikit'] = 'Você não tem ~b~Seringa~s~.',
['not_enough_bandage'] = 'Você não tem ~b~Vendagem~s~.',
['healed'] = 'Você foi tratado.',
-- Blips
['blip_hospital'] = 'Hôspital',
['blip_dead'] = 'unconscious player',
}
+3 -1
View File
@@ -36,7 +36,6 @@ Locales['cs'] = {
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'nemocnice',
['revive_inprogress'] = 'probíhá oživení!',
['revive_complete'] = 'oživili jste ~y~%s~s~',
['revive_complete_award'] = 'oživili jste ~y~%s~s~ a dostali jste ~g~$%s~s~!',
@@ -87,4 +86,7 @@ Locales['cs'] = {
['not_enough_medikit'] = 'nemáte ~b~medikit~s~.',
['not_enough_bandage'] = 'nemáte~b~bandage~s~.',
['healed'] = 'byli jste ošetřeni.',
-- Blips
['blip_hospital'] = 'nemocnice',
['blip_dead'] = 'unconscious player',
}
+3 -1
View File
@@ -36,7 +36,6 @@ Locales['en'] = {
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'hospital',
['revive_inprogress'] = 'a revive is in progress!',
['revive_complete'] = 'you have revived ~y~%s~s~',
['revive_complete_award'] = 'you have revived ~y~%s~s~ and earned ~g~$%s~s~!',
@@ -87,4 +86,7 @@ Locales['en'] = {
['not_enough_medikit'] = 'You do not have ~b~medikit~s~.',
['not_enough_bandage'] = 'You do not have ~b~bandage~s~.',
['healed'] = 'you have been treated.',
-- Blips
['blip_hospital'] = 'hospital',
['blip_dead'] = 'unconscious player',
}
+3 -1
View File
@@ -36,7 +36,6 @@ Locales['es'] = {
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'hospital',
['revive_inprogress'] = 'reanimación en curso',
['revive_complete'] = 'has sido reanimado ~y~%s~s~',
['revive_complete_award'] = 'has sido reanimado ~y~%s~s~, ~g~$%s~s~',
@@ -87,4 +86,7 @@ Locales['es'] = {
['not_enough_medikit'] = 'You do not have ~b~medikit~s~.',
['not_enough_bandage'] = 'You do not have ~b~bandage~s~.',
['healed'] = 'you have been treated.',
-- Blips
['blip_hospital'] = 'hospital',
['blip_dead'] = 'unconscious player',
}
+3 -1
View File
@@ -36,7 +36,6 @@ Locales['fi'] = {
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'sairaala',
['revive_inprogress'] = 'elvytys on menossa!',
['revive_complete'] = 'sinä elvytit henkilön ~y~%s~s~',
['revive_complete_award'] = 'sinä elvytit henkilön ~y~%s~s~ ja tienasit ~g~$%s~s~!',
@@ -87,4 +86,7 @@ Locales['fi'] = {
['not_enough_medikit'] = 'ei tarpeeksi ~b~ensiapupakkauksia~s~.',
['not_enough_bandage'] = 'ei tarpeeksi ~b~sideharsoja~s~.',
['healed'] = 'sinua parannettiin',
-- Blips
['blip_hospital'] = 'sairaala',
['blip_dead'] = 'unconscious player',
}
+4 -2
View File
@@ -36,7 +36,6 @@ Locales['fr'] = {
['confirm_no'] = 'non',
['confirm_yes'] = 'oui',
-- Action Menu
['hospital'] = 'hôpital',
['revive_inprogress'] = 'réanimation en cours',
['revive_complete'] = 'vous avez réanimé ~y~%s~s~',
['revive_complete_award'] = 'vous avez réanimé ~y~%s~s~, ~g~$%s~s~',
@@ -49,7 +48,7 @@ Locales['fr'] = {
-- Boss Menu
['boss_actions'] = 'action Patron',
-- Misc
['invalid_amount'] = '~r~montant invalide',
['invalid_amount'] = '~r~montant invalide~s~',
['actions_prompt'] = 'press ~INPUT_CONTEXT~ access the ~y~Ambulance Actions~s~.',
['deposit_amount'] = 'montant du dépôt',
['money_withdraw'] = 'montant du retrait',
@@ -87,4 +86,7 @@ Locales['fr'] = {
['not_enough_medikit'] = 'vous n\'avez pas de ~b~kit de soin~s~.',
['not_enough_bandage'] = 'vous n\'avez pas de ~b~bandage~s~.',
['healed'] = 'vous avez été soigné.',
-- Blips
['blip_hospital'] = 'hôpital',
['blip_dead'] = 'unconscious player',
}
+3 -1
View File
@@ -36,7 +36,6 @@ Locales['pl'] = {
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'szpital',
['revive_inprogress'] = 'trwa wskrzeszenie',
['revive_complete'] = 'zostałeś wskrzeszony ~y~%s~s~',
['revive_complete_award'] = 'zostałeś wskrzeszony ~y~%s~s~ i zarobiono ~g~$%s~s~!',
@@ -87,4 +86,7 @@ Locales['pl'] = {
['not_enough_medikit'] = 'nie posiadasz ~b~apteczki~s~.',
['not_enough_bandage'] = 'nie posiadasz ~b~bandaża~s~.',
['healed'] = 'zostałeś potraktowany',
-- Blips
['blip_hospital'] = 'szpital',
['blip_dead'] = 'unconscious player',
}
+3 -1
View File
@@ -36,7 +36,6 @@ Locales['sv'] = {
['confirm_no'] = 'no',
['confirm_yes'] = 'yes',
-- Action Menu
['hospital'] = 'sjukhus',
['revive_inprogress'] = 'en återupplivning har börjats',
['revive_complete'] = 'du har återupplivat ~y~%s~s~, bra jobbat!',
['revive_complete_award'] = 'du har återupplivat ~y~%s~s~ och tjärnat ~g~%s SEK~s~ för dina tjänster, bra jobbat!',
@@ -87,4 +86,7 @@ Locales['sv'] = {
['not_enough_medikit'] = 'du har inget ~b~Medecinkit~s~.',
['not_enough_bandage'] = 'du har inget ~b~Bandage~s~.',
['healed'] = 'dina skador har blivit behandlade.',
-- Blips
['blip_hospital'] = 'sjukhus',
['blip_dead'] = 'medvetslös människa',
}