diff --git a/client/main.lua b/client/main.lua index ee310ab7..a5b82dec 100644 --- a/client/main.lua +++ b/client/main.lua @@ -25,37 +25,41 @@ ESX = nil GUI.Time = 0 Citizen.CreateThread(function() - while ESX == nil do - TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) - Citizen.Wait(0) - end + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end + + Citizen.Wait(5000) + PlayerData = ESX.GetPlayerData() end) function RespawnPed(ped, coords) - SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false, true) - NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, false) - SetPlayerInvincible(ped, false) - TriggerEvent('playerSpawned', coords.x, coords.y, coords.z, coords.heading) - ClearPedBloodDamage(ped) - if RespawnToHospitalMenu ~= nil then - RespawnToHospitalMenu.close() - RespawnToHospitalMenu = nil - end - ESX.UI.Menu.CloseAll() + SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false, true) + NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, false) + SetPlayerInvincible(ped, false) + TriggerEvent('playerSpawned', coords.x, coords.y, coords.z, coords.heading) + ClearPedBloodDamage(ped) + if RespawnToHospitalMenu ~= nil then + RespawnToHospitalMenu.close() + RespawnToHospitalMenu = nil + end + + ESX.UI.Menu.CloseAll() end RegisterNetEvent('esx_ambulancejob:heal') AddEventHandler('esx_ambulancejob:heal', function(_type) - local playerPed = GetPlayerPed(-1) - local maxHealth = GetEntityMaxHealth(playerPed) - if _type == 'small' then - local health = GetEntityHealth(playerPed) - local newHealth = math.min(maxHealth , math.floor(health + maxHealth/8)) - SetEntityHealth(playerPed, newHealth) - elseif _type == 'big' then - SetEntityHealth(playerPed, maxHealth) - end - ESX.ShowNotification(_U('healed')) + local playerPed = GetPlayerPed(-1) + local maxHealth = GetEntityMaxHealth(playerPed) + if _type == 'small' then + local health = GetEntityHealth(playerPed) + local newHealth = math.min(maxHealth , math.floor(health + maxHealth/8)) + SetEntityHealth(playerPed, newHealth) + elseif _type == 'big' then + SetEntityHealth(playerPed, maxHealth) + end + ESX.ShowNotification(_U('healed')) end) function StartRespawnToHospitalMenuTimer() @@ -99,74 +103,71 @@ function StartRespawnTimer() end function ShowTimer() - local timer = Config.RespawnDelayAfterRPDeath - Citizen.CreateThread(function() + local timer = Config.RespawnDelayAfterRPDeath + + Citizen.CreateThread(function() + while timer > 0 and IsDead do + Citizen.Wait(0) - while timer > 0 and IsDead do - Citizen.Wait(0) + raw_seconds = timer/1000 + raw_minutes = raw_seconds/60 + minutes = stringsplit(raw_minutes, ".")[1] + seconds = stringsplit(raw_seconds-(minutes*60), ".")[1] + + SetTextFont(4) + SetTextProportional(0) + SetTextScale(0.0, 0.5) + SetTextColour(255, 255, 255, 255) + SetTextDropshadow(0, 0, 0, 0, 255) + SetTextEdge(1, 0, 0, 0, 255) + SetTextDropShadow() + SetTextOutline() + SetTextEntry("STRING") - raw_seconds = timer/1000 - raw_minutes = raw_seconds/60 - minutes = stringsplit(raw_minutes, ".")[1] - seconds = stringsplit(raw_seconds-(minutes*60), ".")[1] + local text = _U('please_wait', minutes, seconds) - SetTextFont(4) - SetTextProportional(0) - SetTextScale(0.0, 0.5) - SetTextColour(255, 255, 255, 255) - SetTextDropshadow(0, 0, 0, 0, 255) - SetTextEdge(1, 0, 0, 0, 255) + if Config.EarlyRespawn then + text = text .. '\n[~b~E~s~]' + end - SetTextDropShadow() - SetTextOutline() - SetTextEntry("STRING") + AddTextComponentString(text) + SetTextCentre(true) + DrawText(0.5, 0.8) - local text = _U('please_wait') .. minutes .. _U('minutes') .. seconds .. _U('seconds') + if Config.EarlyRespawn then + if IsControlPressed(0, Keys['E']) then + RemoveItemsAfterRPDeath() + break + end + end + timer = timer - 15 + end - if Config.EarlyRespawn then - text = text .. '\n[~b~E~w~]' - end + if Config.EarlyRespawn then + while timer <= 0 and IsDead do + Citizen.Wait(0) - AddTextComponentString(text) - SetTextCentre(true) - DrawText(0.5, 0.8) + SetTextFont(4) + SetTextProportional(0) + SetTextScale(0.0, 0.5) + SetTextColour(255, 255, 255, 255) + SetTextDropshadow(0, 0, 0, 0, 255) + SetTextEdge(1, 0, 0, 0, 255) + SetTextDropShadow() + SetTextOutline() + SetTextEntry("STRING") - if Config.EarlyRespawn then - if IsControlPressed(0, Keys['E']) then - RemoveItemsAfterRPDeath() - break - end - end - timer = timer - 15 - end + AddTextComponentString(_U('press_respawn')) + SetTextCentre(true) + DrawText(0.5, 0.8) - if Config.EarlyRespawn then - while timer <= 0 and IsDead do - Citizen.Wait(0) - - SetTextFont(4) - SetTextProportional(0) - SetTextScale(0.0, 0.5) - SetTextColour(255, 255, 255, 255) - SetTextDropshadow(0, 0, 0, 0, 255) - SetTextEdge(1, 0, 0, 0, 255) - - SetTextDropShadow() - SetTextOutline() - SetTextEntry("STRING") - - AddTextComponentString(_U('press_respawn')) - SetTextCentre(true) - DrawText(0.5, 0.8) - - if IsControlPressed(0, Keys['E']) then - RemoveItemsAfterRPDeath() - break - end - end - end - - end) + if IsControlPressed(0, Keys['E']) then + RemoveItemsAfterRPDeath() + break + end + end + end + end) end function RemoveItemsAfterRPDeath() @@ -301,136 +302,134 @@ end function OpenMobileAmbulanceActionsMenu() - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'mobile_ambulance_actions', - { - title = _U('ambulance'), - elements = { - {label = _U('ems_menu'), value = 'citizen_interaction'}, - } - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'mobile_ambulance_actions', + { + title = _U('ambulance'), + align = 'top-left', + elements = { + {label = _U('ems_menu'), value = 'citizen_interaction'}, + } + }, function(data, menu) + if data.current.value == 'citizen_interaction' then + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = _U('ems_menu_title'), + align = 'top-left', + elements = { + {label = _U('ems_menu_revive'), value = 'revive'}, + {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) + if data.current.value == 'revive' then -- revive + + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification(_U('no_players')) + else + ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(qtty) + if qtty > 0 then + local closestPlayerPed = GetPlayerPed(closestPlayer) + local health = GetEntityHealth(closestPlayerPed) + + if health == 0 then + menu.close() + local playerPed = GetPlayerPed(-1) + + ESX.ShowNotification(_U('revive_inprogress')) + TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) + Citizen.Wait(10000) + ClearPedTasks(playerPed) + + TriggerServerEvent('esx_ambulancejob:removeItem', 'medikit') + TriggerServerEvent('esx_ambulancejob:revive', GetPlayerServerId(closestPlayer)) + + -- Show revive award? + if Config.ReviveReward > 0 then + ESX.ShowNotification(_U('revive_complete_award', GetPlayerName(closestPlayer), Config.ReviveReward)) + else + ESX.ShowNotification(_U('revive_complete', GetPlayerName(closestPlayer))) + end + else + ESX.ShowNotification(_U('player_not_unconscious')) + end + else + ESX.ShowNotification(_U('not_enough_medikit')) + end + end, 'medikit') + end + elseif data.current.value == 'small' then + + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification(_U('no_players')) + else + ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(qtty) + if qtty > 0 then + menu.close() + local playerPed = GetPlayerPed(-1) + ESX.ShowNotification(_U('heal_inprogress')) + TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) + Citizen.Wait(10000) + ClearPedTasks(playerPed) + + TriggerServerEvent('esx_ambulancejob:removeItem', 'bandage') + TriggerServerEvent('esx_ambulancejob:heal', GetPlayerServerId(closestPlayer), 'small') + ESX.ShowNotification(_U('heal_complete')) + else + ESX.ShowNotification(_U('not_enough_bandage')) + end + end, 'bandage') + end + elseif data.current.value == 'big' then + + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification(_U('no_players')) + else + ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(qtty) + if qtty > 0 then + menu.close() + local playerPed = GetPlayerPed(-1) + ESX.ShowNotification(_U('heal_inprogress')) + TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) + Citizen.Wait(10000) + ClearPedTasks(playerPed) + TriggerServerEvent('esx_ambulancejob:removeItem', 'medikit') + TriggerServerEvent('esx_ambulancejob:heal', GetPlayerServerId(closestPlayer), 'big') + ESX.ShowNotification(_U('heal_complete')) + else + ESX.ShowNotification(_U('not_enough_medikit')) + end + end, 'medikit') + end + elseif data.current.value == 'put_in_vehicle' then + + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + if closestPlayer == -1 or closestDistance > 3.0 then + ESX.ShowNotification(_U('no_vehicles')) + else + menu.close() + WarpPedInClosestVehicle(GetPlayerPed(closestPlayer)) + end + end + end, function(data, menu) + menu.close() + end + ) - if data.current.value == 'citizen_interaction' then + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { - title = _U('ems_menu_title'), - elements = { - {label = _U('ems_menu_revive'), value = 'revive'}, - {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) - - if data.current.value == 'revive' then - menu.close() - local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() - if closestPlayer == -1 or closestDistance > 3.0 then - ESX.ShowNotification(_U('no_players')) - else - ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(qtty) - if qtty > 0 then - local closestPlayerPed = GetPlayerPed(closestPlayer) - local health = GetEntityHealth(closestPlayerPed) - if health == 0 then - local playerPed = GetPlayerPed(-1) - Citizen.CreateThread(function() - ESX.ShowNotification(_U('revive_inprogress')) - TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) - Wait(10000) - ClearPedTasks(playerPed) - if GetEntityHealth(closestPlayerPed) == 0 then - TriggerServerEvent('esx_ambulancejob:removeItem', 'medikit') - TriggerServerEvent('esx_ambulancejob:revive', GetPlayerServerId(closestPlayer)) - ESX.ShowNotification(_U('revive_complete')) - else - ESX.ShowNotification(_U('isdead')) - end - end) - else - ESX.ShowNotification(_U('unconscious')) - end - else - ESX.ShowNotification(_U('not_enough_medikit')) - end - end, 'medikit') - end - end - - if data.current.value == 'small' then - menu.close() - local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() - if closestPlayer == -1 or closestDistance > 3.0 then - ESX.ShowNotification(_U('no_players')) - else - ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(qtty) - if qtty > 0 then - local playerPed = GetPlayerPed(-1) - Citizen.CreateThread(function() - ESX.ShowNotification(_U('heal_inprogress')) - TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) - Wait(10000) - ClearPedTasks(playerPed) - TriggerServerEvent('esx_ambulancejob:removeItem', 'bandage') - TriggerServerEvent('esx_ambulancejob:heal', GetPlayerServerId(closestPlayer), 'small') - ESX.ShowNotification(_U('heal_complete')) - end) - else - ESX.ShowNotification(_U('not_enough_bandage')) - end - end, 'bandage') - end - end - - if data.current.value == 'big' then - menu.close() - local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() - if closestPlayer == -1 or closestDistance > 3.0 then - ESX.ShowNotification(_U('no_players')) - else - ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(qtty) - if qtty > 0 then - local playerPed = GetPlayerPed(-1) - Citizen.CreateThread(function() - ESX.ShowNotification(_U('heal_inprogress')) - TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) - Wait(10000) - ClearPedTasks(playerPed) - TriggerServerEvent('esx_ambulancejob:removeItem', 'medikit') - TriggerServerEvent('esx_ambulancejob:heal', GetPlayerServerId(closestPlayer), 'big') - ESX.ShowNotification(_U('heal_complete')) - end) - else - ESX.ShowNotification(_U('not_enough_medikit')) - end - end, 'medikit') - end - end - - if data.current.value == 'put_in_vehicle' then - menu.close() - WarpPedInClosestVehicle(GetPlayerPed(closestPlayer)) - end - - end, - function(data, menu) - menu.close() - end - ) - - end - - end, - function(data, menu) - menu.close() - end - ) + end, function(data, menu) + menu.close() + end + ) end @@ -486,107 +485,90 @@ end function OpenVehicleSpawnerMenu() - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - if Config.EnableSocietyOwnedVehicles then + if Config.EnableSocietyOwnedVehicles then - local elements = {} + local elements = {} - ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles) + ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles) - for i=1, #vehicles, 1 do - table.insert(elements, {label = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']', value = vehicles[i]}) - end + for i=1, #vehicles, 1 do + table.insert(elements, {label = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']', value = vehicles[i]}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('veh_menu'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('veh_menu'), + align = 'top-left', + elements = elements, + }, function(data, menu) + menu.close() - menu.close() - - local vehicleProps = data.current.value - - ESX.Game.SpawnVehicle(vehicleProps.model, Config.Zones.VehicleSpawnPoint.Pos, 270.0, function(vehicle) - ESX.Game.SetVehicleProperties(vehicle, vehicleProps) - local playerPed = GetPlayerPed(-1) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) - - TriggerServerEvent('esx_society:removeVehicleFromGarage', 'ambulance', vehicleProps) - - end, - function(data, menu) - - menu.close() - - CurrentAction = 'vehicle_spawner_menu' - CurrentActionMsg = _U('veh_spawn') - CurrentActionData = {} - - end - ) - - end, 'ambulance') - - else - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('veh_menu'), - align = 'top-left', - elements = { - {label = _U('ambulance'), value = 'ambulance'} - }, - }, - function(data, menu) - menu.close() - local model = data.current.value - ESX.Game.SpawnVehicle(model, Config.Zones.VehicleSpawnPoint.Pos, 230.0, function(vehicle) - local playerPed = GetPlayerPed(-1) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) - end, - function(data, menu) - menu.close() - CurrentAction = 'vehicle_spawner_menu' - CurrentActionMsg = _U('veh_spawn') - CurrentActionData = {} - end - ) - - end + local vehicleProps = data.current.value + ESX.Game.SpawnVehicle(vehicleProps.model, Config.Zones.VehicleSpawnPoint.Pos, 270.0, function(vehicle) + ESX.Game.SetVehicleProperties(vehicle, vehicleProps) + local playerPed = GetPlayerPed(-1) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + TriggerServerEvent('esx_society:removeVehicleFromGarage', 'ambulance', vehicleProps) + + end, function(data, menu) + menu.close() + CurrentAction = 'vehicle_spawner_menu' + CurrentActionMsg = _U('veh_spawn') + CurrentActionData = {} + end + ) + end, 'ambulance') + + else -- not society vehicles + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('veh_menu'), + align = 'top-left', + elements = Config.AuthorizedVehicles + }, function(data, menu) + menu.close() + ESX.Game.SpawnVehicle(data.current.model, Config.Zones.VehicleSpawnPoint.Pos, 230.0, function(vehicle) + local playerPed = GetPlayerPed(-1) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + end, function(data, menu) + menu.close() + CurrentAction = 'vehicle_spawner_menu' + CurrentActionMsg = _U('veh_spawn') + CurrentActionData = {} + end + ) + end end function OpenPharmacyMenu() - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'pharmacy', - { - title = _U('pharmacy_menu_title'), - align = 'top-left', - elements = { - {label = _U('pharmacy_take') .. ' ' .. _('medikit'), value = 'medikit'}, - {label = _U('pharmacy_take') .. ' ' .. _('bandage'), value = 'bandage'} - }, - }, - function(data, menu) - TriggerServerEvent('esx_ambulancejob:giveItem', data.current.value) - end, - function(data, menu) - menu.close() - CurrentAction = 'pharmacy' - CurrentActionMsg = _U('open_pharmacy') - CurrentActionData = {} - end - ) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'pharmacy', + { + title = _U('pharmacy_menu_title'), + align = 'top-left', + elements = { + {label = _U('pharmacy_take') .. ' ' .. _('medikit'), value = 'medikit'}, + {label = _U('pharmacy_take') .. ' ' .. _('bandage'), value = 'bandage'} + }, + }, function(data, menu) + TriggerServerEvent('esx_ambulancejob:giveItem', data.current.value) + + end, function(data, menu) + menu.close() + CurrentAction = 'pharmacy' + CurrentActionMsg = _U('open_pharmacy') + CurrentActionData = {} + end + ) end AddEventHandler('playerSpawned', function() @@ -811,35 +793,36 @@ end) -- Activate menu when player is inside marker Citizen.CreateThread(function() - while true do - Citizen.Wait(0) - local coords = GetEntityCoords(GetPlayerPed(-1)) - local isInMarker = false - local currentZone = nil - for k,v in pairs(Config.Zones) do - if PlayerData.job ~= nil and PlayerData.job.name == 'ambulance' then - if(GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentZone = k - end - elseif k ~= 'AmbulanceActions' and k ~= 'VehicleSpawner' and k ~= 'VehicleDeleter' - and k ~= 'Pharmacy' and k ~= 'StairsGoTopBottom' and k ~= 'StairsGoBottomTop' then - if(GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentZone = k - end - end - end - if isInMarker and not hasAlreadyEnteredMarker then - hasAlreadyEnteredMarker = true - lastZone = currentZone - TriggerEvent('esx_ambulancejob:hasEnteredMarker', currentZone) - end - if not isInMarker and hasAlreadyEnteredMarker then - hasAlreadyEnteredMarker = false - TriggerEvent('esx_ambulancejob:hasExitedMarker', lastZone) - end - end + while true do + Citizen.Wait(10) + + local coords = GetEntityCoords(GetPlayerPed(-1)) + local isInMarker = false + local currentZone = nil + for k,v in pairs(Config.Zones) do + if PlayerData.job ~= nil and PlayerData.job.name == 'ambulance' then + if(GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentZone = k + end + elseif k ~= 'AmbulanceActions' and k ~= 'VehicleSpawner' and k ~= 'VehicleDeleter' and k ~= 'Pharmacy' and k ~= 'StairsGoTopBottom' and k ~= 'StairsGoBottomTop' then + if(GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentZone = k + end + end + end + if isInMarker and not hasAlreadyEnteredMarker then + hasAlreadyEnteredMarker = true + lastZone = currentZone + TriggerEvent('esx_ambulancejob:hasEnteredMarker', currentZone) + end + + if not isInMarker and hasAlreadyEnteredMarker then + hasAlreadyEnteredMarker = false + TriggerEvent('esx_ambulancejob:hasExitedMarker', lastZone) + end + end end) -- Key Controls diff --git a/config.lua b/config.lua index 2f8efb28..1ce952f5 100644 --- a/config.lua +++ b/config.lua @@ -26,7 +26,7 @@ Config.RemoveItemsAfterRPDeath = true -- Will display a timer that shows RespawnDelayAfterRPDeath time remaining Config.ShowDeathTimer = true --- Will allow to respawn at any time, don't use RespawnToHospitalMenuTimer at the same time ! +-- Will allow to respawn at any time, don't use with RespawnToHospitalMenuTimer enabled! Config.EarlyRespawn = false -- The player can have a fine (on bank account) Config.RespawnFine = false @@ -35,123 +35,133 @@ Config.RespawnFineAmount = 500 Config.Locale = 'fr' Config.Blip = { - Pos = { x = 307.76, y = -1433.47, z = 28.97 }, - Sprite = 61, - Display = 4, - Scale = 1.2, - Colour = 2, + Pos = { x = 307.76, y = -1433.47, z = 28.97 }, + Sprite = 61, + Display = 4, + Scale = 1.2, + Colour = 2, } Config.HelicopterSpawner = { - SpawnPoint = { x = 313.33, y = -1465.2, z = 45.5 }, - Heading = 0.0 + SpawnPoint = { x = 313.33, y = -1465.2, z = 45.5 }, + Heading = 0.0 +} + +-- https://wiki.fivem.net/wiki/Vehicles +Config.AuthorizedVehicles = { + + { + model = 'ambulance', + label = 'Ambulance' + } + } Config.Zones = { - HospitalInteriorEntering1 = { -- ok - Pos = { x = 294.6, y = -1448.01, z = 28.9 }, - Type = 1 - }, + HospitalInteriorEntering1 = { -- Main entrance + Pos = { x = 294.2, y = -1448.60, z = 29.0 }, + Type = 1 + }, - HospitalInteriorInside1 = { -- ok - Pos = { x = 272.8, y = -1358.8, z = 23.5 }, - Type = -1 - }, + HospitalInteriorInside1 = { + Pos = { x = 272.8, y = -1358.8, z = 23.5 }, + Type = -1 + }, - HospitalInteriorOutside1 = { -- ok - Pos = { x = 295.8, y = -1446.5, z = 28.9 }, - Type = -1 - }, + HospitalInteriorOutside1 = { + Pos = { x = 295.8, y = -1446.5, z = 28.9 }, + Type = -1 + }, - HospitalInteriorExit1 = { -- ok - Pos = { x = 275.7, y = -1361.5, z = 23.5 }, - Type = 1 - }, + HospitalInteriorExit1 = { + Pos = { x = 275.7, y = -1361.5, z = 23.5 }, + Type = 1 + }, - HospitalInteriorEntering2 = { -- Ascenseur aller au toit - Pos = { x = 247.1, y = -1371.4, z = 23.5 }, - Type = 1 - }, + HospitalInteriorEntering2 = { -- Lift go to the roof + Pos = { x = 247.1, y = -1371.4, z = 23.5 }, + Type = 1 + }, - HospitalInteriorInside2 = { -- Toit sortie - Pos = { x = 333.1, y = -1434.9, z = 45.5 }, - Type = -1 - }, + HospitalInteriorInside2 = { -- Roof outlet + Pos = { x = 333.1, y = -1434.9, z = 45.5 }, + Type = -1 + }, - HospitalInteriorOutside2 = { -- Ascenseur retour depuis toit - Pos = { x = 249.1, y = -1369.6, z = 23.5 }, - Type = -1 - }, + HospitalInteriorOutside2 = { -- Lift back from roof + Pos = { x = 249.1, y = -1369.6, z = 23.5 }, + Type = -1 + }, - HospitalInteriorExit2 = { -- Toit entrée - Pos = { x = 335.5, y = -1432.0, z = 45.5 }, - Type = 1 - }, + HospitalInteriorExit2 = { -- Roof entrance + Pos = { x = 335.5, y = -1432.0, z = 45.5 }, + Type = 1 + }, - AmbulanceActions = { -- CLOACKROOM - Pos = { x = 268.4, y = -1363.330, z = 23.5 }, - Type = 1 - }, + AmbulanceActions = { -- Cloakroom + Pos = { x = 268.4, y = -1363.330, z = 23.5 }, + Type = 1 + }, - VehicleSpawner = { - Pos = { x = 307.76, y = -1433.47, z = 28.97 }, - Type = 1 - }, + VehicleSpawner = { + Pos = { x = 307.76, y = -1433.47, z = 28.97 }, + Type = 1 + }, - VehicleSpawnPoint = { - Pos = { x = 304.87, y = -1437.69, z = 28.80 }, - Type = -1 - }, + VehicleSpawnPoint = { + Pos = { x = 304.87, y = -1437.69, z = 28.80 }, + Type = -1 + }, - VehicleDeleter = { - Pos = { x = 327.67, y = -1481.1, z = 28.83 }, - Type = 1 - }, + VehicleDeleter = { + Pos = { x = 327.67, y = -1481.1, z = 28.83 }, + Type = 1 + }, - Pharmacy = { - Pos = { x = 230.13, y = -1366.18, z = 38.53 }, - Type = 1 - }, + Pharmacy = { + Pos = { x = 230.13, y = -1366.18, z = 38.53 }, + Type = 1 + }, - ParkingDoorGoOutInside = { - Pos = { x = 234.56, y = -1373.77, z = 20.97 }, - Type = 1 - }, + ParkingDoorGoOutInside = { + Pos = { x = 234.56, y = -1373.77, z = 20.97 }, + Type = 1 + }, - ParkingDoorGoOutOutside = { - Pos = { x = 320.98, y = -1478.62, z = 28.81 }, - Type = -1 - }, + ParkingDoorGoOutOutside = { + Pos = { x = 320.98, y = -1478.62, z = 28.81 }, + Type = -1 + }, - ParkingDoorGoInInside = { - Pos = { x = 238.64, y = -1368.48, z = 23.53 }, - Type = -1 - }, + ParkingDoorGoInInside = { + Pos = { x = 238.64, y = -1368.48, z = 23.53 }, + Type = -1 + }, - ParkingDoorGoInOutside = { - Pos = { x = 317.97, y = -1476.13, z = 28.97 }, - Type = 1 - }, + ParkingDoorGoInOutside = { + Pos = { x = 317.97, y = -1476.13, z = 28.97 }, + Type = 1 + }, - StairsGoTopTop = { - Pos = { x = 251.91, y = -1363.3, z = 38.53 }, - Type = -1 - }, + StairsGoTopTop = { + Pos = { x = 251.91, y = -1363.3, z = 38.53 }, + Type = -1 + }, - StairsGoTopBottom = { - Pos = { x = 237.45, y = -1373.89, z = 26.30 }, - Type = -1 - }, + StairsGoTopBottom = { + Pos = { x = 237.45, y = -1373.89, z = 26.30 }, + Type = -1 + }, - StairsGoBottomTop = { - Pos = { x = 256.58, y = -1357.7, z = 37.30 }, - Type = -1 - }, + StairsGoBottomTop = { + Pos = { x = 256.58, y = -1357.7, z = 37.30 }, + Type = -1 + }, - StairsGoBottomBottom = { - Pos = { x = 235.45, y = -1372.89, z = 26.30 }, - Type = -1 - } + StairsGoBottomBottom = { + Pos = { x = 235.45, y = -1372.89, z = 26.30 }, + Type = -1 + } } diff --git a/locales/br.lua b/locales/br.lua index c369afca..cb23085f 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -12,11 +12,11 @@ Locales['br'] = { -- Action Menu ['hospital'] = 'Hôspital', ['revive_inprogress'] = 'Reanimação em andamento', - ['revive_complete'] = 'Você ressuscitou ', + ['revive_complete'] = 'você ressuscitou ~y~%s~s~', + ['revive_complete_award'] = 'você ressuscitou ~y~%s~s~, ~g~$%s~s~', ['no_players'] = 'Nenhum jogador nas proximidades', ['no_vehicles'] = 'Sem veículos nas proximidades', - ['isdead'] = 'Está morto', - ['unconscious'] = 'Não está inconsciente', + ['player_not_unconscious'] = 'Não está inconsciente', -- Boss Menu ['deposit_society'] = 'Depositar dinheiro', ['withdraw_society'] = 'Retirar dinheiro da empresa', @@ -45,12 +45,9 @@ Locales['br'] = { -- Death ['respawn_at_hospital'] = 'Você quer ser transportado para o hospital ?', ['yes'] = 'Sim', - ['please_wait'] = 'Você será automaticamente transportado para o hospital em ~b~', - ['minutes'] = ' minutos ', - ['seconds_fine'] = ' segundos ~w~ para renascer \nRenascer agora ~g~$', - ['seconds'] = ' segundos ~w~.', - ['press_respawn_fine'] = 'Você pagará ~g~', + ['please_wait'] = 'Você será automaticamente transportado para o hospital em ~b~%s minutos %s segundos~s~', ['press_respawn'] = 'Aperte [~b~E~w~] para renascer.', + ['respawn_fine'] = 'you paid ~r~$%s~s~ for respawning.', -- Revive ['revive_help'] = 'reviver um jogador', -- Item diff --git a/locales/de.lua b/locales/de.lua index 5f3b0328..6b964884 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -12,14 +12,15 @@ Locales['de'] = { -- Action Menu ['hospital'] = 'Krankenhaus', ['revive_inprogress'] = 'wiederbeleben im Gange', - ['revive_complete'] = 'du wurdest wiederbelebt ', + ['revive_complete'] = 'du wurdest wiederbelebt ~y~%s~s~', + ['revive_complete_award'] = 'du wurdest wiederbelebt ~y~%s~s~, ~g~$%s~s~', ['no_players'] = 'keine Spieler in der Nähe', ['no_vehicles'] = 'keine Fahrzeuge in der Nähe', - ['isdead'] = 'ist gestorben', - ['unconscious'] = 'ist nicht im Koma', + ['player_not_unconscious'] = 'ist nicht im Koma', -- Boss Menu ['deposit_society'] = 'Notdienst einzahlen', ['withdraw_society'] = 'Notdienst abheben', + ['boss_actions'] = 'boss actions', -- Misc ['invalid_amount'] = '~r~ungültiger Betrag', ['open_menu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', @@ -35,12 +36,9 @@ Locales['de'] = { -- Death ['respawn_at_hospital'] = 'Willst du ins Krankenhaus gebracht werden?', ['yes'] = 'ja', - ['please_wait'] = 'bitte warte ~b~', - ['minutes'] = ' minuten ', - ['seconds_fine'] = ' sekunden ~w~zum respawnen\nRespawn jetzt für ~g~$', - ['seconds'] = ' sekunden ~w~bis zum respawn.', - ['press_respawn_fine'] = '~w~ [Drücke ~b~E~w~]', + ['please_wait'] = 'bitte warte ~b~%s minuten %s sekunden~s~ bis zum respawn', ['press_respawn'] = 'Drücke [~b~E~w~] zum respawnen.', + ['respawn_fine'] = 'you paid ~r~$%s~s~ for respawning.', -- Revive ['revive_help'] = 'Spieler wiederbeleben', } diff --git a/locales/en.lua b/locales/en.lua index 5eb7177f..fb5c005d 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -11,12 +11,12 @@ Locales['en'] = { ['helicopter'] = 'helicopter', -- Action Menu ['hospital'] = 'hospital', - ['revive_inprogress'] = 'revive in progress', - ['revive_complete'] = 'you have been revived ', + ['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~!', ['no_players'] = 'no players nearby', ['no_vehicles'] = 'no vehicles nearby', - ['isdead'] = 'is dead', - ['unconscious'] = 'is not unconscious', + ['player_not_unconscious'] = 'that player is not unconscious!', -- Boss Menu ['deposit_society'] = 'eMS Deposit', ['withdraw_society'] = 'eMS Withdraw', @@ -45,12 +45,9 @@ Locales['en'] = { -- Death ['respawn_at_hospital'] = 'do you want to force respawn and spawn in the hospital?', ['yes'] = 'yes', - ['please_wait'] = 'You are unconscious and will bleed out in ~b~', - ['minutes'] = ' minutes ', - ['seconds_fine'] = ' seconds ~w~to respawn \nForce respawn now by pressing ~g~$', - ['seconds'] = ' seconds', - ['press_respawn_fine'] = '~w~ [Press ~b~E~w~]', + ['please_wait'] = 'you are unconscious and will bleed out in ~b~%s minutes and %s seconds~s~', ['press_respawn'] = 'press [~b~E~w~] to respawn.', + ['respawn_fine'] = 'you paid ~r~$%s~s~ for respawning.', -- Revive ['revive_help'] = 'revive a player', -- Item diff --git a/locales/es.lua b/locales/es.lua index 139404ca..371c77d8 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -3,7 +3,7 @@ Locales['es'] = { ['cloakroom'] = 'Guardarropa', ['ems_clothes_civil'] = 'Camiseta', ['ems_clothes_ems'] = 'Equipo de ambulancia', --- Vehicles + -- Vehicles ['veh_menu'] = 'vehículo', ['veh_spawn'] = 'Presione ~INPUT_CONTEXT~ para sacar un vehículo', ['store_veh'] = 'Presione ~INPUT_CONTEXT~ para alamcenar un vehículo', @@ -12,11 +12,11 @@ Locales['es'] = { -- Action Menu ['hospital'] = 'hospital', ['revive_inprogress'] = 'reanimación en curso', - ['revive_complete'] = 'has sido reanimado ', + ['revive_complete'] = 'has sido reanimado ~y~%s~s~', + ['revive_complete_award'] = 'has sido reanimado ~y~%s~s~, ~g~$%s~s~', ['no_players'] = 'ningún jugador cerca', ['no_vehicles'] = 'ningún vehículo cerca', - ['isdead'] = 'Has muerto', - ['unconscious'] = 'n\'estás inconsciente', + ['player_not_unconscious'] = 'n\'estás inconsciente', -- oss Menu ['deposit_society'] = 'depositar dinero', ['withdraw_society'] = 'retirar dinero', @@ -35,12 +35,9 @@ Locales['es'] = { -- Death ['respawn_at_hospital'] = '¿Quieres ser transportado al hospital?', ['yes'] = 'oui', - ['please_wait'] = 's\'por favor, espere ~b~', - ['minutes'] = ' minutos ', - ['seconds_fine'] = ' segundos ~w~to reparecer \nReapareciendo ahora por ~g~€', - ['seconds'] = ' segundos ~w~para reparecer.', - ['press_respawn_fine'] = '~w~ [Pulsa ~b~E~w~]', + ['please_wait'] = 's\'por favor, espere ~b~%s minutos %s segundos para reparecer~s~', ['press_respawn'] = 'presione [~b~E~w~] para reparecer.', + ['respawn_fine'] = 'you paid ~r~$%s~s~ for respawning.', -- Revive ['revive_help'] = 'reviver un jugador', } diff --git a/locales/fr.lua b/locales/fr.lua index 5343d810..0a60983c 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -12,11 +12,11 @@ Locales['fr'] = { -- Action Menu ['hospital'] = 'hôpital', ['revive_inprogress'] = 'réanimation en cours', - ['revive_complete'] = 'vous avez réanimé ', + ['revive_complete'] = 'vous avez réanimé ~y~%s~s~', + ['revive_complete_award'] = 'vous avez réanimé ~y~%s~s~, ~g~$%s~s~', ['no_players'] = 'aucun joueur à proximité', ['no_vehicles'] = 'aucun véhicule à proximité', - ['isdead'] = 'a succombé', - ['unconscious'] = 'n\'est pas inconscient', + ['player_not_unconscious'] = 'n\'est pas inconscient', -- Boss Menu ['deposit_society'] = 'déposer argent', ['withdraw_society'] = 'retirer argent société', @@ -45,12 +45,9 @@ Locales['fr'] = { -- Death ['respawn_at_hospital'] = 'voulez-vous être transporté à l\'hôpital ?', ['yes'] = 'oui', - ['please_wait'] = 'Vous serez automatiquement transporté à l\'hôpital dans ~b~', - ['minutes'] = ' minutes ', - ['seconds_fine'] = ' secondes ~w~ pour réapparaître \nRéapparaître maintenant pour ~g~$', - ['seconds'] = ' secondes ~w~.', - ['press_respawn_fine'] = 'vous payerez ~g~', + ['please_wait'] = 'Vous serez automatiquement transporté à l\'hôpital dans ~b~%s minutes %s secondes~s~', ['press_respawn'] = 'appuyez sur [~b~E~w~] pour réapparaître.', + ['respawn_fine'] = 'you paid ~r~$%s~s~ for respawning.', -- Revive ['revive_help'] = 'relancer un joueur', -- Item diff --git a/locales/sv.lua b/locales/sv.lua index 7238230c..578928f8 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -12,11 +12,11 @@ Locales['sv'] = { -- Action Menu ['hospital'] = 'Sjukhus', ['revive_inprogress'] = 'Återupplivning pågår...', - ['revive_complete'] = 'Du har återupplivat ~y~%s~w~ och tjärnat ~g~$2000~w~ i processen, bra jobbat!', + ['revive_complete'] = 'du har återupplivat ~y~%s~s~, bra jobbat!', + ['revive_complete_award'] = 'du har återupplivat ~y~%s~s~ och tjärnat ~g~$%s~s~ i processen, bra jobbat!', ['no_players'] = 'Inga spelare i närheten!', ['no_vehicles'] = 'Inga fordon i närheten!', - ['isdead'] = 'är död', - ['unconscious'] = 'är medvetslös', + ['player_not_unconscious'] = 'spelaren är inte medvetslös!', -- Boss Menu ['deposit_society'] = 'Sjukvårdens insättning', ['withdraw_society'] = 'Sjukvårdens uttagning', @@ -45,19 +45,16 @@ Locales['sv'] = { -- Death ['respawn_at_hospital'] = 'Vill du snabbresa till sjukhuset?', ['yes'] = 'Ja!', - ['please_wait'] = 'Du är medvetslös och kommer att dö om ~b~', - ['minutes'] = ' minuter ', - ['seconds_fine'] = ' sekunder ~w~till respawn \nForce respawna nu genom att trycka på ~g~$', - ['seconds'] = ' sekunder', - ['press_respawn_fine'] = '~w~ [Tryck ~b~E~w~]', + ['please_wait'] = 'du är medvetslös och kommer att dö om ~b~%s minuter och %s sekunder~s~', ['press_respawn'] = 'Tryck [~b~E~w~] för att respawna.', + ['respawn_fine'] = 'du betalade ~r~$%s~s~ för att respawna.', -- Revive ['revive_help'] = 'Återuppliva en spelare', -- Item - ['used_medikit'] = 'Du har använt 1x Medecinkit', - ['used_bandage'] = 'Du har använt 1x Bandage', + ['used_medikit'] = 'Du har använt ~y~1x~s~ ~b~Medecinkit~s~', + ['used_bandage'] = 'Du har använt ~y~1x~s~ ~b~Bandage~s~', ['not_enough_medikit'] = 'Du har inget ~b~Medecinkit~w~.', ['not_enough_bandage'] = 'Du har inget ~b~Bandage~w~.', - ['healed'] = 'Du har blivit upplivad.', + ['healed'] = 'Du har blivit återupplivad.', -- Misc } diff --git a/server/main.lua b/server/main.lua index 9f8780b7..87aad058 100644 --- a/server/main.lua +++ b/server/main.lua @@ -51,6 +51,7 @@ ESX.RegisterServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function( end if Config.RespawnFine then + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('respawn_fine', Config.RespawnFineAmount)) xPlayer.removeAccountMoney('bank', Config.RespawnFineAmount) end