From 2c74fc4a9afa86348ffbda5674823c0586e70323 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:42:38 +0200 Subject: [PATCH 1/8] convert: esx_ambulancejob > bpt_ambulancejob - converted code - Adapt empiretown code to support bpt_ambulancejob --- .../bpt_ambulancejob}/LICENSE | 14 +- .../[bpt_addons]/bpt_ambulancejob/README.md | 19 + .../bpt_ambulancejob/bpt_ambulancejob.sql} | 0 .../bpt_ambulancejob}/client/job.lua | 72 ++-- .../bpt_ambulancejob}/client/main.lua | 32 +- .../bpt_ambulancejob}/client/vehicle.lua | 4 +- .../bpt_ambulancejob}/config.lua | 0 .../bpt_ambulancejob}/fxmanifest.lua | 0 .../bpt_ambulancejob}/locales/en.lua | 0 .../[bpt_addons]/bpt_menu/config.lua | 2 +- .../[esx_addons]/esx_ambulancejob/README.md | 34 -- .../localization/br_esx_ambulancejob.sql | 33 -- .../localization/cs_esx_ambulancejob.sql | 33 -- .../localization/de_esx_ambulancejob.sql | 33 -- .../localization/en_esx_ambulancejob.sql | 33 -- .../localization/fi_esx_ambulancejob.sql | 33 -- .../localization/pl_esx_ambulancejob.sql | 33 -- .../localization/sv_esx_ambulancejob.sql | 33 -- .../localization/tr_esx_ambulancejob.sql | 33 -- .../esx_ambulancejob/server/main.lua | 344 ------------------ 20 files changed, 79 insertions(+), 706 deletions(-) rename server-data/resources/{[esx_addons]/esx_ambulancejob => [bpt_addons]/bpt_ambulancejob}/LICENSE (98%) create mode 100644 server-data/resources/[bpt_addons]/bpt_ambulancejob/README.md rename server-data/resources/{[esx_addons]/esx_ambulancejob/esx_ambulancejob.sql => [bpt_addons]/bpt_ambulancejob/bpt_ambulancejob.sql} (100%) rename server-data/resources/{[esx_addons]/esx_ambulancejob => [bpt_addons]/bpt_ambulancejob}/client/job.lua (87%) rename server-data/resources/{[esx_addons]/esx_ambulancejob => [bpt_addons]/bpt_ambulancejob}/client/main.lua (90%) rename server-data/resources/{[esx_addons]/esx_ambulancejob => [bpt_addons]/bpt_ambulancejob}/client/vehicle.lua (98%) rename server-data/resources/{[esx_addons]/esx_ambulancejob => [bpt_addons]/bpt_ambulancejob}/config.lua (100%) rename server-data/resources/{[esx_addons]/esx_ambulancejob => [bpt_addons]/bpt_ambulancejob}/fxmanifest.lua (100%) rename server-data/resources/{[esx_addons]/esx_ambulancejob => [bpt_addons]/bpt_ambulancejob}/locales/en.lua (100%) delete mode 100644 server-data/resources/[esx_addons]/esx_ambulancejob/README.md delete mode 100644 server-data/resources/[esx_addons]/esx_ambulancejob/localization/br_esx_ambulancejob.sql delete mode 100644 server-data/resources/[esx_addons]/esx_ambulancejob/localization/cs_esx_ambulancejob.sql delete mode 100644 server-data/resources/[esx_addons]/esx_ambulancejob/localization/de_esx_ambulancejob.sql delete mode 100644 server-data/resources/[esx_addons]/esx_ambulancejob/localization/en_esx_ambulancejob.sql delete mode 100644 server-data/resources/[esx_addons]/esx_ambulancejob/localization/fi_esx_ambulancejob.sql delete mode 100644 server-data/resources/[esx_addons]/esx_ambulancejob/localization/pl_esx_ambulancejob.sql delete mode 100644 server-data/resources/[esx_addons]/esx_ambulancejob/localization/sv_esx_ambulancejob.sql delete mode 100644 server-data/resources/[esx_addons]/esx_ambulancejob/localization/tr_esx_ambulancejob.sql delete mode 100644 server-data/resources/[esx_addons]/esx_ambulancejob/server/main.lua diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/LICENSE b/server-data/resources/[bpt_addons]/bpt_ambulancejob/LICENSE similarity index 98% rename from server-data/resources/[esx_addons]/esx_ambulancejob/LICENSE rename to server-data/resources/[bpt_addons]/bpt_ambulancejob/LICENSE index b28cc28c1..62f066311 100644 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/LICENSE +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/LICENSE @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - fxserver-esx_ambulancejob - Copyright (C) 2023 + + Copyright (C) 2024 bitpredator This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -645,14 +645,14 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - fxserver-esx_ambulancejob Copyright (C) 2023 + Copyright (C) 2024 bitpredator This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -. +. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. \ No newline at end of file +. diff --git a/server-data/resources/[bpt_addons]/bpt_ambulancejob/README.md b/server-data/resources/[bpt_addons]/bpt_ambulancejob/README.md new file mode 100644 index 000000000..6ea79c75f --- /dev/null +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/README.md @@ -0,0 +1,19 @@ +

bpt_ambulancejob

+

Discord + +Copyright (C) 2024 bitpredator + +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. + +ATTENTION: +You are not authorized to change the name of the resource and the resources within it. + +If you want to contribute you can open a pull request. + +You are not authorized to sell this software (this is free project). + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. \ No newline at end of file diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/esx_ambulancejob.sql b/server-data/resources/[bpt_addons]/bpt_ambulancejob/bpt_ambulancejob.sql similarity index 100% rename from server-data/resources/[esx_addons]/esx_ambulancejob/esx_ambulancejob.sql rename to server-data/resources/[bpt_addons]/bpt_ambulancejob/bpt_ambulancejob.sql diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/client/job.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/job.lua similarity index 87% rename from server-data/resources/[esx_addons]/esx_ambulancejob/client/job.lua rename to server-data/resources/[bpt_addons]/bpt_ambulancejob/client/job.lua index a71db3fa2..b265719fb 100644 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/client/job.lua +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/job.lua @@ -5,7 +5,7 @@ isInShopMenu = false function OpenAmbulanceActionsMenu() local elements = { - { unselectable = true, icon = "fas fa-shirt", title = "Ambulance Actions" }, + { unselectable = true, icon = "fas fa-shirt", title = "Ambulance Actions" }, { icon = "fas fa-shirt", title = TranslateCap("cloakroom"), value = "cloakroom" }, } @@ -30,20 +30,20 @@ end function OpenMobileAmbulanceActionsMenu() local elements = { - { unselectable = true, icon = "fas fa-ambulance", title = TranslateCap("ambulance") }, + { unselectable = true, icon = "fas fa-ambulance", title = TranslateCap("ambulance") }, { icon = "fas fa-ambulance", title = TranslateCap("ems_menu"), value = "citizen_interaction" }, } ESX.OpenContext("right", elements, function(_, element) if element.value == "citizen_interaction" then local elements2 = { - { unselectable = true, icon = "fas fa-ambulance", title = element.title }, - { icon = "fas fa-syringe", title = TranslateCap("ems_menu_revive"), value = "revive" }, - { icon = "fas fa-bandage", title = TranslateCap("ems_menu_small"), value = "small" }, - { icon = "fas fa-bandage", title = TranslateCap("ems_menu_big"), value = "big" }, - { icon = "fas fa-car", title = TranslateCap("ems_menu_putincar"), value = "put_in_vehicle" }, - { icon = "fas fa-syringe", title = TranslateCap("ems_menu_search"), value = "search" }, - { icon = "fas fa-syringe", title = TranslateCap("billing"), value = "billing" }, + { unselectable = true, icon = "fas fa-ambulance", title = element.title }, + { icon = "fas fa-syringe", title = TranslateCap("ems_menu_revive"), value = "revive" }, + { icon = "fas fa-bandage", title = TranslateCap("ems_menu_small"), value = "small" }, + { icon = "fas fa-bandage", title = TranslateCap("ems_menu_big"), value = "big" }, + { icon = "fas fa-car", title = TranslateCap("ems_menu_putincar"), value = "put_in_vehicle" }, + { icon = "fas fa-syringe", title = TranslateCap("ems_menu_search"), value = "search" }, + { icon = "fas fa-syringe", title = TranslateCap("billing"), value = "billing" }, } ESX.OpenContext("right", elements2, function(_, element2) @@ -54,14 +54,14 @@ function OpenMobileAmbulanceActionsMenu() local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() if element2.value == "search" then - TriggerServerEvent("esx_ambulancejob:svsearch") + TriggerServerEvent("bpt_ambulancejob:svsearch") elseif closestPlayer == -1 or closestDistance > 1.0 then ESX.ShowNotification(TranslateCap("no_players")) else if element2.value == "revive" then revivePlayer(closestPlayer) elseif element2.value == "small" then - ESX.TriggerServerCallback("esx_ambulancejob:getItemAmount", function(quantity) + ESX.TriggerServerCallback("bpt_ambulancejob:getItemAmount", function(quantity) if quantity > 0 then local closestPlayerPed = GetPlayerPed(closestPlayer) local health = GetEntityHealth(closestPlayerPed) @@ -75,12 +75,8 @@ function OpenMobileAmbulanceActionsMenu() Wait(10000) ClearPedTasks(playerPed) - TriggerServerEvent("esx_ambulancejob:removeItem", "bandage") - TriggerServerEvent( - "esx_ambulancejob:heal", - GetPlayerServerId(closestPlayer), - "small" - ) + TriggerServerEvent("bpt_ambulancejob:removeItem", "bandage") + TriggerServerEvent("bpt_ambulancejob:heal", GetPlayerServerId(closestPlayer), "small") ESX.ShowNotification(TranslateCap("heal_complete", GetPlayerName(closestPlayer))) isBusy = false else @@ -91,7 +87,7 @@ function OpenMobileAmbulanceActionsMenu() end end, "bandage") elseif element2.value == "big" then - ESX.TriggerServerCallback("esx_ambulancejob:getItemAmount", function(quantity) + ESX.TriggerServerCallback("bpt_ambulancejob:getItemAmount", function(quantity) if quantity > 0 then local closestPlayerPed = GetPlayerPed(closestPlayer) local health = GetEntityHealth(closestPlayerPed) @@ -105,8 +101,8 @@ function OpenMobileAmbulanceActionsMenu() Wait(10000) ClearPedTasks(playerPed) - TriggerServerEvent("esx_ambulancejob:removeItem", "medikit") - TriggerServerEvent("esx_ambulancejob:heal", GetPlayerServerId(closestPlayer), "big") + TriggerServerEvent("bpt_ambulancejob:removeItem", "medikit") + TriggerServerEvent("bpt_ambulancejob:heal", GetPlayerServerId(closestPlayer), "big") ESX.ShowNotification(TranslateCap("heal_complete", GetPlayerName(closestPlayer))) isBusy = false else @@ -117,7 +113,7 @@ function OpenMobileAmbulanceActionsMenu() end end, "medikit") elseif element2.value == "put_in_vehicle" then - TriggerServerEvent("esx_ambulancejob:putInVehicle", GetPlayerServerId(closestPlayer)) + TriggerServerEvent("bpt_ambulancejob:putInVehicle", GetPlayerServerId(closestPlayer)) end end end) @@ -160,7 +156,7 @@ end function revivePlayer(closestPlayer) isBusy = true - ESX.TriggerServerCallback("esx_ambulancejob:getItemAmount", function(quantity) + ESX.TriggerServerCallback("bpt_ambulancejob:getItemAmount", function(quantity) if quantity > 0 then local closestPlayerPed = GetPlayerPed(closestPlayer) @@ -177,8 +173,8 @@ function revivePlayer(closestPlayer) end) end - TriggerServerEvent("esx_ambulancejob:removeItem", "medikit") - TriggerServerEvent("esx_ambulancejob:revive", GetPlayerServerId(closestPlayer)) + TriggerServerEvent("bpt_ambulancejob:removeItem", "medikit") + TriggerServerEvent("bpt_ambulancejob:revive", GetPlayerServerId(closestPlayer)) else ESX.ShowNotification(TranslateCap("player_notTranslateCapnconscious")) end @@ -344,19 +340,19 @@ CreateThread(function() (LastHospital ~= nil and LastPart ~= nil and LastPartNum ~= nil) and (LastHospital ~= currentHospital or LastPart ~= currentPart or LastPartNum ~= currentPartNum) then - TriggerEvent("esx_ambulancejob:hasExitedMarker", LastHospital, LastPart, LastPartNum) + TriggerEvent("bpt_ambulancejob:hasExitedMarker", LastHospital, LastPart, LastPartNum) hasExited = true end HasAlreadyEnteredMarker, LastHospital, LastPart, LastPartNum = true, currentHospital, currentPart, currentPartNum - TriggerEvent("esx_ambulancejob:hasEnteredMarker", currentHospital, currentPart, currentPartNum) + TriggerEvent("bpt_ambulancejob:hasEnteredMarker", currentHospital, currentPart, currentPartNum) end if not hasExited and not isInMarker and HasAlreadyEnteredMarker then HasAlreadyEnteredMarker = false - TriggerEvent("esx_ambulancejob:hasExitedMarker", LastHospital, LastPart, LastPartNum) + TriggerEvent("bpt_ambulancejob:hasExitedMarker", LastHospital, LastPart, LastPartNum) end if letSleep then @@ -419,7 +415,7 @@ CreateThread(function() end end) -AddEventHandler("esx_ambulancejob:hasEnteredMarker", function(hospital, part, partNum) +AddEventHandler("bpt_ambulancejob:hasEnteredMarker", function(hospital, part, partNum) if part == "AmbulanceActions" then CurrentAction = part CurrentActionMsg = TranslateCap("actions_prompt") @@ -435,7 +431,7 @@ AddEventHandler("esx_ambulancejob:hasEnteredMarker", function(hospital, part, pa end end) -AddEventHandler("esx_ambulancejob:hasExitedMarker", function() +AddEventHandler("bpt_ambulancejob:hasExitedMarker", function() if not isInShopMenu then ESX.CloseContext() end @@ -477,8 +473,8 @@ CreateThread(function() end end) -RegisterNetEvent("esx_ambulancejob:putInVehicle") -AddEventHandler("esx_ambulancejob:putInVehicle", function() +RegisterNetEvent("bpt_ambulancejob:putInVehicle") +AddEventHandler("bpt_ambulancejob:putInVehicle", function() local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) @@ -504,9 +500,9 @@ end) function OpenCloakroomMenu() local elements = { - { unselectable = true, icon = "fas fa-shirt", title = TranslateCap("cloakroom") }, + { unselectable = true, icon = "fas fa-shirt", title = TranslateCap("cloakroom") }, { icon = "fas fa-shirt", title = TranslateCap("ems_clothes_civil"), value = "citizen_wear" }, - { icon = "fas fa-shirt", title = TranslateCap("ems_clothes_ems"), value = "ambulance_wear" }, + { icon = "fas fa-shirt", title = TranslateCap("ems_clothes_ems"), value = "ambulance_wear" }, } ESX.OpenContext("right", elements, function(_, element) @@ -529,14 +525,14 @@ function OpenCloakroomMenu() end isOnDuty = true - TriggerEvent("esx_ambulancejob:setDeadPlayers", deadPlayers) + TriggerEvent("bpt_ambulancejob:setDeadPlayers", deadPlayers) end) end end) end -RegisterNetEvent("esx_ambulancejob:heal") -AddEventHandler("esx_ambulancejob:heal", function(healType, quiet) +RegisterNetEvent("bpt_ambulancejob:heal") +AddEventHandler("bpt_ambulancejob:heal", function(healType, quiet) local playerPed = PlayerPedId() local maxHealth = GetEntityMaxHealth(playerPed) @@ -565,8 +561,8 @@ AddEventHandler("esx:setJob", function(job) end end) -RegisterNetEvent("esx_ambulancejob:setDeadPlayers") -AddEventHandler("esx_ambulancejob:setDeadPlayers", function(_deadPlayers) +RegisterNetEvent("bpt_ambulancejob:setDeadPlayers") +AddEventHandler("bpt_ambulancejob:setDeadPlayers", function(_deadPlayers) deadPlayers = _deadPlayers if isOnDuty then diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/client/main.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/main.lua similarity index 90% rename from server-data/resources/[esx_addons]/esx_ambulancejob/client/main.lua rename to server-data/resources/[bpt_addons]/bpt_ambulancejob/client/main.lua index 10ef47fb3..ea4ad78ad 100644 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/main.lua @@ -39,7 +39,7 @@ AddEventHandler("esx:onPlayerSpawn", function() Wait(5000) end - ESX.TriggerServerCallback("esx_ambulancejob:getDeathStatus", function(shouldDie) + ESX.TriggerServerCallback("bpt_ambulancejob:getDeathStatus", function(shouldDie) if shouldDie then Wait(10000) SetEntityHealth(PlayerPedId(), 0) @@ -113,8 +113,8 @@ CreateThread(function() end end) -RegisterNetEvent("esx_ambulancejob:clsearch") -AddEventHandler("esx_ambulancejob:clsearch", function(medicId) +RegisterNetEvent("bpt_ambulancejob:clsearch") +AddEventHandler("bpt_ambulancejob:clsearch", function(medicId) local playerPed = PlayerPedId() if isDead then @@ -135,7 +135,7 @@ end) function OnPlayerDeath() isDead = true ESX.CloseContext() - TriggerServerEvent("esx_ambulancejob:setDeathStatus", true) + TriggerServerEvent("bpt_ambulancejob:setDeathStatus", true) StartDeathTimer() StartDistressSignal() @@ -143,8 +143,8 @@ function OnPlayerDeath() StartScreenEffect("DeathFailOut", 0, false) end -RegisterNetEvent("esx_ambulancejob:useItem") -AddEventHandler("esx_ambulancejob:useItem", function(itemName) +RegisterNetEvent("bpt_ambulancejob:useItem") +AddEventHandler("bpt_ambulancejob:useItem", function(itemName) ESX.CloseContext() if itemName == "medikit" then @@ -160,7 +160,7 @@ AddEventHandler("esx_ambulancejob:useItem", function(itemName) DisableAllControlActions(0) end - TriggerEvent("esx_ambulancejob:heal", "big", true) + TriggerEvent("bpt_ambulancejob:heal", "big", true) ESX.ShowNotification(TranslateCap("used_medikit")) end) elseif itemName == "bandage" then @@ -176,7 +176,7 @@ AddEventHandler("esx_ambulancejob:useItem", function(itemName) DisableAllControlActions(0) end - TriggerEvent("esx_ambulancejob:heal", "small", true) + TriggerEvent("bpt_ambulancejob:heal", "small", true) ESX.ShowNotification(TranslateCap("used_bandage")) end) end @@ -213,7 +213,7 @@ function SendDistressSignal() local coords = GetEntityCoords(playerPed) ESX.ShowNotification(TranslateCap("distress_sent")) - TriggerServerEvent("esx_ambulancejob:onPlayerDistress") + TriggerServerEvent("bpt_ambulancejob:onPlayerDistress") end function DrawGenericTextThisFrame() @@ -244,7 +244,7 @@ function StartDeathTimer() local canPayFine = false if Config.EarlyRespawnFine then - ESX.TriggerServerCallback("esx_ambulancejob:checkBalance", function(canPay) + ESX.TriggerServerCallback("bpt_ambulancejob:checkBalance", function(canPay) canPayFine = canPay end) end @@ -303,7 +303,7 @@ function StartDeathTimer() text = text .. TranslateCap("respawn_bleedout_fine", ESX.Math.GroupDigits(Config.EarlyRespawnFineAmount)) if IsControlPressed(0, 38) and timeHeld > 60 then - TriggerServerEvent("esx_ambulancejob:payFine") + TriggerServerEvent("bpt_ambulancejob:payFine") RemoveItemsAfterRPDeath() break end @@ -329,7 +329,7 @@ function StartDeathTimer() end function RemoveItemsAfterRPDeath() - TriggerServerEvent("esx_ambulancejob:setDeathStatus", false) + TriggerServerEvent("bpt_ambulancejob:setDeathStatus", false) CreateThread(function() DoScreenFadeOut(800) @@ -338,7 +338,7 @@ function RemoveItemsAfterRPDeath() Wait(10) end - ESX.TriggerServerCallback("esx_ambulancejob:removeItemsAfterRPDeath", function() + ESX.TriggerServerCallback("bpt_ambulancejob:removeItemsAfterRPDeath", function() local formattedCoords = { x = Config.RespawnPoint.coords.x, y = Config.RespawnPoint.coords.y, @@ -369,11 +369,11 @@ AddEventHandler("esx:onPlayerDeath", function() OnPlayerDeath() end) -RegisterNetEvent("esx_ambulancejob:revive") -AddEventHandler("esx_ambulancejob:revive", function() +RegisterNetEvent("bpt_ambulancejob:revive") +AddEventHandler("bpt_ambulancejob:revive", function() local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) - TriggerServerEvent("esx_ambulancejob:setDeathStatus", false) + TriggerServerEvent("bpt_ambulancejob:setDeathStatus", false) DoScreenFadeOut(800) diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/client/vehicle.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/vehicle.lua similarity index 98% rename from server-data/resources/[esx_addons]/esx_ambulancejob/client/vehicle.lua rename to server-data/resources/[bpt_addons]/bpt_ambulancejob/client/vehicle.lua index 30bb24b4b..5ddb52483 100644 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/client/vehicle.lua +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/vehicle.lua @@ -139,7 +139,7 @@ function StoreNearbyVehicle(playerCoords) return end - ESX.TriggerServerCallback("esx_ambulancejob:storeNearbyVehicle", function(storeSuccess, foundNum) + ESX.TriggerServerCallback("bpt_ambulancejob:storeNearbyVehicle", function(storeSuccess, foundNum) if storeSuccess then local vehicleId = vehiclePlates[foundNum] local attempts = 0 @@ -248,7 +248,7 @@ function OpenShopMenu(elements, restoreCoords, shopCoords) local props = ESX.Game.GetVehicleProperties(vehicle) props.plate = newPlate - ESX.TriggerServerCallback("esx_ambulancejob:buyJobVehicle", function(bought) + ESX.TriggerServerCallback("bpt_ambulancejob:buyJobVehicle", function(bought) if bought then ESX.ShowNotification( TranslateCap("vehicleshop_bought", element.name, ESX.Math.GroupDigits(element.price)) diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/config.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/config.lua similarity index 100% rename from server-data/resources/[esx_addons]/esx_ambulancejob/config.lua rename to server-data/resources/[bpt_addons]/bpt_ambulancejob/config.lua diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua similarity index 100% rename from server-data/resources/[esx_addons]/esx_ambulancejob/fxmanifest.lua rename to server-data/resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/locales/en.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/locales/en.lua similarity index 100% rename from server-data/resources/[esx_addons]/esx_ambulancejob/locales/en.lua rename to server-data/resources/[bpt_addons]/bpt_ambulancejob/locales/en.lua diff --git a/server-data/resources/[bpt_addons]/bpt_menu/config.lua b/server-data/resources/[bpt_addons]/bpt_menu/config.lua index 0d771ac31..36f7cfd11 100644 --- a/server-data/resources/[bpt_addons]/bpt_menu/config.lua +++ b/server-data/resources/[bpt_addons]/bpt_menu/config.lua @@ -930,7 +930,7 @@ Config.AdminCommands = { return end - TriggerServerEvent("esx_ambulancejob:revive", targetServerId) + TriggerServerEvent("bpt_ambulancejob:revive", targetServerId) RageUI.CloseAll() end, }, diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/README.md b/server-data/resources/[esx_addons]/esx_ambulancejob/README.md deleted file mode 100644 index e0fa85ad0..000000000 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# esx_ambulancejob - -ESX Ambulance Job is an plugin for ESX with features: - -- Adds death screen, with early respawn timer and bleed out timer -- Vehicle garages, revive menu and more for on duty EMS - -## Requirements - -* Auto mode - - [esx_skin] - - [esx_vehicleshop] - - [esx_society] - -## Installation -- Import `esx_ambulancejob.sql` in your database -- If you want player management you have to set `Config.EnablePlayerManagement` to `true` in `config.lua` -- Add this in your `server.cfg`: - -``` -start esx_ambulancejob -``` - -# Legal -### License -esx_ambulancejob - ambulance script for fivem - -Copyright (C) 2015-2023 - -This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. - -This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. - -You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/br_esx_ambulancejob.sql b/server-data/resources/[esx_addons]/esx_ambulancejob/localization/br_esx_ambulancejob.sql deleted file mode 100644 index 0665e65ec..000000000 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/br_esx_ambulancejob.sql +++ /dev/null @@ -1,33 +0,0 @@ -USE `es_extended`; - -INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_ambulance', 'EMS', 1) -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_ambulance', 'EMS', 1) -; - -INSERT INTO `datastore` (name, label, shared) VALUES - ('society_ambulance', 'EMS', 1) -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('ambulance',0,'ambulância','Jr. EMT',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',1,'medico','EMT',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',2,'medico chefe','Sr. EMT',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',3,'boss','EMT Supervisor',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}') -; - -INSERT INTO `jobs` (name, label) VALUES - ('ambulance','EMS') -; - -INSERT INTO `items` (name, label, weight) VALUES - ('bandage','curativo', 2), - ('medikit','kit medico', 2) -; - -ALTER TABLE `users` - ADD `is_dead` TINYINT(1) NULL DEFAULT '0' -; diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/cs_esx_ambulancejob.sql b/server-data/resources/[esx_addons]/esx_ambulancejob/localization/cs_esx_ambulancejob.sql deleted file mode 100644 index 9f51a9ec4..000000000 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/cs_esx_ambulancejob.sql +++ /dev/null @@ -1,33 +0,0 @@ -USE `es_extended`; - -INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_ambulance', 'Záchranka', 1) -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_ambulance', 'Záchranka', 1) -; - -INSERT INTO `datastore` (name, label, shared) VALUES - ('society_ambulance', 'Záchranka', 1) -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('ambulance',0,'ambulance','Zdravotník',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',1,'doctor','Doktor',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',2,'chief_doctor','Primář',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',3,'boss','Chirurg',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}') -; - -INSERT INTO `jobs` (name, label) VALUES - ('ambulance','Záchranka') -; - -INSERT INTO `items` (name, label, weight) VALUES - ('bandage','Obvaz', 2), - ('medikit','Lékarnička', 2) -; - -ALTER TABLE `users` - ADD `is_dead` TINYINT(1) NULL DEFAULT '0' -; diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/de_esx_ambulancejob.sql b/server-data/resources/[esx_addons]/esx_ambulancejob/localization/de_esx_ambulancejob.sql deleted file mode 100644 index e902c92c3..000000000 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/de_esx_ambulancejob.sql +++ /dev/null @@ -1,33 +0,0 @@ -USE `es_extended`; - -INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_ambulance', 'Notdienst', 1) -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_ambulance', 'Ambulance', 1) -; - -INSERT INTO `datastore` (name, label, shared) VALUES - ('society_ambulance', 'Ambulance', 1) -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('ambulance',0,'ambulance','Sanitäter',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',1,'doctor','Arzt',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',2,'chief_doctor','Chefarzt',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',3,'boss','Chirurg',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}') -; - -INSERT INTO `jobs` (name, label) VALUES - ('ambulance','Notdienst') -; - -INSERT INTO `items` (name, label, weight) VALUES - ('bandage','Bandage', 2), - ('medikit','Medikit', 2) -; - -ALTER TABLE `users` - ADD `is_dead` TINYINT(1) NULL DEFAULT '0' -; diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/en_esx_ambulancejob.sql b/server-data/resources/[esx_addons]/esx_ambulancejob/localization/en_esx_ambulancejob.sql deleted file mode 100644 index bec419d83..000000000 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/en_esx_ambulancejob.sql +++ /dev/null @@ -1,33 +0,0 @@ -USE `es_extended`; - -INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_ambulance', 'EMS', 1) -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_ambulance', 'EMS', 1) -; - -INSERT INTO `datastore` (name, label, shared) VALUES - ('society_ambulance', 'EMS', 1) -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('ambulance',0,'ambulance','Jr. EMT',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',1,'doctor','EMT',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',2,'chief_doctor','Sr. EMT',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',3,'boss','EMT Supervisor',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}') -; - -INSERT INTO `jobs` (name, label) VALUES - ('ambulance','EMS') -; - -INSERT INTO `items` (name, label, weight) VALUES - ('bandage','Bandage', 2), - ('medikit','Medikit', 2) -; - -ALTER TABLE `users` - ADD `is_dead` TINYINT(1) NULL DEFAULT '0' -; diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/fi_esx_ambulancejob.sql b/server-data/resources/[esx_addons]/esx_ambulancejob/localization/fi_esx_ambulancejob.sql deleted file mode 100644 index c4e4e286b..000000000 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/fi_esx_ambulancejob.sql +++ /dev/null @@ -1,33 +0,0 @@ -USE `es_extended`; - -INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_ambulance', 'Ensihoito', 1) -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_ambulance', 'Ensihoito', 1) -; - -INSERT INTO `datastore` (name, label, shared) VALUES - ('society_ambulance', 'Ensihoito', 1) -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('ambulance',0,'ambulance','Ensihoitaja',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',1,'doctor','Lääkäri',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',2,'chief_doctor','Yli-lääkäri',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',3,'boss','Kirurgi',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}') -; - -INSERT INTO `jobs` (name, label) VALUES - ('ambulance','Ensihoito') -; - -INSERT INTO `items` (name, label, weight) VALUES - ('bandage','Sideharso', 2), - ('medikit','Ensiapupakkaus', 2) -; - -ALTER TABLE `users` - ADD `is_dead` TINYINT(1) NULL DEFAULT '0' -; diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/pl_esx_ambulancejob.sql b/server-data/resources/[esx_addons]/esx_ambulancejob/localization/pl_esx_ambulancejob.sql deleted file mode 100644 index c739fefa1..000000000 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/pl_esx_ambulancejob.sql +++ /dev/null @@ -1,33 +0,0 @@ -USE `es_extended`; - -INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_ambulance', 'Ambulance', 1) -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_ambulance', 'Ambulance', 1) -; - -INSERT INTO `datastore` (name, label, shared) VALUES - ('society_ambulance', 'Pogotowie ratunkowe', 1) -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('ambulance',0,'ambulance','Ratownik',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',1,'doctor','Lekarz',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',2,'chief_doctor','Chirurg',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',3,'boss','Ordynator',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}') -; - -INSERT INTO `jobs` (name, label) VALUES - ('ambulance','Pogotowie ratunkowe') -; - -INSERT INTO `items` (name, label, weight) VALUES - ('bandage','Bandaż', 2), - ('medikit','Defibrylator', 2) -; - -ALTER TABLE `users` - ADD `is_dead` TINYINT(1) NULL DEFAULT '0' -; diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/sv_esx_ambulancejob.sql b/server-data/resources/[esx_addons]/esx_ambulancejob/localization/sv_esx_ambulancejob.sql deleted file mode 100644 index ea22777f7..000000000 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/sv_esx_ambulancejob.sql +++ /dev/null @@ -1,33 +0,0 @@ -USE `es_extended`; - -INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_ambulance', 'Sjukvård', 1) -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_ambulance', 'Sjukvård', 1) -; - -INSERT INTO `datastore` (name, label, shared) VALUES - ('society_ambulance', 'Sjukvård', 1) -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('ambulance',0,'ambulance','Undersköterska',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',1,'doctor','Ambulanssjuksköterska',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',2,'chief_doctor','Läkare',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',3,'boss','Överläkare',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}') -; - -INSERT INTO `jobs` (name, label) VALUES - ('ambulance','Sjukvårdare') -; - -INSERT INTO `items` (name, label, weight) VALUES - ('bandage','Bandage', 2), - ('medikit','Akutväska', 2) -; - -ALTER TABLE `users` - ADD `is_dead` TINYINT(1) NULL DEFAULT '0' -; diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/tr_esx_ambulancejob.sql b/server-data/resources/[esx_addons]/esx_ambulancejob/localization/tr_esx_ambulancejob.sql deleted file mode 100644 index d6c253d79..000000000 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/localization/tr_esx_ambulancejob.sql +++ /dev/null @@ -1,33 +0,0 @@ -USE `es_extended`; - -INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_ambulance', 'EMS', 1) -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_ambulance', 'EMS', 1) -; - -INSERT INTO `datastore` (name, label, shared) VALUES - ('society_ambulance', 'EMS', 1) -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('ambulance',0,'ambulance','Acil Tıp Teknisyeni',20,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',1,'doctor','Doktor',40,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',2,'chief_doctor','Kdemli Doktor',60,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}'), - ('ambulance',3,'boss','Baş Hekim',80,'{\"tshirt_2\":0,\"hair_color_1\":5,\"glasses_2\":3,\"shoes\":9,\"torso_2\":3,\"hair_color_2\":0,\"pants_1\":24,\"glasses_1\":4,\"hair_1\":2,\"sex\":0,\"decals_2\":0,\"tshirt_1\":15,\"helmet_1\":8,\"helmet_2\":0,\"arms\":92,\"face\":19,\"decals_1\":60,\"torso_1\":13,\"hair_2\":0,\"skin\":34,\"pants_2\":5}','{\"tshirt_2\":3,\"decals_2\":0,\"glasses\":0,\"hair_1\":2,\"torso_1\":73,\"shoes\":1,\"hair_color_2\":0,\"glasses_1\":19,\"skin\":13,\"face\":6,\"pants_2\":5,\"tshirt_1\":75,\"pants_1\":37,\"helmet_1\":57,\"torso_2\":0,\"arms\":14,\"sex\":1,\"glasses_2\":0,\"decals_1\":0,\"hair_2\":0,\"helmet_2\":0,\"hair_color_1\":0}') -; - -INSERT INTO `jobs` (name, label) VALUES - ('ambulance','EMS') -; - -INSERT INTO `items` (name, label, weight) VALUES - ('bandage','Bandaj', 2), - ('medikit','Sağlık Kiti', 2) -; - -ALTER TABLE `users` - ADD `is_dead` TINYINT(1) NULL DEFAULT '0' -; diff --git a/server-data/resources/[esx_addons]/esx_ambulancejob/server/main.lua b/server-data/resources/[esx_addons]/esx_ambulancejob/server/main.lua deleted file mode 100644 index 5ace2dc5f..000000000 --- a/server-data/resources/[esx_addons]/esx_ambulancejob/server/main.lua +++ /dev/null @@ -1,344 +0,0 @@ -local playersHealing, deadPlayers = {}, {} - -ESX = exports["es_extended"]:getSharedObject() - -TriggerEvent( - "esx_society:registerSociety", - "ambulance", - "Ambulance", - "society_ambulance", - "society_ambulance", - "society_ambulance", - { type = "public" } -) - -RegisterNetEvent("esx_ambulancejob:revive") -AddEventHandler("esx_ambulancejob:revive", function(playerId) - local xPlayer = ESX.GetPlayerFromId(source) - - if xPlayer and xPlayer.job.name == "ambulance" then - local xTarget = ESX.GetPlayerFromId(playerId) - - if xTarget then - if deadPlayers[playerId] then - if Config.ReviveReward > 0 then - xPlayer.showNotification(TranslateCap("revive_complete_award", xTarget.name, Config.ReviveReward)) - xPlayer.addMoney(Config.ReviveReward, "Revive Reward") - xTarget.triggerEvent("esx_ambulancejob:revive") - else - xPlayer.showNotification(TranslateCap("revive_complete", xTarget.name)) - xTarget.triggerEvent("esx_ambulancejob:revive") - end - else - xPlayer.showNotification(TranslateCap("player_notTranslateCapnconscious")) - end - else - xPlayer.showNotification(TranslateCap("revive_fail_offline")) - end - end -end) - -RegisterNetEvent("esx:onPlayerDeath") -AddEventHandler("esx:onPlayerDeath", function() - deadPlayers[source] = "dead" - TriggerClientEvent("esx_ambulancejob:setDeadPlayers", -1, deadPlayers) -end) - -RegisterServerEvent("esx_ambulancejob:svsearch") -AddEventHandler("esx_ambulancejob:svsearch", function() - TriggerClientEvent("esx_ambulancejob:clsearch", -1, source) -end) - -RegisterNetEvent("esx_ambulancejob:onPlayerDistress") -AddEventHandler("esx_ambulancejob:onPlayerDistress", function() - if deadPlayers[source] then - deadPlayers[source] = "distress" - TriggerClientEvent("esx_ambulancejob:setDeadPlayers", -1, deadPlayers) - end -end) - -RegisterNetEvent("esx:onPlayerSpawn") -AddEventHandler("esx:onPlayerSpawn", function() - if deadPlayers[source] then - deadPlayers[source] = nil - TriggerClientEvent("esx_ambulancejob:setDeadPlayers", -1, deadPlayers) - end -end) - -AddEventHandler("esx:playerDropped", function(playerId) - if deadPlayers[playerId] then - deadPlayers[playerId] = nil - TriggerClientEvent("esx_ambulancejob:setDeadPlayers", -1, deadPlayers) - end -end) - -RegisterNetEvent("esx_ambulancejob:heal") -AddEventHandler("esx_ambulancejob:heal", function(target, type) - local xPlayer = ESX.GetPlayerFromId(source) - - if xPlayer.job.name == "ambulance" then - TriggerClientEvent("esx_ambulancejob:heal", target, type) - end -end) - -RegisterNetEvent("esx_ambulancejob:putInVehicle") -AddEventHandler("esx_ambulancejob:putInVehicle", function(target) - local xPlayer = ESX.GetPlayerFromId(source) - - if xPlayer.job.name == "ambulance" then - TriggerClientEvent("esx_ambulancejob:putInVehicle", target) - end -end) - -ESX.RegisterServerCallback("esx_ambulancejob:removeItemsAfterRPDeath", function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) - - if Config.RemoveCashAfterRPDeath then - if xPlayer.getMoney() > 0 then - xPlayer.removeMoney(xPlayer.getMoney(), "Death") - end - - if xPlayer.getAccount("black_money").money > 0 then - xPlayer.setAccountMoney("black_money", 0, "Death") - end - end - - if Config.RemoveItemsAfterRPDeath then - for i = 1, #xPlayer.inventory, 1 do - if xPlayer.inventory[i].count > 0 then - xPlayer.setInventoryItem(xPlayer.inventory[i].name, 0) - end - end - end - - local playerLoadout = {} - if Config.RemoveWeaponsAfterRPDeath then - for i = 1, #xPlayer.loadout, 1 do - xPlayer.removeWeapon(xPlayer.loadout[i].name) - end - else -- save weapons & restore em' since spawnmanager removes them - for i = 1, #xPlayer.loadout, 1 do - table.insert(playerLoadout, xPlayer.loadout[i]) - end - - -- give back wepaons after a couple of seconds - CreateThread(function() - Wait(5000) - for i = 1, #playerLoadout, 1 do - if playerLoadout[i].label ~= nil then - xPlayer.addWeapon(playerLoadout[i].name, playerLoadout[i].ammo) - end - end - end) - end - - cb() -end) - -if Config.EarlyRespawnFine then - ESX.RegisterServerCallback("esx_ambulancejob:checkBalance", function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) - local bankBalance = xPlayer.getAccount("bank").money - - cb(bankBalance >= Config.EarlyRespawnFineAmount) - end) - - RegisterNetEvent("esx_ambulancejob:payFine") - AddEventHandler("esx_ambulancejob:payFine", function() - local xPlayer = ESX.GetPlayerFromId(source) - local fineAmount = Config.EarlyRespawnFineAmount - - xPlayer.showNotification(TranslateCap("respawn_bleedout_fine_msg", ESX.Math.GroupDigits(fineAmount))) - xPlayer.removeAccountMoney("bank", fineAmount, "Respawn Fine") - end) -end - -ESX.RegisterServerCallback("esx_ambulancejob:getItemAmount", function(source, cb, item) - local xPlayer = ESX.GetPlayerFromId(source) - local quantity = xPlayer.getInventoryItem(item).count - - cb(quantity) -end) - -ESX.RegisterServerCallback("esx_ambulancejob:buyJobVehicle", function(source, cb, vehicleProps, type) - local xPlayer = ESX.GetPlayerFromId(source) - local price = getPriceFromHash(vehicleProps.model, xPlayer.job.grade_name, type) - - -- vehicle model not found - if price == 0 then - cb(false) - else - if xPlayer.getMoney() >= price then - xPlayer.removeMoney(price, "Job Vehicle Purchase") - - MySQL.Async.execute( - "INSERT INTO owned_vehicles (owner, vehicle, plate, type, job, `stored`) VALUES (@owner, @vehicle, @plate, @type, @job, @stored)", - { - ["@owner"] = xPlayer.identifier, - ["@vehicle"] = json.encode(vehicleProps), - ["@plate"] = vehicleProps.plate, - ["@type"] = type, - ["@job"] = xPlayer.job.name, - ["@stored"] = true, - }, - function() - cb(true) - end - ) - else - cb(false) - end - end -end) - -ESX.RegisterServerCallback("esx_ambulancejob:storeNearbyVehicle", function(source, cb, nearbyVehicles) - local xPlayer = ESX.GetPlayerFromId(source) - local foundPlate, foundNum - - for k, v in ipairs(nearbyVehicles) do - local result = MySQL.Sync.fetchAll( - "SELECT plate FROM owned_vehicles WHERE owner = @owner AND plate = @plate AND job = @job", - { - ["@owner"] = xPlayer.identifier, - ["@plate"] = v.plate, - ["@job"] = xPlayer.job.name, - } - ) - - if result[1] then - foundPlate, foundNum = result[1].plate, k - break - end - end - - if not foundPlate then - cb(false) - else - MySQL.Async.execute( - "UPDATE owned_vehicles SET `stored` = true WHERE owner = @owner AND plate = @plate AND job = @job", - { - ["@owner"] = xPlayer.identifier, - ["@plate"] = foundPlate, - ["@job"] = xPlayer.job.name, - }, - function(rowsChanged) - if rowsChanged == 0 then - cb(false) - else - cb(true, foundNum) - end - end - ) - end -end) - -function getPriceFromHash(vehicleHash, jobGrade, type) - local vehicles = Config.AuthorizedVehicles[type][jobGrade] - - for _, v in ipairs(vehicles) do - if GetHashKey(v.model) == vehicleHash then - return v.price - end - end - - return 0 -end - -RegisterNetEvent("esx_ambulancejob:removeItem") -AddEventHandler("esx_ambulancejob:removeItem", function(item) - local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.removeInventoryItem(item, 1) - - if item == "bandage" then - xPlayer.showNotification(TranslateCap("used_bandage")) - elseif item == "medikit" then - xPlayer.showNotification(TranslateCap("used_medikit")) - end -end) - -RegisterNetEvent("esx_ambulancejob:giveItem") -AddEventHandler("esx_ambulancejob:giveItem", function(itemName, amount) - local xPlayer = ESX.GetPlayerFromId(source) - - if xPlayer.job.name ~= "ambulance" then - print(('[esx_ambulancejob] [^2INFO^7] "%s" attempted to spawn in an item!'):format(xPlayer.identifier)) - return - elseif itemName ~= "medikit" and itemName ~= "bandage" then - print(('[esx_ambulancejob] [^2INFO^7] "%s" attempted to spawn in an item!'):format(xPlayer.identifier)) - return - end - - if xPlayer.canCarryItem(itemName, amount) then - xPlayer.addInventoryItem(itemName, amount) - else - xPlayer.showNotification(TranslateCap("max_item")) - end -end) - -ESX.RegisterCommand( - "revive", - "admin", - function(_, args) - args.playerId.triggerEvent("esx_ambulancejob:revive") - end, - true, - { - help = TranslateCap("revive_help"), - validate = true, - arguments = { - { name = "playerId", help = "The player id", type = "player" }, - }, - } -) - -ESX.RegisterUsableItem("medikit", function(source) - if not playersHealing[source] then - local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.removeInventoryItem("medikit", 1) - - playersHealing[source] = true - TriggerClientEvent("esx_ambulancejob:useItem", source, "medikit") - - Wait(10000) - playersHealing[source] = nil - end -end) - -ESX.RegisterUsableItem("bandage", function(source) - if not playersHealing[source] then - local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.removeInventoryItem("bandage", 1) - - playersHealing[source] = true - TriggerClientEvent("esx_ambulancejob:useItem", source, "bandage") - - Wait(10000) - playersHealing[source] = nil - end -end) - -ESX.RegisterServerCallback("esx_ambulancejob:getDeathStatus", function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) - - MySQL.Async.fetchScalar("SELECT is_dead FROM users WHERE identifier = @identifier", { - ["@identifier"] = xPlayer.identifier, - }, function(isDead) - if isDead then - print(('[esx_ambulancejob] [^2INFO^7] "%s" attempted combat logging'):format(xPlayer.identifier)) - end - - cb(isDead) - end) -end) - -RegisterNetEvent("esx_ambulancejob:setDeathStatus") -AddEventHandler("esx_ambulancejob:setDeathStatus", function(isDead) - local xPlayer = ESX.GetPlayerFromId(source) - - if type(isDead) == "boolean" then - MySQL.Sync.execute("UPDATE users SET is_dead = @isDead WHERE identifier = @identifier", { - ["@identifier"] = xPlayer.identifier, - ["@isDead"] = isDead, - }) - end -end) From d186ca990cf0d2e0b3c81c3ca67730962ae28639 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:44:47 +0200 Subject: [PATCH 2/8] convert: esx_ambulancejob > bpt_abulancejob --- .../bpt_ambulancejob/server/main.lua | 339 ++++++++++++++++++ 1 file changed, 339 insertions(+) create mode 100644 server-data/resources/[bpt_addons]/bpt_ambulancejob/server/main.lua diff --git a/server-data/resources/[bpt_addons]/bpt_ambulancejob/server/main.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/server/main.lua new file mode 100644 index 000000000..8e37584f2 --- /dev/null +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/server/main.lua @@ -0,0 +1,339 @@ +local playersHealing, deadPlayers = {}, {} + +ESX = exports["es_extended"]:getSharedObject() + +TriggerEvent("esx_society:registerSociety", "ambulance", "Ambulance", "society_ambulance", "society_ambulance", + "society_ambulance", + { + type = "public" + } +) + +RegisterNetEvent("bpt_ambulancejob:revive") +AddEventHandler("bpt_ambulancejob:revive", function(playerId) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer and xPlayer.job.name == "ambulance" then + local xTarget = ESX.GetPlayerFromId(playerId) + + if xTarget then + if deadPlayers[playerId] then + if Config.ReviveReward > 0 then + xPlayer.showNotification(TranslateCap("revive_complete_award", xTarget.name, Config.ReviveReward)) + xPlayer.addMoney(Config.ReviveReward, "Revive Reward") + xTarget.triggerEvent("bpt_ambulancejob:revive") + else + xPlayer.showNotification(TranslateCap("revive_complete", xTarget.name)) + xTarget.triggerEvent("bpt_ambulancejob:revive") + end + else + xPlayer.showNotification(TranslateCap("player_notTranslateCapnconscious")) + end + else + xPlayer.showNotification(TranslateCap("revive_fail_offline")) + end + end +end) + +RegisterNetEvent("esx:onPlayerDeath") +AddEventHandler("esx:onPlayerDeath", function() + deadPlayers[source] = "dead" + TriggerClientEvent("bpt_ambulancejob:setDeadPlayers", -1, deadPlayers) +end) + +RegisterServerEvent("bpt_ambulancejob:svsearch") +AddEventHandler("bpt_ambulancejob:svsearch", function() + TriggerClientEvent("bpt_ambulancejob:clsearch", -1, source) +end) + +RegisterNetEvent("bpt_ambulancejob:onPlayerDistress") +AddEventHandler("bpt_ambulancejob:onPlayerDistress", function() + if deadPlayers[source] then + deadPlayers[source] = "distress" + TriggerClientEvent("bpt_ambulancejob:setDeadPlayers", -1, deadPlayers) + end +end) + +RegisterNetEvent("esx:onPlayerSpawn") +AddEventHandler("esx:onPlayerSpawn", function() + if deadPlayers[source] then + deadPlayers[source] = nil + TriggerClientEvent("bpt_ambulancejob:setDeadPlayers", -1, deadPlayers) + end +end) + +AddEventHandler("esx:playerDropped", function(playerId) + if deadPlayers[playerId] then + deadPlayers[playerId] = nil + TriggerClientEvent("bpt_ambulancejob:setDeadPlayers", -1, deadPlayers) + end +end) + +RegisterNetEvent("bpt_ambulancejob:heal") +AddEventHandler("bpt_ambulancejob:heal", function(target, type) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == "ambulance" then + TriggerClientEvent("bpt_ambulancejob:heal", target, type) + end +end) + +RegisterNetEvent("bpt_ambulancejob:putInVehicle") +AddEventHandler("bpt_ambulancejob:putInVehicle", function(target) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == "ambulance" then + TriggerClientEvent("bpt_ambulancejob:putInVehicle", target) + end +end) + +ESX.RegisterServerCallback("bpt_ambulancejob:removeItemsAfterRPDeath", function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + + if Config.RemoveCashAfterRPDeath then + if xPlayer.getMoney() > 0 then + xPlayer.removeMoney(xPlayer.getMoney(), "Death") + end + + if xPlayer.getAccount("black_money").money > 0 then + xPlayer.setAccountMoney("black_money", 0, "Death") + end + end + + if Config.RemoveItemsAfterRPDeath then + for i = 1, #xPlayer.inventory, 1 do + if xPlayer.inventory[i].count > 0 then + xPlayer.setInventoryItem(xPlayer.inventory[i].name, 0) + end + end + end + + local playerLoadout = {} + if Config.RemoveWeaponsAfterRPDeath then + for i = 1, #xPlayer.loadout, 1 do + xPlayer.removeWeapon(xPlayer.loadout[i].name) + end + else -- save weapons & restore em' since spawnmanager removes them + for i = 1, #xPlayer.loadout, 1 do + table.insert(playerLoadout, xPlayer.loadout[i]) + end + + -- give back wepaons after a couple of seconds + CreateThread(function() + Wait(5000) + for i = 1, #playerLoadout, 1 do + if playerLoadout[i].label ~= nil then + xPlayer.addWeapon(playerLoadout[i].name, playerLoadout[i].ammo) + end + end + end) + end + + cb() +end) + +if Config.EarlyRespawnFine then + ESX.RegisterServerCallback("bpt_ambulancejob:checkBalance", function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + local bankBalance = xPlayer.getAccount("bank").money + + cb(bankBalance >= Config.EarlyRespawnFineAmount) + end) + + RegisterNetEvent("bpt_ambulancejob:payFine") + AddEventHandler("bpt_ambulancejob:payFine", function() + local xPlayer = ESX.GetPlayerFromId(source) + local fineAmount = Config.EarlyRespawnFineAmount + + xPlayer.showNotification(TranslateCap("respawn_bleedout_fine_msg", ESX.Math.GroupDigits(fineAmount))) + xPlayer.removeAccountMoney("bank", fineAmount, "Respawn Fine") + end) +end + +ESX.RegisterServerCallback("bpt_ambulancejob:getItemAmount", function(source, cb, item) + local xPlayer = ESX.GetPlayerFromId(source) + local quantity = xPlayer.getInventoryItem(item).count + + cb(quantity) +end) + +ESX.RegisterServerCallback("bpt_ambulancejob:buyJobVehicle", function(source, cb, vehicleProps, type) + local xPlayer = ESX.GetPlayerFromId(source) + local price = getPriceFromHash(vehicleProps.model, xPlayer.job.grade_name, type) + + -- vehicle model not found + if price == 0 then + cb(false) + else + if xPlayer.getMoney() >= price then + xPlayer.removeMoney(price, "Job Vehicle Purchase") + + MySQL.Async.execute( + "INSERT INTO owned_vehicles (owner, vehicle, plate, type, job, `stored`) VALUES (@owner, @vehicle, @plate, @type, @job, @stored)", + { + ["@owner"] = xPlayer.identifier, + ["@vehicle"] = json.encode(vehicleProps), + ["@plate"] = vehicleProps.plate, + ["@type"] = type, + ["@job"] = xPlayer.job.name, + ["@stored"] = true, + }, + function() + cb(true) + end + ) + else + cb(false) + end + end +end) + +ESX.RegisterServerCallback("bpt_ambulancejob:storeNearbyVehicle", function(source, cb, nearbyVehicles) + local xPlayer = ESX.GetPlayerFromId(source) + local foundPlate, foundNum + + for k, v in ipairs(nearbyVehicles) do + local result = MySQL.Sync.fetchAll( + "SELECT plate FROM owned_vehicles WHERE owner = @owner AND plate = @plate AND job = @job", + { + ["@owner"] = xPlayer.identifier, + ["@plate"] = v.plate, + ["@job"] = xPlayer.job.name, + } + ) + + if result[1] then + foundPlate, foundNum = result[1].plate, k + break + end + end + + if not foundPlate then + cb(false) + else + MySQL.Async.execute( + "UPDATE owned_vehicles SET `stored` = true WHERE owner = @owner AND plate = @plate AND job = @job", + { + ["@owner"] = xPlayer.identifier, + ["@plate"] = foundPlate, + ["@job"] = xPlayer.job.name, + }, + function(rowsChanged) + if rowsChanged == 0 then + cb(false) + else + cb(true, foundNum) + end + end + ) + end +end) + +function getPriceFromHash(vehicleHash, jobGrade, type) + local vehicles = Config.AuthorizedVehicles[type][jobGrade] + + for _, v in ipairs(vehicles) do + if GetHashKey(v.model) == vehicleHash then + return v.price + end + end + + return 0 +end + +RegisterNetEvent("bpt_ambulancejob:removeItem") +AddEventHandler("bpt_ambulancejob:removeItem", function(item) + local xPlayer = ESX.GetPlayerFromId(source) + xPlayer.removeInventoryItem(item, 1) + + if item == "bandage" then + xPlayer.showNotification(TranslateCap("used_bandage")) + elseif item == "medikit" then + xPlayer.showNotification(TranslateCap("used_medikit")) + end +end) + +RegisterNetEvent("bpt_ambulancejob:giveItem") +AddEventHandler("bpt_ambulancejob:giveItem", function(itemName, amount) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name ~= "ambulance" then + print(('[bpt_ambulancejob] [^2INFO^7] "%s" attempted to spawn in an item!'):format(xPlayer.identifier)) + return + elseif itemName ~= "medikit" and itemName ~= "bandage" then + print(('[bpt_ambulancejob] [^2INFO^7] "%s" attempted to spawn in an item!'):format(xPlayer.identifier)) + return + end + + if xPlayer.canCarryItem(itemName, amount) then + xPlayer.addInventoryItem(itemName, amount) + else + xPlayer.showNotification(TranslateCap("max_item")) + end +end) + +ESX.RegisterCommand("revive", "admin", + function(_, args) + args.playerId.triggerEvent("bpt_ambulancejob:revive") + end, + true, + { + help = TranslateCap("revive_help"), + validate = true, + arguments = { + { name = "playerId", help = "The player id", type = "player" }, + }, + } +) + +ESX.RegisterUsableItem("medikit", function(source) + if not playersHealing[source] then + local xPlayer = ESX.GetPlayerFromId(source) + xPlayer.removeInventoryItem("medikit", 1) + + playersHealing[source] = true + TriggerClientEvent("bpt_ambulancejob:useItem", source, "medikit") + + Wait(10000) + playersHealing[source] = nil + end +end) + +ESX.RegisterUsableItem("bandage", function(source) + if not playersHealing[source] then + local xPlayer = ESX.GetPlayerFromId(source) + xPlayer.removeInventoryItem("bandage", 1) + + playersHealing[source] = true + TriggerClientEvent("bpt_ambulancejob:useItem", source, "bandage") + + Wait(10000) + playersHealing[source] = nil + end +end) + +ESX.RegisterServerCallback("bpt_ambulancejob:getDeathStatus", function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.Async.fetchScalar("SELECT is_dead FROM users WHERE identifier = @identifier", { + ["@identifier"] = xPlayer.identifier, + }, function(isDead) + if isDead then + print(('[bpt_ambulancejob] [^2INFO^7] "%s" attempted combat logging'):format(xPlayer.identifier)) + end + + cb(isDead) + end) +end) + +RegisterNetEvent("bpt_ambulancejob:setDeathStatus") +AddEventHandler("bpt_ambulancejob:setDeathStatus", function(isDead) + local xPlayer = ESX.GetPlayerFromId(source) + + if type(isDead) == "boolean" then + MySQL.Sync.execute("UPDATE users SET is_dead = @isDead WHERE identifier = @identifier", { + ["@identifier"] = xPlayer.identifier, + ["@isDead"] = isDead, + }) + end +end) From 6cf2c548b048723025dfaf8705c703f4c984ce97 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:45:52 +0200 Subject: [PATCH 3/8] fix: fix fxmanifest version --- .../resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-data/resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua index d3fa3c125..7fc30f217 100644 --- a/server-data/resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua @@ -4,7 +4,7 @@ game("gta5") description("ESX Ambulance Job") -version("1.0.0") +version("1.0.1") shared_script("@es_extended/imports.lua") From 5a60e5bc1bae9b6c6f9824948bd9b083ef288665 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Fri, 7 Jun 2024 19:27:52 +0200 Subject: [PATCH 4/8] fix: bpt_ambulancejob\client\job.lua variable billing is never set --- .../[bpt_addons]/bpt_ambulancejob/client/job.lua | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/job.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/job.lua index b265719fb..1f0236f7b 100644 --- a/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/job.lua +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/job.lua @@ -1,7 +1,7 @@ -local CurrentAction, CurrentActionMsg, CurrentActionData = nil, "", {} +local CurrentAction, CurrentActionMsg, CurrentActionData, billing = nil, "", {}, {} local HasAlreadyEnteredMarker, LastHospital, LastPart, LastPartNum local isBusy, deadPlayers, deadPlayerBlips, isOnDuty, vehicle = false, {}, {}, false, {} -isInShopMenu = false +local isInShopMenu = false function OpenAmbulanceActionsMenu() local elements = { @@ -122,7 +122,6 @@ function OpenMobileAmbulanceActionsMenu() end -- billing -local billing if billing == "billing" then ESX.UI.Menu.Open("dialog", GetCurrentResourceName(), "billing", { @@ -137,13 +136,8 @@ if billing == "billing" then if closestPlayer == -1 or closestDistance > 3.0 then ESX.ShowNotification(TranslateCap("no_players_near")) else - TriggerServerEvent( - "esx_billing:sendBill", - GetPlayerServerId(closestPlayer), - "society_ambulance", - "Ambulance", - amount - ) + TriggerServerEvent("esx_billing:sendBill", GetPlayerServerId(closestPlayer), "society_ambulance", + "Ambulance", amount) ESX.ShowNotification(TranslateCap("billing_sent")) end end From 8b5a6d6e06f4b7157850918b7f1b6fb8ee08f256 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:44:36 +0200 Subject: [PATCH 5/8] fix: bpt_ambulancejob\client\job.lua used variable _deadPlayers with unused hint --- .../bpt_ambulancejob/client/job.lua | 32 +++---------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/job.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/job.lua index 1f0236f7b..6e0a1859d 100644 --- a/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/job.lua +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/job.lua @@ -370,30 +370,10 @@ CreateThread(function() 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 - ) + 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) letSleep = false if distance < v.Marker.x then @@ -556,9 +536,7 @@ AddEventHandler("esx:setJob", function(job) end) RegisterNetEvent("bpt_ambulancejob:setDeadPlayers") -AddEventHandler("bpt_ambulancejob:setDeadPlayers", function(_deadPlayers) - deadPlayers = _deadPlayers - +AddEventHandler("bpt_ambulancejob:setDeadPlayers", function() if isOnDuty then for playerId, v in pairs(deadPlayerBlips) do RemoveBlip(v) From 2c28ef862dc1c799d00999bf56dcc1244a1682ee Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sat, 8 Jun 2024 12:27:38 +0200 Subject: [PATCH 6/8] fix: bpt_ambulancejob\client\main.lua - unused variable coords - variable seconds was previously defined as an argument --- .../resources/[bpt_addons]/bpt_ambulancejob/client/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/main.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/main.lua index ea4ad78ad..187857dee 100644 --- a/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/main.lua @@ -210,7 +210,7 @@ end function SendDistressSignal() local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) + local _ = GetEntityCoords(playerPed) ESX.ShowNotification(TranslateCap("distress_sent")) TriggerServerEvent("bpt_ambulancejob:onPlayerDistress") @@ -227,7 +227,7 @@ function DrawGenericTextThisFrame() end function secondsToClock(seconds) - local seconds, hours, mins, secs = tonumber(seconds), 0, 0, 0 + local _ = tonumber(seconds) if seconds <= 0 then return 0, 0 From b0074638e897bc4362ecdba25ddddd10feb2f6f1 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sun, 9 Jun 2024 11:51:06 +0200 Subject: [PATCH 7/8] fix: accessing undefined variable isBusy + drawLoadingText --- .../bpt_ambulancejob/client/vehicle.lua | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/vehicle.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/vehicle.lua index 5ddb52483..10ab8dcb1 100644 --- a/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/vehicle.lua +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/client/vehicle.lua @@ -3,10 +3,10 @@ local spawnedVehicles = {} function OpenVehicleSpawnerMenu(type, hospital, part, partNum) local playerCoords = GetEntityCoords(PlayerPedId()) local elements = { - { unselectable = true, icon = "fas fa-car", title = TranslateCap("garage_title") }, + { unselectable = true, icon = "fas fa-car", title = TranslateCap("garage_title") }, { icon = "fas fa-car", title = TranslateCap("garage_storeditem"), action = "garage" }, - { icon = "fas fa-car", title = TranslateCap("garage_storeitem"), action = "store_garage" }, - { icon = "fas fa-car", title = TranslateCap("garage_buyitem"), action = "buy_vehicle" }, + { icon = "fas fa-car", title = TranslateCap("garage_storeitem"), action = "store_garage" }, + { icon = "fas fa-car", title = TranslateCap("garage_buyitem"), action = "buy_vehicle" }, } ESX.OpenContext("right", elements, function(_, element) if element.action == "buy_vehicle" then @@ -62,7 +62,8 @@ function OpenVehicleSpawnerMenu(type, hospital, part, partNum) ) if v.stored then - label = label .. ('%s'):format(TranslateCap("garage_stored")) + label = label .. + ('%s'):format(TranslateCap("garage_stored")) else label = label .. ('%s'):format(TranslateCap("garage_notstored")) @@ -144,7 +145,8 @@ function StoreNearbyVehicle(playerCoords) local vehicleId = vehiclePlates[foundNum] local attempts = 0 ESX.Game.DeleteVehicle(vehicleId.vehicle) - isBusy = true + local isBusy = true + local drawLoadingText = {} CreateThread(function() while isBusy do @@ -207,7 +209,7 @@ function OpenShopMenu(elements, restoreCoords, shopCoords) ESX.OpenContext("right", elements, function(_, element) local elements2 = { { unselectable = true, icon = "fas fa-car", title = element.title }, - { icon = "fas fa-eye", title = "View", value = "view" }, + { icon = "fas fa-eye", title = "View", value = "view" }, } ESX.OpenContext("right", elements2, function(_, element2) @@ -227,9 +229,9 @@ function OpenShopMenu(elements, restoreCoords, shopCoords) end) local elements3 = { - { unselectable = true, icon = "fas fa-car", title = element.title }, - { icon = "fas fa-check-double", title = "Buy", value = "buy" }, - { icon = "fas fa-eye", title = "Stop Viewing", value = "stop" }, + { unselectable = true, icon = "fas fa-car", title = element.title }, + { icon = "fas fa-check-double", title = "Buy", value = "buy" }, + { icon = "fas fa-eye", title = "Stop Viewing", value = "stop" }, } ESX.OpenContext("right", elements3, function(_, element3) From 05c57eb697105dc376b6edf4208be51c666255a7 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sun, 9 Jun 2024 11:51:51 +0200 Subject: [PATCH 8/8] fix: bpt_ambulancejob\fxmanifest.lua description --- .../resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-data/resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua index 7fc30f217..5770f7709 100644 --- a/server-data/resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua +++ b/server-data/resources/[bpt_addons]/bpt_ambulancejob/fxmanifest.lua @@ -2,7 +2,7 @@ fx_version("adamant") game("gta5") -description("ESX Ambulance Job") +description("BPT Ambulance Job") version("1.0.1")