From 77e93ecee77edb1de20658cc001f702775e489f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 8 Aug 2017 19:17:10 +0200 Subject: [PATCH 001/253] Initial commit --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..e5f1f919 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# fxserver-esx_policejob +FXServer ESX Police Job From 57d8abed3d40cace143a77a70731c56330f4fdc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 8 Aug 2017 20:16:19 +0200 Subject: [PATCH 002/253] Add files --- README.md | 28 + __resource.lua | 14 + client/main.lua | 1430 +++++++++++++++++++++++++++++++++++++ config.lua | 77 ++ esx_policejob_full.sql | 18 + esx_policejob_minimal.sql | 10 + server/main.lua | 263 +++++++ 7 files changed, 1840 insertions(+) create mode 100644 __resource.lua create mode 100644 client/main.lua create mode 100644 config.lua create mode 100644 esx_policejob_full.sql create mode 100644 esx_policejob_minimal.sql create mode 100644 server/main.lua diff --git a/README.md b/README.md index e5f1f919..0c536d16 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,30 @@ # fxserver-esx_policejob FXServer ESX Police Job + +[REQUIREMENTS] + +* Auto mode + * esx_billing => https://github.com/FXServer-ESX/fxserver-esx_billing + +* Player management (boss actions and armory with buyable weapons) + * esx_society => https://github.com/FXServer-ESX/fxserver-esx_society + * esx_datastore => https://github.com/FXServer-ESX/fxserver-esx_datastore + +[INSTALLATION] + +1) CD in your resources/[esx] folder +2) Clone the repository +``` +git clone https://github.com/FXServer-ESX/fxserver-esx_taxijob esx_taxijob +``` +3) * Auto mode : Import esx_policejob_minimal.sql in your database + * Player / Armory management : Import esx_policejob_full.sql in your database + +4) Add this in your server.cfg : + +``` +start esx_policejob +``` +5) * If you want player management you have to set Config.EnablePlayerManagement to true in config.lua + * If you want armory management you have to set Config.EnableArmoryManagement to true in config.lua + diff --git a/__resource.lua b/__resource.lua new file mode 100644 index 00000000..d486b6f5 --- /dev/null +++ b/__resource.lua @@ -0,0 +1,14 @@ +resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' + +description 'ESX Police Job' + +server_scripts { + '@mysql-async/lib/MySQL.lua', + 'config.lua', + 'server/main.lua' +} + +client_scripts { + 'config.lua', + 'client/main.lua' +} diff --git a/client/main.lua b/client/main.lua new file mode 100644 index 00000000..618fd401 --- /dev/null +++ b/client/main.lua @@ -0,0 +1,1430 @@ +local Keys = { + ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, + ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, + ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, + ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, + ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, + ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, + ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, + ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, + ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 +} + +ESX = nil +local PlayerData = {} +local GUI = {} +GUI.Time = 0 +local HasAlreadyEnteredMarker = false +local LastStation = nil +local LastPart = nil +local LastPartNum = nil +local LastEntity = nil +local CurrentAction = nil +local CurrentActionMsg = '' +local CurrentActionData = {} +local IsHandcuffed = false + +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end +end) + +function SetVehicleMaxMods(vehicle) + + local props = { + modEngine = 2, + modBrakes = 2, + modTransmission = 2, + modSuspension = 3, + modTurbo = true, + } + + ESX.Game.SetVehicleProperties(vehicle, props) + +end + +function OpenCloakroomMenu() + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'cloakroom', + { + title = 'Vestiaire', + align = 'top-left', + elements = { + {label = 'Tenue Civil', value = 'citizen_wear'}, + {label = 'Tenue Policier', value = 'police_wear'}, + }, + }, + function(data, menu) + + menu.close() + + if data.current.value == 'citizen_wear' then + + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + TriggerEvent('skinchanger:loadSkin', skin) + end) + + end + + if data.current.value == 'police_wear' then + + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + + if skin.sex == 0 then + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male) + else + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) + end + + end) + + end + + CurrentAction = 'menu_cloakroom' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour vous changer' + CurrentActionData = {} + + end, + function(data, menu) + + menu.close() + + CurrentAction = 'menu_cloakroom' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour vous changer' + CurrentActionData = {} + end + ) + +end + +function OpenArmoryMenu(station) + + if Config.EnableArmoryManagement then + + local elements = { + {label = 'Prendre Arme', value = 'get_weapon'}, + {label = 'Déposer Arme', value = 'put_weapon'} + } + + if PlayerData.job.grade_name == 'boss' then + table.insert(elements, {label = 'Acheter Armes', value = 'buy_weapons'}) + end + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'armory', + { + title = 'Armurerie', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + if data.current.value == 'get_weapon' then + OpenGetWeaponMenu() + end + + if data.current.value == 'put_weapon' then + OpenPutWeaponMenu() + end + + if data.current.value == 'buy_weapons' then + OpenBuyWeaponsMenu(station) + end + + end, + function(data, menu) + + menu.close() + + CurrentAction = 'menu_armory' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie' + CurrentActionData = {station = station} + end + ) + + else + + local elements = {} + + for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do + local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] + table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name), value = weapon.name}) + end + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'armory', + { + title = 'Armurerie', + align = 'top-left', + elements = elements, + }, + function(data, menu) + local weapon = data.current.value + TriggerServerEvent('esx_policejob:giveWeapon', weapon, 1000) + end, + function(data, menu) + + menu.close() + + CurrentAction = 'menu_armory' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie' + CurrentActionData = {station = station} + + end + ) + + end + +end + +function OpenVehicleSpawnerMenu(station, partNum) + + local elements = {} + local vehicles = Config.PoliceStations[station].Vehicles + + for i=1, #Config.PoliceStations[station].AuthorizedVehicles, 1 do + local vehicle = Config.PoliceStations[station].AuthorizedVehicles[i] + table.insert(elements, {label = vehicle.label, value = vehicle.name}) + end + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = 'Véhicule', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + menu.close() + + local model = data.current.value + + local vehicle, distance = ESX.Game.GetClosestVehicle({ + x = vehicles[partNum].SpawnPoint.x, + y = vehicles[partNum].SpawnPoint.y, + z = vehicles[partNum].SpawnPoint.z + }) + + if distance > 3.0 then + + local playerPed = GetPlayerPed(-1) + + if Config.MaxInService == -1 then + + ESX.Game.SpawnVehicle(model, { + x = vehicles[partNum].SpawnPoint.x, + y = vehicles[partNum].SpawnPoint.y, + z = vehicles[partNum].SpawnPoint.z + }, vehicles[partNum].Heading, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + SetVehicleMaxMods(vehicle) + end) + + else + + ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) + + if canTakeService then + + ESX.Game.SpawnVehicle(model, { + x = vehicles[partNum].SpawnPoint.x, + y = vehicles[partNum].SpawnPoint.y, + z = vehicles[partNum].SpawnPoint.z + }, vehicles[partNum].Heading, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + SetVehicleMaxMods(vehicle) + end) + + else + ESX.ShowNotification('Service complet : ' .. inServiceCount .. '/' .. maxInService) + end + + end, 'police') + + end + + else + ESX.ShowNotification('Il y a déja un véhicule de sorti') + end + + end, + function(data, menu) + + menu.close() + + CurrentAction = 'menu_vehicle_spawner' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour sortir un véhicule' + CurrentActionData = {station = station, partNum = partNum} + + end + ) + +end + +function OpenPoliceActionsMenu() + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'police_actions', + { + title = 'Police', + align = 'top-left', + elements = { + {label = 'Interaction citoyen', value = 'citizen_interaction'}, + {label = 'Interaction véhicule', value = 'vehicle_interaction'}, + {label = 'Placer objets', value = 'object_spawner'}, + }, + }, + function(data, menu) + + if data.current.value == 'citizen_interaction' then + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = 'Interaction Csitoyen', + align = 'top-left', + elements = { + {label = 'Carte d\'identité', value = 'identity_card'}, + {label = 'Fouiller', value = 'body_search'}, + {label = 'Menotter / Démenotter', value = 'handcuff'}, + {label = 'Mettre dans véhicule', value = 'put_in_vehicle'}, + {label = 'Amende', value = 'fine'} + }, + }, + function(data2, menu2) + + local player, distance = ESX.Game.GetClosestPlayer() + + if distance ~= -1 and distance <= 3.0 then + + if data2.current.value == 'identity_card' then + OpenIdentityCardMenu(player) + end + + if data2.current.value == 'body_search' then + OpenBodySearchMenu(player) + end + + if data2.current.value == 'handcuff' then + TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(player)) + end + + if data2.current.value == 'put_in_vehicle' then + TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(player)) + end + + if data2.current.value == 'fine' then + OpenFineMenu(player) + end + + else + ESX.ShowNotification('Aucun joueur à proximité') + end + + end, + function(data2, menu2) + menu2.close() + end + ) + + end + + if data.current.value == 'vehicle_interaction' then + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_interaction', + { + title = 'Interaction Csitoyen', + align = 'top-left', + elements = { + {label = 'Infos véhicule', value = 'vehicle_infos'}, + {label = 'Crocheter véhicule', value = 'hijack_vehicle'}, + }, + }, + function(data2, menu2) + + local vehicle, distance = ESX.Game.GetClosestVehicle() + + if distance ~= -1 and distance <= 3.0 then + + local vehicleData = ESX.Game.GetVehicleProperties(vehicle) + + if data2.current.value == 'vehicle_infos' then + OpenVehicleInfosMenu(vehicleData) + end + + if data2.current.value == 'hijack_vehicle' then + + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then + + local vehicle, distance = ESX.Game.GetClosestVehicle({ + x = coords.x, + y = coords.y, + z = coords.z + }) + + if DoesEntityExist(vehicle) then + + Citizen.CreateThread(function() + + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_WELDING", 0, true) + + Wait(20000) + + ClearPedTasksImmediately(playerPed) + + SetVehicleDoorsLocked(vehicle, 1) + SetVehicleDoorsLockedForAllPlayers(vehicle, false) + + TriggerEvent('esx:showNotification', 'Véhicule ~g~déverouillé~s~') + + end) + + end + + end + + end + + else + ESX.ShowNotification('Aucun véhicule à proximité') + end + + end, + function(data2, menu2) + menu2.close() + end + ) + + end + + if data.current.value == 'object_spawner' then + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = 'Interaction Csitoyen', + align = 'top-left', + elements = { + {label = 'Plot', value = 'prop_roadcone02a'}, + {label = 'Barrière', value = 'prop_barrier_work06a'}, + {label = 'Herse', value = 'p_ld_stinger_s'}, + {label = 'Caisse', value = 'prop_boxpile_07d'}, + {label = 'Caisse', value = 'hei_prop_cash_crate_half_full'} + }, + }, + function(data2, menu2) + + + local model = data2.current.value + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + local forward = GetEntityForwardVector(playerPed) + local x, y, z = table.unpack(coords + forward * 1.0) + + if model == 'prop_roadcone02a' then + z = z - 2.0 + end + + ESX.Game.SpawnObject(model, { + x = x, + y = y, + z = z + }, 3.0, function(obj) + SetEntityHeading(obj, GetEntityHeading(playerPed)) + PlaceObjectOnGroundProperly(obj) + end) + + end, + function(data2, menu2) + menu2.close() + end + ) + + end + + end, + function(data, menu) + + menu.close() + + end + ) + +end + +function OpenIdentityCardMenu(player) + + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + + local jobLabel = nil + + if data.job.grade_label ~= nil and data.job.grade_label ~= '' then + jobLabel = 'Job : ' .. data.job.label .. ' - ' .. data.job.grade_label + else + jobLabel = 'Job : ' .. data.job.label + end + + local elements = { + {label = 'Nom : ' .. data.name, value = nil}, + {label = jobLabel, value = nil}, + } + + if data.drunk ~= nil then + table.insert(elements, {label = 'Alcoolémie : ' .. data.drunk .. '%', value = nil}) + end + + if data.licenses ~= nil then + + table.insert(elements, {label = '--- Licenses ---', value = nil}) + + for i=1, #data.licenses, 1 do + table.insert(elements, {label = data.licenses[i].label, value = nil}) + end + + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = 'Interaction Citoyen', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + end, + function(data, menu) + menu.close() + end + ) + + end, GetPlayerServerId(player)) + +end + +function OpenBodySearchMenu(player) + + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + + local elements = {} + + local blackMoney = 0 + + for i=1, #data.accounts, 1 do + if data.accounts[i].name == 'black_money' then + blackMoney = data.accounts[i].money + end + end + + table.insert(elements, { + label = 'Confisquer argent sale : $' .. blackMoney, + value = 'black_money', + itemType = 'item_account', + amount = blackMoney + }) + + table.insert(elements, {label = '--- Armes ---', value = nil}) + + for i=1, #data.weapons, 1 do + table.insert(elements, { + label = 'Confisquer ' .. ESX.GetWeaponLabel(data.weapons[i].name), + value = data.weapons[i].name, + itemType = 'item_weapon', + amount = data.ammo, + }) + end + + table.insert(elements, {label = '--- Inventaire ---', value = nil}) + + for i=1, #data.inventory, 1 do + if data.inventory[i].count > 0 then + table.insert(elements, { + label = 'Confisquer x' .. data.inventory[i].count .. ' ' .. data.inventory[i].label, + value = data.inventory[i].name, + itemType = 'item_standard', + amount = data.inventory[i].count, + }) + end + end + + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'body_search', + { + title = 'Fouille', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + local itemType = data.current.itemType + local itemName = data.current.value + local amount = data.current.amount + + if data.current.value ~= nil then + + TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), itemType, itemName, amount) + + OpenBodySearchMenu(player) + + end + + end, + function(data, menu) + menu.close() + end + ) + + end, GetPlayerServerId(player)) + +end + +function OpenFineMenu(player) + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'fine', + { + title = 'Amende', + align = 'top-left', + elements = { + {label = 'Code de la route', value = 0}, + {label = 'Délit mineur', value = 1}, + {label = 'Délit moyen', value = 2}, + {label = 'Délit grave', value = 3} + }, + }, + function(data, menu) + + OpenFineCategoryMenu(player, data.current.value) + + end, + function(data, menu) + menu.close() + end + ) + +end + +function OpenFineCategoryMenu(player, category) + + ESX.TriggerServerCallback('esx_policejob:getFineList', function(fines) + + local elements = {} + + for i=1, #fines, 1 do + table.insert(elements, { + label = fines[i].label .. ' $' .. fines[i].amount, + value = fines[i].id, + amount = fines[i].amount, + fineLabel = fines[i].label + }) + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'fine_category', + { + title = 'Amende', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + local label = data.current.fineLabel + local amount = data.current.amount + + menu.close() + + if Config.EnablePlayerManagement then + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', 'Amende : ' .. label, amount) + else + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', 'Amende : ' .. label, amount) + end + + ESX.SetTimeout(300, function() + OpenFineCategoryMenu(player, category) + end) + + end, + function(data, menu) + menu.close() + end + ) + + end, category) + +end + +function OpenVehicleInfosMenu(vehicleData) + + ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(infos) + + local elements = {} + + table.insert(elements, {label = 'N°: ' .. infos.plate, value = nil}) + + if infos.owner == nil then + table.insert(elements, {label = 'Propriétaire : Inconnu', value = nil}) + else + table.insert(elements, {label = 'Propriétaire : ' .. infos.owner, value = nil}) + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_infos', + { + title = 'Infos Véhicule', + align = 'top-left', + elements = elements, + }, + nil, + function(data, menu) + menu.close() + end + ) + + end, vehicleData.plate) + +end + +function OpenGetWeaponMenu() + + ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) + + local elements = {} + + for i=1, #weapons, 1 do + if weapons[i].count > 0 then + table.insert(elements, {label = 'x' .. weapons[i].count .. ' ' .. ESX.GetWeaponLabel(weapons[i].name), value = weapons[i].name}) + end + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'armory_get_weapon', + { + title = 'Armurerie - Prendre Arme', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + menu.close() + + ESX.TriggerServerCallback('esx_policejob:removeArmoryWeapon', function() + OpenGetWeaponMenu() + end, data.current.value) + + end, + function(data, menu) + menu.close() + end + ) + + end) + +end + +function OpenPutWeaponMenu() + + local elements = {} + local playerPed = GetPlayerPed(-1) + local weaponList = ESX.GetWeaponList() + + for i=1, #weaponList, 1 do + + local weaponHash = GetHashKey(weaponList[i].name) + + if HasPedGotWeapon(playerPed, weaponHash, false) and weaponList[i].name ~= 'WEAPON_UNARMED' then + local ammo = GetAmmoInPedWeapon(playerPed, weaponHash) + table.insert(elements, {label = weaponList[i].label, value = weaponList[i].name}) + end + + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'armory_put_weapon', + { + title = 'Armurerie - Déposer Arme', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + menu.close() + + ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() + OpenPutWeaponMenu() + end, data.current.value) + + end, + function(data, menu) + menu.close() + end + ) + +end + +function OpenBuyWeaponsMenu(station) + + ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) + + local elements = {} + + for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do + + local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] + local count = 0 + + for i=1, #weapons, 1 do + if weapons[i].name == weapon.name then + count = weapons[i].count + break + end + end + + table.insert(elements, {label = 'x' .. count .. ' ' .. ESX.GetWeaponLabel(weapon.name) .. ' $' .. weapon.price, value = weapon.name, price = weapon.price}) + + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'armory_buy_weapons', + { + title = 'Armurerie - Acheter Armes', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + ESX.TriggerServerCallback('esx_policejob:buy', function(hasEnoughMoney) + + if hasEnoughMoney then + ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() + OpenBuyWeaponsMenu(station) + end, data.current.value) + else + ESX.ShowNotification('Vous n\'avez pas assez d\'argent') + end + + end, data.current.price) + + end, + function(data, menu) + menu.close() + end + ) + + end) + +end + +function OpenBossActionsMenu() + + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'realestateagent', + { + title = PlayerData.job.grade_label, + elements = { + {label = 'Retirer argent société', value = 'withdraw_society_money'}, + {label = 'Déposer argent', value = 'deposit_money'}, + } + }, + function(data, menu) + + if data.current.value == 'withdraw_society_money' then + + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'withdraw_society_money_amount', + { + title = 'Montant du retrait' + }, + function(data, menu) + + local amount = tonumber(data.value) + + if amount == nil then + ESX.ShowNotification('Montant invalide') + else + menu.close() + TriggerServerEvent('esx_society:withdrawMoney', 'police', amount) + end + + end, + function(data, menu) + menu.close() + end + ) + + end + + if data.current.value == 'deposit_money' then + + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'deposit_money_amount', + { + title = 'Montant du dépôt' + }, + function(data, menu) + + local amount = tonumber(data.value) + + if amount == nil then + ESX.ShowNotification('Montant invalide') + else + menu.close() + TriggerServerEvent('esx_society:depositMoney', 'police', amount) + end + + end, + function(data, menu) + menu.close() + end + ) + + end + + end, + function(data, menu) + + menu.close() + + CurrentAction = 'menu_boss_actions' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour ouvrir le menu' + CurrentActionData = {} + + end + ) + +end + +RegisterNetEvent('esx:playerLoaded') +AddEventHandler('esx:playerLoaded', function(xPlayer) + PlayerData = xPlayer +end) + +RegisterNetEvent('esx:setJob') +AddEventHandler('esx:setJob', function(job) + PlayerData.job = job +end) + +AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNum) + + if part == 'Cloakroom' then + CurrentAction = 'menu_cloakroom' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour vous changer' + CurrentActionData = {} + end + + if part == 'Armory' then + CurrentAction = 'menu_armory' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie' + CurrentActionData = {station = station} + end + + if part == 'VehicleSpawner' then + CurrentAction = 'menu_vehicle_spawner' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour sortir un véhicule' + CurrentActionData = {station = station, partNum = partNum} + end + + if part == 'HelicopterSpawner' then + + local helicopters = Config.PoliceStations[station].Helicopters + + local vehicle, distance = ESX.Game.GetClosestVehicle({ + x = helicopters[partNum].SpawnPoint.x, + y = helicopters[partNum].SpawnPoint.y, + z = helicopters[partNum].SpawnPoint.z + }) + + if distance > 3.0 then + + ESX.Game.SpawnVehicle('polmav', { + x = helicopters[partNum].SpawnPoint.x, + y = helicopters[partNum].SpawnPoint.y, + z = helicopters[partNum].SpawnPoint.z + }, helicopters[partNum].Heading, function(vehicle) + SetVehicleModKit(vehicle, 0) + SetVehicleLivery(vehicle, 0) + end) + + end + + end + + if part == 'VehicleDeleter' then + + local playerPed = GetPlayerPed(-1) + + if IsPedInAnyVehicle(playerPed, false) then + + local vehicle, distance = ESX.Game.GetClosestVehicle() + + if distance <= 2.0 then + CurrentAction = 'delete_vehicle' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour ranger le véhicule' + CurrentActionData = {vehicle = vehicle} + end + + end + + end + + if part == 'BossActions' then + CurrentAction = 'menu_boss_actions' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour ouvrir le menu' + CurrentActionData = {} + end + +end) + +AddEventHandler('esx_policejob:hasExitedMarker', function(station, part, partNum) + CurrentAction = nil +end) + +AddEventHandler('esx_policejob:hasEnteredEntityZone', function(entity) + + local playerPed = GetPlayerPed(-1) + + if PlayerData.job ~= nil and PlayerData.job.name == 'police' and not IsPedInAnyVehicle(playerPed, false) then + CurrentAction = 'remove_entity' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour enlever l\'objet' + CurrentActionData = {entity = entity} + end + + if GetEntityModel(entity) == GetHashKey('p_ld_stinger_s') then + + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + + if IsPedInAnyVehicle(playerPed, false) then + + local vehicle, distance = ESX.Game.GetClosestVehicle({ + x = coords.x, + y = coords.y, + z = coords.z + }) + + if distance <= 1.0 then + + for i=0, 7, 1 do + SetVehicleTyreBurst(vehicle, i, true, 1000) + end + + end + + end + + end + +end) + +AddEventHandler('esx_policejob:hasExitedEntityZone', function(entity) + + if CurrentAction == 'remove_entity' then + CurrentAction = nil + end + +end) + +RegisterNetEvent('esx_policejob:handcuff') +AddEventHandler('esx_policejob:handcuff', function() + + IsHandcuffed = not IsHandcuffed; + local playerPed = GetPlayerPed(-1) + + Citizen.CreateThread(function() + + if IsHandcuffed then + + RequestAnimDict('mp_arresting') + + while not HasAnimDictLoaded('mp_arresting') do + Wait(100) + end + + TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) + SetEnableHandcuffs(playerPed, true) + SetPedCanPlayGestureAnims(playerPed, false) + FreezeEntityPosition(playerPed, true) + + else + + ClearPedSecondaryTask(playerPed) + SetEnableHandcuffs(playerPed, false) + SetPedCanPlayGestureAnims(playerPed, true) + FreezeEntityPosition(playerPed, false) + + end + + end) +end) + +RegisterNetEvent('esx_policejob:putInVehicle') +AddEventHandler('esx_policejob:putInVehicle', function() + + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then + + local vehicle, distance = ESX.Game.GetClosestVehicle({ + x = coords.x, + y = coords.y, + z = coords.z + }) + + if DoesEntityExist(vehicle) then + + local maxSeats = GetVehicleMaxNumberOfPassengers(vehicle) + local freeSeat = nil + + for i=maxSeats - 1, 0, -1 do + if IsVehicleSeatFree(vehicle, i) then + freeSeat = i + break + end + end + + if freeSeat ~= nil then + TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) + end + + end + + end + +end) + +-- Handcuff +Citizen.CreateThread(function() + while true do + Wait(0) + if IsHandcuffed then + DisableControlAction(0, 142, true) -- MeleeAttackAlternate + DisableControlAction(0, 30, true) -- MoveLeftRight + DisableControlAction(0, 31, true) -- MoveUpDown + end + end +end) + +-- Create blips +Citizen.CreateThread(function() + + for k,v in pairs(Config.PoliceStations) do + + local blip = AddBlipForCoord(v.Blip.Pos.x, v.Blip.Pos.y, v.Blip.Pos.z) + + SetBlipSprite (blip, 60) + SetBlipDisplay(blip, 4) + SetBlipScale (blip, 1.2) + SetBlipColour (blip, v.Blip.Color) + SetBlipAsShortRange(blip, true) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentString("Commissariat") + EndTextCommandSetBlipName(blip) + + end + +end) + +-- Display markers +Citizen.CreateThread(function() + while true do + + Wait(0) + + if PlayerData.job ~= nil and PlayerData.job.name == 'police' then + + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + + for k,v in pairs(Config.PoliceStations) do + + for i=1, #v.Cloakrooms, 1 do + if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end + + for i=1, #v.Armories, 1 do + if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end + + for i=1, #v.Vehicles, 1 do + if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end + + for i=1, #v.VehicleDeleters, 1 do + if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end + + if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'police' and PlayerData.job.grade_name == 'boss' then + + for i=1, #v.BossActions, 1 do + if not v.BossActions[i].disabled and GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end + + end + + end + + end + + end +end) + +-- Enter / Exit marker events +Citizen.CreateThread(function() + + while true do + + Wait(0) + + if PlayerData.job ~= nil and PlayerData.job.name == 'police' then + + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + local isInMarker = false + local currentStation = nil + local currentPart = nil + local currentPartNum = nil + + for k,v in pairs(Config.PoliceStations) do + + for i=1, #v.Cloakrooms, 1 do + if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'Cloakroom' + currentPartNum = i + end + end + + for i=1, #v.Armories, 1 do + if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'Armory' + currentPartNum = i + end + end + + for i=1, #v.Vehicles, 1 do + + if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'VehicleSpawner' + currentPartNum = i + end + + if GetDistanceBetweenCoords(coords, v.Vehicles[i].SpawnPoint.x, v.Vehicles[i].SpawnPoint.y, v.Vehicles[i].SpawnPoint.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'VehicleSpawnPoint' + currentPartNum = i + end + + end + + for i=1, #v.Helicopters, 1 do + + if GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner.x, v.Helicopters[i].Spawner.y, v.Helicopters[i].Spawner.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'HelicopterSpawner' + currentPartNum = i + end + + if GetDistanceBetweenCoords(coords, v.Helicopters[i].SpawnPoint.x, v.Helicopters[i].SpawnPoint.y, v.Helicopters[i].SpawnPoint.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'HelicopterSpawnPoint' + currentPartNum = i + end + + end + + for i=1, #v.VehicleDeleters, 1 do + if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'VehicleDeleter' + currentPartNum = i + end + end + + if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'police' and PlayerData.job.grade_name == 'boss' then + + for i=1, #v.BossActions, 1 do + if GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'BossActions' + currentPartNum = i + end + end + + end + + end + + local hasExited = false + + if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) ) then + + if + (LastStation ~= nil and LastPart ~= nil and LastPartNum ~= nil) and + (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) + then + TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) + hasExited = true + end + + HasAlreadyEnteredMarker = true + LastStation = currentStation + LastPart = currentPart + LastPartNum = currentPartNum + + TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) + end + + if not hasExited and not isInMarker and HasAlreadyEnteredMarker then + + HasAlreadyEnteredMarker = false + + TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) + end + + end + + end +end) + +-- Enter / Exit entity zone events +Citizen.CreateThread(function() + while true do + + Citizen.Wait(0) + + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + + local entity, distance = ESX.Game.GetClosestObject({ + 'prop_roadcone02a', + 'prop_barrier_work06a', + 'p_ld_stinger_s', + 'prop_boxpile_07d', + 'hei_prop_cash_crate_half_full' + }) + + if distance ~= -1 and distance <= 3.0 then + + if LastEntity ~= entity then + TriggerEvent('esx_policejob:hasEnteredEntityZone', entity) + LastEntity = entity + end + + else + + if LastEntity ~= nil then + TriggerEvent('esx_policejob:hasExitedEntityZone', LastEntity) + LastEntity = nil + end + + end + + end +end) + +-- Key Controls +Citizen.CreateThread(function() + while true do + + Citizen.Wait(0) + + if CurrentAction ~= nil then + + SetTextComponentFormat('STRING') + AddTextComponentString(CurrentActionMsg) + DisplayHelpTextFromStringLabel(0, 0, 1, -1) + + if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' and (GetGameTimer() - GUI.Time) > 150 then + + if CurrentAction == 'menu_cloakroom' then + OpenCloakroomMenu() + end + + if CurrentAction == 'menu_armory' then + OpenArmoryMenu(CurrentActionData.station) + end + + if CurrentAction == 'menu_vehicle_spawner' then + OpenVehicleSpawnerMenu(CurrentActionData.station, CurrentActionData.partNum) + end + + if CurrentAction == 'delete_vehicle' then + + if + GetEntityModel(vehicle) == GetHashKey('police') or + GetEntityModel(vehicle) == GetHashKey('police2') or + GetEntityModel(vehicle) == GetHashKey('police3') or + GetEntityModel(vehicle) == GetHashKey('police4') or + GetEntityModel(vehicle) == GetHashKey('policeb') or + GetEntityModel(vehicle) == GetHashKey('policet') + then + TriggerServerEvent('esx_service:disableService', 'police') + end + + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + end + + if CurrentAction == 'menu_boss_actions' then + OpenBossActionsMenu() + end + + if CurrentAction == 'remove_entity' then + DeleteEntity(CurrentActionData.entity) + end + + CurrentAction = nil + GUI.Time = GetGameTimer() + + end + + end + + if IsControlPressed(0, Keys['F6']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') and (GetGameTimer() - GUI.Time) > 150 then + OpenPoliceActionsMenu() + GUI.Time = GetGameTimer() + end + + end +end) diff --git a/config.lua b/config.lua new file mode 100644 index 00000000..00e67176 --- /dev/null +++ b/config.lua @@ -0,0 +1,77 @@ +Config = {} +Config.DrawDistance = 100.0 +Config.MarkerType = 1 +Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} +Config.MarkerColor = {r = 50, g = 50, b = 204} +Config.EnablePlayerManagement = false +Config.EnableArmoryManagement = false +Config.MaxInService = -1 + +Config.PoliceStations = { + + LSPD = { + + Blip = { + Pos = {x = 425.130, y = -979.558, z = 30.711}, + Color = 29 + }, + + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_ASSAULTRIFLE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + {name = 'WEAPON_STICKYBOMB', price = 250}, + {name = 'GADGET_PARACHUTE', price = 300}, + }, + + AuthorizedVehicles = { + {name = 'police' , label = 'Véhicule de patrouille 1'}, + {name = 'police2', label = 'Véhicule de patrouille 2'}, + {name = 'police3', label = 'Véhicule de patrouille 3'}, + {name = 'police4', label = 'Véhicule civil'}, + {name = 'policeb', label = 'Moto'}, + {name = 'policet', label = 'Van de transport'}, + }, + + Cloakrooms = { + {x = 452.600, y = -993.306, z = 29.750} + }, + + Armories = { + {x = 451.699, y = -980.356, z = 29.689} + }, + + Vehicles = { + { + Spawner = {x = 454.69, y = -1017.4, z = 27.430}, + SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, + Heading = 90.0 + } + }, + + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, + + VehicleDeleters = { + {x = 462.74, y = -1014.4, z = 27.065}, + {x = 462.40, y = -1019.7, z = 27.104} + }, + + BossActions = { + {x = 448.417, y = -973.208, z = 29.689} + } + + } + +} \ No newline at end of file diff --git a/esx_policejob_full.sql b/esx_policejob_full.sql new file mode 100644 index 00000000..543a5801 --- /dev/null +++ b/esx_policejob_full.sql @@ -0,0 +1,18 @@ +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police','Police',1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police','Police',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police','LSPD') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recrue','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',3,'commandant','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') +; diff --git a/esx_policejob_minimal.sql b/esx_policejob_minimal.sql new file mode 100644 index 00000000..fca6635c --- /dev/null +++ b/esx_policejob_minimal.sql @@ -0,0 +1,10 @@ +INSERT INTO `jobs` (name, label) VALUES + ('police','LSPD') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recrue','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',3,'commandant','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') +; diff --git a/server/main.lua b/server/main.lua new file mode 100644 index 00000000..11ace9c4 --- /dev/null +++ b/server/main.lua @@ -0,0 +1,263 @@ +ESX = nil + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +if Config.MaxInService ~= -1 then + TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) +end + +RegisterServerEvent('esx_policejob:giveWeapon') +AddEventHandler('esx_policejob:giveWeapon', function(weapon, ammo) + local xPlayer = ESX.GetPlayerFromId(source) + xPlayer.addWeapon(weapon, ammo) +end) + +RegisterServerEvent('esx_policejob:confiscatePlayerItem') +AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, itemName, amount) + + local sourceXPlayer = ESX.GetPlayerFromId(source) + local targetXPlayer = ESX.GetPlayerFromId(target) + + if itemType == 'item_standard' then + + local label = sourceXPlayer.getInventoryItem(itemName).label + + targetXPlayer.removeInventoryItem(itemName, amount) + sourceXPlayer.addInventoryItem(itemName, amount) + + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, 'Vous avez confisqué ~y~x' .. amount .. ' ' .. label .. '~s~ à ~b~' .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. '~s~ vous a confisqué ~y~x' .. amount .. ' ' .. label ) + + end + + if itemType == 'item_account' then + + targetXPlayer.removeAccountMoney(itemName, amount) + sourceXPlayer.addAccountMoney(itemName, amount) + + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, 'Vous avez confisqué ~y~$' .. amount .. '~s~ à ~b~' .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. '~s~ vous a confisqué ~y~$' .. amount) + + end + + if itemType == 'item_weapon' then + + targetXPlayer.removeWeapon(itemName) + sourceXPlayer.addWeapon(itemName, amount) + + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, 'Vous avez confisqué ~y~x1 ' .. ESX.GetWeaponLabel(itemName) .. '~s~ à ~b~' .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. '~s~ vous a confisqué ~y~x1 ' .. ESX.GetWeaponLabel(itemName)) + + end + +end) + +RegisterServerEvent('esx_policejob:handcuff') +AddEventHandler('esx_policejob:handcuff', function(target) + TriggerClientEvent('esx_policejob:handcuff', target) +end) + +RegisterServerEvent('esx_policejob:putInVehicle') +AddEventHandler('esx_policejob:putInVehicle', function(target) + TriggerClientEvent('esx_policejob:putInVehicle', target) +end) + +ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, cb, target) + + local xPlayer = ESX.GetPlayerFromId(target) + + local data = { + name = GetPlayerName(source), + job = xPlayer.job, + inventory = xPlayer.inventory, + accounts = xPlayer.accounts, + weapons = xPlayer.loadout + } + + TriggerEvent('esx_status:getStatus', _source, 'drunk', function(status) + data.drunk = status:getPercent() + end) + + TriggerEvent('esx_license:getLicenses', _source, function(licenses) + data.licenses = licenses + end) + + cb(data) + +end) + +ESX.RegisterServerCallback('esx_policejob:getFineList', function(source, cb, category) + + MySQL.Async.fetchAll( + 'SELECT * FROM fine_types WHERE category = @category', + { + ['@category'] = category + }, + function(fines) + cb(fines) + end + ) + +end) + +ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, plate) + + MySQL.Async.fetchAll( + 'SELECT * FROM owned_vehicles', + {}, + function(result) + + local foundIdentifier = nil + + for i=1, #result, 1 do + + local vehicleData = json.decode(result[i].vehicle) + + if vehicleData.plate == plate then + foundIdentifier = result[i].owner + break + end + + end + + if foundIdentifier ~= nil then + + MySQL.Async.fetchAll( + 'SELECT * FROM users WHERE identifier = @identifier', + { + ['@identifier'] = foundIdentifier + }, + function(result) + + local infos = { + plate = plate, + owner = result[1].name + } + + cb(infos) + + end + ) + + else + + local infos = { + plate = plate + } + + cb(infos) + + end + + end + ) + +end) + +ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb) + + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + + local weapons = store.get('weapons') + + if weapons == nil then + weapons = {} + end + + cb(weapons) + + end) + +end) + +ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, weaponName) + + local xPlayer = ESX.GetPlayerFromId(source) + + xPlayer.removeWeapon(weaponName) + + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + + local weapons = store.get('weapons') + + if weapons == nil then + weapons = {} + end + + local foundWeapon = false + + for i=1, #weapons, 1 do + if weapons[i].name == weaponName then + weapons[i].count = weapons[i].count + 1 + foundWeapon = true + end + end + + if not foundWeapon then + table.insert(weapons, { + name = weaponName, + count = 1 + }) + end + + store.set('weapons', weapons) + + cb() + + end) + +end) + +ESX.RegisterServerCallback('esx_policejob:removeArmoryWeapon', function(source, cb, weaponName) + + local xPlayer = ESX.GetPlayerFromId(source) + + xPlayer.addWeapon(weaponName, 1000) + + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + + local weapons = store.get('weapons') + + if weapons == nil then + weapons = {} + end + + local foundWeapon = false + + for i=1, #weapons, 1 do + if weapons[i].name == weaponName then + weapons[i].count = (weapons[i].count > 0 and weapons[i].count - 1 or 0) + foundWeapon = true + end + end + + if not foundWeapon then + table.insert(weapons, { + name = weaponName, + count = 0 + }) + end + + store.set('weapons', weapons) + + cb() + + end) + +end) + + +ESX.RegisterServerCallback('esx_policejob:buy', function(source, cb, amount) + + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_police', function(account) + + if account.money >= amount then + account.removeMoney(amount) + cb(true) + else + cb(false) + end + + end) + +end) \ No newline at end of file From 816a498b05c637b28e7707eb66212f3526915055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 8 Aug 2017 20:17:40 +0200 Subject: [PATCH 003/253] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c536d16..8eca241e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ FXServer ESX Police Job 1) CD in your resources/[esx] folder 2) Clone the repository ``` -git clone https://github.com/FXServer-ESX/fxserver-esx_taxijob esx_taxijob +git clone https://github.com/FXServer-ESX/fxserver-esx_policejob esx_policejob ``` 3) * Auto mode : Import esx_policejob_minimal.sql in your database * Player / Armory management : Import esx_policejob_full.sql in your database From a8e552f31964aa741c437d870c98dc29d65c02ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 9 Aug 2017 00:02:15 +0200 Subject: [PATCH 004/253] Update esx_policejob_full.sql --- esx_policejob_full.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esx_policejob_full.sql b/esx_policejob_full.sql index 543a5801..e3e1254a 100644 --- a/esx_policejob_full.sql +++ b/esx_policejob_full.sql @@ -11,8 +11,8 @@ INSERT INTO `jobs` (name, label) VALUES ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recrue','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',0,'recruit','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'commandant','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') + ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; From 2924875655019c51b5bab7d553b09b2b3c12e3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 9 Aug 2017 00:02:31 +0200 Subject: [PATCH 005/253] Update esx_policejob_minimal.sql --- esx_policejob_minimal.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esx_policejob_minimal.sql b/esx_policejob_minimal.sql index fca6635c..daf423d6 100644 --- a/esx_policejob_minimal.sql +++ b/esx_policejob_minimal.sql @@ -3,8 +3,8 @@ INSERT INTO `jobs` (name, label) VALUES ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recrue','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',0,'recruit','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'commandant','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') + ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; From 5150d2f3c81d7067cc8740b8b45593273eba7075 Mon Sep 17 00:00:00 2001 From: renaiku Date: Wed, 9 Aug 2017 00:56:59 +0200 Subject: [PATCH 006/253] Changing Csitoyen => Citoyen --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 618fd401..90b6f293 100644 --- a/client/main.lua +++ b/client/main.lua @@ -295,7 +295,7 @@ function OpenPoliceActionsMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'citizen_interaction', { - title = 'Interaction Csitoyen', + title = 'Interaction Citoyen', align = 'top-left', elements = { {label = 'Carte d\'identité', value = 'identity_card'}, From cd0635ab728a9036b1066b3798069b66ba88c184 Mon Sep 17 00:00:00 2001 From: renaiku Date: Wed, 9 Aug 2017 01:03:36 +0200 Subject: [PATCH 007/253] =?UTF-8?q?Renamming=20interactions=20menu=20(Csit?= =?UTF-8?q?oyen=20=3D>=20v=C3=A9hicule=20&=20voirie)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 90b6f293..f325c23a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -348,7 +348,7 @@ function OpenPoliceActionsMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'vehicle_interaction', { - title = 'Interaction Csitoyen', + title = 'Interaction véhicule', align = 'top-left', elements = { {label = 'Infos véhicule', value = 'vehicle_infos'}, @@ -420,7 +420,7 @@ function OpenPoliceActionsMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'citizen_interaction', { - title = 'Interaction Csitoyen', + title = 'Interaction voirie', align = 'top-left', elements = { {label = 'Plot', value = 'prop_roadcone02a'}, From d798033971a261d99934434e4f0bbff78443ee5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 9 Aug 2017 14:14:06 +0200 Subject: [PATCH 008/253] Add LICENSE.txt --- LICENSE.txt | 674 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 674 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 00000000..30ace6a8 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + 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. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +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. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + 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 . + +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: + + {project} Copyright (C) {year} {fullname} + 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. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +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 From 37e5ad4afa9a886a5584b2b6d9b886413af9d056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Fri, 11 Aug 2017 15:51:54 +0200 Subject: [PATCH 009/253] Add phone number --- client/main.lua | 17 +++++++++++++++-- server/main.lua | 17 +++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index f325c23a..80013822 100644 --- a/client/main.lua +++ b/client/main.lua @@ -348,7 +348,7 @@ function OpenPoliceActionsMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'vehicle_interaction', { - title = 'Interaction véhicule', + title = 'Interaction Véhicule', align = 'top-left', elements = { {label = 'Infos véhicule', value = 'vehicle_infos'}, @@ -420,7 +420,7 @@ function OpenPoliceActionsMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'citizen_interaction', { - title = 'Interaction voirie', + title = 'Interactions Voirie', align = 'top-left', elements = { {label = 'Plot', value = 'prop_roadcone02a'}, @@ -924,6 +924,19 @@ AddEventHandler('esx:setJob', function(job) PlayerData.job = job end) +RegisterNetEvent('esx_phone:loaded') +AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) + + local specialContact = { + name = 'Police', + number = 'police', + base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDFGQTJDRkI0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDFGQTJDRkM0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0MUZBMkNGOTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0MUZBMkNGQTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoW66EYAAAjGSURBVHjapJcLcFTVGcd/u3cfSXaTLEk2j80TCI8ECI9ABCyoiBqhBVQqVG2ppVKBQqUVgUl5OU7HKqNOHUHU0oHamZZWoGkVS6cWAR2JPJuAQBPy2ISEvLN57+v2u2E33e4k6Ngz85+9d++95/zP9/h/39GpqsqiRYsIGz8QZAq28/8PRfC+4HT4fMXFxeiH+GC54NeCbYLLATLpYe/ECx4VnBTsF0wWhM6lXY8VbBE0Ch4IzLcpfDFD2P1TgrdC7nMCZLRxQ9AkiAkQCn77DcH3BC2COoFRkCSIG2JzLwqiQi0RSmCD4JXbmNKh0+kc/X19tLtc9Ll9sk9ZS1yoU71YIk3xsbEx8QaDEc2ttxmaJSKC1ggSKBK8MKwTFQVXRzs3WzpJGjmZgvxcMpMtWIwqsjztvSrlzjYul56jp+46qSmJmMwR+P3+4aZ8TtCprRkk0DvUW7JjmV6lsqoKW/pU1q9YQOE4Nxkx4ladE7zd8ivuVmJQfXZKW5dx5EwPRw4fxNx2g5SUVLw+33AkzoRaQDP9SkFu6OKqz0uF8yaz7vsOL6ycQVLkcSg/BlWNsjuFoKE1knqDSl5aNnmPLmThrE0UvXqQqvJPyMrMGorEHwQfEha57/3P7mXS684GFjy8kreLppPUuBXfyd/ibeoS2kb0mWPANhJdYjb61AxUvx5PdT3+4y+Tb3mTd19ZSebE+VTXVGNQlHAC7w4VhH8TbA36vKq6ilnzlvPSunHw6Trc7XpZ14AyfgYeyz18crGN1Alz6e3qwNNQSv4dZox1h/BW9+O7eIaEsVv41Y4XeHJDG83Nl4mLTwzGhJYtx0PzNTjOB9KMTlc7Nkcem39YAGU7cbeBKVLMPGMVf296nMd2VbBq1wmizHoqqm/wrS1/Zf0+N19YN2PIu1fcIda4Vk66Zx/rVi+jo9eIX9wZGGcFXUMR6BHUa76/2ezioYcXMtpyAl91DSaTfDxlJbtLprHm2ecpObqPuTPzSNV9yKz4a4zJSuLo71/j8Q17ON69EmXiPIlNMe6FoyzOqWPW/MU03Lw5EFcyKghTrNDh7+/vw545mcJcWbTiGKpRdGPMXbx90sGmDaux6sXk+kimjU+BjnMkx3kYP34cXrFuZ+3nrHi6iDMt92JITcPjk3R3naRwZhpuNSqoD93DKaFVU7j2dhcF8+YzNlpErbIBTVh8toVccbaysPB+4pMcuPw25kwSsau7BIlmHpy3guaOPtISYyi/UkaJM5Lpc5agq5Xkcl6gIHkmqaMn0dtylcjIyPThCNyhaXyfR2W0I1our0v6qBii07ih5rDtGSOxNVdk1y4R2SR8jR/g7hQD9l1jUeY/WLJB5m39AlZN4GZyIQ1fFJNsEgt0duBIc5GRkcZF53mNwIzhXPDgQPoZIkiMkbTxtstDMVnmFA4cOsbz2/aKjSQjev4Mp9ZAg+hIpFhB3EH5Yal16+X+Kq3dGfxkzRY+KauBjBzREvGN0kNCTARu94AejBLMHorAQ7cEQMGs2cXvkWshYLDi6e9l728O8P1XW6hKeB2yv42q18tjj+iFTGoSi+X9jJM9RTxS9E+OHT0krhNiZqlbqraoT7RAU5bBGrEknEBhgJks7KXbLS8qERI0ErVqF/Y4K6NHZfLZB+/wzJvncacvFd91oXO3o/O40MfZKJOKu/rne+mRQByXM4lYreb1tUnkizVVA/0SpfpbWaCNBeEE5gb/UH19NLqEgDF+oNDQWcn41Cj0EXFEWqzkOIyYekslFkThsvMxpIyE2hIc6lXGZ6cPyK7Nnk5OipixRdxgUESAYmhq68VsGgy5CYKCUAJTg0+izApXne3CJFmUTwg4L3FProFxU+6krqmXu3MskkhSD2av41jLdzlnfFrSdCZxyqfMnppN6ZUa7pwt0h3fiK9DCt4IO9e7YqisvI7VYgmNv7mhBKKD/9psNi5dOMv5ZjukjsLdr0ffWsyTi6eSlfcA+dmiVyOXs+/sHNZu3M6PdxzgVO9GmDSHsSNqmTz/R6y6Xxqma4fwaS5Mn85n1ZE0Vl3CHBER3lUNEhiURpPJRFdTOcVnpUJnPIhR7cZXfoH5UYc5+E4RzRH3sfSnl9m2dSMjE+Tz9msse+o5dr7UwcQ5T3HwlWUkNuzG3dKFSTbsNs7m/Y8vExOlC29UWkMJlAxKoRQMR3IC7x85zOn6fHS50+U/2Untx2R1voinu5no+DQmz7yPXmMKZnsu0wrm0Oe3YhOVHdm8A09dBQYhTv4T7C+xUPrZh8Qn2MMr4qcDSRfoirWgKAvtgOpv1JI8Zi77X15G7L+fxeOUOiUFxZiULD5fSlNzNM62W+k1yq5gjajGX/ZHvOIyxd+Fkj+P092rWP/si0Qr7VisMaEWuCiYonXFwbAUTWWPYLV245NITnGkUXnpI9butLJn2y6iba+hlp7C09qBcvoN7FYL9mhxo1/y/LoEXK8Pv6qIC8WbBY/xr9YlPLf9dZT+OqKTUwfmDBm/GOw7ws4FWpuUP2gJEZvKqmocuXPZuWYJMzKuSsH+SNwh3bo0p6hao6HeEqwYEZ2M6aKWd3PwTCy7du/D0F1DsmzE6/WGLr5LsDF4LggnYBacCOboQLHQ3FFfR58SR+HCR1iQH8ukhA5s5o5AYZMwUqOp74nl8xvRHDlRTsnxYpJsUjtsceHt2C8Fm0MPJrphTkZvBc4It9RKLOFx91Pf0Igu0k7W2MmkOewS2QYJUJVWVz9VNbXUVVwkyuAmKTFJayrDo/4Jwe/CT0aGYTrWVYEeUfsgXssMRcpyenraQJa0VX9O3ZU+Ma1fax4xGxUsUVFkOUbcama1hf+7+LmA9juHWshwmwOE1iMmCFYEzg1jtIm1BaxW6wCGGoFdewPfvyE4ertTiv4rHC73B855dwp2a23bbd4tC1hvhOCbX7b4VyUQKhxrtSOaYKngasizvwi0RmOS4O1QZf2yYfiaR+73AvhTQEVf+rpn9/8IMAChKDrDzfsdIQAAAABJRU5ErkJggg==' + } + + TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) + +end) + AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNum) if part == 'Cloakroom' then diff --git a/server/main.lua b/server/main.lua index 11ace9c4..efe9bc0a 100644 --- a/server/main.lua +++ b/server/main.lua @@ -260,4 +260,21 @@ ESX.RegisterServerCallback('esx_policejob:buy', function(source, cb, amount) end) +end) + +TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message, anon) + + local xPlayer = ESX.GetPlayerFromId(source) + local xPlayers = ESX.GetPlayers() + + if phoneNumber == 'police' then + for k, v in pairs(xPlayers) do + if v.job.name == 'police' then + TriggerEvent('esx_phone:getDistpatchRequestId', function(requestId) + TriggerClientEvent('esx_phone:onMessage', v.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, 'Alerte police', requestId) + end) + end + end + end + end) \ No newline at end of file From ca7cc2879172baf2f8246f3456bbf2bbba268a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sun, 13 Aug 2017 20:56:40 +0200 Subject: [PATCH 010/253] Fix prop detection + probably fix getclosestvehicle --- client/main.lua | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/client/main.lua b/client/main.lua index 80013822..aff4c245 100644 --- a/client/main.lua +++ b/client/main.lua @@ -420,7 +420,7 @@ function OpenPoliceActionsMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'citizen_interaction', { - title = 'Interactions Voirie', + title = 'Interaction Voirie', align = 'top-left', elements = { {label = 'Plot', value = 'prop_roadcone02a'}, @@ -1343,6 +1343,15 @@ end) -- Enter / Exit entity zone events Citizen.CreateThread(function() + + local trackedEntities = { + 'prop_roadcone02a', + 'prop_barrier_work06a', + 'p_ld_stinger_s', + 'prop_boxpile_07d', + 'hei_prop_cash_crate_half_full' + } + while true do Citizen.Wait(0) @@ -1350,19 +1359,32 @@ Citizen.CreateThread(function() local playerPed = GetPlayerPed(-1) local coords = GetEntityCoords(playerPed) - local entity, distance = ESX.Game.GetClosestObject({ - 'prop_roadcone02a', - 'prop_barrier_work06a', - 'p_ld_stinger_s', - 'prop_boxpile_07d', - 'hei_prop_cash_crate_half_full' - }) + local closestDistance = -1 + local closestEntity = nil - if distance ~= -1 and distance <= 3.0 then + for i=1, #trackedEntities, 1 do + + local object = GetClosestObjectOfType(coords.x, coords.y, coords.z, 3.0, GetHashKey(trackedEntities[i]), false, false, false) + + if DoesEntityExist(object) then - if LastEntity ~= entity then - TriggerEvent('esx_policejob:hasEnteredEntityZone', entity) - LastEntity = entity + local objCoords = GetEntityCoords(object) + local distance = GetDistanceBetweenCoords(coords.x, coords.y, coords.z, objCoords.x, objCoords.y, objCoords.z, true) + + if closestDistance == -1 or closestDistance > distance then + closestDistance = distance + closestEntity = object + end + + end + + end + + if closestDistance ~= -1 and closestDistance <= 3.0 then + + if LastEntity ~= closestEntity then + TriggerEvent('esx_policejob:hasEnteredEntityZone', closestEntity) + LastEntity = closestEntity end else From 086c4619ab8dc189f133b7233207bf47438652a6 Mon Sep 17 00:00:00 2001 From: Don Date: Tue, 15 Aug 2017 07:23:05 -0700 Subject: [PATCH 011/253] Multi-language support Added multi-language support --- __resource.lua | 6 ++ client/main.lua | 150 ++++++++++++++++++++++++------------------------ config.lua | 1 + locales/en.lua | 91 +++++++++++++++++++++++++++++ locales/fr.lua | 91 +++++++++++++++++++++++++++++ server/main.lua | 14 ++--- 6 files changed, 271 insertions(+), 82 deletions(-) create mode 100644 locales/en.lua create mode 100644 locales/fr.lua diff --git a/__resource.lua b/__resource.lua index d486b6f5..a5448753 100644 --- a/__resource.lua +++ b/__resource.lua @@ -3,12 +3,18 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' server_scripts { + '@es_extended/locale.lua', + 'locales/en.lua', + 'locales/fr.lua', '@mysql-async/lib/MySQL.lua', 'config.lua', 'server/main.lua' } client_scripts { + '@es_extended/locale.lua', + 'locales/en.lua', + 'locales/fr.lua', 'config.lua', 'client/main.lua' } diff --git a/client/main.lua b/client/main.lua index aff4c245..374949a2 100644 --- a/client/main.lua +++ b/client/main.lua @@ -52,11 +52,11 @@ function OpenCloakroomMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'cloakroom', { - title = 'Vestiaire', + title = _U('cloakroom'), align = 'top-left', elements = { - {label = 'Tenue Civil', value = 'citizen_wear'}, - {label = 'Tenue Policier', value = 'police_wear'}, + {label = _U('citizen_wear'), value = 'citizen_wear'}, + {label = _U('police_wear'), value = 'police_wear'}, }, }, function(data, menu) @@ -86,7 +86,7 @@ function OpenCloakroomMenu() end CurrentAction = 'menu_cloakroom' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour vous changer' + CurrentActionMsg = _U('open_cloackroom') CurrentActionData = {} end, @@ -95,7 +95,7 @@ function OpenCloakroomMenu() menu.close() CurrentAction = 'menu_cloakroom' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour vous changer' + CurrentActionMsg = _U('open_cloackroom') CurrentActionData = {} end ) @@ -107,12 +107,12 @@ function OpenArmoryMenu(station) if Config.EnableArmoryManagement then local elements = { - {label = 'Prendre Arme', value = 'get_weapon'}, - {label = 'Déposer Arme', value = 'put_weapon'} + {label = _U('get_weapon'), value = 'get_weapon'}, + {label = _U('put_weapon'), value = 'put_weapon'} } if PlayerData.job.grade_name == 'boss' then - table.insert(elements, {label = 'Acheter Armes', value = 'buy_weapons'}) + table.insert(elements, {label = _U('buy_weapons'), value = 'buy_weapons'}) end ESX.UI.Menu.CloseAll() @@ -120,7 +120,7 @@ function OpenArmoryMenu(station) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'armory', { - title = 'Armurerie', + title = _U('armory'), align = 'top-left', elements = elements, }, @@ -144,7 +144,7 @@ function OpenArmoryMenu(station) menu.close() CurrentAction = 'menu_armory' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie' + CurrentActionMsg = _U('open_armory') CurrentActionData = {station = station} end ) @@ -163,7 +163,7 @@ function OpenArmoryMenu(station) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'armory', { - title = 'Armurerie', + title = _U('armory'), align = 'top-left', elements = elements, }, @@ -176,7 +176,7 @@ function OpenArmoryMenu(station) menu.close() CurrentAction = 'menu_armory' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie' + CurrentActionMsg = _U('open_armory') CurrentActionData = {station = station} end @@ -201,7 +201,7 @@ function OpenVehicleSpawnerMenu(station, partNum) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'vehicle_spawner', { - title = 'Véhicule', + title = _U('vehicle_menu'), align = 'top-left', elements = elements, }, @@ -248,7 +248,7 @@ function OpenVehicleSpawnerMenu(station, partNum) end) else - ESX.ShowNotification('Service complet : ' .. inServiceCount .. '/' .. maxInService) + ESX.ShowNotification(_U('service_max') .. inServiceCount .. '/' .. maxInService) end end, 'police') @@ -256,7 +256,7 @@ function OpenVehicleSpawnerMenu(station, partNum) end else - ESX.ShowNotification('Il y a déja un véhicule de sorti') + ESX.ShowNotification(_U('vehicle_out')) end end, @@ -265,7 +265,7 @@ function OpenVehicleSpawnerMenu(station, partNum) menu.close() CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour sortir un véhicule' + CurrentActionMsg = _U('vehicle_spawner') CurrentActionData = {station = station, partNum = partNum} end @@ -283,9 +283,9 @@ function OpenPoliceActionsMenu() title = 'Police', align = 'top-left', elements = { - {label = 'Interaction citoyen', value = 'citizen_interaction'}, - {label = 'Interaction véhicule', value = 'vehicle_interaction'}, - {label = 'Placer objets', value = 'object_spawner'}, + {label = _U('citizen_interaction'), value = 'citizen_interaction'}, + {label = _U('vehicle_interaction'), value = 'vehicle_interaction'}, + {label = _U('object_spawner'), value = 'object_spawner'}, }, }, function(data, menu) @@ -295,14 +295,14 @@ function OpenPoliceActionsMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'citizen_interaction', { - title = 'Interaction Citoyen', + title = _U('citizen_interaction'), align = 'top-left', elements = { - {label = 'Carte d\'identité', value = 'identity_card'}, - {label = 'Fouiller', value = 'body_search'}, - {label = 'Menotter / Démenotter', value = 'handcuff'}, - {label = 'Mettre dans véhicule', value = 'put_in_vehicle'}, - {label = 'Amende', value = 'fine'} + {label = _U('id_card'), value = 'identity_card'}, + {label = _U('search'), value = 'body_search'}, + {label = _U('handcuff'), value = 'handcuff'}, + {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, + {label = _U('fine'), value = 'fine'} }, }, function(data2, menu2) @@ -332,7 +332,7 @@ function OpenPoliceActionsMenu() end else - ESX.ShowNotification('Aucun joueur à proximité') + ESX.ShowNotification(_U('no_players_nearby')) end end, @@ -348,11 +348,11 @@ function OpenPoliceActionsMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'vehicle_interaction', { - title = 'Interaction Véhicule', + title = _U('vehicle_interaction'), align = 'top-left', elements = { - {label = 'Infos véhicule', value = 'vehicle_infos'}, - {label = 'Crocheter véhicule', value = 'hijack_vehicle'}, + {label = _U('vehicle_info'), value = 'vehicle_infos'}, + {label = _U('pick_lock'), value = 'hijack_vehicle'}, }, }, function(data2, menu2) @@ -393,7 +393,7 @@ function OpenPoliceActionsMenu() SetVehicleDoorsLocked(vehicle, 1) SetVehicleDoorsLockedForAllPlayers(vehicle, false) - TriggerEvent('esx:showNotification', 'Véhicule ~g~déverouillé~s~') + TriggerEvent('esx:showNotification', _U('vehicle_unlocked')) end) @@ -404,7 +404,7 @@ function OpenPoliceActionsMenu() end else - ESX.ShowNotification('Aucun véhicule à proximité') + ESX.ShowNotification(_U('no_vehicles_nearby')) end end, @@ -420,14 +420,14 @@ function OpenPoliceActionsMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'citizen_interaction', { - title = 'Interaction Voirie', + title = _U('traffic_interaction'), align = 'top-left', elements = { - {label = 'Plot', value = 'prop_roadcone02a'}, - {label = 'Barrière', value = 'prop_barrier_work06a'}, - {label = 'Herse', value = 'p_ld_stinger_s'}, - {label = 'Caisse', value = 'prop_boxpile_07d'}, - {label = 'Caisse', value = 'hei_prop_cash_crate_half_full'} + {label = _U('cone'), value = 'prop_roadcone02a'}, + {label = _U('barrier'), value = 'prop_barrier_work06a'}, + {label = _U('spikestrips'), value = 'p_ld_stinger_s'}, + {label = _U('box'), value = 'prop_boxpile_07d'}, + {label = _U('cash'), value = 'hei_prop_cash_crate_half_full'} }, }, function(data2, menu2) @@ -483,12 +483,12 @@ function OpenIdentityCardMenu(player) end local elements = { - {label = 'Nom : ' .. data.name, value = nil}, + {label = _U('name') .. data.name, value = nil}, {label = jobLabel, value = nil}, } if data.drunk ~= nil then - table.insert(elements, {label = 'Alcoolémie : ' .. data.drunk .. '%', value = nil}) + table.insert(elements, {label = _U('bac') .. data.drunk .. '%', value = nil}) end if data.licenses ~= nil then @@ -504,7 +504,7 @@ function OpenIdentityCardMenu(player) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'citizen_interaction', { - title = 'Interaction Citoyen', + title = _U('citizen_interaction'), align = 'top-left', elements = elements, }, @@ -535,7 +535,7 @@ function OpenBodySearchMenu(player) end table.insert(elements, { - label = 'Confisquer argent sale : $' .. blackMoney, + label = _U('confiscate_dirty') .. blackMoney, value = 'black_money', itemType = 'item_account', amount = blackMoney @@ -545,19 +545,19 @@ function OpenBodySearchMenu(player) for i=1, #data.weapons, 1 do table.insert(elements, { - label = 'Confisquer ' .. ESX.GetWeaponLabel(data.weapons[i].name), + label = _U('confiscate') .. ESX.GetWeaponLabel(data.weapons[i].name), value = data.weapons[i].name, itemType = 'item_weapon', amount = data.ammo, }) end - table.insert(elements, {label = '--- Inventaire ---', value = nil}) + table.insert(elements, {label = _U('inventory_label'), value = nil}) for i=1, #data.inventory, 1 do if data.inventory[i].count > 0 then table.insert(elements, { - label = 'Confisquer x' .. data.inventory[i].count .. ' ' .. data.inventory[i].label, + label = _U('confiscate_inv') .. data.inventory[i].count .. ' ' .. data.inventory[i].label, value = data.inventory[i].name, itemType = 'item_standard', amount = data.inventory[i].count, @@ -569,7 +569,7 @@ function OpenBodySearchMenu(player) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'body_search', { - title = 'Fouille', + title = _U('search'), align = 'top-left', elements = elements, }, @@ -602,13 +602,13 @@ function OpenFineMenu(player) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'fine', { - title = 'Amende', + title = _U('fine'), align = 'top-left', elements = { - {label = 'Code de la route', value = 0}, - {label = 'Délit mineur', value = 1}, - {label = 'Délit moyen', value = 2}, - {label = 'Délit grave', value = 3} + {label = _U('traffic_offense'), value = 0}, + {label = _U('minor_offense'), value = 1}, + {label = _U('average_offense'), value = 2}, + {label = _U('major_offense'), value = 3} }, }, function(data, menu) @@ -641,7 +641,7 @@ function OpenFineCategoryMenu(player, category) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'fine_category', { - title = 'Amende', + title = _U('fine'), align = 'top-left', elements = elements, }, @@ -653,9 +653,9 @@ function OpenFineCategoryMenu(player, category) menu.close() if Config.EnablePlayerManagement then - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', 'Amende : ' .. label, amount) + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', _U('fine_total') .. label, amount) else - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', 'Amende : ' .. label, amount) + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', _U('fine_total') .. label, amount) end ESX.SetTimeout(300, function() @@ -678,18 +678,18 @@ function OpenVehicleInfosMenu(vehicleData) local elements = {} - table.insert(elements, {label = 'N°: ' .. infos.plate, value = nil}) + table.insert(elements, {label = _U('plate') .. infos.plate, value = nil}) if infos.owner == nil then - table.insert(elements, {label = 'Propriétaire : Inconnu', value = nil}) + table.insert(elements, {label = _U('owner_unknown'), value = nil}) else - table.insert(elements, {label = 'Propriétaire : ' .. infos.owner, value = nil}) + table.insert(elements, {label = _U('owner') .. infos.owner, value = nil}) end ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'vehicle_infos', { - title = 'Infos Véhicule', + title = _U('vehicle_info'), align = 'top-left', elements = elements, }, @@ -718,7 +718,7 @@ function OpenGetWeaponMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'armory_get_weapon', { - title = 'Armurerie - Prendre Arme', + title = _U('get_weapon_menu'), align = 'top-left', elements = elements, }, @@ -760,7 +760,7 @@ function OpenPutWeaponMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'armory_put_weapon', { - title = 'Armurerie - Déposer Arme', + title = _U('put_weapon_menu'), align = 'top-left', elements = elements, }, @@ -805,7 +805,7 @@ function OpenBuyWeaponsMenu(station) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'armory_buy_weapons', { - title = 'Armurerie - Acheter Armes', + title = _U('buy_weapon_menu'), align = 'top-left', elements = elements, }, @@ -818,7 +818,7 @@ function OpenBuyWeaponsMenu(station) OpenBuyWeaponsMenu(station) end, data.current.value) else - ESX.ShowNotification('Vous n\'avez pas assez d\'argent') + ESX.ShowNotification(_U('not_enough_money')) end end, data.current.price) @@ -842,8 +842,8 @@ function OpenBossActionsMenu() { title = PlayerData.job.grade_label, elements = { - {label = 'Retirer argent société', value = 'withdraw_society_money'}, - {label = 'Déposer argent', value = 'deposit_money'}, + {label = _U('take_company_money'), value = 'withdraw_society_money'}, + {label = _U('deposit_money'), value = 'deposit_money'}, } }, function(data, menu) @@ -853,14 +853,14 @@ function OpenBossActionsMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'withdraw_society_money_amount', { - title = 'Montant du retrait' + title = _U('amount_of_withdrawal') }, function(data, menu) local amount = tonumber(data.value) if amount == nil then - ESX.ShowNotification('Montant invalide') + ESX.ShowNotification(_U('invalid_amount')) else menu.close() TriggerServerEvent('esx_society:withdrawMoney', 'police', amount) @@ -879,14 +879,14 @@ function OpenBossActionsMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'deposit_money_amount', { - title = 'Montant du dépôt' + title = _U('amount_of_deposit') }, function(data, menu) local amount = tonumber(data.value) if amount == nil then - ESX.ShowNotification('Montant invalide') + ESX.ShowNotification(_U('invalid_amount')) else menu.close() TriggerServerEvent('esx_society:depositMoney', 'police', amount) @@ -906,7 +906,7 @@ function OpenBossActionsMenu() menu.close() CurrentAction = 'menu_boss_actions' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour ouvrir le menu' + CurrentActionMsg = _U('open_bossmenu') CurrentActionData = {} end @@ -941,19 +941,19 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu if part == 'Cloakroom' then CurrentAction = 'menu_cloakroom' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour vous changer' + CurrentActionMsg = _U('open_cloackroom') CurrentActionData = {} end if part == 'Armory' then CurrentAction = 'menu_armory' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie' + CurrentActionMsg = _U('open_armory') CurrentActionData = {station = station} end if part == 'VehicleSpawner' then CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour sortir un véhicule' + CurrentActionMsg = _U('vehicle_spawner') CurrentActionData = {station = station, partNum = partNum} end @@ -992,7 +992,7 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu if distance <= 2.0 then CurrentAction = 'delete_vehicle' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour ranger le véhicule' + CurrentActionMsg = _U('store_vehicle') CurrentActionData = {vehicle = vehicle} end @@ -1002,7 +1002,7 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu if part == 'BossActions' then CurrentAction = 'menu_boss_actions' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour ouvrir le menu' + CurrentActionMsg = _U('open_bossmenu') CurrentActionData = {} end @@ -1018,7 +1018,7 @@ AddEventHandler('esx_policejob:hasEnteredEntityZone', function(entity) if PlayerData.job ~= nil and PlayerData.job.name == 'police' and not IsPedInAnyVehicle(playerPed, false) then CurrentAction = 'remove_entity' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour enlever l\'objet' + CurrentActionMsg = _U('remove_object') CurrentActionData = {entity = entity} end @@ -1152,7 +1152,7 @@ Citizen.CreateThread(function() SetBlipAsShortRange(blip, true) BeginTextCommandSetBlipName("STRING") - AddTextComponentString("Commissariat") + AddTextComponentString(_U('map_blip')) EndTextCommandSetBlipName(blip) end diff --git a/config.lua b/config.lua index 00e67176..4a1defb3 100644 --- a/config.lua +++ b/config.lua @@ -6,6 +6,7 @@ Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false Config.MaxInService = -1 +Config.Locale = 'en' Config.PoliceStations = { diff --git a/locales/en.lua b/locales/en.lua new file mode 100644 index 00000000..0ad97fbe --- /dev/null +++ b/locales/en.lua @@ -0,0 +1,91 @@ +Locales['en'] = { + --Cloackroom + ['cloakroom'] = 'locker room', + ['citizen_wear'] = 'civilian Outfit', + ['police_wear'] = 'police Outfit', + ['open_cloackroom'] = 'press ~INPUT_CONTEXT~ to change', + --Armory + ['get_weapon'] = 'get Weapon', + ['put_weapon'] = 'put Weapon', + ['buy_weapons'] = 'buy Weapons', + ['armory'] = 'armory', + ['open_armory'] = 'press ~INPUT_CONTEXT~ to access the armory', + --Vehicles + ['vehicle_menu'] = 'vehicle', + ['vehicle_out'] = 'there is already a car out of the garage', + ['vehicle_spawner'] = 'press ~INPUT_CONTEXT~ to take out a vehicle', + ['store_vehicle'] = 'press ~INPUT_CONTEXT~ to store the vehicle', + ['service_max'] = 'Max officers in service : ', + --Action Menu + ['citizen_interaction'] = 'citizen Interaction', + ['vehicle_interaction'] = 'vehicle Interaction', + ['object_spawner'] = 'object Spawner', + + ['id_card'] = 'iD Card', + ['search'] = 'search', + ['handcuff'] = 'cuff / Uncuff', + ['put_in_vehicle'] = 'put in Vehicle', + ['fine'] = 'fine', + ['no_players_nearby'] = 'no players nearby', + + ['vehicle_info'] = 'vehicle Info', + ['pick_lock'] = 'lockpick Vehicle', + ['vehicle_unlocked'] = 'vehicle ~g~Unlocked~s~', + ['no_vehicles_nearby'] = 'no vehicles nearby', + ['traffic_interaction'] = 'Interaction Voirie', + ['cone'] = 'cone', + ['barrier'] = 'barrier', + ['spikestrips'] = 'spikestrips', + ['box'] = 'box', + ['cash'] = 'Box of cash', + --ID Card Menu + ['name'] = 'name : ', + ['bac'] = 'bAC : ', + --Body Search Menu + ['confiscate_dirty'] = 'confiscate dirty money : $', + ['guns_label'] = '--- Guns ---', + ['confiscate'] = 'confiscate ', + ['inventory_label'] = '--- Inventory ---', + ['confiscate_inv'] = 'confiscate x', + + ['traffic_offense'] = 'traffic Offense', + ['minor_offense'] = 'minor Offense', + ['average_offense'] = 'average Offense', + ['major_offense'] = 'major Offense', + ['fine_total'] = 'fine : ', + --Vehicle Info Menu + ['plate'] = 'Plate: ', + ['owner_unknown'] = 'owner : Unknown', + ['owner'] = 'owner : ', + --Weapons Menus + ['get_weapon_menu'] = 'armory - Take Weapon', + ['put_weapon_menu'] = 'armory - Put Weapon', + ['buy_weapon_menu'] = 'armory - Buy Guns', + ['not_enough_money'] = 'you do not have enough money', + --Boss Menu + ['take_company_money'] = 'withdraw Company Money', + ['deposit_money'] = 'deposit Money', + ['amount_of_withdrawal'] = 'amount of Withdrawal', + ['invalid_amount'] = 'amount Invalid', + ['amount_of_deposit'] = 'amount of Deposit', + ['open_bossmenu'] = 'press ~INPUT_CONTEXT~ to open the menu', + --Misc + ['remove_object'] = 'press ~INPUT_CONTEXT~ to delete the object', + ['map_blip'] = 'police Station', + --Notifications + ['from'] = '~s~ from ~b~', + ['you_have_confinv'] = 'you have confiscated ~y~x', + ['confinv'] = '~s~ confiscated from you ~y~x', + ['you_have_confdm'] = 'you have confiscated ~y~$', + ['confdm'] = '~s~ confiscated from you ~y~$', + ['you_have_confweapon'] = 'you have confiscated ~y~x1 ', + ['confweapon'] = '~s~ confiscated from you ~y~x1 ', + ['alert_police'] = 'alert police', + --Authorized Vehicles + ['police'] = 'patrol Vehicle 1', + ['police2'] = 'patrol Vehicle 2', + ['police3'] = 'patrol Vehicle 3', + ['police4'] = 'unmarked Vehicle', + ['policeb'] = 'motorcycle', + ['policet'] = 'transport Van', +} \ No newline at end of file diff --git a/locales/fr.lua b/locales/fr.lua new file mode 100644 index 00000000..6756fbeb --- /dev/null +++ b/locales/fr.lua @@ -0,0 +1,91 @@ +Locales['fr'] = { + --Cloakroom + ['cloakroom'] = 'vestiaire', + ['citizen_wear'] = 'tenue Civil', + ['police_wear'] = 'tenue Policier', + ['open_cloackroom'] = 'appuez sur ~INPUT_CONTEXT~ pour vous changer', + --Armory + ['get_weapon'] = 'prendre Arme', + ['put_weapon'] = 'déposer Arme', + ['buy_weapons'] = 'acheter Armes', + ['armory'] = 'armurerie', + ['open_armory'] = 'appuez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie', + --Vehicles + ['vehicle_menu'] = 'véhicule', + ['vehicle_out'] = 'il y a déja un véhicule de sorti', + ['vehicle_spawner'] = 'appuez sur ~INPUT_CONTEXT~ pour sortir un véhicule', + ['store_vehicle'] = 'appuez sur ~INPUT_CONTEXT~ pour ranger le véhicule', + ['service_max'] = 'Service complet : ', + --Action Menu + ['citizen_interaction'] = 'interaction citoyen', + ['vehicle_interaction'] = 'interaction véhicule', + ['object_spawner'] = 'placer objets', + + ['id_card'] = 'carte d\'identité', + ['search'] = 'fouiller', + ['handcuff'] = 'menotter / Démenotter', + ['put_in_vehicle'] = 'mettre dans véhicule', + ['fine'] = 'Amende', + ['no_players_nearby'] = 'aucun joueur à proximité', + + ['vehicle_info'] = 'infos véhicule', + ['pick_lock'] = 'crocheter véhicule', + ['vehicle_unlocked'] = 'véhicule ~g~déverouillé~s~', + ['no_vehicles_nearby'] = 'aucun véhicule à proximité', + ['traffic_interaction'] = 'Interaction Voirie', + ['cone'] = 'plot', + ['barrier'] = 'barrière', + ['spikestrips'] = 'herse', + ['box'] = 'caisse', + ['cash'] = 'caisse', + --ID Card Menu + ['name'] = 'nom : ', + ['bac'] = 'alcoolémie : ', + --Body Search Menu + ['confiscate_dirty'] = 'confisquer argent sale : $', + ['guns_label'] = '--- Armes ---', + ['confiscate'] = 'confisquer ', + ['inventory_label'] = '--- Inventaire ---', + ['confiscate_inv'] = 'confisquer x', + + ['traffic_offense'] = 'code de la route', + ['minor_offense'] = 'délit mineur', + ['average_offense'] = 'délit moyen', + ['major_offense'] = 'délit grave', + ['fine_total'] = 'amende : ', + --Vehicle Info Menu + ['plate'] = 'N°: ', + ['owner_unknown'] = 'propriétaire : Inconnu', + ['owner'] = 'propriétaire : ', + --Weapons Menus + ['get_weapon_menu'] = 'armurerie - Prendre Arme', + ['put_weapon_menu'] = 'armurerie - Déposer Arme', + ['buy_weapon_menu'] = 'armurerie - Acheter Armes', + ['not_enough_money'] = 'vous n\'avez pas assez d\'argent', + --Boss Menu + ['take_company_money'] = 'retirer argent société', + ['deposit_money'] = 'déposer argent', + ['amount_of_withdrawal'] = 'montant du retrait', + ['invalid_amount'] = 'montant invalide', + ['amount_of_deposit'] = 'montant du dépôt', + ['open_bossmenu'] = 'appuez sur ~INPUT_CONTEXT~ pour ouvrir le menu', + --Misc + ['remove_object'] = 'appuez sur ~INPUT_CONTEXT~ pour enlever l\'objet', + ['map_blip'] = 'Commissariat', + --Notifications + ['from'] = '~s~ à ~b~', + ['you_have_confinv'] = 'vous avez confisqué ~y~x', + ['confinv'] = '~s~ vous a confisqué ~y~x', + ['you_have_confdm'] = 'vous avez confisqué ~y~$', + ['confdm'] = '~s~ vous a confisqué ~y~$', + ['you_have_confweapon'] = 'vous avez confisqué ~y~x1 ', + ['confweapon'] = '~s~ vous a confisqué ~y~x1 ', + ['alert_police'] = 'alerte police', + --Authorized Vehicles + ['police'] = 'véhicule de patrouille 1', + ['police2'] = 'véhicule de patrouille 2', + ['police3'] = 'véhicule de patrouille 3', + ['police4'] = 'véhicule civil', + ['policeb'] = 'moto', + ['policet'] = 'van de transport', +} \ No newline at end of file diff --git a/server/main.lua b/server/main.lua index efe9bc0a..7bb6445e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -25,8 +25,8 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, targetXPlayer.removeInventoryItem(itemName, amount) sourceXPlayer.addInventoryItem(itemName, amount) - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, 'Vous avez confisqué ~y~x' .. amount .. ' ' .. label .. '~s~ à ~b~' .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. '~s~ vous a confisqué ~y~x' .. amount .. ' ' .. label ) + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confinv') .. amount .. ' ' .. label .. _U('from') .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confinv') .. amount .. ' ' .. label ) end @@ -35,8 +35,8 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, targetXPlayer.removeAccountMoney(itemName, amount) sourceXPlayer.addAccountMoney(itemName, amount) - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, 'Vous avez confisqué ~y~$' .. amount .. '~s~ à ~b~' .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. '~s~ vous a confisqué ~y~$' .. amount) + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confdm') .. amount .. _U('from') .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confdm') .. amount) end @@ -45,8 +45,8 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, targetXPlayer.removeWeapon(itemName) sourceXPlayer.addWeapon(itemName, amount) - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, 'Vous avez confisqué ~y~x1 ' .. ESX.GetWeaponLabel(itemName) .. '~s~ à ~b~' .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. '~s~ vous a confisqué ~y~x1 ' .. ESX.GetWeaponLabel(itemName)) + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confweapon') .. ESX.GetWeaponLabel(itemName) .. _U('from') .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confweapon') .. ESX.GetWeaponLabel(itemName)) end @@ -271,7 +271,7 @@ TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message for k, v in pairs(xPlayers) do if v.job.name == 'police' then TriggerEvent('esx_phone:getDistpatchRequestId', function(requestId) - TriggerClientEvent('esx_phone:onMessage', v.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, 'Alerte police', requestId) + TriggerClientEvent('esx_phone:onMessage', v.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, _('alert_police'), requestId) end) end end From dc2dec383541304db5eed3de8d206eb41986f31e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 15 Aug 2017 10:29:04 +0200 Subject: [PATCH 012/253] Add fine_types in SQL --- esx_policejob_full.sql | 55 +++++++++++++++++++++++++++++++++++++++ esx_policejob_minimal.sql | 55 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) diff --git a/esx_policejob_full.sql b/esx_policejob_full.sql index e3e1254a..68599dc1 100644 --- a/esx_policejob_full.sql +++ b/esx_policejob_full.sql @@ -16,3 +16,58 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Usage abusif du klaxon',30,0), + ('Franchir une ligne continue',40,0), + ('Circulation à contresens',250,0), + ('Demi-tour non autorisé',250,0), + ('Circulation hors-route',170,0), + ('Non-respect des distances de sécurité',30,0), + ('Arrêt dangereux / interdit',150,0), + ('Stationnement gênant / interdit',70,0), + ('Non respect de la priorité à droite',70,0), + ('Non-respect à un véhicule prioritaire',90,0), + ('Non-respect d\'un stop',105,0), + ('Non-respect d\'un feu rouge',130,0), + ('Dépassement dangereux',100,0), + ('Véhicule non en état',100,0), + ('Conduite sans permis',1500,0), + ('Délit de fuite',800,0), + ('Excès de vitesse < 5 kmh',90,0), + ('Excès de vitesse 5-15 kmh',120,0), + ('Excès de vitesse 15-30 kmh',180,0), + ('Excès de vitesse > 30 kmh',300,0), + ('Entrave de la circulation',110,1), + ('Dégradation de la voie publique',90,1), + ('Trouble à l\'ordre publique',90,1), + ('Entrave opération de police',130,1), + ('Insulte envers / entre civils',75,1), + ('Outrage à agent de police',110,1), + ('Menace verbale ou intimidation envers civil',90,1), + ('Menace verbale ou intimidation envers policier',150,1), + ('Manifestation illégale',250,1), + ('Tentative de corruption',1500,1), + ('Arme blanche sortie en ville',120,2), + ('Arme léthale sortie en ville',300,2), + ('Port d\'arme non autorisé (défaut de license)',600,2), + ('Port d\'arme illégal',700,2), + ('Pris en flag lockpick',300,2), + ('Vol de voiture',1800,2), + ('Vente de drogue',1500,2), + ('Fabriquation de drogue',1500,2), + ('Possession de drogue',650,2), + ('Prise d\'ôtage civil',1500,2), + ('Prise d\'ôtage agent de l\'état',2000,2), + ('Braquage particulier',650,2), + ('Braquage magasin',650,2), + ('Braquage de banque',1500,2), + ('Tir sur civil',2000,3), + ('Tir sur agent de l\'état',2500,3), + ('Tentative de meurtre sur civil',3000,3), + ('Tentative de meurtre sur agent de l\'état',5000,3), + ('Meurtre sur civil',10000,3), + ('Meurte sur agent de l\'état',30000,3), + ('Meurtre involontaire',1800,3), + ('Escroquerie à l\'entreprise',2000,2) +; diff --git a/esx_policejob_minimal.sql b/esx_policejob_minimal.sql index daf423d6..a916b0eb 100644 --- a/esx_policejob_minimal.sql +++ b/esx_policejob_minimal.sql @@ -8,3 +8,58 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Usage abusif du klaxon',30,0), + ('Franchir une ligne continue',40,0), + ('Circulation à contresens',250,0), + ('Demi-tour non autorisé',250,0), + ('Circulation hors-route',170,0), + ('Non-respect des distances de sécurité',30,0), + ('Arrêt dangereux / interdit',150,0), + ('Stationnement gênant / interdit',70,0), + ('Non respect de la priorité à droite',70,0), + ('Non-respect à un véhicule prioritaire',90,0), + ('Non-respect d\'un stop',105,0), + ('Non-respect d\'un feu rouge',130,0), + ('Dépassement dangereux',100,0), + ('Véhicule non en état',100,0), + ('Conduite sans permis',1500,0), + ('Délit de fuite',800,0), + ('Excès de vitesse < 5 kmh',90,0), + ('Excès de vitesse 5-15 kmh',120,0), + ('Excès de vitesse 15-30 kmh',180,0), + ('Excès de vitesse > 30 kmh',300,0), + ('Entrave de la circulation',110,1), + ('Dégradation de la voie publique',90,1), + ('Trouble à l\'ordre publique',90,1), + ('Entrave opération de police',130,1), + ('Insulte envers / entre civils',75,1), + ('Outrage à agent de police',110,1), + ('Menace verbale ou intimidation envers civil',90,1), + ('Menace verbale ou intimidation envers policier',150,1), + ('Manifestation illégale',250,1), + ('Tentative de corruption',1500,1), + ('Arme blanche sortie en ville',120,2), + ('Arme léthale sortie en ville',300,2), + ('Port d\'arme non autorisé (défaut de license)',600,2), + ('Port d\'arme illégal',700,2), + ('Pris en flag lockpick',300,2), + ('Vol de voiture',1800,2), + ('Vente de drogue',1500,2), + ('Fabriquation de drogue',1500,2), + ('Possession de drogue',650,2), + ('Prise d\'ôtage civil',1500,2), + ('Prise d\'ôtage agent de l\'état',2000,2), + ('Braquage particulier',650,2), + ('Braquage magasin',650,2), + ('Braquage de banque',1500,2), + ('Tir sur civil',2000,3), + ('Tir sur agent de l\'état',2500,3), + ('Tentative de meurtre sur civil',3000,3), + ('Tentative de meurtre sur agent de l\'état',5000,3), + ('Meurtre sur civil',10000,3), + ('Meurte sur agent de l\'état',30000,3), + ('Meurtre involontaire',1800,3), + ('Escroquerie à l\'entreprise',2000,2) +; \ No newline at end of file From 9856d1ea3db1a0b099a047b6b114fd3928599a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 15 Aug 2017 10:36:43 +0200 Subject: [PATCH 013/253] Add CREATE_TABLE fine_types --- esx_policejob_full.sql | 10 ++++++++++ esx_policejob_minimal.sql | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/esx_policejob_full.sql b/esx_policejob_full.sql index 68599dc1..3c26e954 100644 --- a/esx_policejob_full.sql +++ b/esx_policejob_full.sql @@ -17,6 +17,16 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; +CREATE TABLE `fine_types` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +); + INSERT INTO `fine_types` (label, amount, category) VALUES ('Usage abusif du klaxon',30,0), ('Franchir une ligne continue',40,0), diff --git a/esx_policejob_minimal.sql b/esx_policejob_minimal.sql index a916b0eb..0105430d 100644 --- a/esx_policejob_minimal.sql +++ b/esx_policejob_minimal.sql @@ -9,6 +9,17 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; +CREATE TABLE `fine_types` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +); + + INSERT INTO `fine_types` (label, amount, category) VALUES ('Usage abusif du klaxon',30,0), ('Franchir une ligne continue',40,0), From 9b40b93f02b1c0ecaa78ac1489f3ae8134884050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 15 Aug 2017 11:03:44 +0200 Subject: [PATCH 014/253] Fix wrong player name on identity card --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 7bb6445e..37345b40 100644 --- a/server/main.lua +++ b/server/main.lua @@ -67,7 +67,7 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, local xPlayer = ESX.GetPlayerFromId(target) local data = { - name = GetPlayerName(source), + name = GetPlayerName(target), job = xPlayer.job, inventory = xPlayer.inventory, accounts = xPlayer.accounts, From 687b1351ae6f5c5a98259d64fbbd7793e49abd4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 15 Aug 2017 11:05:18 +0200 Subject: [PATCH 015/253] Fix status --- server/main.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 37345b40..fdd8932e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -75,7 +75,11 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, } TriggerEvent('esx_status:getStatus', _source, 'drunk', function(status) - data.drunk = status:getPercent() + + if status ~= nil then + data.drunk = status.getPercent() + end + end) TriggerEvent('esx_license:getLicenses', _source, function(licenses) From 7e6fcb0db3888a3a9cf55a2fc9696344ca8545c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 15 Aug 2017 18:08:56 +0200 Subject: [PATCH 016/253] Set fr as default locale --- config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.lua b/config.lua index 4a1defb3..b111e511 100644 --- a/config.lua +++ b/config.lua @@ -6,7 +6,7 @@ Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false Config.MaxInService = -1 -Config.Locale = 'en' +Config.Locale = 'fr' Config.PoliceStations = { From 4e791afe0e893e135c6e8a61164dac5984c8170b Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Tue, 15 Aug 2017 15:53:47 -0400 Subject: [PATCH 017/253] Grammatical fix (en) --- locales/en.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locales/en.lua b/locales/en.lua index 0ad97fbe..4f0a9562 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -15,7 +15,7 @@ Locales['en'] = { ['vehicle_out'] = 'there is already a car out of the garage', ['vehicle_spawner'] = 'press ~INPUT_CONTEXT~ to take out a vehicle', ['store_vehicle'] = 'press ~INPUT_CONTEXT~ to store the vehicle', - ['service_max'] = 'Max officers in service : ', + ['service_max'] = 'Max officers in service: ', --Action Menu ['citizen_interaction'] = 'citizen Interaction', ['vehicle_interaction'] = 'vehicle Interaction', @@ -42,7 +42,7 @@ Locales['en'] = { ['name'] = 'name : ', ['bac'] = 'bAC : ', --Body Search Menu - ['confiscate_dirty'] = 'confiscate dirty money : $', + ['confiscate_dirty'] = 'confiscate dirty money: $', ['guns_label'] = '--- Guns ---', ['confiscate'] = 'confiscate ', ['inventory_label'] = '--- Inventory ---', @@ -52,11 +52,11 @@ Locales['en'] = { ['minor_offense'] = 'minor Offense', ['average_offense'] = 'average Offense', ['major_offense'] = 'major Offense', - ['fine_total'] = 'fine : ', + ['fine_total'] = 'fine: ', --Vehicle Info Menu ['plate'] = 'Plate: ', - ['owner_unknown'] = 'owner : Unknown', - ['owner'] = 'owner : ', + ['owner_unknown'] = 'owner: Unknown', + ['owner'] = 'owner: ', --Weapons Menus ['get_weapon_menu'] = 'armory - Take Weapon', ['put_weapon_menu'] = 'armory - Put Weapon', From c83be9168749a11f8953b3a66e3190ea3bab1d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 16 Aug 2017 16:33:25 +0200 Subject: [PATCH 018/253] Fix vehicle detection --- client/main.lua | 60 ++++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 41 deletions(-) diff --git a/client/main.lua b/client/main.lua index 374949a2..cd8846fc 100644 --- a/client/main.lua +++ b/client/main.lua @@ -211,13 +211,9 @@ function OpenVehicleSpawnerMenu(station, partNum) local model = data.current.value - local vehicle, distance = ESX.Game.GetClosestVehicle({ - x = vehicles[partNum].SpawnPoint.x, - y = vehicles[partNum].SpawnPoint.y, - z = vehicles[partNum].SpawnPoint.z - }) + local vehicle = GetClosestVehicle(vehicles[partNum].SpawnPoint.x, vehicles[partNum].SpawnPoint.y, vehicles[partNum].SpawnPoint.z, 3.0, 0, 71) - if distance > 3.0 then + if DoesEntityExist(vehicle) then local playerPed = GetPlayerPed(-1) @@ -357,9 +353,11 @@ function OpenPoliceActionsMenu() }, function(data2, menu2) - local vehicle, distance = ESX.Game.GetClosestVehicle() + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) - if distance ~= -1 and distance <= 3.0 then + if DoesEntityExist(vehicle) then local vehicleData = ESX.Game.GetVehicleProperties(vehicle) @@ -372,14 +370,10 @@ function OpenPoliceActionsMenu() local playerPed = GetPlayerPed(-1) local coords = GetEntityCoords(playerPed) - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - - local vehicle, distance = ESX.Game.GetClosestVehicle({ - x = coords.x, - y = coords.y, - z = coords.z - }) + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 3.0) then + local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) + if DoesEntityExist(vehicle) then Citizen.CreateThread(function() @@ -960,14 +954,9 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu if part == 'HelicopterSpawner' then local helicopters = Config.PoliceStations[station].Helicopters - - local vehicle, distance = ESX.Game.GetClosestVehicle({ - x = helicopters[partNum].SpawnPoint.x, - y = helicopters[partNum].SpawnPoint.y, - z = helicopters[partNum].SpawnPoint.z - }) + local vehicle = GetClosestVehicle(helicopters[partNum].SpawnPoint.x, helicopters[partNum].SpawnPoint.y, helicopters[partNum].SpawnPoint.z, 3.0, 0, 71) - if distance > 3.0 then + if DoesEntityExist(vehicle) then ESX.Game.SpawnVehicle('polmav', { x = helicopters[partNum].SpawnPoint.x, @@ -985,12 +974,13 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu if part == 'VehicleDeleter' then local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) if IsPedInAnyVehicle(playerPed, false) then - local vehicle, distance = ESX.Game.GetClosestVehicle() + local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) - if distance <= 2.0 then + if DoesEntityExist(vehicle) then CurrentAction = 'delete_vehicle' CurrentActionMsg = _U('store_vehicle') CurrentActionData = {vehicle = vehicle} @@ -1029,18 +1019,10 @@ AddEventHandler('esx_policejob:hasEnteredEntityZone', function(entity) if IsPedInAnyVehicle(playerPed, false) then - local vehicle, distance = ESX.Game.GetClosestVehicle({ - x = coords.x, - y = coords.y, - z = coords.z - }) - - if distance <= 1.0 then - - for i=0, 7, 1 do - SetVehicleTyreBurst(vehicle, i, true, 1000) - end + local vehicle = GetVehiclePedIsIn(playerPed) + for i=0, 7, 1 do + SetVehicleTyreBurst(vehicle, i, true, 1000) end end @@ -1098,12 +1080,8 @@ AddEventHandler('esx_policejob:putInVehicle', function() if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle, distance = ESX.Game.GetClosestVehicle({ - x = coords.x, - y = coords.y, - z = coords.z - }) - + local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) + if DoesEntityExist(vehicle) then local maxSeats = GetVehicleMaxNumberOfPassengers(vehicle) From 4b0173ff82ef840b9b1803ce2b71d60425b88a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 16 Aug 2017 16:55:24 +0200 Subject: [PATCH 019/253] Fix condition --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index cd8846fc..585a8036 100644 --- a/client/main.lua +++ b/client/main.lua @@ -213,7 +213,7 @@ function OpenVehicleSpawnerMenu(station, partNum) local vehicle = GetClosestVehicle(vehicles[partNum].SpawnPoint.x, vehicles[partNum].SpawnPoint.y, vehicles[partNum].SpawnPoint.z, 3.0, 0, 71) - if DoesEntityExist(vehicle) then + if not DoesEntityExist(vehicle) then local playerPed = GetPlayerPed(-1) From 6300cd1d8b12ab8de6448ffd8f8dcaa331f8bdc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 16 Aug 2017 16:59:38 +0200 Subject: [PATCH 020/253] Fix delete vehicle --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 585a8036..f731549a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -978,7 +978,7 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu if IsPedInAnyVehicle(playerPed, false) then - local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) + local vehicle = GetVehicelPedIsIn(playerPed, false) if DoesEntityExist(vehicle) then CurrentAction = 'delete_vehicle' From 4116611330a6fdf2dbf2d2550f6ce0a663b55da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 16 Aug 2017 17:04:16 +0200 Subject: [PATCH 021/253] Fix typo --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index f731549a..83f7ffba 100644 --- a/client/main.lua +++ b/client/main.lua @@ -978,7 +978,7 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu if IsPedInAnyVehicle(playerPed, false) then - local vehicle = GetVehicelPedIsIn(playerPed, false) + local vehicle = GetVehiclePedIsIn(playerPed, false) if DoesEntityExist(vehicle) then CurrentAction = 'delete_vehicle' From 08af39980f251611d7d618a8455c22ee5e40895e Mon Sep 17 00:00:00 2001 From: TakumiBR <31086346+TakumiBR@users.noreply.github.com> Date: Thu, 17 Aug 2017 08:36:40 -0700 Subject: [PATCH 022/253] Multi-language support Brazilian Portuguese translation. --- __resource.lua | 2 ++ locales/br.lua | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 locales/br.lua diff --git a/__resource.lua b/__resource.lua index a5448753..184ac3ec 100644 --- a/__resource.lua +++ b/__resource.lua @@ -4,6 +4,7 @@ description 'ESX Police Job' server_scripts { '@es_extended/locale.lua', + 'locales/br.lua', 'locales/en.lua', 'locales/fr.lua', '@mysql-async/lib/MySQL.lua', @@ -13,6 +14,7 @@ server_scripts { client_scripts { '@es_extended/locale.lua', + 'locales/br.lua', 'locales/en.lua', 'locales/fr.lua', 'config.lua', diff --git a/locales/br.lua b/locales/br.lua new file mode 100644 index 00000000..e8e67d9e --- /dev/null +++ b/locales/br.lua @@ -0,0 +1,91 @@ +Locales['br'] = { + --Cloackroom + ['cloakroom'] = 'Vestiário', + ['citizen_wear'] = 'Roupa casual', + ['police_wear'] = 'Uniforme da Polícia', + ['open_cloackroom'] = 'Pressione ~INPUT_CONTEXT~ para se trocar', + --Armory + ['get_weapon'] = 'Pegar arma', + ['put_weapon'] = 'Entregar arma', + ['buy_weapons'] = 'Comprar armas', + ['armory'] = 'Arsenal', + ['open_armory'] = 'Pressione ~INPUT_CONTEXT~ para acessar o arsenal', + --Vehicles + ['vehicle_menu'] = 'Veículo', + ['vehicle_out'] = 'Já existe um carro fora da garagem', + ['vehicle_spawner'] = 'Pressione ~INPUT_CONTEXT~ para escolher um veículo', + ['store_vehicle'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', + ['service_max'] = 'Maximo de oficiais em serviço : ', + --Action Menu + ['citizen_interaction'] = 'Interagir com o cidadão', + ['vehicle_interaction'] = 'Interagir com o veículo', + ['object_spawner'] = 'Interagir com as rodovias', + + ['id_card'] = 'Carteira de identidade', + ['search'] = 'Procurar', + ['handcuff'] = 'Algemar / Soltar', + ['put_in_vehicle'] = 'Colocar no veículo', + ['fine'] = 'Multa', + ['no_players_nearby'] = 'Nenhum jogador nas proximidades', + + ['vehicle_info'] = 'Informações', + ['pick_lock'] = 'Trancar veículo', + ['vehicle_unlocked'] = 'Veículo ~g~destravado~s~', + ['no_vehicles_nearby'] = 'Nenhum veículo nas proximidades', + ['traffic_interaction'] = 'Interagir com as rodovias', + ['cone'] = 'Cones', + ['barrier'] = 'Barreira', + ['spikestrips'] = 'Fita de pregos', + ['box'] = 'Caixa', + ['cash'] = 'Caixa de dinheiro', + --ID Card Menu + ['name'] = 'Nome : ', + ['bac'] = 'bAC : ', + --Body Search Menu + ['confiscate_dirty'] = 'Confiscar dinheiro sujo : $', + ['guns_label'] = '--- Armas ---', + ['confiscate'] = 'Confiscar ', + ['inventory_label'] = '--- Inventário ---', + ['confiscate_inv'] = 'Confiscar x', + + ['traffic_offense'] = 'Infrações de transito', + ['minor_offense'] = 'Infração leve', + ['average_offense'] = 'Infração média', + ['major_offense'] = 'Infração grave', + ['fine_total'] = 'Multa : ', + --Vehicle Info Menu + ['plate'] = 'Placa: ', + ['owner_unknown'] = 'Proprietário : Desconhecido', + ['owner'] = 'Proprietário : ', + --Weapons Menus + ['get_weapon_menu'] = 'Arsenal - Pegar arma', + ['put_weapon_menu'] = 'Arsenal - Entregar arma', + ['buy_weapon_menu'] = 'Arsenal - Comprar armas', + ['not_enough_money'] = 'Você não tem dinheiro suficiente', + --Boss Menu + ['take_company_money'] = 'Retirar o dinheiro da empresa', + ['deposit_money'] = 'Depositar dinheiro', + ['amount_of_withdrawal'] = 'Quantidade de retirada', + ['invalid_amount'] = 'Quantidade inválida', + ['amount_of_deposit'] = 'Quantidade de depósito', + ['open_bossmenu'] = 'Pressione ~INPUT_CONTEXT~ para abrir o menu', + --Misc + ['remove_object'] = 'Pressione ~INPUT_CONTEXT~ para remover o objeto', + ['map_blip'] = 'Departamento de Polícia', + --Notifications + ['from'] = '~s~ de ~b~', + ['you_have_confinv'] = 'Você confiscou ~y~x', + ['confinv'] = '~s~ confiscado de você ~y~x', + ['you_have_confdm'] = 'Você confiscou ~y~$', + ['confdm'] = '~s~ confiscado de você ~y~$', + ['you_have_confweapon'] = 'Você confiscou ~y~x1 ', + ['confweapon'] = '~s~ confiscado de você ~y~x1 ', + ['alert_police'] = 'Alerta da Polícia', + --Authorized Vehicles + ['police'] = 'Viatura - Blazer', + ['police2'] = 'Viatura - Parati', + ['police3'] = 'viatura - Fluence', + ['police4'] = 'Viatura - Blazer cinza', + ['policeb'] = 'Moto da Polícia', + ['policet'] = 'Van de Transporte', +} \ No newline at end of file From 862e35fcab5c8c263a401b8189ce54f1397fd86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sat, 19 Aug 2017 18:04:28 +0200 Subject: [PATCH 023/253] Fix SpawnOBject arguments --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 83f7ffba..d8bebf5d 100644 --- a/client/main.lua +++ b/client/main.lua @@ -441,7 +441,7 @@ function OpenPoliceActionsMenu() x = x, y = y, z = z - }, 3.0, function(obj) + }, function(obj) SetEntityHeading(obj, GetEntityHeading(playerPed)) PlaceObjectOnGroundProperly(obj) end) From e8085da1775b6c6d2153d2e20075c1f2f59337f2 Mon Sep 17 00:00:00 2001 From: renaiku Date: Mon, 21 Aug 2017 21:02:37 +0200 Subject: [PATCH 024/253] update getplayers --- server/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/main.lua b/server/main.lua index fdd8932e..ed21ebd2 100644 --- a/server/main.lua +++ b/server/main.lua @@ -272,10 +272,11 @@ TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message local xPlayers = ESX.GetPlayers() if phoneNumber == 'police' then - for k, v in pairs(xPlayers) do - if v.job.name == 'police' then + for i=1, #xPlayers, 1 do + local xPlayer2 = ESX.GetPlayerFromId(xPlayers[i]) + if xPlayer2.job.name == 'police' then TriggerEvent('esx_phone:getDistpatchRequestId', function(requestId) - TriggerClientEvent('esx_phone:onMessage', v.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, _('alert_police'), requestId) + TriggerClientEvent('esx_phone:onMessage', xPlayer2.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, _('alert_police'), requestId) end) end end From d26a4594251996543371f34207819cbf08acaaec Mon Sep 17 00:00:00 2001 From: Don Date: Wed, 23 Aug 2017 19:25:02 -0700 Subject: [PATCH 025/253] sql multilanguage update Credits to: TehBADger --- esx_policejob_en_full.sql | 83 ++++++++++++++++++++++++++++++++++++ esx_policejob_en_minimal.sql | 76 +++++++++++++++++++++++++++++++++ 2 files changed, 159 insertions(+) create mode 100644 esx_policejob_en_full.sql create mode 100644 esx_policejob_en_minimal.sql diff --git a/esx_policejob_en_full.sql b/esx_policejob_en_full.sql new file mode 100644 index 00000000..be26c653 --- /dev/null +++ b/esx_policejob_en_full.sql @@ -0,0 +1,83 @@ +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police','Police',1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police','Police',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police','LSPD') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') +; + +CREATE TABLE `fine_types` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Misuse of a horn', 30, 0), + ('Illegally Crossing a continuous Line', 40, 0), + ('Driving on the wrong side of the road', 250, 0), + ('Illegal U-Turn', 250, 0), + ('Illegally Driving Off-road', 170, 0), + ('Refusing a Lawful Command', 30, 0), + ('Illegally Stoped of a Vehicle', 150, 0), + ('Illegal Parking', 70, 0), + ('Failing to Yield to the right', 70, 0), + ('Failure to comply with Vehicle Information', 90, 0), + ('Failing to stop at a Stop Sign ', 105, 0), + ('Failing to stop at a Red Light', 130, 0), + ('Illegal Passing', 100, 0), + ('Driving an illegal Vehicle', 100, 0), + ('Driving without a License', 1500, 0), + ('Hit and Run', 800, 0), + ('Exceeding Speeds Over < 5 mph', 90, 0), + ('Exceeding Speeds Over 5-15 mph', 120, 0), + ('Exceeding Speeds Over 15-30 mph', 180, 0), + ('Exceeding Speeds Over > 30 mph', 300, 0), + ('Impeding traffic flow', 110, 1), + ('Public Intoxication', 90, 1), + ('Disorderly conduct', 90, 1), + ('Obstruction of Justice', 130, 1), + ('Insults towards Civilans', 75, 1), + ('Disrespecting of an LEO', 110, 1), + ('Verbal Threat towards a Civilan', 90, 1), + ('Verbal Threat towards an LEO', 150, 1), + ('Providing False Information', 250, 1), + ('Attempt of Corruption', 1500, 1), + ('Brandishing a weapon in city Limits', 120, 2), + ('Brandishing a Lethal Weapon in city Limits', 300, 2), + ('No Firearms License', 600, 2), + ('Possession of an Illegal Weapon', 700, 2), + ('Possession of Burglary Tools', 300, 2), + ('Grand Theft Auto', 1800, 2), + ('Intent to Sell/Distrube of an illegal Substance', 1500, 2), + ('Frabrication of an Illegal Substance', 1500, 2), + ('Possession of an Illegal Substance ', 650, 2), + ('Kidnapping of a Civilan', 1500, 2), + ('Kidnapping of an LEO', 2000, 2), + ('Robbery', 650, 2), + ('Armed Robbery of a Store', 650, 2), + ('Armed Robbery of a Bank', 1500, 2), + ('Assault on a Civilian', 2000, 3), + ('Assault of an LEO', 2500, 3), + ('Attempt of Murder of a Civilian', 3000, 3), + ('Attempt of Murder of an LEO', 5000, 3), + ('Murder of a Civilian', 10000, 3), + ('Murder of an LEO', 30000, 3), + ('Involuntary manslaughter', 1800, 3), + ('Fraud', 2000, 2); +; \ No newline at end of file diff --git a/esx_policejob_en_minimal.sql b/esx_policejob_en_minimal.sql new file mode 100644 index 00000000..35fd99df --- /dev/null +++ b/esx_policejob_en_minimal.sql @@ -0,0 +1,76 @@ +INSERT INTO `jobs` (name, label) VALUES + ('police','LSPD') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') +; + +CREATE TABLE `fine_types` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +); + + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Misuse of a horn', 30, 0), + ('Illegally Crossing a continuous Line', 40, 0), + ('Driving on the wrong side of the road', 250, 0), + ('Illegal U-Turn', 250, 0), + ('Illegally Driving Off-road', 170, 0), + ('Refusing a Lawful Command', 30, 0), + ('Illegally Stoped of a Vehicle', 150, 0), + ('Illegal Parking', 70, 0), + ('Failing to Yield to the right', 70, 0), + ('Failure to comply with Vehicle Information', 90, 0), + ('Failing to stop at a Stop Sign ', 105, 0), + ('Failing to stop at a Red Light', 130, 0), + ('Illegal Passing', 100, 0), + ('Driving an illegal Vehicle', 100, 0), + ('Driving without a License', 1500, 0), + ('Hit and Run', 800, 0), + ('Exceeding Speeds Over < 5 mph', 90, 0), + ('Exceeding Speeds Over 5-15 mph', 120, 0), + ('Exceeding Speeds Over 15-30 mph', 180, 0), + ('Exceeding Speeds Over > 30 mph', 300, 0), + ('Impeding traffic flow', 110, 1), + ('Public Intoxication', 90, 1), + ('Disorderly conduct', 90, 1), + ('Obstruction of Justice', 130, 1), + ('Insults towards Civilans', 75, 1), + ('Disrespecting of an LEO', 110, 1), + ('Verbal Threat towards a Civilan', 90, 1), + ('Verbal Threat towards an LEO', 150, 1), + ('Providing False Information', 250, 1), + ('Attempt of Corruption', 1500, 1), + ('Brandishing a weapon in city Limits', 120, 2), + ('Brandishing a Lethal Weapon in city Limits', 300, 2), + ('No Firearms License', 600, 2), + ('Possession of an Illegal Weapon', 700, 2), + ('Possession of Burglary Tools', 300, 2), + ('Grand Theft Auto', 1800, 2), + ('Intent to Sell/Distrube of an illegal Substance', 1500, 2), + ('Frabrication of an Illegal Substance', 1500, 2), + ('Possession of an Illegal Substance ', 650, 2), + ('Kidnapping of a Civilan', 1500, 2), + ('Kidnapping of an LEO', 2000, 2), + ('Robbery', 650, 2), + ('Armed Robbery of a Store', 650, 2), + ('Armed Robbery of a Bank', 1500, 2), + ('Assault on a Civilian', 2000, 3), + ('Assault of an LEO', 2500, 3), + ('Attempt of Murder of a Civilian', 3000, 3), + ('Attempt of Murder of an LEO', 5000, 3), + ('Murder of a Civilian', 10000, 3), + ('Murder of an LEO', 30000, 3), + ('Involuntary manslaughter', 1800, 3), + ('Fraud', 2000, 2); +; \ No newline at end of file From 70a796e583506d0f34a691148de970e90c9eb290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Fri, 25 Aug 2017 10:52:14 +0200 Subject: [PATCH 026/253] Add ESX.UI.Menu.CloseAll --- client/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/client/main.lua b/client/main.lua index d8bebf5d..b37eeb9a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -999,6 +999,7 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu end) AddEventHandler('esx_policejob:hasExitedMarker', function(station, part, partNum) + ESX.UI.Menu.CloseAll() CurrentAction = nil end) From 1090d0f663654f84a42de3a6bbcec6f8c19171ec Mon Sep 17 00:00:00 2001 From: ultratm Date: Sat, 26 Aug 2017 11:29:18 +0200 Subject: [PATCH 027/253] Add German Language --- de_config.lua | 78 +++++++++++++++++++++++++++++++ de_esx_policejob_full.sql | 82 ++++++++++++++++++++++++++++++++ de_esx_policejob_minimal.sql | 75 +++++++++++++++++++++++++++++ locales/de.lua | 91 ++++++++++++++++++++++++++++++++++++ 4 files changed, 326 insertions(+) create mode 100644 de_config.lua create mode 100644 de_esx_policejob_full.sql create mode 100644 de_esx_policejob_minimal.sql create mode 100644 locales/de.lua diff --git a/de_config.lua b/de_config.lua new file mode 100644 index 00000000..55ba5522 --- /dev/null +++ b/de_config.lua @@ -0,0 +1,78 @@ +Config = {} +Config.DrawDistance = 100.0 +Config.MarkerType = 1 +Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} +Config.MarkerColor = {r = 50, g = 50, b = 204} +Config.EnablePlayerManagement = false +Config.EnableArmoryManagement = false +Config.MaxInService = -1 +Config.Locale = 'de' + +Config.PoliceStations = { + + LSPD = { + + Blip = { + Pos = {x = 425.130, y = -979.558, z = 30.711}, + Color = 29 + }, + + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_ASSAULTRIFLE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + {name = 'WEAPON_STICKYBOMB', price = 250}, + {name = 'GADGET_PARACHUTE', price = 300}, + }, + + AuthorizedVehicles = { + {name = 'police' , label = 'Streifenfahrzeug 1'}, + {name = 'police2', label = 'Streifenfahrzeug 2'}, + {name = 'police3', label = 'Streifenfahrzeug 3'}, + {name = 'police4', label = 'Zivilfahrzeug'}, + {name = 'policeb', label = 'Motorrad'}, + {name = 'policet', label = 'Transporter'}, + }, + + Cloakrooms = { + {x = 452.600, y = -993.306, z = 29.750} + }, + + Armories = { + {x = 451.699, y = -980.356, z = 29.689} + }, + + Vehicles = { + { + Spawner = {x = 454.69, y = -1017.4, z = 27.430}, + SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, + Heading = 90.0 + } + }, + + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, + + VehicleDeleters = { + {x = 462.74, y = -1014.4, z = 27.065}, + {x = 462.40, y = -1019.7, z = 27.104} + }, + + BossActions = { + {x = 448.417, y = -973.208, z = 29.689} + } + + } + +} \ No newline at end of file diff --git a/de_esx_policejob_full.sql b/de_esx_policejob_full.sql new file mode 100644 index 00000000..a13e74fe --- /dev/null +++ b/de_esx_policejob_full.sql @@ -0,0 +1,82 @@ +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police','Polizei',1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police','Polizei',1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police','LSPD') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Rekrut',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') +; + +CREATE TABLE `fine_types` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `fine_types` VALUES ('1', 'Missbrauchen der Hupe', '30', '0'); +INSERT INTO `fine_types` VALUES ('2', 'Vorfahrtstraße missachtet', '40', '0'); +INSERT INTO `fine_types` VALUES ('3', 'Gegenverkehr', '250', '0'); +INSERT INTO `fine_types` VALUES ('4', 'Unbefugtes Wenden', '250', '0'); +INSERT INTO `fine_types` VALUES ('5', 'Off-Road fahren', '170', '0'); +INSERT INTO `fine_types` VALUES ('6', 'Sicherheitsrichtlinien missachtet', '30', '0'); +INSERT INTO `fine_types` VALUES ('7', 'Gefährliches halten', '150', '0'); +INSERT INTO `fine_types` VALUES ('8', 'Nicht erlaubtes parken', '70', '0'); +INSERT INTO `fine_types` VALUES ('9', 'Nicht respektieren des Rechtsfahrgebotes', '70', '0'); +INSERT INTO `fine_types` VALUES ('10', 'Nicht einhaltender Priorität eines Rettungsfahrzeuges', '90', '0'); +INSERT INTO `fine_types` VALUES ('11', 'Nicht angehalten nach Aufforderung', '105', '0'); +INSERT INTO `fine_types` VALUES ('12', 'Bei Rot über die Ampel', '130', '0'); +INSERT INTO `fine_types` VALUES ('13', 'gefährliches Überholmanöver', '100', '0'); +INSERT INTO `fine_types` VALUES ('14', 'Fahrzeug nicht Verkehrstauglich', '100', '0'); +INSERT INTO `fine_types` VALUES ('15', 'Fahren ohne Lizenz', '1500', '0'); +INSERT INTO `fine_types` VALUES ('16', 'Hit and Run', '800', '0'); +INSERT INTO `fine_types` VALUES ('17', 'zu schnell < 5 kmh', '90', '0'); +INSERT INTO `fine_types` VALUES ('18', 'zu schnell 5-15 kmh', '120', '0'); +INSERT INTO `fine_types` VALUES ('19', 'zu schnell 15-30 kmh', '180', '0'); +INSERT INTO `fine_types` VALUES ('20', 'zu schnell > 30 kmh', '300', '0'); +INSERT INTO `fine_types` VALUES ('21', 'Verkehrsbehinderung', '110', '1'); +INSERT INTO `fine_types` VALUES ('22', 'Nicht Benutzung öffentlicher Straßen', '90', '1'); +INSERT INTO `fine_types` VALUES ('23', 'Störung der öffentlichen Ordnung', '90', '1'); +INSERT INTO `fine_types` VALUES ('24', 'Polizeieinsatz behindern', '130', '1'); +INSERT INTO `fine_types` VALUES ('25', 'Beildigung an Zivilist', '75', '1'); +INSERT INTO `fine_types` VALUES ('26', 'Polizist geringschätzen', '110', '1'); +INSERT INTO `fine_types` VALUES ('27', 'verbale Bedrohung an Zivilist', '90', '1'); +INSERT INTO `fine_types` VALUES ('28', 'verbale Bedrohung an Polizist', '150', '1'); +INSERT INTO `fine_types` VALUES ('29', 'Illegale Demonstration', '250', '1'); +INSERT INTO `fine_types` VALUES ('30', 'versuchte Bestechung', '1500', '1'); +INSERT INTO `fine_types` VALUES ('31', 'Mit Messer in der Stadt bewaffnet', '120', '2'); +INSERT INTO `fine_types` VALUES ('32', 'Mit tötlicher Waffe bewaffnet', '300', '2'); +INSERT INTO `fine_types` VALUES ('33', 'Unbefugter Besitz einer Waffe (Standard-Lizenz)', '600', '2'); +INSERT INTO `fine_types` VALUES ('34', 'Illegale Waffe', '700', '2'); +INSERT INTO `fine_types` VALUES ('35', 'Einbruch/Aufbruch', '300', '2'); +INSERT INTO `fine_types` VALUES ('36', 'Autodiebstahl', '1800', '2'); +INSERT INTO `fine_types` VALUES ('37', 'Drogenverkauf', '1500', '2'); +INSERT INTO `fine_types` VALUES ('38', 'Drogen herstellen', '1500', '2'); +INSERT INTO `fine_types` VALUES ('39', 'Drogenbesitz', '650', '2'); +INSERT INTO `fine_types` VALUES ('40', 'Zivile Geisel genommen', '1500', '2'); +INSERT INTO `fine_types` VALUES ('41', 'Geiselnahme', '2000', '2'); +INSERT INTO `fine_types` VALUES ('42', 'Waghalsiges Lenken', '650', '2'); +INSERT INTO `fine_types` VALUES ('43', 'Ladenraub', '650', '2'); +INSERT INTO `fine_types` VALUES ('44', 'Bankraub', '1500', '2'); +INSERT INTO `fine_types` VALUES ('45', 'Schießen auf Zivilisten', '2000', '3'); +INSERT INTO `fine_types` VALUES ('46', 'Schießen auf Beamten', '2500', '3'); +INSERT INTO `fine_types` VALUES ('47', 'versuchterMord an Zivilisten', '3000', '3'); +INSERT INTO `fine_types` VALUES ('48', 'versuchter Mord an einem Beamten', '5000', '3'); +INSERT INTO `fine_types` VALUES ('49', 'Mord an Zivilisten', '10000', '3'); +INSERT INTO `fine_types` VALUES ('50', 'Mord an Beamten', '30000', '3'); +INSERT INTO `fine_types` VALUES ('51', 'versehentlicher Mord', '1800', '3'); +INSERT INTO `fine_types` VALUES ('52', 'Firmenbetrug', '2000', '2'); +; \ No newline at end of file diff --git a/de_esx_policejob_minimal.sql b/de_esx_policejob_minimal.sql new file mode 100644 index 00000000..d0d67a2b --- /dev/null +++ b/de_esx_policejob_minimal.sql @@ -0,0 +1,75 @@ +INSERT INTO `jobs` (name, label) VALUES + ('police','LSPD') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Rekrut',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') +; + +CREATE TABLE `fine_types` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +); + + +INSERT INTO `fine_types` VALUES ('1', 'Missbrauchen der Hupe', '30', '0'); +INSERT INTO `fine_types` VALUES ('2', 'Vorfahrtstraße missachtet', '40', '0'); +INSERT INTO `fine_types` VALUES ('3', 'Gegenverkehr', '250', '0'); +INSERT INTO `fine_types` VALUES ('4', 'Unbefugtes Wenden', '250', '0'); +INSERT INTO `fine_types` VALUES ('5', 'Off-Road fahren', '170', '0'); +INSERT INTO `fine_types` VALUES ('6', 'Sicherheitsrichtlinien missachtet', '30', '0'); +INSERT INTO `fine_types` VALUES ('7', 'Gefährliches halten', '150', '0'); +INSERT INTO `fine_types` VALUES ('8', 'Nicht erlaubtes parken', '70', '0'); +INSERT INTO `fine_types` VALUES ('9', 'Nicht respektieren des Rechtsfahrgebotes', '70', '0'); +INSERT INTO `fine_types` VALUES ('10', 'Nicht einhaltender Priorität eines Rettungsfahrzeuges', '90', '0'); +INSERT INTO `fine_types` VALUES ('11', 'Nicht angehalten nach Aufforderung', '105', '0'); +INSERT INTO `fine_types` VALUES ('12', 'Bei Rot über die Ampel', '130', '0'); +INSERT INTO `fine_types` VALUES ('13', 'gefährliches Überholmanöver', '100', '0'); +INSERT INTO `fine_types` VALUES ('14', 'Fahrzeug nicht Verkehrstauglich', '100', '0'); +INSERT INTO `fine_types` VALUES ('15', 'Fahren ohne Lizenz', '1500', '0'); +INSERT INTO `fine_types` VALUES ('16', 'Hit and Run', '800', '0'); +INSERT INTO `fine_types` VALUES ('17', 'zu schnell < 5 kmh', '90', '0'); +INSERT INTO `fine_types` VALUES ('18', 'zu schnell 5-15 kmh', '120', '0'); +INSERT INTO `fine_types` VALUES ('19', 'zu schnell 15-30 kmh', '180', '0'); +INSERT INTO `fine_types` VALUES ('20', 'zu schnell > 30 kmh', '300', '0'); +INSERT INTO `fine_types` VALUES ('21', 'Verkehrsbehinderung', '110', '1'); +INSERT INTO `fine_types` VALUES ('22', 'Nicht Benutzung öffentlicher Straßen', '90', '1'); +INSERT INTO `fine_types` VALUES ('23', 'Störung der öffentlichen Ordnung', '90', '1'); +INSERT INTO `fine_types` VALUES ('24', 'Polizeieinsatz behindern', '130', '1'); +INSERT INTO `fine_types` VALUES ('25', 'Beildigung an Zivilist', '75', '1'); +INSERT INTO `fine_types` VALUES ('26', 'Polizist geringschätzen', '110', '1'); +INSERT INTO `fine_types` VALUES ('27', 'verbale Bedrohung an Zivilist', '90', '1'); +INSERT INTO `fine_types` VALUES ('28', 'verbale Bedrohung an Polizist', '150', '1'); +INSERT INTO `fine_types` VALUES ('29', 'Illegale Demonstration', '250', '1'); +INSERT INTO `fine_types` VALUES ('30', 'versuchte Bestechung', '1500', '1'); +INSERT INTO `fine_types` VALUES ('31', 'Mit Messer in der Stadt bewaffnet', '120', '2'); +INSERT INTO `fine_types` VALUES ('32', 'Mit tötlicher Waffe bewaffnet', '300', '2'); +INSERT INTO `fine_types` VALUES ('33', 'Unbefugter Besitz einer Waffe (Standard-Lizenz)', '600', '2'); +INSERT INTO `fine_types` VALUES ('34', 'Illegale Waffe', '700', '2'); +INSERT INTO `fine_types` VALUES ('35', 'Einbruch/Aufbruch', '300', '2'); +INSERT INTO `fine_types` VALUES ('36', 'Autodiebstahl', '1800', '2'); +INSERT INTO `fine_types` VALUES ('37', 'Drogenverkauf', '1500', '2'); +INSERT INTO `fine_types` VALUES ('38', 'Drogen herstellen', '1500', '2'); +INSERT INTO `fine_types` VALUES ('39', 'Drogenbesitz', '650', '2'); +INSERT INTO `fine_types` VALUES ('40', 'Zivile Geisel genommen', '1500', '2'); +INSERT INTO `fine_types` VALUES ('41', 'Geiselnahme', '2000', '2'); +INSERT INTO `fine_types` VALUES ('42', 'Waghalsiges Lenken', '650', '2'); +INSERT INTO `fine_types` VALUES ('43', 'Ladenraub', '650', '2'); +INSERT INTO `fine_types` VALUES ('44', 'Bankraub', '1500', '2'); +INSERT INTO `fine_types` VALUES ('45', 'Schießen auf Zivilisten', '2000', '3'); +INSERT INTO `fine_types` VALUES ('46', 'Schießen auf Beamten', '2500', '3'); +INSERT INTO `fine_types` VALUES ('47', 'versuchterMord an Zivilisten', '3000', '3'); +INSERT INTO `fine_types` VALUES ('48', 'versuchter Mord an einem Beamten', '5000', '3'); +INSERT INTO `fine_types` VALUES ('49', 'Mord an Zivilisten', '10000', '3'); +INSERT INTO `fine_types` VALUES ('50', 'Mord an Beamten', '30000', '3'); +INSERT INTO `fine_types` VALUES ('51', 'versehentlicher Mord', '1800', '3'); +INSERT INTO `fine_types` VALUES ('52', 'Firmenbetrug', '2000', '2'); +; \ No newline at end of file diff --git a/locales/de.lua b/locales/de.lua new file mode 100644 index 00000000..2a06348e --- /dev/null +++ b/locales/de.lua @@ -0,0 +1,91 @@ +Locales['de'] = { + --Cloackroom + ['cloakroom'] = 'Garderobe', + ['citizen_wear'] = 'Zivilkleidung', + ['police_wear'] = 'Arbeitskleidung', + ['open_cloackroom'] = 'Drücke ~INPUT_CONTEXT~ um dich umzuziehen', + --Armory + ['get_weapon'] = 'Waffen holen', + ['put_weapon'] = 'Waffen bringen', + ['buy_weapons'] = 'Waffen kaufen', + ['armory'] = 'Waffenkammer', + ['open_armory'] = 'Drücke ~INPUT_CONTEXT~ um die Waffenkammer zu öffnen', + --Vehicles + ['vehicle_menu'] = 'Fahrzeug', + ['vehicle_out'] = 'es ist bereits ein Fahrzeug draussen', + ['vehicle_spawner'] = 'Drücke ~INPUT_CONTEXT~ um ein Fahrzeug zu holen', + ['store_vehicle'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', + ['service_max'] = 'Max Polizisten im Dienst : ', + --Action Menu + ['citizen_interaction'] = 'Zivilistenaktionen', + ['vehicle_interaction'] = 'Fahrzeuginteraktionen', + ['object_spawner'] = 'Objekt Spawner', + + ['id_card'] = 'ID Karte', + ['search'] = 'Suche', + ['handcuff'] = 'Festnehmen / Freilassen', + ['put_in_vehicle'] = 'In Fahrzeug setzen', + ['fine'] = 'Strafe', + ['no_players_nearby'] = 'Keine Spieler in der Nähe', + + ['vehicle_info'] = 'Fahrzeug Info', + ['pick_lock'] = 'Fahrzeug öffnen', + ['vehicle_unlocked'] = 'Fahrzeug ~g~offen~s~', + ['no_vehicles_nearby'] = 'Keine Fahrzeuge in der Nähe', + ['traffic_interaction'] = 'Straßeninteraktionen', + ['cone'] = 'Hütchen', + ['barrier'] = 'Barriere', + ['spikestrips'] = 'Nagelband', + ['box'] = 'Box', + ['cash'] = 'Box mit Geld', + --ID Card Menu + ['name'] = 'name : ', + ['bac'] = 'bAC : ', + --Body Search Menu + ['confiscate_dirty'] = 'Schwarzgeld konfesziert : $', + ['guns_label'] = '--- Waffen ---', + ['confiscate'] = 'konfeszieren ', + ['inventory_label'] = '--- Inventar ---', + ['confiscate_inv'] = 'konfeziere x', + + ['traffic_offense'] = 'Verkehrs vergehen', + ['minor_offense'] = 'Geringes vergehen', + ['average_offense'] = 'Normales vergehen', + ['major_offense'] = 'Hohes vergehen', + ['fine_total'] = 'Strafe : ', + --Vehicle Info Menu + ['plate'] = 'Plate: ', + ['owner_unknown'] = 'Besitzer : Unbekannt', + ['owner'] = 'Besitzer : ', + --Weapons Menus + ['get_weapon_menu'] = 'Waffenkammer - Waffen nehmen', + ['put_weapon_menu'] = 'Waffenkammer - Waffen bringen', + ['buy_weapon_menu'] = 'Waffenkammer - Waffen kaufen', + ['not_enough_money'] = 'Du hast nicht genug Geld', + --Boss Menu + ['take_company_money'] = 'Firmengeld abheben', + ['deposit_money'] = 'Geld einzahlen', + ['amount_of_withdrawal'] = 'Betrag zum abheben', + ['invalid_amount'] = 'ungültiger Betrag', + ['amount_of_deposit'] = 'Betrag zum einzahlen', + ['open_bossmenu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', + --Misc + ['remove_object'] = 'Drücke ~INPUT_CONTEXT~ um das Objekt zu entfernen', + ['map_blip'] = 'Polizeistation', + --Notifications + ['from'] = '~s~ von ~b~', + ['you_have_confinv'] = 'du hast ~y~x konfesziert', + ['confinv'] = '~s~ hat von dir ~y~x konfesziert', + ['you_have_confdm'] = 'du hast ~y~$ konfesziert', + ['confdm'] = '~s~ hat von dir ~y~$ konfesziert', + ['you_have_confweapon'] = 'du hast ~y~x1 konfesziert', + ['confweapon'] = '~s~ hat von dir ~y~x1 konfesziert', + ['alert_police'] = 'Polizei alamieren', + --Authorized Vehicles + ['police'] = 'Streifenfahrzeug 1', + ['police2'] = 'Streifenfahrzeug 2', + ['police3'] = 'Streifenfahrzeug 3', + ['police4'] = 'Zivilfahrzeug', + ['policeb'] = 'Motorrad', + ['policet'] = 'Transporter', +} \ No newline at end of file From 755d11b8920745b5917f054d356b038b444fecfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Thu, 31 Aug 2017 11:08:29 +0200 Subject: [PATCH 028/253] Fix helicpoter spawn --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index b37eeb9a..b5a05f3c 100644 --- a/client/main.lua +++ b/client/main.lua @@ -956,7 +956,7 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu local helicopters = Config.PoliceStations[station].Helicopters local vehicle = GetClosestVehicle(helicopters[partNum].SpawnPoint.x, helicopters[partNum].SpawnPoint.y, helicopters[partNum].SpawnPoint.z, 3.0, 0, 71) - if DoesEntityExist(vehicle) then + if not DoesEntityExist(vehicle) then ESX.Game.SpawnVehicle('polmav', { x = helicopters[partNum].SpawnPoint.x, From 0c33748f9dbd810a4c604e470b94d32ea9afeaf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Thu, 31 Aug 2017 13:28:25 +0200 Subject: [PATCH 029/253] Helicopter fix #2 --- client/main.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index b5a05f3c..8df0062b 100644 --- a/client/main.lua +++ b/client/main.lua @@ -954,9 +954,8 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu if part == 'HelicopterSpawner' then local helicopters = Config.PoliceStations[station].Helicopters - local vehicle = GetClosestVehicle(helicopters[partNum].SpawnPoint.x, helicopters[partNum].SpawnPoint.y, helicopters[partNum].SpawnPoint.z, 3.0, 0, 71) - if not DoesEntityExist(vehicle) then + if not IsAnyVehicleNearPoint(helicopters[partNum].SpawnPoint.x, helicopters[partNum].SpawnPoint.y, helicopters[partNum].SpawnPoint.z, 3.0) then ESX.Game.SpawnVehicle('polmav', { x = helicopters[partNum].SpawnPoint.x, From 0f9436bc6d5591f0fbb84e6f149fd5b789c50c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sat, 2 Sep 2017 00:42:05 +0200 Subject: [PATCH 030/253] Use new phone --- server/main.lua | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/server/main.lua b/server/main.lua index ed21ebd2..b97d9624 100644 --- a/server/main.lua +++ b/server/main.lua @@ -6,6 +6,8 @@ if Config.MaxInService ~= -1 then TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) end +TriggerEvent('esx_phone:registerNumber', 'police', _('alert_police'), true, true) + RegisterServerEvent('esx_policejob:giveWeapon') AddEventHandler('esx_policejob:giveWeapon', function(weapon, ammo) local xPlayer = ESX.GetPlayerFromId(source) @@ -265,21 +267,3 @@ ESX.RegisterServerCallback('esx_policejob:buy', function(source, cb, amount) end) end) - -TriggerEvent('esx_phone:registerCallback', function(source, phoneNumber, message, anon) - - local xPlayer = ESX.GetPlayerFromId(source) - local xPlayers = ESX.GetPlayers() - - if phoneNumber == 'police' then - for i=1, #xPlayers, 1 do - local xPlayer2 = ESX.GetPlayerFromId(xPlayers[i]) - if xPlayer2.job.name == 'police' then - TriggerEvent('esx_phone:getDistpatchRequestId', function(requestId) - TriggerClientEvent('esx_phone:onMessage', xPlayer2.source, xPlayer.get('phoneNumber'), message, xPlayer.get('coords'), anon, _('alert_police'), requestId) - end) - end - end - end - -end) \ No newline at end of file From 758a7b96e64a55903483d83ab7e9eb755c433a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sun, 3 Sep 2017 12:24:28 +0200 Subject: [PATCH 031/253] Use new boss menu + Add chest --- client/main.lua | 179 +++++++++++++++++++++++------------ de_esx_policejob_full.sql | 4 + de_esx_policejob_minimal.sql | 4 + esx_policejob_en_full.sql | 4 + esx_policejob_en_minimal.sql | 4 + esx_policejob_full.sql | 4 + esx_policejob_minimal.sql | 4 + server/main.lua | 63 ++++++++++++ 8 files changed, 205 insertions(+), 61 deletions(-) diff --git a/client/main.lua b/client/main.lua index 8df0062b..5b858f37 100644 --- a/client/main.lua +++ b/client/main.lua @@ -136,7 +136,15 @@ function OpenArmoryMenu(station) if data.current.value == 'buy_weapons' then OpenBuyWeaponsMenu(station) - end + end + + if data.current.value == 'put_stock' then + OpenPutStocksMenu() + end + + if data.current.value == 'get_stock' then + OpenGetStocksMenu() + end end, function(data, menu) @@ -827,84 +835,121 @@ function OpenBuyWeaponsMenu(station) end -function OpenBossActionsMenu() +function OpenGetStocksMenu() - ESX.UI.Menu.CloseAll() + ESX.TriggerServerCallback('esx_policejob:getStockItems', function(items) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'realestateagent', - { - title = PlayerData.job.grade_label, - elements = { - {label = _U('take_company_money'), value = 'withdraw_society_money'}, - {label = _U('deposit_money'), value = 'deposit_money'}, - } - }, - function(data, menu) + print(json.encode(items)) - if data.current.value == 'withdraw_society_money' then + local elements = {} + + for i=1, #items, 1 do + table.insert(elements, {label = 'x' .. items[i].count .. ' ' .. items[i].label, value = items[i].name}) + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'stocks_menu', + { + title = 'Police Stock', + elements = elements + }, + function(data, menu) + + local itemName = data.current.value ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'withdraw_society_money_amount', + 'dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { - title = _U('amount_of_withdrawal') + title = 'Quantité' }, - function(data, menu) + function(data2, menu2) - local amount = tonumber(data.value) + local count = tonumber(data2.value) - if amount == nil then - ESX.ShowNotification(_U('invalid_amount')) + if count == nil then + ESX.ShowNotification('Quantité invalide') else - menu.close() - TriggerServerEvent('esx_society:withdrawMoney', 'police', amount) + menu2.close() + menu.close() + OpenGetStocksMenu() + + TriggerServerEvent('esx_policejob:getStockItem', itemName, count) end end, - function(data, menu) - menu.close() + function(data2, menu2) + menu2.close() end ) + end, + function(data, menu) + menu.close() + end + ) + + end) + +end + +function OpenPutStocksMenu() + + ESX.TriggerServerCallback('esx_policejob:getPlayerInventory', function(inventory) + + local elements = {} + + for i=1, #inventory.items, 1 do + + local item = inventory.items[i] + + if item.count > 0 then + table.insert(elements, {label = item.label .. ' x' .. item.count, type = 'item_standard', value = item.name}) end - if data.current.value == 'deposit_money' then - - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'deposit_money_amount', - { - title = _U('amount_of_deposit') - }, - function(data, menu) - - local amount = tonumber(data.value) - - if amount == nil then - ESX.ShowNotification(_U('invalid_amount')) - else - menu.close() - TriggerServerEvent('esx_society:depositMoney', 'police', amount) - end - - end, - function(data, menu) - menu.close() - end - ) - - end - - end, - function(data, menu) - - menu.close() - - CurrentAction = 'menu_boss_actions' - CurrentActionMsg = _U('open_bossmenu') - CurrentActionData = {} - end - ) + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'stocks_menu', + { + title = 'Inventaire', + elements = elements + }, + function(data, menu) + + local itemName = data.current.value + + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', + { + title = 'Quantité' + }, + function(data2, menu2) + + local count = tonumber(data2.value) + + if count == nil then + ESX.ShowNotification('Quantité invalide') + else + menu2.close() + menu.close() + OpenPutStocksMenu() + + TriggerServerEvent('esx_policejob:putStockItems', itemName, count) + end + + end, + function(data2, menu2) + menu2.close() + end + ) + + end, + function(data, menu) + menu.close() + end + ) + + end) end @@ -1420,7 +1465,19 @@ Citizen.CreateThread(function() end if CurrentAction == 'menu_boss_actions' then - OpenBossActionsMenu() + + ESX.UI.menu.CloseAll() + + TriggerEvent('esx_society:openBossMenu', 'police', function(data, menu) + + menu.close() + + CurrentAction = 'menu_boss_actions' + CurrentActionMsg = _U('open_bossmenu') + CurrentActionData = {} + + end) + end if CurrentAction == 'remove_entity' then diff --git a/de_esx_policejob_full.sql b/de_esx_policejob_full.sql index a13e74fe..7889aae5 100644 --- a/de_esx_policejob_full.sql +++ b/de_esx_policejob_full.sql @@ -6,6 +6,10 @@ INSERT INTO `datastore` (name, label, shared) VALUES ('society_police','Polizei',1) ; +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Polizei', 1) +; + INSERT INTO `jobs` (name, label) VALUES ('police','LSPD') ; diff --git a/de_esx_policejob_minimal.sql b/de_esx_policejob_minimal.sql index d0d67a2b..0a4e0d61 100644 --- a/de_esx_policejob_minimal.sql +++ b/de_esx_policejob_minimal.sql @@ -9,6 +9,10 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Polizei', 1) +; + CREATE TABLE `fine_types` ( `id` int(11) NOT NULL AUTO_INCREMENT, diff --git a/esx_policejob_en_full.sql b/esx_policejob_en_full.sql index be26c653..c21720ae 100644 --- a/esx_policejob_en_full.sql +++ b/esx_policejob_en_full.sql @@ -6,6 +6,10 @@ INSERT INTO `datastore` (name, label, shared) VALUES ('society_police','Police',1) ; +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + INSERT INTO `jobs` (name, label) VALUES ('police','LSPD') ; diff --git a/esx_policejob_en_minimal.sql b/esx_policejob_en_minimal.sql index 35fd99df..f28257d6 100644 --- a/esx_policejob_en_minimal.sql +++ b/esx_policejob_en_minimal.sql @@ -9,6 +9,10 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + CREATE TABLE `fine_types` ( `id` int(11) NOT NULL AUTO_INCREMENT, diff --git a/esx_policejob_full.sql b/esx_policejob_full.sql index 3c26e954..f0eb8786 100644 --- a/esx_policejob_full.sql +++ b/esx_policejob_full.sql @@ -6,6 +6,10 @@ INSERT INTO `datastore` (name, label, shared) VALUES ('society_police','Police',1) ; +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + INSERT INTO `jobs` (name, label) VALUES ('police','LSPD') ; diff --git a/esx_policejob_minimal.sql b/esx_policejob_minimal.sql index 0105430d..ee413e4c 100644 --- a/esx_policejob_minimal.sql +++ b/esx_policejob_minimal.sql @@ -9,6 +9,10 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + CREATE TABLE `fine_types` ( `id` int(11) NOT NULL AUTO_INCREMENT, diff --git a/server/main.lua b/server/main.lua index b97d9624..3fbb6288 100644 --- a/server/main.lua +++ b/server/main.lua @@ -64,6 +64,50 @@ AddEventHandler('esx_policejob:putInVehicle', function(target) TriggerClientEvent('esx_policejob:putInVehicle', target) end) +RegisterServerEvent('esx_policejob:getStockItem') +AddEventHandler('esx_policejob:getStockItem', function(itemName, count) + + local xPlayer = ESX.GetPlayerFromId(source) + + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_policestock', function(inventory) + + local item = inventory.getItem(itemName) + + if item.count >= count then + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Quantité invalide') + end + + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez retiré x' .. count .. ' ' .. item.label) + + end) + +end) + +RegisterServerEvent('esx_policejob:putStockItems') +AddEventHandler('esx_policejob:putStockItems', function(itemName, count) + + local xPlayer = ESX.GetPlayerFromId(source) + + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_policestock', function(inventory) + + local item = inventory.getItem(itemName) + + if item.count >= 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Quantité invalide') + end + + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez ajouté x' .. count .. ' ' .. item.label) + + end) + +end) + ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, cb, target) local xPlayer = ESX.GetPlayerFromId(target) @@ -267,3 +311,22 @@ ESX.RegisterServerCallback('esx_policejob:buy', function(source, cb, amount) end) end) + +ESX.RegisterServerCallback('esx_policejob:getStockItems', function(source, cb) + + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_policestock', function(inventory) + cb(inventory.items) + end) + +end) + +ESX.RegisterServerCallback('esx_policejob:getPlayerInventory', function(source, cb) + + local xPlayer = ESX.GetPlayerFromId(source) + local items = xPlayer.inventory + + cb({ + items = items + }) + +end) \ No newline at end of file From a9c4c3e3427e3740dc37940e9df60ab34b0420b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sun, 3 Sep 2017 13:10:30 +0200 Subject: [PATCH 032/253] Fix typo --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 5b858f37..57dcf625 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1466,7 +1466,7 @@ Citizen.CreateThread(function() if CurrentAction == 'menu_boss_actions' then - ESX.UI.menu.CloseAll() + ESX.UI.Menu.CloseAll() TriggerEvent('esx_society:openBossMenu', 'police', function(data, menu) From 73bd5539b02ef38b2c50292d78772efd9561b74c Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Sun, 3 Sep 2017 15:36:57 -0400 Subject: [PATCH 033/253] Update Multi-Language Support --- client/main.lua | 12 ++++++------ locales/en.lua | 6 ++++++ locales/fr.lua | 6 ++++++ server/main.lua | 10 +++++----- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/client/main.lua b/client/main.lua index 57dcf625..9cc699f5 100644 --- a/client/main.lua +++ b/client/main.lua @@ -850,7 +850,7 @@ function OpenGetStocksMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'stocks_menu', { - title = 'Police Stock', + title = _U('police_stock'), elements = elements }, function(data, menu) @@ -860,14 +860,14 @@ function OpenGetStocksMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { - title = 'Quantité' + title = _U('quantity') }, function(data2, menu2) local count = tonumber(data2.value) if count == nil then - ESX.ShowNotification('Quantité invalide') + ESX.ShowNotification(_U('quantity_invalid')) else menu2.close() menu.close() @@ -911,7 +911,7 @@ function OpenPutStocksMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'stocks_menu', { - title = 'Inventaire', + title = _U('inventory'), elements = elements }, function(data, menu) @@ -921,14 +921,14 @@ function OpenPutStocksMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { - title = 'Quantité' + title = _U('quantity') }, function(data2, menu2) local count = tonumber(data2.value) if count == nil then - ESX.ShowNotification('Quantité invalide') + ESX.ShowNotification(_U('quantity_invalid')) else menu2.close() menu.close() diff --git a/locales/en.lua b/locales/en.lua index 4f0a9562..16e9347d 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -69,6 +69,12 @@ Locales['en'] = { ['invalid_amount'] = 'amount Invalid', ['amount_of_deposit'] = 'amount of Deposit', ['open_bossmenu'] = 'press ~INPUT_CONTEXT~ to open the menu', + ['quantity_invalid'] = 'invalid quantity', + ['have_withdraw'] = 'you have withdrawn x', + ['added'] = 'you added x', + ['quantity'] = 'quantity', + ['inventory'] = 'inventory', + ['police_stock'] = 'Police Stock', --Misc ['remove_object'] = 'press ~INPUT_CONTEXT~ to delete the object', ['map_blip'] = 'police Station', diff --git a/locales/fr.lua b/locales/fr.lua index 6756fbeb..34fcb76a 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -69,6 +69,12 @@ Locales['fr'] = { ['invalid_amount'] = 'montant invalide', ['amount_of_deposit'] = 'montant du dépôt', ['open_bossmenu'] = 'appuez sur ~INPUT_CONTEXT~ pour ouvrir le menu', + ['quantity_invalid'] = 'Quantité invalide', + ['have_withdrawn'] = 'Vous avez retiré x', + ['added'] = 'Vous avez ajouté x', + ['quantity'] = 'Quantité', + ['inventory'] = 'inventaire', + ['police_stock'] = 'Police Stock', --Misc ['remove_object'] = 'appuez sur ~INPUT_CONTEXT~ pour enlever l\'objet', ['map_blip'] = 'Commissariat', diff --git a/server/main.lua b/server/main.lua index 3fbb6288..e95c3dd8 100644 --- a/server/main.lua +++ b/server/main.lua @@ -6,7 +6,7 @@ if Config.MaxInService ~= -1 then TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) end -TriggerEvent('esx_phone:registerNumber', 'police', _('alert_police'), true, true) +TriggerEvent('esx_phone:registerNumber', 'police', _U('alert_police'), true, true) RegisterServerEvent('esx_policejob:giveWeapon') AddEventHandler('esx_policejob:giveWeapon', function(weapon, ammo) @@ -77,10 +77,10 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count) inventory.removeItem(itemName, count) xPlayer.addInventoryItem(itemName, count) else - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Quantité invalide') + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) end - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez retiré x' .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) end) @@ -99,10 +99,10 @@ AddEventHandler('esx_policejob:putStockItems', function(itemName, count) xPlayer.removeInventoryItem(itemName, count) inventory.addItem(itemName, count) else - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Quantité invalide') + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) end - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez ajouté x' .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('added') .. count .. ' ' .. item.label) end) From 6270ad297ad17c18a27144d58cf2d02286e99c23 Mon Sep 17 00:00:00 2001 From: renaiku Date: Mon, 4 Sep 2017 19:50:17 +0200 Subject: [PATCH 034/253] Add 'drag' when handcuffed in citizen interaction --- client/main.lua | 29 +++++++++++++++++++++++++++++ locales/fr.lua | 1 + server/main.lua | 6 ++++++ 3 files changed, 36 insertions(+) diff --git a/client/main.lua b/client/main.lua index 9cc699f5..8a85f61c 100644 --- a/client/main.lua +++ b/client/main.lua @@ -23,6 +23,8 @@ local CurrentAction = nil local CurrentActionMsg = '' local CurrentActionData = {} local IsHandcuffed = false +local IsDragged = false +local CopPed = 0 Citizen.CreateThread(function() while ESX == nil do @@ -305,6 +307,7 @@ function OpenPoliceActionsMenu() {label = _U('id_card'), value = 'identity_card'}, {label = _U('search'), value = 'body_search'}, {label = _U('handcuff'), value = 'handcuff'}, + {label = _U('drag'), value = 'drag'}, {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, {label = _U('fine'), value = 'fine'} }, @@ -327,6 +330,10 @@ function OpenPoliceActionsMenu() TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(player)) end + if data2.current.value == 'drag' then + TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(player)) + end + if data2.current.value == 'put_in_vehicle' then TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(player)) end @@ -1117,6 +1124,28 @@ AddEventHandler('esx_policejob:handcuff', function() end) end) +RegisterNetEvent('esx_policejob:drag') +AddEventHandler('esx_policejob:drag', function(cop) + TriggerServerEvent('esx:clientLog', 'starting dragging') + IsDragged = not IsDragged + CopPed = tonumber(cop) +end) + +Citizen.CreateThread(function() + while true do + Wait(0) + if IsHandcuffed then + if IsDragged then + local ped = GetPlayerPed(GetPlayerFromServerId(CopPed)) + local myped = GetPlayerPed(-1) + AttachEntityToEntity(myped, ped, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) + else + DetachEntity(GetPlayerPed(-1), true, false) + end + end + end +end) + RegisterNetEvent('esx_policejob:putInVehicle') AddEventHandler('esx_policejob:putInVehicle', function() diff --git a/locales/fr.lua b/locales/fr.lua index 34fcb76a..493ab5c2 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -24,6 +24,7 @@ Locales['fr'] = { ['id_card'] = 'carte d\'identité', ['search'] = 'fouiller', ['handcuff'] = 'menotter / Démenotter', + ['drag'] = 'escorter', ['put_in_vehicle'] = 'mettre dans véhicule', ['fine'] = 'Amende', ['no_players_nearby'] = 'aucun joueur à proximité', diff --git a/server/main.lua b/server/main.lua index e95c3dd8..b938d860 100644 --- a/server/main.lua +++ b/server/main.lua @@ -59,6 +59,12 @@ AddEventHandler('esx_policejob:handcuff', function(target) TriggerClientEvent('esx_policejob:handcuff', target) end) +RegisterServerEvent('esx_policejob:drag') +AddEventHandler('esx_policejob:drag', function(target) + local _source = source + TriggerClientEvent('esx_policejob:drag', target, _source) +end) + RegisterServerEvent('esx_policejob:putInVehicle') AddEventHandler('esx_policejob:putInVehicle', function(target) TriggerClientEvent('esx_policejob:putInVehicle', target) From ea17d7504044006a0d3f14037e30a3624a3b47d7 Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Mon, 4 Sep 2017 14:05:11 -0400 Subject: [PATCH 035/253] Update multi-language support --- locales/en.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/en.lua b/locales/en.lua index 16e9347d..232feafc 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -24,6 +24,7 @@ Locales['en'] = { ['id_card'] = 'iD Card', ['search'] = 'search', ['handcuff'] = 'cuff / Uncuff', + ['drag'] = 'drag', ['put_in_vehicle'] = 'put in Vehicle', ['fine'] = 'fine', ['no_players_nearby'] = 'no players nearby', From 900173887f3833606131e4be34be8cbbfe852ce4 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Mon, 4 Sep 2017 20:12:18 -0500 Subject: [PATCH 036/253] Update main.lua --- server/main.lua | 58 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/server/main.lua b/server/main.lua index b938d860..823ce96d 100644 --- a/server/main.lua +++ b/server/main.lua @@ -116,16 +116,30 @@ end) ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, cb, target) + if Config.EnableGCIdentity then + local xPlayer = ESX.GetPlayerFromId(target) - + + local identifier = GetPlayerIdentifiers(target)[1] + + local result = MySQL.Sync.fetchAll("SELECT firstname, lastname, sex, dateofbirth, height FROM users WHERE identifier = @identifier", { + ['@identifier'] = identifier + }) + + local user = result[1] + local firstname = user['firstname'] + local lastname = user['lastname'] + local data = { - name = GetPlayerName(target), - job = xPlayer.job, - inventory = xPlayer.inventory, - accounts = xPlayer.accounts, - weapons = xPlayer.loadout + name = GetPlayerName(target), + job = xPlayer.job, + inventory = xPlayer.inventory, + accounts = xPlayer.accounts, + weapons = xPlayer.loadout, + firstname = firstname, + lastname = lastname } - + TriggerEvent('esx_status:getStatus', _source, 'drunk', function(status) if status ~= nil then @@ -139,6 +153,34 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, end) cb(data) + + else + + local xPlayer = ESX.GetPlayerFromId(target) + + local data = { + name = GetPlayerName(target), + job = xPlayer.job, + inventory = xPlayer.inventory, + accounts = xPlayer.accounts, + weapons = xPlayer.loadout + } + + TriggerEvent('esx_status:getStatus', _source, 'drunk', function(status) + + if status ~= nil then + data.drunk = status.getPercent() + end + + end) + + TriggerEvent('esx_license:getLicenses', _source, function(licenses) + data.licenses = licenses + end) + + cb(data) + + end end) @@ -335,4 +377,4 @@ ESX.RegisterServerCallback('esx_policejob:getPlayerInventory', function(source, items = items }) -end) \ No newline at end of file +end) From 31e9cbf88c23288574a64958a32ffffedfffddf8 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Mon, 4 Sep 2017 20:13:51 -0500 Subject: [PATCH 037/253] Update main.lua --- client/main.lua | 125 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 88 insertions(+), 37 deletions(-) diff --git a/client/main.lua b/client/main.lua index 8a85f61c..3bd6c0ed 100644 --- a/client/main.lua +++ b/client/main.lua @@ -481,54 +481,105 @@ end function OpenIdentityCardMenu(player) - ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + if Config.EnableGCIdentity then + + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - local jobLabel = nil + local jobLabel = nil - if data.job.grade_label ~= nil and data.job.grade_label ~= '' then - jobLabel = 'Job : ' .. data.job.label .. ' - ' .. data.job.grade_label - else - jobLabel = 'Job : ' .. data.job.label - end + if data.job.grade_label ~= nil and data.job.grade_label ~= '' then + jobLabel = 'Job : ' .. data.job.label .. ' - ' .. data.job.grade_label + else + jobLabel = 'Job : ' .. data.job.label + end + + local elements = { + {label = _U('name') .. data.firstname .. " " .. data.lastname, value = nil}, + {label = jobLabel, value = nil}, + } - local elements = { - {label = _U('name') .. data.name, value = nil}, - {label = jobLabel, value = nil}, - } - - if data.drunk ~= nil then - table.insert(elements, {label = _U('bac') .. data.drunk .. '%', value = nil}) - end - - if data.licenses ~= nil then - - table.insert(elements, {label = '--- Licenses ---', value = nil}) - - for i=1, #data.licenses, 1 do - table.insert(elements, {label = data.licenses[i].label, value = nil}) + if data.drunk ~= nil then + table.insert(elements, {label = _U('bac') .. data.drunk .. '%', value = nil}) end - end + if data.licenses ~= nil then - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { - title = _U('citizen_interaction'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + table.insert(elements, {label = '--- Licenses ---', value = nil}) + + for i=1, #data.licenses, 1 do + table.insert(elements, {label = data.licenses[i].label, value = nil}) + end - end, - function(data, menu) - menu.close() end - ) - end, GetPlayerServerId(player)) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = _U('citizen_interaction'), + align = 'top-left', + elements = elements, + }, + function(data, menu) + + end, + function(data, menu) + menu.close() + end + ) + + end, GetPlayerServerId(player)) + + else + + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + + local jobLabel = nil + + if data.job.grade_label ~= nil and data.job.grade_label ~= '' then + jobLabel = 'Job : ' .. data.job.label .. ' - ' .. data.job.grade_label + else + jobLabel = 'Job : ' .. data.job.label + end + + local elements = { + {label = _U('name') .. data.name, value = nil}, + {label = jobLabel, value = nil}, + } + + if data.drunk ~= nil then + table.insert(elements, {label = _U('bac') .. data.drunk .. '%', value = nil}) + end + + if data.licenses ~= nil then + + table.insert(elements, {label = '--- Licenses ---', value = nil}) + + for i=1, #data.licenses, 1 do + table.insert(elements, {label = data.licenses[i].label, value = nil}) + end + + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = _U('citizen_interaction'), + align = 'top-left', + elements = elements, + }, + function(data, menu) + + end, + function(data, menu) + menu.close() + end + ) + + end, GetPlayerServerId(player)) + + end end - function OpenBodySearchMenu(player) ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) From 0b291ad4d253637c92c30279f89455f04163fd10 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Mon, 4 Sep 2017 20:14:19 -0500 Subject: [PATCH 038/253] Update config.lua --- config.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.lua b/config.lua index b111e511..55f7aa9e 100644 --- a/config.lua +++ b/config.lua @@ -5,6 +5,7 @@ Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false +Config.EnableGCIdentity = false Config.MaxInService = -1 Config.Locale = 'fr' @@ -75,4 +76,4 @@ Config.PoliceStations = { } -} \ No newline at end of file +} From 014fe0c862c5d2eecbdef1680ff7816c1fbd15a5 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Mon, 4 Sep 2017 20:21:42 -0500 Subject: [PATCH 039/253] Update main.lua --- client/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/client/main.lua b/client/main.lua index 3bd6c0ed..cc212948 100644 --- a/client/main.lua +++ b/client/main.lua @@ -580,6 +580,7 @@ function OpenIdentityCardMenu(player) end end + function OpenBodySearchMenu(player) ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) From adb229e006ab9bd76d9a823dc60611def665d3c4 Mon Sep 17 00:00:00 2001 From: Don Date: Mon, 4 Sep 2017 22:52:43 -0700 Subject: [PATCH 040/253] Add custom ped option Add custom ped option Thank you to @GiZz and @SuperCoolNinja --- client/main.lua | 294 +++++++++++++++++++++++++++++++++++------------- config.lua | 5 +- en_config.lua | 78 +++++++++++++ locales/en.lua | 5 + locales/fr.lua | 5 + 5 files changed, 306 insertions(+), 81 deletions(-) create mode 100644 en_config.lua diff --git a/client/main.lua b/client/main.lua index cc212948..e52a75e5 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,10 +1,10 @@ local Keys = { - ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, - ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, + ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, + ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, - ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, + ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 @@ -49,29 +49,66 @@ end function OpenCloakroomMenu() + local elements = { + {label = _U('citizen_wear'), value = 'citizen_wear'}, + {label = _U('police_wear'), value = 'police_wear'} +} + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'cloakroom', - { - title = _U('cloakroom'), - align = 'top-left', - elements = { - {label = _U('citizen_wear'), value = 'citizen_wear'}, - {label = _U('police_wear'), value = 'police_wear'}, - }, - }, - function(data, menu) - + if Config.EnableNonFreemodePeds then + table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear'}) + table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear'}) + table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear'}) + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'cloakroom', + { + title = _U('cloakroom'), + align = 'top-left', + elements = elements, + }, + + function(data, menu) + menu.close() - if data.current.value == 'citizen_wear' then - - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - TriggerEvent('skinchanger:loadSkin', skin) - end) + --Taken from SuperCoolNinja + if data.current.value == 'citizen_wear' then --Ajout de tenue par grades - end + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + + if skin.sex == 0 then + + local model = GetHashKey("mp_m_freemode_01") --[FR]--Pour changer de Skin Male veuillez changer Ici ! + --[EN]--Here for change Ped Skin Model Here is for Man + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end + + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + TriggerEvent('skinchanger:loadSkin', skin) + else + local model = GetHashKey("mp_f_freemode_01") --[FR]--Pour changer de Femal Male veuillez changer Ici ! + --[EN]--Here for change Ped Skin Model Here is for Girl + + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end + + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + TriggerEvent('skinchanger:loadSkin', skin) + end + + end) + end if data.current.value == 'police_wear' then @@ -82,10 +119,109 @@ function OpenCloakroomMenu() else TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) end - + end) - end +end + --Taken from SuperCoolNinja + if data.current.value == 'sheriff_wear' then + + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + + if skin.sex == 0 then + + local model = GetHashKey("s_m_y_sheriff_01") --[FR]--Pour changer de Mal Male veuillez changer Ici ! + --[EN]--Here for change Ped Skin Model Here is for Man + + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end + + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + else + local model = GetHashKey("s_f_y_sheriff_01") --[FR]--Pour changer de Femal Male veuillez changer Ici ! + --[EN]--Here for change Ped Skin Model Here is for Girl + + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end + + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + end + + end) + end + --Taken from SuperCoolNinja + if data.current.value == 'lieutenant_wear' then --Ajout de tenue par grades + + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + + if skin.sex == 0 then + local model = GetHashKey("s_m_y_swat_01") --[FR]--Pour changer de Mal Male veuillez changer Ici ! + --[EN]--Here for change Ped Skin Model Here is for Man + + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end + + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + else + local model = GetHashKey("s_m_y_swat_01") --[FR]--Pour changer de Femal Male veuillez changer Ici ! + --[EN]--Here for change Ped Skin Model Here is for Girl + + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end + + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + end + + end) + end + --Taken from SuperCoolNinja + if data.current.value == 'commandant_wear' then --Ajout de tenue par grades + + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + + if skin.sex == 0 then + local model = GetHashKey("ig_fbisuit_01") --[FR]--Pour changer de Mal Male veuillez changer Ici ! + --[EN]--Here for change Ped Skin Model Here is for Man + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end + + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + else + local model = GetHashKey("ig_fbisuit_01") --[FR]--Pour changer de Femal Male veuillez changer Ici ! + --[EN]--Here for change Ped Skin Model Here is for Girl + + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end + + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + end + + end) + end CurrentAction = 'menu_cloakroom' CurrentActionMsg = _U('open_cloackroom') @@ -93,7 +229,7 @@ function OpenCloakroomMenu() end, function(data, menu) - + menu.close() CurrentAction = 'menu_cloakroom' @@ -138,11 +274,11 @@ function OpenArmoryMenu(station) if data.current.value == 'buy_weapons' then OpenBuyWeaponsMenu(station) - end + end if data.current.value == 'put_stock' then OpenPutStocksMenu() - end + end if data.current.value == 'get_stock' then OpenGetStocksMenu() @@ -150,7 +286,7 @@ function OpenArmoryMenu(station) end, function(data, menu) - + menu.close() CurrentAction = 'menu_armory' @@ -230,8 +366,8 @@ function OpenVehicleSpawnerMenu(station, partNum) if Config.MaxInService == -1 then ESX.Game.SpawnVehicle(model, { - x = vehicles[partNum].SpawnPoint.x, - y = vehicles[partNum].SpawnPoint.y, + x = vehicles[partNum].SpawnPoint.x, + y = vehicles[partNum].SpawnPoint.y, z = vehicles[partNum].SpawnPoint.z }, vehicles[partNum].Heading, function(vehicle) TaskWarpPedIntoVehicle(playerPed, vehicle, -1) @@ -245,8 +381,8 @@ function OpenVehicleSpawnerMenu(station, partNum) if canTakeService then ESX.Game.SpawnVehicle(model, { - x = vehicles[partNum].SpawnPoint.x, - y = vehicles[partNum].SpawnPoint.y, + x = vehicles[partNum].SpawnPoint.x, + y = vehicles[partNum].SpawnPoint.y, z = vehicles[partNum].SpawnPoint.z }, vehicles[partNum].Heading, function(vehicle) TaskWarpPedIntoVehicle(playerPed, vehicle, -1) @@ -280,7 +416,7 @@ function OpenVehicleSpawnerMenu(station, partNum) end function OpenPoliceActionsMenu() - + ESX.UI.Menu.CloseAll() ESX.UI.Menu.Open( @@ -388,7 +524,7 @@ function OpenPoliceActionsMenu() if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 3.0) then local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) - + if DoesEntityExist(vehicle) then Citizen.CreateThread(function() @@ -471,7 +607,7 @@ function OpenPoliceActionsMenu() end, function(data, menu) - + menu.close() end @@ -482,7 +618,7 @@ end function OpenIdentityCardMenu(player) if Config.EnableGCIdentity then - + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) local jobLabel = nil @@ -492,7 +628,7 @@ function OpenIdentityCardMenu(player) else jobLabel = 'Job : ' .. data.job.label end - + local elements = { {label = _U('name') .. data.firstname .. " " .. data.lastname, value = nil}, {label = jobLabel, value = nil}, @@ -528,7 +664,7 @@ function OpenIdentityCardMenu(player) ) end, GetPlayerServerId(player)) - + else ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) @@ -540,7 +676,7 @@ function OpenIdentityCardMenu(player) else jobLabel = 'Job : ' .. data.job.label end - + local elements = { {label = _U('name') .. data.name, value = nil}, {label = jobLabel, value = nil}, @@ -576,7 +712,7 @@ function OpenIdentityCardMenu(player) ) end, GetPlayerServerId(player)) - + end end @@ -586,7 +722,7 @@ function OpenBodySearchMenu(player) ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) local elements = {} - + local blackMoney = 0 for i=1, #data.accounts, 1 do @@ -625,8 +761,8 @@ function OpenBodySearchMenu(player) }) end end - - + + ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'body_search', { @@ -673,7 +809,7 @@ function OpenFineMenu(player) }, }, function(data, menu) - + OpenFineCategoryMenu(player, data.current.value) end, @@ -689,7 +825,7 @@ function OpenFineCategoryMenu(player, category) ESX.TriggerServerCallback('esx_policejob:getFineList', function(fines) local elements = {} - + for i=1, #fines, 1 do table.insert(elements, { label = fines[i].label .. ' $' .. fines[i].amount, @@ -796,7 +932,7 @@ function OpenGetWeaponMenu() menu.close() end ) - + end) end @@ -826,7 +962,7 @@ function OpenPutWeaponMenu() elements = elements, }, function(data, menu) - + menu.close() ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() @@ -848,7 +984,7 @@ function OpenBuyWeaponsMenu(station) local elements = {} for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do - + local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] local count = 0 @@ -860,7 +996,7 @@ function OpenBuyWeaponsMenu(station) end table.insert(elements, {label = 'x' .. count .. ' ' .. ESX.GetWeaponLabel(weapon.name) .. ' $' .. weapon.price, value = weapon.name, price = weapon.price}) - + end ESX.UI.Menu.Open( @@ -873,7 +1009,7 @@ function OpenBuyWeaponsMenu(station) function(data, menu) ESX.TriggerServerCallback('esx_policejob:buy', function(hasEnoughMoney) - + if hasEnoughMoney then ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() OpenBuyWeaponsMenu(station) @@ -1014,7 +1150,7 @@ end RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(xPlayer) - PlayerData = xPlayer + PlayerData = xPlayer end) RegisterNetEvent('esx:setJob') @@ -1062,8 +1198,8 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu if not IsAnyVehicleNearPoint(helicopters[partNum].SpawnPoint.x, helicopters[partNum].SpawnPoint.y, helicopters[partNum].SpawnPoint.z, 3.0) then ESX.Game.SpawnVehicle('polmav', { - x = helicopters[partNum].SpawnPoint.x, - y = helicopters[partNum].SpawnPoint.y, + x = helicopters[partNum].SpawnPoint.x, + y = helicopters[partNum].SpawnPoint.y, z = helicopters[partNum].SpawnPoint.z }, helicopters[partNum].Heading, function(vehicle) SetVehicleModKit(vehicle, 0) @@ -1152,25 +1288,25 @@ AddEventHandler('esx_policejob:handcuff', function() Citizen.CreateThread(function() if IsHandcuffed then - + RequestAnimDict('mp_arresting') - + while not HasAnimDictLoaded('mp_arresting') do Wait(100) end - + TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) SetEnableHandcuffs(playerPed, true) SetPedCanPlayGestureAnims(playerPed, false) FreezeEntityPosition(playerPed, true) - + else - + ClearPedSecondaryTask(playerPed) SetEnableHandcuffs(playerPed, false) SetPedCanPlayGestureAnims(playerPed, true) FreezeEntityPosition(playerPed, false) - + end end) @@ -1190,9 +1326,9 @@ Citizen.CreateThread(function() if IsDragged then local ped = GetPlayerPed(GetPlayerFromServerId(CopPed)) local myped = GetPlayerPed(-1) - AttachEntityToEntity(myped, ped, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) + AttachEntityToEntity(myped, ped, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) else - DetachEntity(GetPlayerPed(-1), true, false) + DetachEntity(GetPlayerPed(-1), true, false) end end end @@ -1207,7 +1343,7 @@ AddEventHandler('esx_policejob:putInVehicle', function() if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) - + if DoesEntityExist(vehicle) then local maxSeats = GetVehicleMaxNumberOfPassengers(vehicle) @@ -1226,7 +1362,7 @@ AddEventHandler('esx_policejob:putInVehicle', function() end - end + end end) @@ -1248,13 +1384,13 @@ Citizen.CreateThread(function() for k,v in pairs(Config.PoliceStations) do local blip = AddBlipForCoord(v.Blip.Pos.x, v.Blip.Pos.y, v.Blip.Pos.z) - + SetBlipSprite (blip, 60) SetBlipDisplay(blip, 4) SetBlipScale (blip, 1.2) SetBlipColour (blip, v.Blip.Color) SetBlipAsShortRange(blip, true) - + BeginTextCommandSetBlipName("STRING") AddTextComponentString(_U('map_blip')) EndTextCommandSetBlipName(blip) @@ -1266,14 +1402,14 @@ end) -- Display markers Citizen.CreateThread(function() while true do - + Wait(0) - + if PlayerData.job ~= nil and PlayerData.job.name == 'police' then local playerPed = GetPlayerPed(-1) local coords = GetEntityCoords(playerPed) - + for k,v in pairs(Config.PoliceStations) do for i=1, #v.Cloakrooms, 1 do @@ -1354,7 +1490,7 @@ Citizen.CreateThread(function() end for i=1, #v.Vehicles, 1 do - + if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.MarkerSize.x then isInMarker = true currentStation = k @@ -1372,7 +1508,7 @@ Citizen.CreateThread(function() end for i=1, #v.Helicopters, 1 do - + if GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner.x, v.Helicopters[i].Spawner.y, v.Helicopters[i].Spawner.z, true) < Config.MarkerSize.x then isInMarker = true currentStation = k @@ -1416,7 +1552,7 @@ Citizen.CreateThread(function() local hasExited = false if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) ) then - + if (LastStation ~= nil and LastPart ~= nil and LastPartNum ~= nil) and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) @@ -1429,14 +1565,14 @@ Citizen.CreateThread(function() LastStation = currentStation LastPart = currentPart LastPartNum = currentPartNum - + TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) end if not hasExited and not isInMarker and HasAlreadyEnteredMarker then - + HasAlreadyEnteredMarker = false - + TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) end @@ -1447,7 +1583,7 @@ end) -- Enter / Exit entity zone events Citizen.CreateThread(function() - + local trackedEntities = { 'prop_roadcone02a', 'prop_barrier_work06a', @@ -1467,9 +1603,9 @@ Citizen.CreateThread(function() local closestEntity = nil for i=1, #trackedEntities, 1 do - + local object = GetClosestObjectOfType(coords.x, coords.y, coords.z, 3.0, GetHashKey(trackedEntities[i]), false, false, false) - + if DoesEntityExist(object) then local objCoords = GetEntityCoords(object) @@ -1541,12 +1677,12 @@ Citizen.CreateThread(function() then TriggerServerEvent('esx_service:disableService', 'police') end - + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) end if CurrentAction == 'menu_boss_actions' then - + ESX.UI.Menu.CloseAll() TriggerEvent('esx_society:openBossMenu', 'police', function(data, menu) @@ -1567,7 +1703,7 @@ Citizen.CreateThread(function() CurrentAction = nil GUI.Time = GetGameTimer() - + end end diff --git a/config.lua b/config.lua index 55f7aa9e..1e44c8db 100644 --- a/config.lua +++ b/config.lua @@ -6,11 +6,12 @@ Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false Config.EnableGCIdentity = false +Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.MaxInService = -1 -Config.Locale = 'fr' +Config.Locale = 'fr' Config.PoliceStations = { - + LSPD = { Blip = { diff --git a/en_config.lua b/en_config.lua new file mode 100644 index 00000000..5bfb5289 --- /dev/null +++ b/en_config.lua @@ -0,0 +1,78 @@ +Config = {} +Config.DrawDistance = 100.0 +Config.MarkerType = 1 +Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} +Config.MarkerColor = {r = 50, g = 50, b = 204} +Config.EnablePlayerManagement = false +Config.EnableArmoryManagement = false +Config.EnableGCIdentity = false +Config.EnableNonFreemodePeds = false +Config.MaxInService = -1 +Config.Locale = 'en' + + LSPD = { + + Blip = { + Pos = {x = 425.130, y = -979.558, z = 30.711}, + Color = 29 + }, + + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_ASSAULTRIFLE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + {name = 'WEAPON_STICKYBOMB', price = 250}, + {name = 'GADGET_PARACHUTE', price = 300}, + }, + + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, + + Cloakrooms = { + {x = 452.600, y = -993.306, z = 29.750} + }, + + Armories = { + {x = 451.699, y = -980.356, z = 29.689} + }, + + Vehicles = { + { + Spawner = {x = 454.69, y = -1017.4, z = 27.430}, + SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, + Heading = 90.0 + } + }, + + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, + + VehicleDeleters = { + {x = 462.74, y = -1014.4, z = 27.065}, + {x = 462.40, y = -1019.7, z = 27.104} + }, + + BossActions = { + {x = 448.417, y = -973.208, z = 29.689} + } + + } + +} diff --git a/locales/en.lua b/locales/en.lua index 232feafc..135d19c4 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -3,6 +3,11 @@ Locales['en'] = { ['cloakroom'] = 'locker room', ['citizen_wear'] = 'civilian Outfit', ['police_wear'] = 'police Outfit', + ['sheriff_wear'] = 'sheriff Outfit', + ['lieutenant_wear'] = 'Swatt outfit ', + ['commandant_wear'] = 'Fbi outfit', + ['statepd_wear'] = 'State Police outfit', + ['specops_wear'] = 'Spec OPS outfit', ['open_cloackroom'] = 'press ~INPUT_CONTEXT~ to change', --Armory ['get_weapon'] = 'get Weapon', diff --git a/locales/fr.lua b/locales/fr.lua index 493ab5c2..db2b2fe7 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -3,6 +3,11 @@ Locales['fr'] = { ['cloakroom'] = 'vestiaire', ['citizen_wear'] = 'tenue Civil', ['police_wear'] = 'tenue Policier', + ['sheriff_wear'] = 'sheriff Outfit', + ['lieutenant_wear'] = 'Swatt outfit ', + ['commandant_wear'] = 'Fbi outfit', + ['statepd_wear'] = 'State Police outfit', + ['specops_wear'] = 'Spec OPS outfit', ['open_cloackroom'] = 'appuez sur ~INPUT_CONTEXT~ pour vous changer', --Armory ['get_weapon'] = 'prendre Arme', From f19bb82d9a45c03fdca73cc48794471c817589bb Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Wed, 6 Sep 2017 07:50:54 -0500 Subject: [PATCH 041/253] Update main.lua --- server/main.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/server/main.lua b/server/main.lua index 823ce96d..df7e1429 100644 --- a/server/main.lua +++ b/server/main.lua @@ -127,8 +127,14 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, }) local user = result[1] - local firstname = user['firstname'] - local lastname = user['lastname'] + local firstname = user['firstname'] + local lastname = user['lastname'] + local sex = user['sex'] + local dob = tostring(user['dateofbirth']) + local heightInit = user['height'] + local heightFeet = tonumber(string.format("%.0f",heightInit / 12, 0)) + local heightInches = heightInit % 12 + local height = heightFeet .. "\' " .. heightInches .. "\"" local data = { name = GetPlayerName(target), @@ -137,7 +143,10 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, accounts = xPlayer.accounts, weapons = xPlayer.loadout, firstname = firstname, - lastname = lastname + lastname = lastname, + sex = sex, + dob = dob, + height = height } TriggerEvent('esx_status:getStatus', _source, 'drunk', function(status) From e6ec5b859afc9bc8f2db3da0bf6c9ac39d68dd54 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Wed, 6 Sep 2017 07:52:00 -0500 Subject: [PATCH 042/253] Update main.lua --- server/main.lua | 130 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 94 insertions(+), 36 deletions(-) diff --git a/server/main.lua b/server/main.lua index df7e1429..eea0f1f8 100644 --- a/server/main.lua +++ b/server/main.lua @@ -209,55 +209,113 @@ end) ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, plate) - MySQL.Async.fetchAll( - 'SELECT * FROM owned_vehicles', - {}, - function(result) + if Config.EnableGCIdentity then + + MySQL.Async.fetchAll( + 'SELECT * FROM owned_vehicles', + {}, + function(result) - local foundIdentifier = nil + local foundIdentifier = nil - for i=1, #result, 1 do + for i=1, #result, 1 do - local vehicleData = json.decode(result[i].vehicle) + local vehicleData = json.decode(result[i].vehicle) + + if vehicleData.plate == plate then + foundIdentifier = result[i].owner + break + end + + end + + if foundIdentifier ~= nil then + + MySQL.Async.fetchAll( + 'SELECT * FROM users WHERE identifier = @identifier', + { + ['@identifier'] = foundIdentifier + }, + function(result) + + local ownerName = result[1].firstname .. " " .. result[1].lastname + + local infos = { + plate = plate, + owner = ownerName + } + + cb(infos) + + end + ) + + else + + local infos = { + plate = plate + } + + cb(infos) - if vehicleData.plate == plate then - foundIdentifier = result[i].owner - break end end - - if foundIdentifier ~= nil then - - MySQL.Async.fetchAll( - 'SELECT * FROM users WHERE identifier = @identifier', - { - ['@identifier'] = foundIdentifier - }, - function(result) - - local infos = { - plate = plate, - owner = result[1].name - } - - cb(infos) - - end - ) + ) + + else + + MySQL.Async.fetchAll( + 'SELECT * FROM owned_vehicles', + {}, + function(result) - else + local foundIdentifier = nil - local infos = { + for i=1, #result, 1 do + + local vehicleData = json.decode(result[i].vehicle) + + if vehicleData.plate == plate then + foundIdentifier = result[i].owner + break + end + + end + + if foundIdentifier ~= nil then + + MySQL.Async.fetchAll( + 'SELECT * FROM users WHERE identifier = @identifier', + { + ['@identifier'] = foundIdentifier + }, + function(result) + + local infos = { + plate = plate, + owner = result[1].name + } + + cb(infos) + + end + ) + + else + + local infos = { plate = plate - } + } - cb(infos) + cb(infos) + + end end - - end - ) + ) + + end end) From 081ee252789f00da4e3128538a2a9ff4104d34e2 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Wed, 6 Sep 2017 07:53:44 -0500 Subject: [PATCH 043/253] Update main.lua --- client/main.lua | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index e52a75e5..54f0ac0b 100644 --- a/client/main.lua +++ b/client/main.lua @@ -621,17 +621,55 @@ function OpenIdentityCardMenu(player) ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - local jobLabel = nil - + local jobLabel = nil + local sexLabel = nil + local sex = nil + local dobLabel = nil + local heightLabel = nil + local idLabel = nil + if data.job.grade_label ~= nil and data.job.grade_label ~= '' then jobLabel = 'Job : ' .. data.job.label .. ' - ' .. data.job.grade_label else jobLabel = 'Job : ' .. data.job.label end + if data.sex ~= nil then + if (data.sex == 'm') or (data.sex == 'M') then + sex = 'Male' + else + sex = 'Female' + end + sexLabel = 'Sex : ' .. sex + else + sexLabel = 'Sex : Unknown' + end + + if data.dob ~= nil then + dobLabel = 'DOB : ' .. data.dob + else + dobLabel = 'DOB : Unknown' + end + + if data.height ~= nil then + heightLabel = 'Height : ' .. data.height + else + heightLabel = 'Height : Unknown' + end + + if data.name ~= nil then + idLabel = 'ID : ' .. data.name + else + idLabel = 'ID : Unknown' + end + local elements = { {label = _U('name') .. data.firstname .. " " .. data.lastname, value = nil}, + {label = sexLabel, value = nil}, + {label = dobLabel, value = nil}, + {label = heightLabel, value = nil}, {label = jobLabel, value = nil}, + {label = idLabel, value = nil}, } if data.drunk ~= nil then From 04f81235c856af865db632eab3ade8344f057785 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Wed, 6 Sep 2017 08:06:14 -0500 Subject: [PATCH 044/253] Update main.lua --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 54f0ac0b..bd590a13 100644 --- a/client/main.lua +++ b/client/main.lua @@ -623,7 +623,7 @@ function OpenIdentityCardMenu(player) local jobLabel = nil local sexLabel = nil - local sex = nil + local sex = nil local dobLabel = nil local heightLabel = nil local idLabel = nil From c336248e2345f3ebf43e47697dc12fc37bec8a10 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Wed, 6 Sep 2017 08:07:08 -0500 Subject: [PATCH 045/253] Update main.lua --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index bd590a13..9fd361eb 100644 --- a/client/main.lua +++ b/client/main.lua @@ -669,7 +669,7 @@ function OpenIdentityCardMenu(player) {label = dobLabel, value = nil}, {label = heightLabel, value = nil}, {label = jobLabel, value = nil}, - {label = idLabel, value = nil}, + {label = idLabel, value = nil}, } if data.drunk ~= nil then From b8dab5f3325bb3d1293fa6723b6882f7140b6d2a Mon Sep 17 00:00:00 2001 From: Don Date: Thu, 7 Sep 2017 21:52:42 -0700 Subject: [PATCH 046/253] Add take out of vehicle Add take out of vehicle --- client/main.lua | 80 +++++++++++--------- en_config.lua | 194 ++++++++++++++++++++++++++++++++++++++++++++++-- locales/en.lua | 1 + locales/fr.lua | 1 + server/main.lua | 5 ++ 5 files changed, 240 insertions(+), 41 deletions(-) diff --git a/client/main.lua b/client/main.lua index 9fd361eb..504f57ce 100644 --- a/client/main.lua +++ b/client/main.lua @@ -57,10 +57,10 @@ function OpenCloakroomMenu() ESX.UI.Menu.CloseAll() if Config.EnableNonFreemodePeds then - table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear'}) - table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear'}) - table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear'}) - end + table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear'}) + table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear'}) + table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear'}) + end ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'cloakroom', @@ -75,14 +75,13 @@ function OpenCloakroomMenu() menu.close() --Taken from SuperCoolNinja - if data.current.value == 'citizen_wear' then --Ajout de tenue par grades + if data.current.value == 'citizen_wear' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) if skin.sex == 0 then - local model = GetHashKey("mp_m_freemode_01") --[FR]--Pour changer de Skin Male veuillez changer Ici ! - --[EN]--Here for change Ped Skin Model Here is for Man + local model = GetHashKey("mp_m_freemode_01") RequestModel(model) while not HasModelLoaded(model) do RequestModel(model) @@ -93,8 +92,7 @@ function OpenCloakroomMenu() SetModelAsNoLongerNeeded(model) TriggerEvent('skinchanger:loadSkin', skin) else - local model = GetHashKey("mp_f_freemode_01") --[FR]--Pour changer de Femal Male veuillez changer Ici ! - --[EN]--Here for change Ped Skin Model Here is for Girl + local model = GetHashKey("mp_f_freemode_01") RequestModel(model) while not HasModelLoaded(model) do @@ -122,16 +120,15 @@ function OpenCloakroomMenu() end) -end - --Taken from SuperCoolNinja + end + if data.current.value == 'sheriff_wear' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) if skin.sex == 0 then - local model = GetHashKey("s_m_y_sheriff_01") --[FR]--Pour changer de Mal Male veuillez changer Ici ! - --[EN]--Here for change Ped Skin Model Here is for Man + local model = GetHashKey("s_m_y_sheriff_01") RequestModel(model) while not HasModelLoaded(model) do @@ -142,8 +139,7 @@ end SetPlayerModel(PlayerId(), model) SetModelAsNoLongerNeeded(model) else - local model = GetHashKey("s_f_y_sheriff_01") --[FR]--Pour changer de Femal Male veuillez changer Ici ! - --[EN]--Here for change Ped Skin Model Here is for Girl + local model = GetHashKey("s_f_y_sheriff_01") RequestModel(model) while not HasModelLoaded(model) do @@ -157,14 +153,13 @@ end end) end - --Taken from SuperCoolNinja - if data.current.value == 'lieutenant_wear' then --Ajout de tenue par grades + + if data.current.value == 'lieutenant_wear' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) if skin.sex == 0 then - local model = GetHashKey("s_m_y_swat_01") --[FR]--Pour changer de Mal Male veuillez changer Ici ! - --[EN]--Here for change Ped Skin Model Here is for Man + local model = GetHashKey("s_m_y_swat_01") RequestModel(model) while not HasModelLoaded(model) do @@ -175,8 +170,7 @@ end SetPlayerModel(PlayerId(), model) SetModelAsNoLongerNeeded(model) else - local model = GetHashKey("s_m_y_swat_01") --[FR]--Pour changer de Femal Male veuillez changer Ici ! - --[EN]--Here for change Ped Skin Model Here is for Girl + local model = GetHashKey("s_m_y_swat_01") RequestModel(model) while not HasModelLoaded(model) do @@ -190,14 +184,14 @@ end end) end - --Taken from SuperCoolNinja - if data.current.value == 'commandant_wear' then --Ajout de tenue par grades + + if data.current.value == 'commandant_wear' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - local model = GetHashKey("ig_fbisuit_01") --[FR]--Pour changer de Mal Male veuillez changer Ici ! - --[EN]--Here for change Ped Skin Model Here is for Man + if skin.sex == 0 then + local model = GetHashKey("s_m_y_swat_01") + RequestModel(model) while not HasModelLoaded(model) do RequestModel(model) @@ -207,8 +201,7 @@ end SetPlayerModel(PlayerId(), model) SetModelAsNoLongerNeeded(model) else - local model = GetHashKey("ig_fbisuit_01") --[FR]--Pour changer de Femal Male veuillez changer Ici ! - --[EN]--Here for change Ped Skin Model Here is for Girl + local model = GetHashKey("s_m_y_swat_01") RequestModel(model) while not HasModelLoaded(model) do @@ -223,6 +216,7 @@ end end) end + CurrentAction = 'menu_cloakroom' CurrentActionMsg = _U('open_cloackroom') CurrentActionData = {} @@ -277,12 +271,12 @@ function OpenArmoryMenu(station) end if data.current.value == 'put_stock' then - OpenPutStocksMenu() - end + OpenPutStocksMenu() + end - if data.current.value == 'get_stock' then - OpenGetStocksMenu() - end + if data.current.value == 'get_stock' then + OpenGetStocksMenu() + end end, function(data, menu) @@ -445,6 +439,7 @@ function OpenPoliceActionsMenu() {label = _U('handcuff'), value = 'handcuff'}, {label = _U('drag'), value = 'drag'}, {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, + {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, {label = _U('fine'), value = 'fine'} }, }, @@ -474,6 +469,10 @@ function OpenPoliceActionsMenu() TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(player)) end + if data2.current.value == 'out_the_vehicle' then + TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(player)) + end + if data2.current.value == 'fine' then OpenFineMenu(player) end @@ -623,7 +622,7 @@ function OpenIdentityCardMenu(player) local jobLabel = nil local sexLabel = nil - local sex = nil + local sex = nil local dobLabel = nil local heightLabel = nil local idLabel = nil @@ -669,7 +668,7 @@ function OpenIdentityCardMenu(player) {label = dobLabel, value = nil}, {label = heightLabel, value = nil}, {label = jobLabel, value = nil}, - {label = idLabel, value = nil}, + {label = idLabel, value = nil}, } if data.drunk ~= nil then @@ -938,6 +937,17 @@ function OpenVehicleInfosMenu(vehicleData) end +RegisterNetEvent('esx_policejob:OutVehicle') +AddEventHandler('esx_policejob:OutVehicle', function(t) + local ped = GetPlayerPed(t) + ClearPedTasksImmediately(ped) + plyPos = GetEntityCoords(GetPlayerPed(-1), true) + local xnew = plyPos.x+2 + local ynew = plyPos.y+2 + + SetEntityCoords(GetPlayerPed(-1), xnew, ynew, plyPos.z) +end) + function OpenGetWeaponMenu() ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) diff --git a/en_config.lua b/en_config.lua index 5bfb5289..0936e6f9 100644 --- a/en_config.lua +++ b/en_config.lua @@ -6,12 +6,13 @@ Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false Config.EnableGCIdentity = false -Config.EnableNonFreemodePeds = false +Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.MaxInService = -1 Config.Locale = 'en' - LSPD = { +Config.PoliceStations = { + LSPD1 = { Blip = { Pos = {x = 425.130, y = -979.558, z = 30.711}, Color = 29 @@ -21,14 +22,12 @@ Config.Locale = 'en' {name = 'WEAPON_NIGHTSTICK', price = 200}, {name = 'WEAPON_COMBATPISTOL', price = 300}, {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_ASSAULTRIFLE', price = 1500}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, {name = 'WEAPON_PUMPSHOTGUN', price = 600}, {name = 'WEAPON_STUNGUN', price = 500}, {name = 'WEAPON_FLASHLIGHT', price = 80}, {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, {name = 'WEAPON_FLAREGUN', price = 60}, - {name = 'WEAPON_STICKYBOMB', price = 250}, - {name = 'GADGET_PARACHUTE', price = 300}, }, AuthorizedVehicles = { @@ -73,6 +72,189 @@ Config.Locale = 'en' {x = 448.417, y = -973.208, z = 29.689} } - } + }, + + SASP1 = { + Blip = { + Pos = {x = 825.34204101563, y = -1290.0471191406, z = 28.240659713745 }, + Color = 40 + }, + + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + }, + + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, + + Cloakrooms = { + {x = 830.11590576172, y = -1311.4512939453, z = 28.13673210144 } -- state pd + }, + + Armories = { + {x = 858.25366210938, y = -1321.5992431641, z = 28.136734008789 } -- state pd + }, + + Vehicles = { + { + Spawner = {x = 863.17700195313, y = -1346.2406005859, z = 26.039228439331 }, --state pd + SpawnPoint = {x = 871.07720947266, y = -1350.00390625, z = 26.3092918396 }, -- state pd + Heading = 90.0 --state pd + } + }, + + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, + + VehicleDeleters = { + {x = 823.95031738281, y = -1371.1483154297, z = 26.136753082275 } --state pd + }, + + BossActions = { + {x = 850.228515625, y = -1284.50390625, z = 28.004758834839 } --state pd + } + + }, + + LSPD2 = { + Blip = { + Pos = {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, + Color = 29 + }, + + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + }, + + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, + + Cloakrooms = { + {x = -450.2878112793, y = 6016.482421875, z = 31.716369628906 }, + }, + + Armories = { + {x = -448.04425048828, y = 6007.7104492188, z = 31.716369628906 }, + }, + + Vehicles = { + { + Spawner = {x = -452.30313110352, y = 6005.6704101563, z = 31.840929031372 }, + SpawnPoint = {x = -454.96899414063, y = 6001.8876953125, z = 31.340549468994 }, + Heading = 87.0 + } + }, + + Helicopters = { + { + Spawner = {x = -462.88317871094, y = 5993.7685546875, z = 31.245756149292 }, + SpawnPoint = {x = -475.48043823242, y = 5988.326171875, z = 31.336708068848 }, + Heading = 270.0 + } + }, + + VehicleDeleters = { + {x = -447.64434814453, y = 5994.5024414063, z = 31.340551376343 }, + }, + + BossActions = { + {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, + } + + }, + + SASP2 = { + Blip = { + Pos = {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, + Color = 40 + }, + + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + }, + + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, + + Cloakrooms = { + {x = 1857.2354736328, y = 3689.8408203125, z = 34.26708984375 }, -- state pd + }, + + Armories = { + {x = 1848.3413085938, y = 3690.1345214844, z = 34.26708984375 }, -- state pd + }, + + Vehicles = { + { + Spawner = {x = 1866.208984375, y = 3693.8125, z = 33.737236022949 }, --state pd + SpawnPoint = {x = 1872.9417724609, y = 3690.5759277344, z = 33.569362640381 }, -- state pd + Heading = 90.0 --state pd + } + }, + + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, + + VehicleDeleters = { + {x = 1866.4152832031, y = 3699.6052246094, z = 33.535938262939 }, --state pd + }, + + BossActions = { + {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, --state pd + } + + }, } diff --git a/locales/en.lua b/locales/en.lua index 135d19c4..5fe64aa3 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -31,6 +31,7 @@ Locales['en'] = { ['handcuff'] = 'cuff / Uncuff', ['drag'] = 'drag', ['put_in_vehicle'] = 'put in Vehicle', + ['out_the_vehicle'] = 'take ou of vehicle', ['fine'] = 'fine', ['no_players_nearby'] = 'no players nearby', diff --git a/locales/fr.lua b/locales/fr.lua index db2b2fe7..f034108b 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -31,6 +31,7 @@ Locales['fr'] = { ['handcuff'] = 'menotter / Démenotter', ['drag'] = 'escorter', ['put_in_vehicle'] = 'mettre dans véhicule', + ['out_the_vehicle'] = 'sortir du véhicule', ['fine'] = 'Amende', ['no_players_nearby'] = 'aucun joueur à proximité', diff --git a/server/main.lua b/server/main.lua index eea0f1f8..5dcc4570 100644 --- a/server/main.lua +++ b/server/main.lua @@ -70,6 +70,11 @@ AddEventHandler('esx_policejob:putInVehicle', function(target) TriggerClientEvent('esx_policejob:putInVehicle', target) end) +RegisterServerEvent('esx_policejob:OutVehicle') +AddEventHandler('esx_policejob:OutVehicle', function(target) + TriggerClientEvent('esx_policejob:OutVehicle', target) +end) + RegisterServerEvent('esx_policejob:getStockItem') AddEventHandler('esx_policejob:getStockItem', function(itemName, count) From aa4cfef3d971ec78613315a71fc3ae8dfef6b2db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sat, 9 Sep 2017 17:00:11 +0200 Subject: [PATCH 047/253] Add society garage support --- client/main.lua | 213 +++++++++++++++++++++++++++++++----------------- config.lua | 23 +++--- de_config.lua | 22 +++-- en_config.lua | 23 +++--- 4 files changed, 173 insertions(+), 108 deletions(-) diff --git a/client/main.lua b/client/main.lua index 504f57ce..afd2a146 100644 --- a/client/main.lua +++ b/client/main.lua @@ -23,8 +23,8 @@ local CurrentAction = nil local CurrentActionMsg = '' local CurrentActionData = {} local IsHandcuffed = false -local IsDragged = false -local CopPed = 0 +local IsDragged = false +local CopPed = 0 Citizen.CreateThread(function() while ESX == nil do @@ -52,7 +52,7 @@ function OpenCloakroomMenu() local elements = { {label = _U('citizen_wear'), value = 'citizen_wear'}, {label = _U('police_wear'), value = 'police_wear'} -} + } ESX.UI.Menu.CloseAll() @@ -328,84 +328,134 @@ end function OpenVehicleSpawnerMenu(station, partNum) - local elements = {} local vehicles = Config.PoliceStations[station].Vehicles - for i=1, #Config.PoliceStations[station].AuthorizedVehicles, 1 do - local vehicle = Config.PoliceStations[station].AuthorizedVehicles[i] - table.insert(elements, {label = vehicle.label, value = vehicle.name}) - end - ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('vehicle_menu'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + if Config.EnableSocietyOwnedVehicles then - menu.close() + local elements = {} - local model = data.current.value + ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(garageVehicles) - local vehicle = GetClosestVehicle(vehicles[partNum].SpawnPoint.x, vehicles[partNum].SpawnPoint.y, vehicles[partNum].SpawnPoint.z, 3.0, 0, 71) - - if not DoesEntityExist(vehicle) then - - local playerPed = GetPlayerPed(-1) - - if Config.MaxInService == -1 then - - ESX.Game.SpawnVehicle(model, { - x = vehicles[partNum].SpawnPoint.x, - y = vehicles[partNum].SpawnPoint.y, - z = vehicles[partNum].SpawnPoint.z - }, vehicles[partNum].Heading, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - SetVehicleMaxMods(vehicle) - end) - - else - - ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) - - if canTakeService then - - ESX.Game.SpawnVehicle(model, { - x = vehicles[partNum].SpawnPoint.x, - y = vehicles[partNum].SpawnPoint.y, - z = vehicles[partNum].SpawnPoint.z - }, vehicles[partNum].Heading, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - SetVehicleMaxMods(vehicle) - end) - - else - ESX.ShowNotification(_U('service_max') .. inServiceCount .. '/' .. maxInService) - end - - end, 'police') - - end - - else - ESX.ShowNotification(_U('vehicle_out')) + for i=1, #garageVehicles, 1 do + table.insert(elements, {label = GetDisplayNameFromVehicleModel(garageVehicles[i].model) .. ' [' .. garageVehicles[i].plate .. ']', value = garageVehicles[i]}) end - end, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('vehicle_menu'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - menu.close() + menu.close() - CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = _U('vehicle_spawner') - CurrentActionData = {station = station, partNum = partNum} + local vehicleProps = data.current.value + ESX.Game.SpawnVehicle(vehicleProps.model, vehicles[partNum].SpawnPoint, 270.0, function(vehicle) + ESX.Game.SetVehicleProperties(vehicle, vehicleProps) + local playerPed = GetPlayerPed(-1) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) + + TriggerServerEvent('esx_society:removeVehicleFromGarage', 'police', vehicleProps) + + end, + function(data, menu) + + menu.close() + + CurrentAction = 'menu_vehicle_spawner' + CurrentActionMsg = _U('vehicle_spawner') + CurrentActionData = {station = station, partNum = partNum} + + end + ) + + end, 'police') + + else + + local elements = {} + + for i=1, #Config.PoliceStations[station].AuthorizedVehicles, 1 do + local vehicle = Config.PoliceStations[station].AuthorizedVehicles[i] + table.insert(elements, {label = vehicle.label, value = vehicle.name}) end - ) + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('vehicle_menu'), + align = 'top-left', + elements = elements, + }, + function(data, menu) + + menu.close() + + local model = data.current.value + + local vehicle = GetClosestVehicle(vehicles[partNum].SpawnPoint.x, vehicles[partNum].SpawnPoint.y, vehicles[partNum].SpawnPoint.z, 3.0, 0, 71) + + if not DoesEntityExist(vehicle) then + + local playerPed = GetPlayerPed(-1) + + if Config.MaxInService == -1 then + + ESX.Game.SpawnVehicle(model, { + x = vehicles[partNum].SpawnPoint.x, + y = vehicles[partNum].SpawnPoint.y, + z = vehicles[partNum].SpawnPoint.z + }, vehicles[partNum].Heading, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + SetVehicleMaxMods(vehicle) + end) + + else + + ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) + + if canTakeService then + + ESX.Game.SpawnVehicle(model, { + x = vehicles[partNum].SpawnPoint.x, + y = vehicles[partNum].SpawnPoint.y, + z = vehicles[partNum].SpawnPoint.z + }, vehicles[partNum].Heading, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + SetVehicleMaxMods(vehicle) + end) + + else + ESX.ShowNotification(_U('service_max') .. inServiceCount .. '/' .. maxInService) + end + + end, 'police') + + end + + else + ESX.ShowNotification(_U('vehicle_out')) + end + + end, + function(data, menu) + + menu.close() + + CurrentAction = 'menu_vehicle_spawner' + CurrentActionMsg = _U('vehicle_spawner') + CurrentActionData = {station = station, partNum = partNum} + + end + ) + + end end @@ -1715,15 +1765,24 @@ Citizen.CreateThread(function() if CurrentAction == 'delete_vehicle' then - if - GetEntityModel(vehicle) == GetHashKey('police') or - GetEntityModel(vehicle) == GetHashKey('police2') or - GetEntityModel(vehicle) == GetHashKey('police3') or - GetEntityModel(vehicle) == GetHashKey('police4') or - GetEntityModel(vehicle) == GetHashKey('policeb') or - GetEntityModel(vehicle) == GetHashKey('policet') - then - TriggerServerEvent('esx_service:disableService', 'police') + if Config.EnableSocietyOwnedVehicles then + + local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) + TriggerServerEvent('esx_society:putVehicleInGarage', 'police', vehicleProps) + + else + + if + GetEntityModel(vehicle) == GetHashKey('police') or + GetEntityModel(vehicle) == GetHashKey('police2') or + GetEntityModel(vehicle) == GetHashKey('police3') or + GetEntityModel(vehicle) == GetHashKey('police4') or + GetEntityModel(vehicle) == GetHashKey('policeb') or + GetEntityModel(vehicle) == GetHashKey('policet') + then + TriggerServerEvent('esx_service:disableService', 'police') + end + end ESX.Game.DeleteVehicle(CurrentActionData.vehicle) diff --git a/config.lua b/config.lua index 1e44c8db..9e8d1f8b 100644 --- a/config.lua +++ b/config.lua @@ -1,14 +1,15 @@ -Config = {} -Config.DrawDistance = 100.0 -Config.MarkerType = 1 -Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} -Config.MarkerColor = {r = 50, g = 50, b = 204} -Config.EnablePlayerManagement = false -Config.EnableArmoryManagement = false -Config.EnableGCIdentity = false -Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds -Config.MaxInService = -1 -Config.Locale = 'fr' +Config = {} +Config.DrawDistance = 100.0 +Config.MarkerType = 1 +Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} +Config.MarkerColor = {r = 50, g = 50, b = 204} +Config.EnablePlayerManagement = false +Config.EnableArmoryManagement = false +Config.EnableGCIdentity = false +Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds +Config.EnableSocietyOwnedVehicles = false +Config.MaxInService = -1 +Config.Locale = 'fr' Config.PoliceStations = { diff --git a/de_config.lua b/de_config.lua index 55ba5522..a7c890f7 100644 --- a/de_config.lua +++ b/de_config.lua @@ -1,12 +1,16 @@ -Config = {} -Config.DrawDistance = 100.0 -Config.MarkerType = 1 -Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} -Config.MarkerColor = {r = 50, g = 50, b = 204} -Config.EnablePlayerManagement = false -Config.EnableArmoryManagement = false -Config.MaxInService = -1 -Config.Locale = 'de' +Config = {} +Config.DrawDistance = 100.0 +Config.MarkerType = 1 +Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} +Config.MarkerColor = {r = 50, g = 50, b = 204} +Config.EnablePlayerManagement = false +Config.EnableArmoryManagement = false +Config.EnableGCIdentity = false +Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds +Config.EnableSocietyOwnedVehicles = false +Config.MaxInService = -1 +Config.Locale = 'de' + Config.PoliceStations = { diff --git a/en_config.lua b/en_config.lua index 0936e6f9..f1340a9f 100644 --- a/en_config.lua +++ b/en_config.lua @@ -1,14 +1,15 @@ -Config = {} -Config.DrawDistance = 100.0 -Config.MarkerType = 1 -Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} -Config.MarkerColor = {r = 50, g = 50, b = 204} -Config.EnablePlayerManagement = false -Config.EnableArmoryManagement = false -Config.EnableGCIdentity = false -Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds -Config.MaxInService = -1 -Config.Locale = 'en' +Config = {} +Config.DrawDistance = 100.0 +Config.MarkerType = 1 +Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} +Config.MarkerColor = {r = 50, g = 50, b = 204} +Config.EnablePlayerManagement = false +Config.EnableArmoryManagement = false +Config.EnableGCIdentity = false +Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds +Config.EnableSocietyOwnedVehicles = false +Config.MaxInService = -1 +Config.Locale = 'en' Config.PoliceStations = { From 72b7f5225b5fdb01cd0db8f15fc6ea5639730431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sat, 9 Sep 2017 17:13:37 +0200 Subject: [PATCH 048/253] Clean up repo --- README.md | 3 +- de_esx_policejob_minimal.sql | 79 --- esx_policejob_full.sql => esx_policejob.sql | 0 esx_policejob_en_minimal.sql | 80 --- esx_policejob_minimal.sql | 80 --- de_config.lua => localization/de_config.lua | 0 .../de_esx_policejob.sql | 0 en_config.lua => localization/en_config.lua | 522 +++++++++--------- .../esx_policejob_en.sql | 0 9 files changed, 262 insertions(+), 502 deletions(-) delete mode 100644 de_esx_policejob_minimal.sql rename esx_policejob_full.sql => esx_policejob.sql (100%) delete mode 100644 esx_policejob_en_minimal.sql delete mode 100644 esx_policejob_minimal.sql rename de_config.lua => localization/de_config.lua (100%) rename de_esx_policejob_full.sql => localization/de_esx_policejob.sql (100%) rename en_config.lua => localization/en_config.lua (96%) rename esx_policejob_en_full.sql => localization/esx_policejob_en.sql (100%) diff --git a/README.md b/README.md index 8eca241e..adb07de1 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,7 @@ FXServer ESX Police Job ``` git clone https://github.com/FXServer-ESX/fxserver-esx_policejob esx_policejob ``` -3) * Auto mode : Import esx_policejob_minimal.sql in your database - * Player / Armory management : Import esx_policejob_full.sql in your database +3) Import esx_policejob.sql in your database 4) Add this in your server.cfg : diff --git a/de_esx_policejob_minimal.sql b/de_esx_policejob_minimal.sql deleted file mode 100644 index 0a4e0d61..00000000 --- a/de_esx_policejob_minimal.sql +++ /dev/null @@ -1,79 +0,0 @@ -INSERT INTO `jobs` (name, label) VALUES - ('police','LSPD') -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recruit','Rekrut',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_police', 'Polizei', 1) -; - -CREATE TABLE `fine_types` ( - - `id` int(11) NOT NULL AUTO_INCREMENT, - `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, - - PRIMARY KEY (`id`) -); - - -INSERT INTO `fine_types` VALUES ('1', 'Missbrauchen der Hupe', '30', '0'); -INSERT INTO `fine_types` VALUES ('2', 'Vorfahrtstraße missachtet', '40', '0'); -INSERT INTO `fine_types` VALUES ('3', 'Gegenverkehr', '250', '0'); -INSERT INTO `fine_types` VALUES ('4', 'Unbefugtes Wenden', '250', '0'); -INSERT INTO `fine_types` VALUES ('5', 'Off-Road fahren', '170', '0'); -INSERT INTO `fine_types` VALUES ('6', 'Sicherheitsrichtlinien missachtet', '30', '0'); -INSERT INTO `fine_types` VALUES ('7', 'Gefährliches halten', '150', '0'); -INSERT INTO `fine_types` VALUES ('8', 'Nicht erlaubtes parken', '70', '0'); -INSERT INTO `fine_types` VALUES ('9', 'Nicht respektieren des Rechtsfahrgebotes', '70', '0'); -INSERT INTO `fine_types` VALUES ('10', 'Nicht einhaltender Priorität eines Rettungsfahrzeuges', '90', '0'); -INSERT INTO `fine_types` VALUES ('11', 'Nicht angehalten nach Aufforderung', '105', '0'); -INSERT INTO `fine_types` VALUES ('12', 'Bei Rot über die Ampel', '130', '0'); -INSERT INTO `fine_types` VALUES ('13', 'gefährliches Überholmanöver', '100', '0'); -INSERT INTO `fine_types` VALUES ('14', 'Fahrzeug nicht Verkehrstauglich', '100', '0'); -INSERT INTO `fine_types` VALUES ('15', 'Fahren ohne Lizenz', '1500', '0'); -INSERT INTO `fine_types` VALUES ('16', 'Hit and Run', '800', '0'); -INSERT INTO `fine_types` VALUES ('17', 'zu schnell < 5 kmh', '90', '0'); -INSERT INTO `fine_types` VALUES ('18', 'zu schnell 5-15 kmh', '120', '0'); -INSERT INTO `fine_types` VALUES ('19', 'zu schnell 15-30 kmh', '180', '0'); -INSERT INTO `fine_types` VALUES ('20', 'zu schnell > 30 kmh', '300', '0'); -INSERT INTO `fine_types` VALUES ('21', 'Verkehrsbehinderung', '110', '1'); -INSERT INTO `fine_types` VALUES ('22', 'Nicht Benutzung öffentlicher Straßen', '90', '1'); -INSERT INTO `fine_types` VALUES ('23', 'Störung der öffentlichen Ordnung', '90', '1'); -INSERT INTO `fine_types` VALUES ('24', 'Polizeieinsatz behindern', '130', '1'); -INSERT INTO `fine_types` VALUES ('25', 'Beildigung an Zivilist', '75', '1'); -INSERT INTO `fine_types` VALUES ('26', 'Polizist geringschätzen', '110', '1'); -INSERT INTO `fine_types` VALUES ('27', 'verbale Bedrohung an Zivilist', '90', '1'); -INSERT INTO `fine_types` VALUES ('28', 'verbale Bedrohung an Polizist', '150', '1'); -INSERT INTO `fine_types` VALUES ('29', 'Illegale Demonstration', '250', '1'); -INSERT INTO `fine_types` VALUES ('30', 'versuchte Bestechung', '1500', '1'); -INSERT INTO `fine_types` VALUES ('31', 'Mit Messer in der Stadt bewaffnet', '120', '2'); -INSERT INTO `fine_types` VALUES ('32', 'Mit tötlicher Waffe bewaffnet', '300', '2'); -INSERT INTO `fine_types` VALUES ('33', 'Unbefugter Besitz einer Waffe (Standard-Lizenz)', '600', '2'); -INSERT INTO `fine_types` VALUES ('34', 'Illegale Waffe', '700', '2'); -INSERT INTO `fine_types` VALUES ('35', 'Einbruch/Aufbruch', '300', '2'); -INSERT INTO `fine_types` VALUES ('36', 'Autodiebstahl', '1800', '2'); -INSERT INTO `fine_types` VALUES ('37', 'Drogenverkauf', '1500', '2'); -INSERT INTO `fine_types` VALUES ('38', 'Drogen herstellen', '1500', '2'); -INSERT INTO `fine_types` VALUES ('39', 'Drogenbesitz', '650', '2'); -INSERT INTO `fine_types` VALUES ('40', 'Zivile Geisel genommen', '1500', '2'); -INSERT INTO `fine_types` VALUES ('41', 'Geiselnahme', '2000', '2'); -INSERT INTO `fine_types` VALUES ('42', 'Waghalsiges Lenken', '650', '2'); -INSERT INTO `fine_types` VALUES ('43', 'Ladenraub', '650', '2'); -INSERT INTO `fine_types` VALUES ('44', 'Bankraub', '1500', '2'); -INSERT INTO `fine_types` VALUES ('45', 'Schießen auf Zivilisten', '2000', '3'); -INSERT INTO `fine_types` VALUES ('46', 'Schießen auf Beamten', '2500', '3'); -INSERT INTO `fine_types` VALUES ('47', 'versuchterMord an Zivilisten', '3000', '3'); -INSERT INTO `fine_types` VALUES ('48', 'versuchter Mord an einem Beamten', '5000', '3'); -INSERT INTO `fine_types` VALUES ('49', 'Mord an Zivilisten', '10000', '3'); -INSERT INTO `fine_types` VALUES ('50', 'Mord an Beamten', '30000', '3'); -INSERT INTO `fine_types` VALUES ('51', 'versehentlicher Mord', '1800', '3'); -INSERT INTO `fine_types` VALUES ('52', 'Firmenbetrug', '2000', '2'); -; \ No newline at end of file diff --git a/esx_policejob_full.sql b/esx_policejob.sql similarity index 100% rename from esx_policejob_full.sql rename to esx_policejob.sql diff --git a/esx_policejob_en_minimal.sql b/esx_policejob_en_minimal.sql deleted file mode 100644 index f28257d6..00000000 --- a/esx_policejob_en_minimal.sql +++ /dev/null @@ -1,80 +0,0 @@ -INSERT INTO `jobs` (name, label) VALUES - ('police','LSPD') -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recruit','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_police', 'Police', 1) -; - -CREATE TABLE `fine_types` ( - - `id` int(11) NOT NULL AUTO_INCREMENT, - `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, - - PRIMARY KEY (`id`) -); - - -INSERT INTO `fine_types` (label, amount, category) VALUES - ('Misuse of a horn', 30, 0), - ('Illegally Crossing a continuous Line', 40, 0), - ('Driving on the wrong side of the road', 250, 0), - ('Illegal U-Turn', 250, 0), - ('Illegally Driving Off-road', 170, 0), - ('Refusing a Lawful Command', 30, 0), - ('Illegally Stoped of a Vehicle', 150, 0), - ('Illegal Parking', 70, 0), - ('Failing to Yield to the right', 70, 0), - ('Failure to comply with Vehicle Information', 90, 0), - ('Failing to stop at a Stop Sign ', 105, 0), - ('Failing to stop at a Red Light', 130, 0), - ('Illegal Passing', 100, 0), - ('Driving an illegal Vehicle', 100, 0), - ('Driving without a License', 1500, 0), - ('Hit and Run', 800, 0), - ('Exceeding Speeds Over < 5 mph', 90, 0), - ('Exceeding Speeds Over 5-15 mph', 120, 0), - ('Exceeding Speeds Over 15-30 mph', 180, 0), - ('Exceeding Speeds Over > 30 mph', 300, 0), - ('Impeding traffic flow', 110, 1), - ('Public Intoxication', 90, 1), - ('Disorderly conduct', 90, 1), - ('Obstruction of Justice', 130, 1), - ('Insults towards Civilans', 75, 1), - ('Disrespecting of an LEO', 110, 1), - ('Verbal Threat towards a Civilan', 90, 1), - ('Verbal Threat towards an LEO', 150, 1), - ('Providing False Information', 250, 1), - ('Attempt of Corruption', 1500, 1), - ('Brandishing a weapon in city Limits', 120, 2), - ('Brandishing a Lethal Weapon in city Limits', 300, 2), - ('No Firearms License', 600, 2), - ('Possession of an Illegal Weapon', 700, 2), - ('Possession of Burglary Tools', 300, 2), - ('Grand Theft Auto', 1800, 2), - ('Intent to Sell/Distrube of an illegal Substance', 1500, 2), - ('Frabrication of an Illegal Substance', 1500, 2), - ('Possession of an Illegal Substance ', 650, 2), - ('Kidnapping of a Civilan', 1500, 2), - ('Kidnapping of an LEO', 2000, 2), - ('Robbery', 650, 2), - ('Armed Robbery of a Store', 650, 2), - ('Armed Robbery of a Bank', 1500, 2), - ('Assault on a Civilian', 2000, 3), - ('Assault of an LEO', 2500, 3), - ('Attempt of Murder of a Civilian', 3000, 3), - ('Attempt of Murder of an LEO', 5000, 3), - ('Murder of a Civilian', 10000, 3), - ('Murder of an LEO', 30000, 3), - ('Involuntary manslaughter', 1800, 3), - ('Fraud', 2000, 2); -; \ No newline at end of file diff --git a/esx_policejob_minimal.sql b/esx_policejob_minimal.sql deleted file mode 100644 index ee413e4c..00000000 --- a/esx_policejob_minimal.sql +++ /dev/null @@ -1,80 +0,0 @@ -INSERT INTO `jobs` (name, label) VALUES - ('police','LSPD') -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recruit','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_police', 'Police', 1) -; - -CREATE TABLE `fine_types` ( - - `id` int(11) NOT NULL AUTO_INCREMENT, - `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, - - PRIMARY KEY (`id`) -); - - -INSERT INTO `fine_types` (label, amount, category) VALUES - ('Usage abusif du klaxon',30,0), - ('Franchir une ligne continue',40,0), - ('Circulation à contresens',250,0), - ('Demi-tour non autorisé',250,0), - ('Circulation hors-route',170,0), - ('Non-respect des distances de sécurité',30,0), - ('Arrêt dangereux / interdit',150,0), - ('Stationnement gênant / interdit',70,0), - ('Non respect de la priorité à droite',70,0), - ('Non-respect à un véhicule prioritaire',90,0), - ('Non-respect d\'un stop',105,0), - ('Non-respect d\'un feu rouge',130,0), - ('Dépassement dangereux',100,0), - ('Véhicule non en état',100,0), - ('Conduite sans permis',1500,0), - ('Délit de fuite',800,0), - ('Excès de vitesse < 5 kmh',90,0), - ('Excès de vitesse 5-15 kmh',120,0), - ('Excès de vitesse 15-30 kmh',180,0), - ('Excès de vitesse > 30 kmh',300,0), - ('Entrave de la circulation',110,1), - ('Dégradation de la voie publique',90,1), - ('Trouble à l\'ordre publique',90,1), - ('Entrave opération de police',130,1), - ('Insulte envers / entre civils',75,1), - ('Outrage à agent de police',110,1), - ('Menace verbale ou intimidation envers civil',90,1), - ('Menace verbale ou intimidation envers policier',150,1), - ('Manifestation illégale',250,1), - ('Tentative de corruption',1500,1), - ('Arme blanche sortie en ville',120,2), - ('Arme léthale sortie en ville',300,2), - ('Port d\'arme non autorisé (défaut de license)',600,2), - ('Port d\'arme illégal',700,2), - ('Pris en flag lockpick',300,2), - ('Vol de voiture',1800,2), - ('Vente de drogue',1500,2), - ('Fabriquation de drogue',1500,2), - ('Possession de drogue',650,2), - ('Prise d\'ôtage civil',1500,2), - ('Prise d\'ôtage agent de l\'état',2000,2), - ('Braquage particulier',650,2), - ('Braquage magasin',650,2), - ('Braquage de banque',1500,2), - ('Tir sur civil',2000,3), - ('Tir sur agent de l\'état',2500,3), - ('Tentative de meurtre sur civil',3000,3), - ('Tentative de meurtre sur agent de l\'état',5000,3), - ('Meurtre sur civil',10000,3), - ('Meurte sur agent de l\'état',30000,3), - ('Meurtre involontaire',1800,3), - ('Escroquerie à l\'entreprise',2000,2) -; \ No newline at end of file diff --git a/de_config.lua b/localization/de_config.lua similarity index 100% rename from de_config.lua rename to localization/de_config.lua diff --git a/de_esx_policejob_full.sql b/localization/de_esx_policejob.sql similarity index 100% rename from de_esx_policejob_full.sql rename to localization/de_esx_policejob.sql diff --git a/en_config.lua b/localization/en_config.lua similarity index 96% rename from en_config.lua rename to localization/en_config.lua index f1340a9f..4990c8e7 100644 --- a/en_config.lua +++ b/localization/en_config.lua @@ -1,261 +1,261 @@ -Config = {} -Config.DrawDistance = 100.0 -Config.MarkerType = 1 -Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} -Config.MarkerColor = {r = 50, g = 50, b = 204} -Config.EnablePlayerManagement = false -Config.EnableArmoryManagement = false -Config.EnableGCIdentity = false -Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds -Config.EnableSocietyOwnedVehicles = false -Config.MaxInService = -1 -Config.Locale = 'en' - -Config.PoliceStations = { - - LSPD1 = { - Blip = { - Pos = {x = 425.130, y = -979.558, z = 30.711}, - Color = 29 - }, - - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, - - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, - - Cloakrooms = { - {x = 452.600, y = -993.306, z = 29.750} - }, - - Armories = { - {x = 451.699, y = -980.356, z = 29.689} - }, - - Vehicles = { - { - Spawner = {x = 454.69, y = -1017.4, z = 27.430}, - SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, - Heading = 90.0 - } - }, - - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, - - VehicleDeleters = { - {x = 462.74, y = -1014.4, z = 27.065}, - {x = 462.40, y = -1019.7, z = 27.104} - }, - - BossActions = { - {x = 448.417, y = -973.208, z = 29.689} - } - - }, - - SASP1 = { - Blip = { - Pos = {x = 825.34204101563, y = -1290.0471191406, z = 28.240659713745 }, - Color = 40 - }, - - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, - - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, - - Cloakrooms = { - {x = 830.11590576172, y = -1311.4512939453, z = 28.13673210144 } -- state pd - }, - - Armories = { - {x = 858.25366210938, y = -1321.5992431641, z = 28.136734008789 } -- state pd - }, - - Vehicles = { - { - Spawner = {x = 863.17700195313, y = -1346.2406005859, z = 26.039228439331 }, --state pd - SpawnPoint = {x = 871.07720947266, y = -1350.00390625, z = 26.3092918396 }, -- state pd - Heading = 90.0 --state pd - } - }, - - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, - - VehicleDeleters = { - {x = 823.95031738281, y = -1371.1483154297, z = 26.136753082275 } --state pd - }, - - BossActions = { - {x = 850.228515625, y = -1284.50390625, z = 28.004758834839 } --state pd - } - - }, - - LSPD2 = { - Blip = { - Pos = {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, - Color = 29 - }, - - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, - - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, - - Cloakrooms = { - {x = -450.2878112793, y = 6016.482421875, z = 31.716369628906 }, - }, - - Armories = { - {x = -448.04425048828, y = 6007.7104492188, z = 31.716369628906 }, - }, - - Vehicles = { - { - Spawner = {x = -452.30313110352, y = 6005.6704101563, z = 31.840929031372 }, - SpawnPoint = {x = -454.96899414063, y = 6001.8876953125, z = 31.340549468994 }, - Heading = 87.0 - } - }, - - Helicopters = { - { - Spawner = {x = -462.88317871094, y = 5993.7685546875, z = 31.245756149292 }, - SpawnPoint = {x = -475.48043823242, y = 5988.326171875, z = 31.336708068848 }, - Heading = 270.0 - } - }, - - VehicleDeleters = { - {x = -447.64434814453, y = 5994.5024414063, z = 31.340551376343 }, - }, - - BossActions = { - {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, - } - - }, - - SASP2 = { - Blip = { - Pos = {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, - Color = 40 - }, - - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, - - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, - - Cloakrooms = { - {x = 1857.2354736328, y = 3689.8408203125, z = 34.26708984375 }, -- state pd - }, - - Armories = { - {x = 1848.3413085938, y = 3690.1345214844, z = 34.26708984375 }, -- state pd - }, - - Vehicles = { - { - Spawner = {x = 1866.208984375, y = 3693.8125, z = 33.737236022949 }, --state pd - SpawnPoint = {x = 1872.9417724609, y = 3690.5759277344, z = 33.569362640381 }, -- state pd - Heading = 90.0 --state pd - } - }, - - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, - - VehicleDeleters = { - {x = 1866.4152832031, y = 3699.6052246094, z = 33.535938262939 }, --state pd - }, - - BossActions = { - {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, --state pd - } - - }, - -} +Config = {} +Config.DrawDistance = 100.0 +Config.MarkerType = 1 +Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} +Config.MarkerColor = {r = 50, g = 50, b = 204} +Config.EnablePlayerManagement = false +Config.EnableArmoryManagement = false +Config.EnableGCIdentity = false +Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds +Config.EnableSocietyOwnedVehicles = false +Config.MaxInService = -1 +Config.Locale = 'en' + +Config.PoliceStations = { + + LSPD1 = { + Blip = { + Pos = {x = 425.130, y = -979.558, z = 30.711}, + Color = 29 + }, + + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + }, + + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, + + Cloakrooms = { + {x = 452.600, y = -993.306, z = 29.750} + }, + + Armories = { + {x = 451.699, y = -980.356, z = 29.689} + }, + + Vehicles = { + { + Spawner = {x = 454.69, y = -1017.4, z = 27.430}, + SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, + Heading = 90.0 + } + }, + + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, + + VehicleDeleters = { + {x = 462.74, y = -1014.4, z = 27.065}, + {x = 462.40, y = -1019.7, z = 27.104} + }, + + BossActions = { + {x = 448.417, y = -973.208, z = 29.689} + } + + }, + + SASP1 = { + Blip = { + Pos = {x = 825.34204101563, y = -1290.0471191406, z = 28.240659713745 }, + Color = 40 + }, + + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + }, + + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, + + Cloakrooms = { + {x = 830.11590576172, y = -1311.4512939453, z = 28.13673210144 } -- state pd + }, + + Armories = { + {x = 858.25366210938, y = -1321.5992431641, z = 28.136734008789 } -- state pd + }, + + Vehicles = { + { + Spawner = {x = 863.17700195313, y = -1346.2406005859, z = 26.039228439331 }, --state pd + SpawnPoint = {x = 871.07720947266, y = -1350.00390625, z = 26.3092918396 }, -- state pd + Heading = 90.0 --state pd + } + }, + + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, + + VehicleDeleters = { + {x = 823.95031738281, y = -1371.1483154297, z = 26.136753082275 } --state pd + }, + + BossActions = { + {x = 850.228515625, y = -1284.50390625, z = 28.004758834839 } --state pd + } + + }, + + LSPD2 = { + Blip = { + Pos = {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, + Color = 29 + }, + + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + }, + + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, + + Cloakrooms = { + {x = -450.2878112793, y = 6016.482421875, z = 31.716369628906 }, + }, + + Armories = { + {x = -448.04425048828, y = 6007.7104492188, z = 31.716369628906 }, + }, + + Vehicles = { + { + Spawner = {x = -452.30313110352, y = 6005.6704101563, z = 31.840929031372 }, + SpawnPoint = {x = -454.96899414063, y = 6001.8876953125, z = 31.340549468994 }, + Heading = 87.0 + } + }, + + Helicopters = { + { + Spawner = {x = -462.88317871094, y = 5993.7685546875, z = 31.245756149292 }, + SpawnPoint = {x = -475.48043823242, y = 5988.326171875, z = 31.336708068848 }, + Heading = 270.0 + } + }, + + VehicleDeleters = { + {x = -447.64434814453, y = 5994.5024414063, z = 31.340551376343 }, + }, + + BossActions = { + {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, + } + + }, + + SASP2 = { + Blip = { + Pos = {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, + Color = 40 + }, + + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + }, + + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, + + Cloakrooms = { + {x = 1857.2354736328, y = 3689.8408203125, z = 34.26708984375 }, -- state pd + }, + + Armories = { + {x = 1848.3413085938, y = 3690.1345214844, z = 34.26708984375 }, -- state pd + }, + + Vehicles = { + { + Spawner = {x = 1866.208984375, y = 3693.8125, z = 33.737236022949 }, --state pd + SpawnPoint = {x = 1872.9417724609, y = 3690.5759277344, z = 33.569362640381 }, -- state pd + Heading = 90.0 --state pd + } + }, + + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, + + VehicleDeleters = { + {x = 1866.4152832031, y = 3699.6052246094, z = 33.535938262939 }, --state pd + }, + + BossActions = { + {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, --state pd + } + + }, + +} diff --git a/esx_policejob_en_full.sql b/localization/esx_policejob_en.sql similarity index 100% rename from esx_policejob_en_full.sql rename to localization/esx_policejob_en.sql From 9a87b353341b3797ef7ea142aaa2b3680a578167 Mon Sep 17 00:00:00 2001 From: David Carneiro <31643017+TheMrDeivid@users.noreply.github.com> Date: Sat, 9 Sep 2017 23:16:54 +0100 Subject: [PATCH 049/253] Added a animations menu Thanks renaiku for the help with codding --- client/main.lua | 233 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 233 insertions(+) diff --git a/client/main.lua b/client/main.lua index afd2a146..4cbfe4de 100644 --- a/client/main.lua +++ b/client/main.lua @@ -472,6 +472,7 @@ function OpenPoliceActionsMenu() {label = _U('citizen_interaction'), value = 'citizen_interaction'}, {label = _U('vehicle_interaction'), value = 'vehicle_interaction'}, {label = _U('object_spawner'), value = 'object_spawner'}, + {label = _U('animations'), value = 'animations'}, }, }, function(data, menu) @@ -653,6 +654,238 @@ function OpenPoliceActionsMenu() ) end + + if data.current.value == 'animations' then + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'police_animations', + { + title = _U('police_animations'), + align = 'top-left', + elements = { + {label = _U('dotraffic'), value = 'traffic'}, + {label = _U('take_note'), value = 'take_notes'}, + {label = _U('dobinoculars'), value = 'binoculars'}, + {label = _U('stand_by'), value = 'standbycop'}, + {label = _U('stand_by_2'), value = 'standbycop2'}, + {label = _U('stand_by_3'), value = 'standbycop3'}, + {label = _U('crowd_control'), value = 'crowdcontrol'}, + {label = _U('doinvestigate'), value = 'investigate'}, + {label = _U('docrouch'), value = 'crouch'}, + {label = _U('hang_out'), value = 'hangout'}, + {label = _U('doleaning'), value = 'leaning'}, + {label = _U('dosmoking'), value = 'smoking'}, + {label = _U('dodrinking'), value = 'drinking'}, + {label = _U('domobile'), value = 'mobile'}, + {label = _U('aacoffe'), value = 'coffe'}, + {label = _U('push_ups'), value = 'pushups'}, + }, + }, + function(data2, menu2) + + local playerPed = GetPlayerPed(-1) + + if data2.current.value == 'traffic' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_CAR_PARK_ATTENDANT", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('dealing_with_traffic')) + + end) + + end + + if data2.current.value == 'take_notes' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_CLIPBOARD", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('taking_notes')) + + end) + + end + + if data2.current.value == 'binoculars' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_BINOCULARS", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('use_binoculars')) + + end) + + end + + + if data2.current.value == 'standbycop' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_COP_IDLES", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('standing_cop')) + + end) + + end + + if data2.current.value == 'standbycop2' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_GUARD_STAND", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('standing_cop_2')) + + end) + + end + + if data2.current.value == 'standbycop3' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_GUARD_PATROL", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('standing_cop_3')) + + end) + + end + + + if data2.current.value == 'crowdcontrol' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_POLICE_CROWD_CONTROL", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('do_crowd_control')) + + end) + + end + + if data2.current.value == 'investigate' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_POLICE_INVESTIGATE", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('investigate_done')) + + end) + + end + + if data2.current.value == 'crouch' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_MEDIC_KNEEL", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('kneel')) + + end) + + end + + if data2.current.value == 'hangout' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_HANG_OUT_STREET", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) + + end) + + end + + if data2.current.value == 'leaning' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_LEANING", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) + + end) + + end + + if data2.current.value == 'smoking' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_SMOKING", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) + + end) + + end + + if data2.current.value == 'drinking' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_DRINKING", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) + + end) + + end + + if data2.current.value == 'mobile' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_STAND_MOBILE", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) + + end) + + end + + if data2.current.value == 'coffe' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_AA_COFFEE", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) + + end) + + end + + if data2.current.value == 'pushups' then + + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_PUSH_UPS", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('exercise')) + + end) + + end + + end, + function(data2, menu2) + menu2.close() + end + ) + + end end, function(data, menu) From 9355a7da330d7abed484db9725fab411cb5e8e5f Mon Sep 17 00:00:00 2001 From: David Carneiro <31643017+TheMrDeivid@users.noreply.github.com> Date: Sat, 9 Sep 2017 23:18:06 +0100 Subject: [PATCH 050/253] Added a animations menu --- locales/en.lua | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/locales/en.lua b/locales/en.lua index 5fe64aa3..9f3eff97 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -25,6 +25,7 @@ Locales['en'] = { ['citizen_interaction'] = 'citizen Interaction', ['vehicle_interaction'] = 'vehicle Interaction', ['object_spawner'] = 'object Spawner', + ['animations'] = 'animations', ['id_card'] = 'iD Card', ['search'] = 'search', @@ -45,6 +46,34 @@ Locales['en'] = { ['spikestrips'] = 'spikestrips', ['box'] = 'box', ['cash'] = 'Box of cash', + ['police_animations'] = 'Police Animations', + ['dotraffic'] = 'Do a traffic stop', + ['take_note'] = 'Take notes', + ['stand_by'] = 'Stand by', + ['stand_by_2'] = 'Stand by 2', + ['stand_by_3'] = 'Stand by 3', + ['crowd_control'] = 'Crowd control', + ['doinvestigate'] = 'Investigate', + ['dobinoculars'] = 'Use the binoculars', + ['taking_notes'] = 'Im done with taking notes', + ['dealing_with_traffic'] = 'Dealing with traffic is hard', + ['standing_cop'] = 'I cant be here anymore', + ['standing_cop_2'] = 'I cant be here anymore', + ['standing_cop_3'] = 'I cant be here anymore', + ['use_binoculars'] = 'I cant see nothing', + ['do_crowd_control'] = 'The crowd is contained', + ['investigate_done'] = 'My investigation is done', + ['docrouch'] = 'Crouch', + ['kneel'] = 'Let me get up', + ['hang_out'] = 'Free time 1', + ['hanging_out'] = 'Lets go work', + ['doleaning'] = 'Free time 2', + ['dosmoking'] = 'Free time 3', + ['dodrinking'] = 'Free time 4', + ['domobile'] = 'Free time 5', + ['aacoffe'] = 'Morning coffe', + ['push_ups'] = 'Exercise a little', + ['exercise'] = 'Im tired', --ID Card Menu ['name'] = 'name : ', ['bac'] = 'bAC : ', @@ -101,4 +130,4 @@ Locales['en'] = { ['police4'] = 'unmarked Vehicle', ['policeb'] = 'motorcycle', ['policet'] = 'transport Van', -} \ No newline at end of file +} From eedda6ece377365158b062990390c96e3244c4c3 Mon Sep 17 00:00:00 2001 From: David Carneiro <31643017+TheMrDeivid@users.noreply.github.com> Date: Sun, 10 Sep 2017 17:38:00 +0100 Subject: [PATCH 051/253] Added a cancel animation option --- client/main.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/main.lua b/client/main.lua index 4cbfe4de..33099a2a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -679,6 +679,7 @@ function OpenPoliceActionsMenu() {label = _U('domobile'), value = 'mobile'}, {label = _U('aacoffe'), value = 'coffe'}, {label = _U('push_ups'), value = 'pushups'}, + {label = _U('cancel_emote'), value = 'emotecancel'}, }, }, function(data2, menu2) @@ -878,6 +879,16 @@ function OpenPoliceActionsMenu() end) end + + if data2.current.value == 'emotecancel' then + + Citizen.CreateThread(function() + ClearPedTasksImmediately(GetPlayerPed(-1)) + TriggerEvent('esx:showNotification', _U('emotecanceled')) + + end) + + end end, function(data2, menu2) From e436dfa9313bb5cedb1a178ef2726440e98b36b6 Mon Sep 17 00:00:00 2001 From: David Carneiro <31643017+TheMrDeivid@users.noreply.github.com> Date: Sun, 10 Sep 2017 17:39:13 +0100 Subject: [PATCH 052/253] Added a cancel animation option --- locales/en.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/locales/en.lua b/locales/en.lua index 9f3eff97..375c64a3 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -74,6 +74,8 @@ Locales['en'] = { ['aacoffe'] = 'Morning coffe', ['push_ups'] = 'Exercise a little', ['exercise'] = 'Im tired', + ['cancel_emote'] = 'Cancel animation', + ['emotecanceled'] = 'Animation stoped', --ID Card Menu ['name'] = 'name : ', ['bac'] = 'bAC : ', From 5f65370f243decc242f0e50387953e96e7dcebac Mon Sep 17 00:00:00 2001 From: o0Coro0o Date: Mon, 11 Sep 2017 21:47:07 +0200 Subject: [PATCH 053/253] Add files via upload Added Spanish language --- locales/es.lua | 107 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 locales/es.lua diff --git a/locales/es.lua b/locales/es.lua new file mode 100644 index 00000000..18d923c3 --- /dev/null +++ b/locales/es.lua @@ -0,0 +1,107 @@ +Locales['es'] = { + --Cloakroom + ['cloakroom'] = 'Taquilla', + ['citizen_wear'] = 'Ropa civil', + ['police_wear'] = 'Ropa CNP', + ['sheriff_wear'] = 'Ropa Oficial', + ['lieutenant_wear'] = 'Ropa Teniente', + ['commandant_wear'] = 'Ropa Secreta', + ['statepd_wear'] = 'Ropa Guardia Civil', + ['specops_wear'] = 'Ropa GEO', + ['open_cloackroom'] = 'Presionar ~INPUT_CONTEXT~ para abrir la taquilla', + --Armory + ['get_weapon'] = 'Coger arma', + ['put_weapon'] = 'Depositar arma', + ['buy_weapons'] = 'Comprar armas', + ['armory'] = 'Arsenal', + ['open_armory'] = 'Presionarr ~INPUT_CONTEXT~ para acceder a la armeria', + --Vehicles + ['vehicle_menu'] = 'Vehículo', + ['vehicle_out'] = 'Ya tienes un vehículo fuera', + ['vehicle_spawner'] = 'Presionar ~INPUT_CONTEXT~ para sacar un vehículo', + ['store_vehicle'] = 'Presionar ~INPUT_CONTEXT~ para guardar un vehículo', + ['service_max'] = 'Servicio completado : ', + --Action Menu + ['citizen_interaction'] = 'Interacción ciudadana', + ['vehicle_interaction'] = 'Interacción vehículo', + ['object_spawner'] = 'Colocar objetos', + + ['id_card'] = 'Documento de identidad', + ['search'] = 'Buscar', + ['handcuff'] = 'Poner/quitar Esposas', + ['drag'] = 'escoltar', + ['put_in_vehicle'] = 'Meter en el vehículo', + ['out_the_vehicle'] = 'Sacar del vehículo', + ['fine'] = 'Multa', + ['no_players_nearby'] = 'No hay jugadores cerca', + + ['vehicle_info'] = 'Información del vehículo', + ['pick_lock'] = 'Forzar coche', + ['vehicle_unlocked'] = 'Vehículo desbloqueado~s~', + ['no_vehicles_nearby'] = 'No hay vehículos cerca', + ['traffic_interaction'] = 'Rutas de interacción', + ['cone'] = 'Cono', + ['barrier'] = 'Barrera', + ['spikestrips'] = 'Grada', + ['box'] = 'Caja', + ['cash'] = 'Dinero', + --ID Card Menu + ['name'] = 'Nombre : ', + ['bac'] = 'Alcoolemia : ', + --Body Search Menu + ['confiscate_dirty'] = 'Confiscar dinero negro : €', + ['guns_label'] = '--- Armas ---', + ['confiscate'] = 'Confiscar ', + ['inventory_label'] = '--- Inventario ---', + ['confiscate_inv'] = 'Confiscar x', + + ['traffic_offense'] = 'Delito de tráfico', + ['minor_offense'] = 'Delito menor', + ['average_offense'] = 'Delito medio', + ['major_offense'] = 'Delito grave', + ['fine_total'] = 'Multa total : ', + --Vehicle Info Menu + ['plate'] = 'N°: ', + ['owner_unknown'] = 'Propietario : Desconocido', + ['owner'] = 'Propietario : ', + --Weapons Menus + ['get_weapon_menu'] = 'Arsenal - Coger armas', + ['put_weapon_menu'] = 'Arsenal - Depositar armas', + ['buy_weapon_menu'] = 'Arsenal - Comprar armas', + ['not_enough_money'] = 'No tienes suficiente dinero', + --Boss Menu + ['take_company_money'] = 'Retirar dinero de la empresa', + ['deposit_money'] = 'Depositar dinero en la empresa', + ['amount_of_withdrawal'] = 'Cantidad a retirar', + ['invalid_amount'] = 'Cantidad inválida', + ['amount_of_deposit'] = 'Cantidad a depositar', + ['open_bossmenu'] = 'Presionar ~INPUT_CONTEXT~ para abrir el menú', + ['quantity_invalid'] = 'Cantidad invalida', + ['have_withdrawn'] = 'Has retirado x', + ['added'] = 'Has metido x', + ['quantity'] = 'Cantidad', + ['inventory'] = 'inventario', + ['police_stock'] = 'Almacen Policial', + --Misc + ['remove_object'] = 'Presionar ~INPUT_CONTEXT~ para eliminar el objeto', + ['map_blip'] = 'Comisaría de policía', + --Notifications + ['from'] = '~s~ de ~b~', + ['you_have_confinv'] = 'Has confiscado ~y~x', + ['confinv'] = '~s~ Te han confiscado ~y~x', + ['you_have_confdm'] = 'Has confiscado ~y~€', + ['confdm'] = '~s~ Te han confiscado ~y~€', + ['you_have_confweapon'] = 'Has confiscado ~y~x1 ', + ['confweapon'] = '~s~ Te han confiscado ~y~x1 ', + ['alert_police'] = 'Alerta policia', + --Authorized Vehicles + ['policebike'] = 'Bicicleta Policía', + ['focuscnp'] = 'Vehículo patrulla 1', + ['tiguancnp'] = 'Vehículo patrulla 2', + ['police3'] = 'Vehículo patrulla 3', + ['police4'] = 'Vehículo Secreta', + ['policeb'] = 'Moto', + ['policet'] = 'Furgón policial', + ['polmav'] = 'Helicóptero de la policía', + ['buzzard2'] = 'Helicóptero de mando', +} \ No newline at end of file From b367ba351eb070ae621187b3dbfa1dc1b4dc190f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 12 Sep 2017 10:31:22 +0200 Subject: [PATCH 054/253] Bring back stocks menu --- client/main.lua | 352 ++++++++++++++++++++++++------------------------ 1 file changed, 177 insertions(+), 175 deletions(-) diff --git a/client/main.lua b/client/main.lua index 33099a2a..df37bb44 100644 --- a/client/main.lua +++ b/client/main.lua @@ -240,7 +240,9 @@ function OpenArmoryMenu(station) local elements = { {label = _U('get_weapon'), value = 'get_weapon'}, - {label = _U('put_weapon'), value = 'put_weapon'} + {label = _U('put_weapon'), value = 'put_weapon'}, + {label = 'Prendre Objet', value = 'get_stock'}, + {label = 'Déposer objet', value = 'put_stock'} } if PlayerData.job.grade_name == 'boss' then @@ -657,240 +659,240 @@ function OpenPoliceActionsMenu() if data.current.value == 'animations' then - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'police_animations', - { - title = _U('police_animations'), - align = 'top-left', - elements = { - {label = _U('dotraffic'), value = 'traffic'}, - {label = _U('take_note'), value = 'take_notes'}, - {label = _U('dobinoculars'), value = 'binoculars'}, - {label = _U('stand_by'), value = 'standbycop'}, - {label = _U('stand_by_2'), value = 'standbycop2'}, - {label = _U('stand_by_3'), value = 'standbycop3'}, - {label = _U('crowd_control'), value = 'crowdcontrol'}, - {label = _U('doinvestigate'), value = 'investigate'}, - {label = _U('docrouch'), value = 'crouch'}, - {label = _U('hang_out'), value = 'hangout'}, - {label = _U('doleaning'), value = 'leaning'}, - {label = _U('dosmoking'), value = 'smoking'}, - {label = _U('dodrinking'), value = 'drinking'}, - {label = _U('domobile'), value = 'mobile'}, - {label = _U('aacoffe'), value = 'coffe'}, - {label = _U('push_ups'), value = 'pushups'}, - {label = _U('cancel_emote'), value = 'emotecancel'}, + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'police_animations', + title = _U('police_animations'), + align = 'top-left', + elements = { + {label = _U('dotraffic'), value = 'traffic'}, + {label = _U('take_note'), value = 'take_notes'}, + {label = _U('dobinoculars'), value = 'binoculars'}, + {label = _U('stand_by'), value = 'standbycop'}, + {label = _U('stand_by_2'), value = 'standbycop2'}, + {label = _U('stand_by_3'), value = 'standbycop3'}, + {label = _U('crowd_control'), value = 'crowdcontrol'}, + {label = _U('doinvestigate'), value = 'investigate'}, + {label = _U('docrouch'), value = 'crouch'}, + {label = _U('hang_out'), value = 'hangout'}, + {label = _U('doleaning'), value = 'leaning'}, + {label = _U('dosmoking'), value = 'smoking'}, + {label = _U('dodrinking'), value = 'drinking'}, + {label = _U('domobile'), value = 'mobile'}, + {label = _U('aacoffe'), value = 'coffe'}, + {label = _U('push_ups'), value = 'pushups'}, + {label = _U('cancel_emote'), value = 'emotecancel'}, + }, }, - }, - function(data2, menu2) - local playerPed = GetPlayerPed(-1) + function(data2, menu2) - if data2.current.value == 'traffic' then + local playerPed = GetPlayerPed(-1) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_CAR_PARK_ATTENDANT", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('dealing_with_traffic')) + if data2.current.value == 'traffic' then - end) + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_CAR_PARK_ATTENDANT", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('dealing_with_traffic')) - end - - if data2.current.value == 'take_notes' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_CLIPBOARD", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('taking_notes')) + end - end) + if data2.current.value == 'take_notes' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_CLIPBOARD", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('taking_notes')) - if data2.current.value == 'binoculars' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_BINOCULARS", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('use_binoculars')) + end - end) + if data2.current.value == 'binoculars' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_BINOCULARS", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('use_binoculars')) + end) - if data2.current.value == 'standbycop' then + end - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_COP_IDLES", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('standing_cop')) - end) + if data2.current.value == 'standbycop' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_COP_IDLES", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('standing_cop')) - if data2.current.value == 'standbycop2' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_GUARD_STAND", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('standing_cop_2')) + end - end) + if data2.current.value == 'standbycop2' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_GUARD_STAND", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('standing_cop_2')) - if data2.current.value == 'standbycop3' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_GUARD_PATROL", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('standing_cop_3')) + end - end) + if data2.current.value == 'standbycop3' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_GUARD_PATROL", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('standing_cop_3')) + end) - if data2.current.value == 'crowdcontrol' then + end - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_POLICE_CROWD_CONTROL", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('do_crowd_control')) - end) + if data2.current.value == 'crowdcontrol' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_POLICE_CROWD_CONTROL", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('do_crowd_control')) - if data2.current.value == 'investigate' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_POLICE_INVESTIGATE", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('investigate_done')) + end - end) + if data2.current.value == 'investigate' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_POLICE_INVESTIGATE", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('investigate_done')) - if data2.current.value == 'crouch' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_MEDIC_KNEEL", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('kneel')) + end - end) + if data2.current.value == 'crouch' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_MEDIC_KNEEL", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('kneel')) - if data2.current.value == 'hangout' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_HANG_OUT_STREET", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) + end - end) + if data2.current.value == 'hangout' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_HANG_OUT_STREET", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) - if data2.current.value == 'leaning' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_LEANING", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) + end - end) + if data2.current.value == 'leaning' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_LEANING", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) - if data2.current.value == 'smoking' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_SMOKING", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) + end - end) + if data2.current.value == 'smoking' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_SMOKING", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) - if data2.current.value == 'drinking' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_DRINKING", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) + end - end) + if data2.current.value == 'drinking' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_DRINKING", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) - if data2.current.value == 'mobile' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_STAND_MOBILE", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) + end - end) + if data2.current.value == 'mobile' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_STAND_MOBILE", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) - if data2.current.value == 'coffe' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_AA_COFFEE", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) + end - end) + if data2.current.value == 'coffe' then - end + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_AA_COFFEE", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('hanging_out')) - if data2.current.value == 'pushups' then + end) - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_PUSH_UPS", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('exercise')) + end - end) + if data2.current.value == 'pushups' then - end - - if data2.current.value == 'emotecancel' then + Citizen.CreateThread(function() + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_PUSH_UPS", 0, true) + Wait(20000) + ClearPedTasksImmediately(playerPed) + TriggerEvent('esx:showNotification', _U('exercise')) - Citizen.CreateThread(function() - ClearPedTasksImmediately(GetPlayerPed(-1)) - TriggerEvent('esx:showNotification', _U('emotecanceled')) + end) - end) + end - end + if data2.current.value == 'emotecancel' then - end, + Citizen.CreateThread(function() + ClearPedTasksImmediately(GetPlayerPed(-1)) + TriggerEvent('esx:showNotification', _U('emotecanceled')) + + end) + + end + + end, function(data2, menu2) menu2.close() end @@ -1231,17 +1233,6 @@ function OpenVehicleInfosMenu(vehicleData) end -RegisterNetEvent('esx_policejob:OutVehicle') -AddEventHandler('esx_policejob:OutVehicle', function(t) - local ped = GetPlayerPed(t) - ClearPedTasksImmediately(ped) - plyPos = GetEntityCoords(GetPlayerPed(-1), true) - local xnew = plyPos.x+2 - local ynew = plyPos.y+2 - - SetEntityCoords(GetPlayerPed(-1), xnew, ynew, plyPos.z) -end) - function OpenGetWeaponMenu() ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) @@ -1708,6 +1699,17 @@ AddEventHandler('esx_policejob:putInVehicle', function() end) +RegisterNetEvent('esx_policejob:OutVehicle') +AddEventHandler('esx_policejob:OutVehicle', function(t) + local ped = GetPlayerPed(t) + ClearPedTasksImmediately(ped) + plyPos = GetEntityCoords(GetPlayerPed(-1), true) + local xnew = plyPos.x+2 + local ynew = plyPos.y+2 + + SetEntityCoords(GetPlayerPed(-1), xnew, ynew, plyPos.z) +end) + -- Handcuff Citizen.CreateThread(function() while true do From dbb82c4210fda2bf762c1fdb2ce98f73ac7bb69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 12 Sep 2017 10:32:09 +0200 Subject: [PATCH 055/253] Fix stock --- server/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/main.lua b/server/main.lua index 5dcc4570..6233f3e6 100644 --- a/server/main.lua +++ b/server/main.lua @@ -80,7 +80,7 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count) local xPlayer = ESX.GetPlayerFromId(source) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_policestock', function(inventory) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) local item = inventory.getItem(itemName) @@ -102,7 +102,7 @@ AddEventHandler('esx_policejob:putStockItems', function(itemName, count) local xPlayer = ESX.GetPlayerFromId(source) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_policestock', function(inventory) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) local item = inventory.getItem(itemName) @@ -434,7 +434,7 @@ end) ESX.RegisterServerCallback('esx_policejob:getStockItems', function(source, cb) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_policestock', function(inventory) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) cb(inventory.items) end) From dd4f9bf11130bc84ce77dfd317d997678e24fbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 12 Sep 2017 10:37:56 +0200 Subject: [PATCH 056/253] Remove animations --- client/main.lua | 244 ------------------------------------------------ 1 file changed, 244 deletions(-) diff --git a/client/main.lua b/client/main.lua index df37bb44..44357bfe 100644 --- a/client/main.lua +++ b/client/main.lua @@ -474,7 +474,6 @@ function OpenPoliceActionsMenu() {label = _U('citizen_interaction'), value = 'citizen_interaction'}, {label = _U('vehicle_interaction'), value = 'vehicle_interaction'}, {label = _U('object_spawner'), value = 'object_spawner'}, - {label = _U('animations'), value = 'animations'}, }, }, function(data, menu) @@ -656,249 +655,6 @@ function OpenPoliceActionsMenu() ) end - - if data.current.value == 'animations' then - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'police_animations', - title = _U('police_animations'), - align = 'top-left', - elements = { - {label = _U('dotraffic'), value = 'traffic'}, - {label = _U('take_note'), value = 'take_notes'}, - {label = _U('dobinoculars'), value = 'binoculars'}, - {label = _U('stand_by'), value = 'standbycop'}, - {label = _U('stand_by_2'), value = 'standbycop2'}, - {label = _U('stand_by_3'), value = 'standbycop3'}, - {label = _U('crowd_control'), value = 'crowdcontrol'}, - {label = _U('doinvestigate'), value = 'investigate'}, - {label = _U('docrouch'), value = 'crouch'}, - {label = _U('hang_out'), value = 'hangout'}, - {label = _U('doleaning'), value = 'leaning'}, - {label = _U('dosmoking'), value = 'smoking'}, - {label = _U('dodrinking'), value = 'drinking'}, - {label = _U('domobile'), value = 'mobile'}, - {label = _U('aacoffe'), value = 'coffe'}, - {label = _U('push_ups'), value = 'pushups'}, - {label = _U('cancel_emote'), value = 'emotecancel'}, - }, - }, - - function(data2, menu2) - - local playerPed = GetPlayerPed(-1) - - if data2.current.value == 'traffic' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_CAR_PARK_ATTENDANT", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('dealing_with_traffic')) - - end) - - end - - if data2.current.value == 'take_notes' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_CLIPBOARD", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('taking_notes')) - - end) - - end - - if data2.current.value == 'binoculars' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_BINOCULARS", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('use_binoculars')) - - end) - - end - - - if data2.current.value == 'standbycop' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_COP_IDLES", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('standing_cop')) - - end) - - end - - if data2.current.value == 'standbycop2' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_GUARD_STAND", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('standing_cop_2')) - - end) - - end - - if data2.current.value == 'standbycop3' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_GUARD_PATROL", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('standing_cop_3')) - - end) - - end - - - if data2.current.value == 'crowdcontrol' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_POLICE_CROWD_CONTROL", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('do_crowd_control')) - - end) - - end - - if data2.current.value == 'investigate' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_POLICE_INVESTIGATE", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('investigate_done')) - - end) - - end - - if data2.current.value == 'crouch' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_MEDIC_KNEEL", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('kneel')) - - end) - - end - - if data2.current.value == 'hangout' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_HANG_OUT_STREET", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) - - end) - - end - - if data2.current.value == 'leaning' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_LEANING", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) - - end) - - end - - if data2.current.value == 'smoking' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_SMOKING", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) - - end) - - end - - if data2.current.value == 'drinking' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_DRINKING", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) - - end) - - end - - if data2.current.value == 'mobile' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_STAND_MOBILE", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) - - end) - - end - - if data2.current.value == 'coffe' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_AA_COFFEE", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('hanging_out')) - - end) - - end - - if data2.current.value == 'pushups' then - - Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_PUSH_UPS", 0, true) - Wait(20000) - ClearPedTasksImmediately(playerPed) - TriggerEvent('esx:showNotification', _U('exercise')) - - end) - - end - - if data2.current.value == 'emotecancel' then - - Citizen.CreateThread(function() - ClearPedTasksImmediately(GetPlayerPed(-1)) - TriggerEvent('esx:showNotification', _U('emotecanceled')) - - end) - - end - - end, - function(data2, menu2) - menu2.close() - end - ) - - end end, function(data, menu) From 83bd85c377dac233f9a66b8a763bf54631171072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 12 Sep 2017 11:12:27 +0200 Subject: [PATCH 057/253] Fix drunk status detection --- server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index 6233f3e6..1fff1ef6 100644 --- a/server/main.lua +++ b/server/main.lua @@ -154,10 +154,10 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, height = height } - TriggerEvent('esx_status:getStatus', _source, 'drunk', function(status) + TriggerEvent('esx_status:getStatus', source, 'drunk', function(status) if status ~= nil then - data.drunk = status.getPercent() + data.drunk = math.floor(status.percent) end end) From 0249ca241bf3931bf929839a6a1bd30bbad30e61 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 12 Sep 2017 08:52:46 -0500 Subject: [PATCH 058/253] Update config.lua --- config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.lua b/config.lua index 9e8d1f8b..06146f26 100644 --- a/config.lua +++ b/config.lua @@ -5,7 +5,7 @@ Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false -Config.EnableGCIdentity = false +Config.EnableESXIdentity = false Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false Config.MaxInService = -1 From 4ffa0fe775e89dcad09c83638898b79921cb9561 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 12 Sep 2017 08:56:38 -0500 Subject: [PATCH 059/253] Update main.lua --- server/main.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/main.lua b/server/main.lua index 1fff1ef6..f9944b44 100644 --- a/server/main.lua +++ b/server/main.lua @@ -121,13 +121,13 @@ end) ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, cb, target) - if Config.EnableGCIdentity then + if Config.EnableESXIdentity then local xPlayer = ESX.GetPlayerFromId(target) local identifier = GetPlayerIdentifiers(target)[1] - local result = MySQL.Sync.fetchAll("SELECT firstname, lastname, sex, dateofbirth, height FROM users WHERE identifier = @identifier", { + local result = MySQL.Sync.fetchAll("SELECT * FROM characters WHERE identifier = @identifier", { ['@identifier'] = identifier }) @@ -135,10 +135,10 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, local firstname = user['firstname'] local lastname = user['lastname'] local sex = user['sex'] - local dob = tostring(user['dateofbirth']) + local dob = user['dateofbirth'] local heightInit = user['height'] local heightFeet = tonumber(string.format("%.0f",heightInit / 12, 0)) - local heightInches = heightInit % 12 + local heightInches = tonumber(string.format("%.0f",heightInit % 12, 0)) local height = heightFeet .. "\' " .. heightInches .. "\"" local data = { @@ -214,7 +214,7 @@ end) ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, plate) - if Config.EnableGCIdentity then + if Config.EnableESXIdentity then MySQL.Async.fetchAll( 'SELECT * FROM owned_vehicles', @@ -237,7 +237,7 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, if foundIdentifier ~= nil then MySQL.Async.fetchAll( - 'SELECT * FROM users WHERE identifier = @identifier', + 'SELECT * FROM characters WHERE identifier = @identifier', { ['@identifier'] = foundIdentifier }, From 8b9d63df6f9da9c4dbae94f371b4f327c6a49d0c Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 12 Sep 2017 08:57:39 -0500 Subject: [PATCH 060/253] Update main.lua --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 44357bfe..7efda18e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -668,7 +668,7 @@ end function OpenIdentityCardMenu(player) - if Config.EnableGCIdentity then + if Config.EnableESXIdentity then ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) From 712bd5706d44fe0bdb4140c4f092da41ed39c40b Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 12 Sep 2017 08:59:10 -0500 Subject: [PATCH 061/253] Update en_config.lua --- localization/en_config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localization/en_config.lua b/localization/en_config.lua index 4990c8e7..de9bd993 100644 --- a/localization/en_config.lua +++ b/localization/en_config.lua @@ -5,7 +5,7 @@ Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false -Config.EnableGCIdentity = false +Config.EnableESXIdentity = false Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false Config.MaxInService = -1 From db5a7439cd73a703ed816b447ca24bfa460fdbc1 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 12 Sep 2017 08:59:24 -0500 Subject: [PATCH 062/253] Update de_config.lua --- localization/de_config.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localization/de_config.lua b/localization/de_config.lua index a7c890f7..627a5d4c 100644 --- a/localization/de_config.lua +++ b/localization/de_config.lua @@ -5,7 +5,7 @@ Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false -Config.EnableGCIdentity = false +Config.EnableESXIdentity = false Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false Config.MaxInService = -1 @@ -79,4 +79,4 @@ Config.PoliceStations = { } -} \ No newline at end of file +} From e0465ea5eba58a0869c795dc27dd9051f5395e7e Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 12 Sep 2017 08:59:35 -0500 Subject: [PATCH 063/253] Update config.lua --- config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.lua b/config.lua index 06146f26..7e9e041b 100644 --- a/config.lua +++ b/config.lua @@ -5,7 +5,7 @@ Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false -Config.EnableESXIdentity = false +Config.EnableESXIdentity = false Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false Config.MaxInService = -1 From 0462fa7f639fd84a7b85481733ecef7752ebdba2 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 12 Sep 2017 09:01:22 -0500 Subject: [PATCH 064/253] Update config.lua --- config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.lua b/config.lua index 7e9e041b..6fbdba41 100644 --- a/config.lua +++ b/config.lua @@ -5,7 +5,7 @@ Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false -Config.EnableESXIdentity = false +Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false Config.MaxInService = -1 From edc53cde5da140c3ac745c8ddddd797ddeca43de Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 12 Sep 2017 09:01:35 -0500 Subject: [PATCH 065/253] Update en_config.lua --- localization/en_config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localization/en_config.lua b/localization/en_config.lua index de9bd993..880efeba 100644 --- a/localization/en_config.lua +++ b/localization/en_config.lua @@ -5,7 +5,7 @@ Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false -Config.EnableESXIdentity = false +Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false Config.MaxInService = -1 From 6fbcd1fd98bb69467439adba0725949ab3cc8c49 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 12 Sep 2017 09:01:57 -0500 Subject: [PATCH 066/253] Update de_config.lua --- localization/de_config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localization/de_config.lua b/localization/de_config.lua index 627a5d4c..bd6585e8 100644 --- a/localization/de_config.lua +++ b/localization/de_config.lua @@ -5,7 +5,7 @@ Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false -Config.EnableESXIdentity = false +Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false Config.MaxInService = -1 From b576d444e44361788155dd77e241d44b7534240b Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 12 Sep 2017 09:10:46 -0500 Subject: [PATCH 067/253] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index adb07de1..4d8d3dcb 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ FXServer ESX Police Job * Player management (boss actions and armory with buyable weapons) * esx_society => https://github.com/FXServer-ESX/fxserver-esx_society * esx_datastore => https://github.com/FXServer-ESX/fxserver-esx_datastore + +* ESX Identity Support + * esx_identity => https://github.com/ArkSeyonet/fxserver-esx_identity [INSTALLATION] From cff78c023b06bf88aa85b537eeedee47af2e149d Mon Sep 17 00:00:00 2001 From: nearbyplayer <3721216+nearbyplayer@users.noreply.github.com> Date: Tue, 12 Sep 2017 11:53:32 -0400 Subject: [PATCH 068/253] Update esx_policejob_en.sql Fix Grade Names --- localization/esx_policejob_en.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/localization/esx_policejob_en.sql b/localization/esx_policejob_en.sql index c21720ae..204e54df 100644 --- a/localization/esx_policejob_en.sql +++ b/localization/esx_policejob_en.sql @@ -15,10 +15,10 @@ INSERT INTO `jobs` (name, label) VALUES ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recruit','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',0,'recruit','Recruit',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',1,'sergeant','Sergeant',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') + ('police',3,'boss','Chief',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; CREATE TABLE `fine_types` ( @@ -84,4 +84,4 @@ INSERT INTO `fine_types` (label, amount, category) VALUES ('Murder of an LEO', 30000, 3), ('Involuntary manslaughter', 1800, 3), ('Fraud', 2000, 2); -; \ No newline at end of file +; From 6a3c9cb72375b36ab8969f92b454c4412905923e Mon Sep 17 00:00:00 2001 From: Coro Veneno Date: Tue, 12 Sep 2017 23:11:56 +0200 Subject: [PATCH 069/253] Update Spanish Language Added Spanish Language --- __resource.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/__resource.lua b/__resource.lua index 184ac3ec..9b596dec 100644 --- a/__resource.lua +++ b/__resource.lua @@ -3,20 +3,22 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' server_scripts { - '@es_extended/locale.lua', + '@es_extended/locale.lua', 'locales/br.lua', - 'locales/en.lua', - 'locales/fr.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'locales/es.lua', '@mysql-async/lib/MySQL.lua', 'config.lua', 'server/main.lua' } -client_scripts { - '@es_extended/locale.lua', +client_scripts + '@es_extended/locale.lua', 'locales/br.lua', - 'locales/en.lua', - 'locales/fr.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'locales/es.lua', 'config.lua', 'client/main.lua' } From 08541068339de460f09109d65052764b9210d22e Mon Sep 17 00:00:00 2001 From: Don <30905704+ddh3@users.noreply.github.com> Date: Tue, 12 Sep 2017 15:46:29 -0700 Subject: [PATCH 070/253] fixed spelling fixed spelling --- locales/en.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/en.lua b/locales/en.lua index 375c64a3..06ea6dbc 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -32,7 +32,7 @@ Locales['en'] = { ['handcuff'] = 'cuff / Uncuff', ['drag'] = 'drag', ['put_in_vehicle'] = 'put in Vehicle', - ['out_the_vehicle'] = 'take ou of vehicle', + ['out_the_vehicle'] = 'take out of vehicle', ['fine'] = 'fine', ['no_players_nearby'] = 'no players nearby', From 91e6aace4e65dec6dc611beccb7950e19bd4a679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 13 Sep 2017 12:06:28 +0200 Subject: [PATCH 071/253] Update licenses support --- config.lua | 1 + server/main.lua | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/config.lua b/config.lua index 9e8d1f8b..fe299041 100644 --- a/config.lua +++ b/config.lua @@ -8,6 +8,7 @@ Config.EnableArmoryManagement = false Config.EnableGCIdentity = false Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false +Config.EnableLicenses = false Config.MaxInService = -1 Config.Locale = 'fr' diff --git a/server/main.lua b/server/main.lua index 1fff1ef6..93466ddc 100644 --- a/server/main.lua +++ b/server/main.lua @@ -162,11 +162,16 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, end) - TriggerEvent('esx_license:getLicenses', _source, function(licenses) - data.licenses = licenses - end) + if Config.EnableLicenses then - cb(data) + TriggerEvent('esx_license:getLicenses', source, function(licenses) + data.licenses = licenses + cb(data) + end) + + else + cb(data) + end else From 6cd451101cd10d4fd55261f28399640d9b0311e8 Mon Sep 17 00:00:00 2001 From: nearbyplayer <3721216+nearbyplayer@users.noreply.github.com> Date: Wed, 13 Sep 2017 06:28:02 -0400 Subject: [PATCH 072/253] Update __resource.lua Small fix. --- __resource.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__resource.lua b/__resource.lua index 9b596dec..4afa6080 100644 --- a/__resource.lua +++ b/__resource.lua @@ -13,7 +13,7 @@ server_scripts { 'server/main.lua' } -client_scripts +client_scripts { '@es_extended/locale.lua', 'locales/br.lua', 'locales/en.lua', From f47cc3fb69c058b583e5d89069a61cc3edca2cb4 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Wed, 13 Sep 2017 21:29:57 +0200 Subject: [PATCH 073/253] feat(society): register the society witht the new system (#18) * feat(society): register the society witht the new system * Update main.lua --- server/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/server/main.lua b/server/main.lua index 3f00b8b2..a20a550e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -7,6 +7,7 @@ if Config.MaxInService ~= -1 then end TriggerEvent('esx_phone:registerNumber', 'police', _U('alert_police'), true, true) +TriggerEvent('esx_society:registerSociety', 'police', 'Police', 'society_police', 'society_police', 'society_police', {type = 'public'}) RegisterServerEvent('esx_policejob:giveWeapon') AddEventHandler('esx_policejob:giveWeapon', function(weapon, ammo) From f4871fba0f6bbd273a0055be5eed2e15889b4e8b Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Wed, 13 Sep 2017 22:06:28 +0200 Subject: [PATCH 074/253] fix(cloakroom): don't loose weapon while going back to citizen --- client/main.lua | 47 +++++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/client/main.lua b/client/main.lua index 7efda18e..eefa2f05 100644 --- a/client/main.lua +++ b/client/main.lua @@ -75,38 +75,29 @@ function OpenCloakroomMenu() menu.close() --Taken from SuperCoolNinja - if data.current.value == 'citizen_wear' then + if data.current.value == 'citizen_wear' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + local model = nil - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + if skin.sex == 0 then + model = GetHashKey("mp_m_freemode_01") + else + model = GetHashKey("mp_f_freemode_01") + end - if skin.sex == 0 then + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(1) + end - local model = GetHashKey("mp_m_freemode_01") - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - TriggerEvent('skinchanger:loadSkin', skin) - else - local model = GetHashKey("mp_f_freemode_01") - - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end - - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - TriggerEvent('skinchanger:loadSkin', skin) - end - - end) - end + TriggerEvent('skinchanger:loadSkin', skin) + TriggerEvent('esx:restoreLoadout') + end) + end if data.current.value == 'police_wear' then From 828624ccf86798bcc6512bfc7526c29397d69aa2 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Thu, 14 Sep 2017 14:26:25 +0200 Subject: [PATCH 075/253] chore(coding-style): correct indentation --- .editorconfig | 9 + __resource.lua | 30 +- client/main.lua | 2427 +++++++++++++++-------------- config.lua | 114 +- locales/br.lua | 174 +-- locales/de.lua | 174 +-- locales/en.lua | 260 +-- locales/es.lua | 214 +-- locales/fr.lua | 200 +-- localization/de_config.lua | 112 +- localization/de_esx_policejob.sql | 30 +- localization/en_config.lua | 412 ++--- localization/esx_policejob_en.sql | 134 +- server/main.lua | 572 +++---- 14 files changed, 2436 insertions(+), 2426 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..41c2aaf2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 2 +indent_style = space +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/__resource.lua b/__resource.lua index 4afa6080..dc62d8b1 100644 --- a/__resource.lua +++ b/__resource.lua @@ -3,22 +3,22 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' server_scripts { - '@es_extended/locale.lua', - 'locales/br.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'locales/es.lua', - '@mysql-async/lib/MySQL.lua', - 'config.lua', - 'server/main.lua' + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'locales/es.lua', + '@mysql-async/lib/MySQL.lua', + 'config.lua', + 'server/main.lua' } client_scripts { - '@es_extended/locale.lua', - 'locales/br.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'locales/es.lua', - 'config.lua', - 'client/main.lua' + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'locales/es.lua', + 'config.lua', + 'client/main.lua' } diff --git a/client/main.lua b/client/main.lua index eefa2f05..bfadf5e5 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,19 +1,17 @@ local Keys = { - ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, - ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, - ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, - ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, - ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, - ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, - ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, - ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, - ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 + ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, + ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, + ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, + ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, + ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, + ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, + ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, + ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, + ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 } -ESX = nil local PlayerData = {} local GUI = {} -GUI.Time = 0 local HasAlreadyEnteredMarker = false local LastStation = nil local LastPart = nil @@ -23,63 +21,66 @@ local CurrentAction = nil local CurrentActionMsg = '' local CurrentActionData = {} local IsHandcuffed = false -local IsDragged = false -local CopPed = 0 +local IsDragged = false +local CopPed = 0 + +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 end) function SetVehicleMaxMods(vehicle) - local props = { - modEngine = 2, - modBrakes = 2, - modTransmission = 2, - modSuspension = 3, - modTurbo = true, - } + local props = { + modEngine = 2, + modBrakes = 2, + modTransmission = 2, + modSuspension = 3, + modTurbo = true, + } - ESX.Game.SetVehicleProperties(vehicle, props) + ESX.Game.SetVehicleProperties(vehicle, props) end function OpenCloakroomMenu() - local elements = { + local elements = { {label = _U('citizen_wear'), value = 'citizen_wear'}, {label = _U('police_wear'), value = 'police_wear'} - } + } - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - if Config.EnableNonFreemodePeds then - table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear'}) - table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear'}) - table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear'}) - end + if Config.EnableNonFreemodePeds then + table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear'}) + table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear'}) + table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear'}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'cloakroom', - { - title = _U('cloakroom'), - align = 'top-left', - elements = elements, - }, + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'cloakroom', + { + title = _U('cloakroom'), + align = 'top-left', + elements = elements, + }, - function(data, menu) + function(data, menu) - menu.close() + menu.close() - --Taken from SuperCoolNinja - if data.current.value == 'citizen_wear' then + --Taken from SuperCoolNinja + if data.current.value == 'citizen_wear' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) local model = nil - if skin.sex == 0 then + if skin.sex == 0 then model = GetHashKey("mp_m_freemode_01") else model = GetHashKey("mp_f_freemode_01") @@ -99,1132 +100,1132 @@ function OpenCloakroomMenu() end) end - if data.current.value == 'police_wear' then + if data.current.value == 'police_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male) - else - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) - end + if skin.sex == 0 then + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male) + else + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) + end - end) + end) - end + end - if data.current.value == 'sheriff_wear' then + if data.current.value == 'sheriff_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then + if skin.sex == 0 then - local model = GetHashKey("s_m_y_sheriff_01") + local model = GetHashKey("s_m_y_sheriff_01") - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - else - local model = GetHashKey("s_f_y_sheriff_01") + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + else + local model = GetHashKey("s_f_y_sheriff_01") - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - end + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + end - end) - end + end) + end - if data.current.value == 'lieutenant_wear' then + if data.current.value == 'lieutenant_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - local model = GetHashKey("s_m_y_swat_01") + if skin.sex == 0 then + local model = GetHashKey("s_m_y_swat_01") - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - else - local model = GetHashKey("s_m_y_swat_01") + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + else + local model = GetHashKey("s_m_y_swat_01") - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - end + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + end - end) - end + end) + end - if data.current.value == 'commandant_wear' then + if data.current.value == 'commandant_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - local model = GetHashKey("s_m_y_swat_01") + if skin.sex == 0 then + local model = GetHashKey("s_m_y_swat_01") - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - else - local model = GetHashKey("s_m_y_swat_01") + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + else + local model = GetHashKey("s_m_y_swat_01") - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(0) + end - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - end + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + end - end) - end + end) + end - CurrentAction = 'menu_cloakroom' - CurrentActionMsg = _U('open_cloackroom') - CurrentActionData = {} + CurrentAction = 'menu_cloakroom' + CurrentActionMsg = _U('open_cloackroom') + CurrentActionData = {} - end, - function(data, menu) + end, + function(data, menu) - menu.close() + menu.close() - CurrentAction = 'menu_cloakroom' - CurrentActionMsg = _U('open_cloackroom') - CurrentActionData = {} - end - ) + CurrentAction = 'menu_cloakroom' + CurrentActionMsg = _U('open_cloackroom') + CurrentActionData = {} + end + ) end function OpenArmoryMenu(station) - if Config.EnableArmoryManagement then + if Config.EnableArmoryManagement then - local elements = { - {label = _U('get_weapon'), value = 'get_weapon'}, - {label = _U('put_weapon'), value = 'put_weapon'}, - {label = 'Prendre Objet', value = 'get_stock'}, - {label = 'Déposer objet', value = 'put_stock'} - } + local elements = { + {label = _U('get_weapon'), value = 'get_weapon'}, + {label = _U('put_weapon'), value = 'put_weapon'}, + {label = 'Prendre Objet', value = 'get_stock'}, + {label = 'Déposer objet', value = 'put_stock'} + } - if PlayerData.job.grade_name == 'boss' then - table.insert(elements, {label = _U('buy_weapons'), value = 'buy_weapons'}) - end + if PlayerData.job.grade_name == 'boss' then + table.insert(elements, {label = _U('buy_weapons'), value = 'buy_weapons'}) + end - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'armory', - { - title = _U('armory'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'armory', + { + title = _U('armory'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - if data.current.value == 'get_weapon' then - OpenGetWeaponMenu() - end + if data.current.value == 'get_weapon' then + OpenGetWeaponMenu() + end - if data.current.value == 'put_weapon' then - OpenPutWeaponMenu() - end + if data.current.value == 'put_weapon' then + OpenPutWeaponMenu() + end - if data.current.value == 'buy_weapons' then - OpenBuyWeaponsMenu(station) - end + if data.current.value == 'buy_weapons' then + OpenBuyWeaponsMenu(station) + end - if data.current.value == 'put_stock' then - OpenPutStocksMenu() - end + if data.current.value == 'put_stock' then + OpenPutStocksMenu() + end - if data.current.value == 'get_stock' then - OpenGetStocksMenu() - end + if data.current.value == 'get_stock' then + OpenGetStocksMenu() + end - end, - function(data, menu) + end, + function(data, menu) - menu.close() + menu.close() - CurrentAction = 'menu_armory' - CurrentActionMsg = _U('open_armory') - CurrentActionData = {station = station} - end - ) + CurrentAction = 'menu_armory' + CurrentActionMsg = _U('open_armory') + CurrentActionData = {station = station} + end + ) - else + else - local elements = {} + local elements = {} - for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do - local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] - table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name), value = weapon.name}) - end + for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do + local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] + table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name), value = weapon.name}) + end - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'armory', - { - title = _U('armory'), - align = 'top-left', - elements = elements, - }, - function(data, menu) - local weapon = data.current.value - TriggerServerEvent('esx_policejob:giveWeapon', weapon, 1000) - end, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'armory', + { + title = _U('armory'), + align = 'top-left', + elements = elements, + }, + function(data, menu) + local weapon = data.current.value + TriggerServerEvent('esx_policejob:giveWeapon', weapon, 1000) + end, + function(data, menu) - menu.close() + menu.close() - CurrentAction = 'menu_armory' - CurrentActionMsg = _U('open_armory') - CurrentActionData = {station = station} + CurrentAction = 'menu_armory' + CurrentActionMsg = _U('open_armory') + CurrentActionData = {station = station} - end - ) + end + ) - end + end end function OpenVehicleSpawnerMenu(station, partNum) - local vehicles = Config.PoliceStations[station].Vehicles + local vehicles = Config.PoliceStations[station].Vehicles - 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(garageVehicles) + ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(garageVehicles) - for i=1, #garageVehicles, 1 do - table.insert(elements, {label = GetDisplayNameFromVehicleModel(garageVehicles[i].model) .. ' [' .. garageVehicles[i].plate .. ']', value = garageVehicles[i]}) - end + for i=1, #garageVehicles, 1 do + table.insert(elements, {label = GetDisplayNameFromVehicleModel(garageVehicles[i].model) .. ' [' .. garageVehicles[i].plate .. ']', value = garageVehicles[i]}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('vehicle_menu'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('vehicle_menu'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - menu.close() + menu.close() - local vehicleProps = data.current.value + local vehicleProps = data.current.value - ESX.Game.SpawnVehicle(vehicleProps.model, vehicles[partNum].SpawnPoint, 270.0, function(vehicle) - ESX.Game.SetVehicleProperties(vehicle, vehicleProps) - local playerPed = GetPlayerPed(-1) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) + ESX.Game.SpawnVehicle(vehicleProps.model, vehicles[partNum].SpawnPoint, 270.0, function(vehicle) + ESX.Game.SetVehicleProperties(vehicle, vehicleProps) + local playerPed = GetPlayerPed(-1) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) - TriggerServerEvent('esx_society:removeVehicleFromGarage', 'police', vehicleProps) + TriggerServerEvent('esx_society:removeVehicleFromGarage', 'police', vehicleProps) - end, - function(data, menu) + end, + function(data, menu) - menu.close() + menu.close() - CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = _U('vehicle_spawner') - CurrentActionData = {station = station, partNum = partNum} + CurrentAction = 'menu_vehicle_spawner' + CurrentActionMsg = _U('vehicle_spawner') + CurrentActionData = {station = station, partNum = partNum} - end - ) + end + ) - end, 'police') + end, 'police') - else + else - local elements = {} + local elements = {} - for i=1, #Config.PoliceStations[station].AuthorizedVehicles, 1 do - local vehicle = Config.PoliceStations[station].AuthorizedVehicles[i] - table.insert(elements, {label = vehicle.label, value = vehicle.name}) - end + for i=1, #Config.PoliceStations[station].AuthorizedVehicles, 1 do + local vehicle = Config.PoliceStations[station].AuthorizedVehicles[i] + table.insert(elements, {label = vehicle.label, value = vehicle.name}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('vehicle_menu'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('vehicle_menu'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - menu.close() + menu.close() - local model = data.current.value + local model = data.current.value - local vehicle = GetClosestVehicle(vehicles[partNum].SpawnPoint.x, vehicles[partNum].SpawnPoint.y, vehicles[partNum].SpawnPoint.z, 3.0, 0, 71) + local vehicle = GetClosestVehicle(vehicles[partNum].SpawnPoint.x, vehicles[partNum].SpawnPoint.y, vehicles[partNum].SpawnPoint.z, 3.0, 0, 71) - if not DoesEntityExist(vehicle) then + if not DoesEntityExist(vehicle) then - local playerPed = GetPlayerPed(-1) + local playerPed = GetPlayerPed(-1) - if Config.MaxInService == -1 then + if Config.MaxInService == -1 then - ESX.Game.SpawnVehicle(model, { - x = vehicles[partNum].SpawnPoint.x, - y = vehicles[partNum].SpawnPoint.y, - z = vehicles[partNum].SpawnPoint.z - }, vehicles[partNum].Heading, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - SetVehicleMaxMods(vehicle) - end) + ESX.Game.SpawnVehicle(model, { + x = vehicles[partNum].SpawnPoint.x, + y = vehicles[partNum].SpawnPoint.y, + z = vehicles[partNum].SpawnPoint.z + }, vehicles[partNum].Heading, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + SetVehicleMaxMods(vehicle) + end) - else + else - ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) + ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) - if canTakeService then + if canTakeService then - ESX.Game.SpawnVehicle(model, { - x = vehicles[partNum].SpawnPoint.x, - y = vehicles[partNum].SpawnPoint.y, - z = vehicles[partNum].SpawnPoint.z - }, vehicles[partNum].Heading, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - SetVehicleMaxMods(vehicle) - end) + ESX.Game.SpawnVehicle(model, { + x = vehicles[partNum].SpawnPoint.x, + y = vehicles[partNum].SpawnPoint.y, + z = vehicles[partNum].SpawnPoint.z + }, vehicles[partNum].Heading, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + SetVehicleMaxMods(vehicle) + end) - else - ESX.ShowNotification(_U('service_max') .. inServiceCount .. '/' .. maxInService) - end + else + ESX.ShowNotification(_U('service_max') .. inServiceCount .. '/' .. maxInService) + end - end, 'police') + end, 'police') - end + end - else - ESX.ShowNotification(_U('vehicle_out')) - end + else + ESX.ShowNotification(_U('vehicle_out')) + end - end, - function(data, menu) + end, + function(data, menu) - menu.close() + menu.close() - CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = _U('vehicle_spawner') - CurrentActionData = {station = station, partNum = partNum} + CurrentAction = 'menu_vehicle_spawner' + CurrentActionMsg = _U('vehicle_spawner') + CurrentActionData = {station = station, partNum = partNum} - end - ) + end + ) - end + end end function OpenPoliceActionsMenu() - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'police_actions', - { - title = 'Police', - align = 'top-left', - elements = { - {label = _U('citizen_interaction'), value = 'citizen_interaction'}, - {label = _U('vehicle_interaction'), value = 'vehicle_interaction'}, - {label = _U('object_spawner'), value = 'object_spawner'}, - }, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'police_actions', + { + title = 'Police', + align = 'top-left', + elements = { + {label = _U('citizen_interaction'), value = 'citizen_interaction'}, + {label = _U('vehicle_interaction'), value = 'vehicle_interaction'}, + {label = _U('object_spawner'), value = 'object_spawner'}, + }, + }, + function(data, menu) - if data.current.value == 'citizen_interaction' then + if data.current.value == 'citizen_interaction' then - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { - title = _U('citizen_interaction'), - align = 'top-left', - elements = { - {label = _U('id_card'), value = 'identity_card'}, - {label = _U('search'), value = 'body_search'}, - {label = _U('handcuff'), value = 'handcuff'}, - {label = _U('drag'), value = 'drag'}, - {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, - {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, - {label = _U('fine'), value = 'fine'} - }, - }, - function(data2, menu2) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = _U('citizen_interaction'), + align = 'top-left', + elements = { + {label = _U('id_card'), value = 'identity_card'}, + {label = _U('search'), value = 'body_search'}, + {label = _U('handcuff'), value = 'handcuff'}, + {label = _U('drag'), value = 'drag'}, + {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, + {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, + {label = _U('fine'), value = 'fine'} + }, + }, + function(data2, menu2) - local player, distance = ESX.Game.GetClosestPlayer() + local player, distance = ESX.Game.GetClosestPlayer() - if distance ~= -1 and distance <= 3.0 then + if distance ~= -1 and distance <= 3.0 then - if data2.current.value == 'identity_card' then - OpenIdentityCardMenu(player) - end + if data2.current.value == 'identity_card' then + OpenIdentityCardMenu(player) + end - if data2.current.value == 'body_search' then - OpenBodySearchMenu(player) - end + if data2.current.value == 'body_search' then + OpenBodySearchMenu(player) + end - if data2.current.value == 'handcuff' then - TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(player)) - end + if data2.current.value == 'handcuff' then + TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(player)) + end - if data2.current.value == 'drag' then - TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(player)) - end + if data2.current.value == 'drag' then + TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(player)) + end - if data2.current.value == 'put_in_vehicle' then - TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(player)) - end + if data2.current.value == 'put_in_vehicle' then + TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(player)) + end - if data2.current.value == 'out_the_vehicle' then - TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(player)) - end + if data2.current.value == 'out_the_vehicle' then + TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(player)) + end - if data2.current.value == 'fine' then - OpenFineMenu(player) - end + if data2.current.value == 'fine' then + OpenFineMenu(player) + end - else - ESX.ShowNotification(_U('no_players_nearby')) - end + else + ESX.ShowNotification(_U('no_players_nearby')) + end - end, - function(data2, menu2) - menu2.close() - end - ) + end, + function(data2, menu2) + menu2.close() + end + ) - end + end - if data.current.value == 'vehicle_interaction' then + if data.current.value == 'vehicle_interaction' then - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_interaction', - { - title = _U('vehicle_interaction'), - align = 'top-left', - elements = { - {label = _U('vehicle_info'), value = 'vehicle_infos'}, - {label = _U('pick_lock'), value = 'hijack_vehicle'}, - }, - }, - function(data2, menu2) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_interaction', + { + title = _U('vehicle_interaction'), + align = 'top-left', + elements = { + {label = _U('vehicle_info'), value = 'vehicle_infos'}, + {label = _U('pick_lock'), value = 'hijack_vehicle'}, + }, + }, + function(data2, menu2) - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) - local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) - if DoesEntityExist(vehicle) then + if DoesEntityExist(vehicle) then - local vehicleData = ESX.Game.GetVehicleProperties(vehicle) + local vehicleData = ESX.Game.GetVehicleProperties(vehicle) - if data2.current.value == 'vehicle_infos' then - OpenVehicleInfosMenu(vehicleData) - end + if data2.current.value == 'vehicle_infos' then + OpenVehicleInfosMenu(vehicleData) + end - if data2.current.value == 'hijack_vehicle' then + if data2.current.value == 'hijack_vehicle' then - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 3.0) then + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 3.0) then - local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) + local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) - if DoesEntityExist(vehicle) then + if DoesEntityExist(vehicle) then - Citizen.CreateThread(function() + Citizen.CreateThread(function() - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_WELDING", 0, true) + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_WELDING", 0, true) - Wait(20000) + Wait(20000) - ClearPedTasksImmediately(playerPed) + ClearPedTasksImmediately(playerPed) - SetVehicleDoorsLocked(vehicle, 1) - SetVehicleDoorsLockedForAllPlayers(vehicle, false) + SetVehicleDoorsLocked(vehicle, 1) + SetVehicleDoorsLockedForAllPlayers(vehicle, false) - TriggerEvent('esx:showNotification', _U('vehicle_unlocked')) + TriggerEvent('esx:showNotification', _U('vehicle_unlocked')) - end) + end) - end + end - end + end - end + end - else - ESX.ShowNotification(_U('no_vehicles_nearby')) - end + else + ESX.ShowNotification(_U('no_vehicles_nearby')) + end - end, - function(data2, menu2) - menu2.close() - end - ) + end, + function(data2, menu2) + menu2.close() + end + ) - end + end - if data.current.value == 'object_spawner' then + if data.current.value == 'object_spawner' then - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { - title = _U('traffic_interaction'), - align = 'top-left', - elements = { - {label = _U('cone'), value = 'prop_roadcone02a'}, - {label = _U('barrier'), value = 'prop_barrier_work06a'}, - {label = _U('spikestrips'), value = 'p_ld_stinger_s'}, - {label = _U('box'), value = 'prop_boxpile_07d'}, - {label = _U('cash'), value = 'hei_prop_cash_crate_half_full'} - }, - }, - function(data2, menu2) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = _U('traffic_interaction'), + align = 'top-left', + elements = { + {label = _U('cone'), value = 'prop_roadcone02a'}, + {label = _U('barrier'), value = 'prop_barrier_work06a'}, + {label = _U('spikestrips'), value = 'p_ld_stinger_s'}, + {label = _U('box'), value = 'prop_boxpile_07d'}, + {label = _U('cash'), value = 'hei_prop_cash_crate_half_full'} + }, + }, + function(data2, menu2) - local model = data2.current.value - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) - local forward = GetEntityForwardVector(playerPed) - local x, y, z = table.unpack(coords + forward * 1.0) + local model = data2.current.value + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + local forward = GetEntityForwardVector(playerPed) + local x, y, z = table.unpack(coords + forward * 1.0) - if model == 'prop_roadcone02a' then - z = z - 2.0 - end + if model == 'prop_roadcone02a' then + z = z - 2.0 + end - ESX.Game.SpawnObject(model, { - x = x, - y = y, - z = z - }, function(obj) - SetEntityHeading(obj, GetEntityHeading(playerPed)) - PlaceObjectOnGroundProperly(obj) - end) + ESX.Game.SpawnObject(model, { + x = x, + y = y, + z = z + }, function(obj) + SetEntityHeading(obj, GetEntityHeading(playerPed)) + PlaceObjectOnGroundProperly(obj) + end) - end, - function(data2, menu2) - menu2.close() - end - ) + end, + function(data2, menu2) + menu2.close() + end + ) - end + end - end, - function(data, menu) + end, + function(data, menu) - menu.close() + menu.close() - end - ) + end + ) end function OpenIdentityCardMenu(player) - if Config.EnableESXIdentity then + if Config.EnableESXIdentity then - ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - local jobLabel = nil - local sexLabel = nil - local sex = nil - local dobLabel = nil - local heightLabel = nil - local idLabel = nil - - if data.job.grade_label ~= nil and data.job.grade_label ~= '' then - jobLabel = 'Job : ' .. data.job.label .. ' - ' .. data.job.grade_label - else - jobLabel = 'Job : ' .. data.job.label - end + local jobLabel = nil + local sexLabel = nil + local sex = nil + local dobLabel = nil + local heightLabel = nil + local idLabel = nil - if data.sex ~= nil then - if (data.sex == 'm') or (data.sex == 'M') then - sex = 'Male' - else - sex = 'Female' - end - sexLabel = 'Sex : ' .. sex - else - sexLabel = 'Sex : Unknown' - end - - if data.dob ~= nil then - dobLabel = 'DOB : ' .. data.dob - else - dobLabel = 'DOB : Unknown' - end - - if data.height ~= nil then - heightLabel = 'Height : ' .. data.height - else - heightLabel = 'Height : Unknown' - end - - if data.name ~= nil then - idLabel = 'ID : ' .. data.name - else - idLabel = 'ID : Unknown' - end - - local elements = { - {label = _U('name') .. data.firstname .. " " .. data.lastname, value = nil}, - {label = sexLabel, value = nil}, - {label = dobLabel, value = nil}, - {label = heightLabel, value = nil}, - {label = jobLabel, value = nil}, - {label = idLabel, value = nil}, - } + if data.job.grade_label ~= nil and data.job.grade_label ~= '' then + jobLabel = 'Job : ' .. data.job.label .. ' - ' .. data.job.grade_label + else + jobLabel = 'Job : ' .. data.job.label + end - if data.drunk ~= nil then - table.insert(elements, {label = _U('bac') .. data.drunk .. '%', value = nil}) - end + if data.sex ~= nil then + if (data.sex == 'm') or (data.sex == 'M') then + sex = 'Male' + else + sex = 'Female' + end + sexLabel = 'Sex : ' .. sex + else + sexLabel = 'Sex : Unknown' + end - if data.licenses ~= nil then + if data.dob ~= nil then + dobLabel = 'DOB : ' .. data.dob + else + dobLabel = 'DOB : Unknown' + end - table.insert(elements, {label = '--- Licenses ---', value = nil}) + if data.height ~= nil then + heightLabel = 'Height : ' .. data.height + else + heightLabel = 'Height : Unknown' + end - for i=1, #data.licenses, 1 do - table.insert(elements, {label = data.licenses[i].label, value = nil}) - end + if data.name ~= nil then + idLabel = 'ID : ' .. data.name + else + idLabel = 'ID : Unknown' + end - end + local elements = { + {label = _U('name') .. data.firstname .. " " .. data.lastname, value = nil}, + {label = sexLabel, value = nil}, + {label = dobLabel, value = nil}, + {label = heightLabel, value = nil}, + {label = jobLabel, value = nil}, + {label = idLabel, value = nil}, + } - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { - title = _U('citizen_interaction'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + if data.drunk ~= nil then + table.insert(elements, {label = _U('bac') .. data.drunk .. '%', value = nil}) + end - end, - function(data, menu) - menu.close() - end - ) + if data.licenses ~= nil then - end, GetPlayerServerId(player)) + table.insert(elements, {label = '--- Licenses ---', value = nil}) - else + for i=1, #data.licenses, 1 do + table.insert(elements, {label = data.licenses[i].label, value = nil}) + end - ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + end - local jobLabel = nil + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = _U('citizen_interaction'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - if data.job.grade_label ~= nil and data.job.grade_label ~= '' then - jobLabel = 'Job : ' .. data.job.label .. ' - ' .. data.job.grade_label - else - jobLabel = 'Job : ' .. data.job.label - end + end, + function(data, menu) + menu.close() + end + ) - local elements = { - {label = _U('name') .. data.name, value = nil}, - {label = jobLabel, value = nil}, - } + end, GetPlayerServerId(player)) - if data.drunk ~= nil then - table.insert(elements, {label = _U('bac') .. data.drunk .. '%', value = nil}) - end + else - if data.licenses ~= nil then + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - table.insert(elements, {label = '--- Licenses ---', value = nil}) + local jobLabel = nil - for i=1, #data.licenses, 1 do - table.insert(elements, {label = data.licenses[i].label, value = nil}) - end + if data.job.grade_label ~= nil and data.job.grade_label ~= '' then + jobLabel = 'Job : ' .. data.job.label .. ' - ' .. data.job.grade_label + else + jobLabel = 'Job : ' .. data.job.label + end - end + local elements = { + {label = _U('name') .. data.name, value = nil}, + {label = jobLabel, value = nil}, + } - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { - title = _U('citizen_interaction'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + if data.drunk ~= nil then + table.insert(elements, {label = _U('bac') .. data.drunk .. '%', value = nil}) + end - end, - function(data, menu) - menu.close() - end - ) + if data.licenses ~= nil then - end, GetPlayerServerId(player)) + table.insert(elements, {label = '--- Licenses ---', value = nil}) - end + for i=1, #data.licenses, 1 do + table.insert(elements, {label = data.licenses[i].label, value = nil}) + end + + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = _U('citizen_interaction'), + align = 'top-left', + elements = elements, + }, + function(data, menu) + + end, + function(data, menu) + menu.close() + end + ) + + end, GetPlayerServerId(player)) + + end end function OpenBodySearchMenu(player) - ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - local elements = {} + local elements = {} - local blackMoney = 0 + local blackMoney = 0 - for i=1, #data.accounts, 1 do - if data.accounts[i].name == 'black_money' then - blackMoney = data.accounts[i].money - end - end + for i=1, #data.accounts, 1 do + if data.accounts[i].name == 'black_money' then + blackMoney = data.accounts[i].money + end + end - table.insert(elements, { - label = _U('confiscate_dirty') .. blackMoney, - value = 'black_money', - itemType = 'item_account', - amount = blackMoney - }) + table.insert(elements, { + label = _U('confiscate_dirty') .. blackMoney, + value = 'black_money', + itemType = 'item_account', + amount = blackMoney + }) - table.insert(elements, {label = '--- Armes ---', value = nil}) + table.insert(elements, {label = '--- Armes ---', value = nil}) - for i=1, #data.weapons, 1 do - table.insert(elements, { - label = _U('confiscate') .. ESX.GetWeaponLabel(data.weapons[i].name), - value = data.weapons[i].name, - itemType = 'item_weapon', - amount = data.ammo, - }) - end + for i=1, #data.weapons, 1 do + table.insert(elements, { + label = _U('confiscate') .. ESX.GetWeaponLabel(data.weapons[i].name), + value = data.weapons[i].name, + itemType = 'item_weapon', + amount = data.ammo, + }) + end - table.insert(elements, {label = _U('inventory_label'), value = nil}) + table.insert(elements, {label = _U('inventory_label'), value = nil}) - for i=1, #data.inventory, 1 do - if data.inventory[i].count > 0 then - table.insert(elements, { - label = _U('confiscate_inv') .. data.inventory[i].count .. ' ' .. data.inventory[i].label, - value = data.inventory[i].name, - itemType = 'item_standard', - amount = data.inventory[i].count, - }) - end - end + for i=1, #data.inventory, 1 do + if data.inventory[i].count > 0 then + table.insert(elements, { + label = _U('confiscate_inv') .. data.inventory[i].count .. ' ' .. data.inventory[i].label, + value = data.inventory[i].name, + itemType = 'item_standard', + amount = data.inventory[i].count, + }) + end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'body_search', - { - title = _U('search'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'body_search', + { + title = _U('search'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - local itemType = data.current.itemType - local itemName = data.current.value - local amount = data.current.amount + local itemType = data.current.itemType + local itemName = data.current.value + local amount = data.current.amount - if data.current.value ~= nil then + if data.current.value ~= nil then - TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), itemType, itemName, amount) + TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), itemType, itemName, amount) - OpenBodySearchMenu(player) + OpenBodySearchMenu(player) - end + end - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end, GetPlayerServerId(player)) + end, GetPlayerServerId(player)) end function OpenFineMenu(player) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'fine', - { - title = _U('fine'), - align = 'top-left', - elements = { - {label = _U('traffic_offense'), value = 0}, - {label = _U('minor_offense'), value = 1}, - {label = _U('average_offense'), value = 2}, - {label = _U('major_offense'), value = 3} - }, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'fine', + { + title = _U('fine'), + align = 'top-left', + elements = { + {label = _U('traffic_offense'), value = 0}, + {label = _U('minor_offense'), value = 1}, + {label = _U('average_offense'), value = 2}, + {label = _U('major_offense'), value = 3} + }, + }, + function(data, menu) - OpenFineCategoryMenu(player, data.current.value) + OpenFineCategoryMenu(player, data.current.value) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) end function OpenFineCategoryMenu(player, category) - ESX.TriggerServerCallback('esx_policejob:getFineList', function(fines) + ESX.TriggerServerCallback('esx_policejob:getFineList', function(fines) - local elements = {} + local elements = {} - for i=1, #fines, 1 do - table.insert(elements, { - label = fines[i].label .. ' $' .. fines[i].amount, - value = fines[i].id, - amount = fines[i].amount, - fineLabel = fines[i].label - }) - end + for i=1, #fines, 1 do + table.insert(elements, { + label = fines[i].label .. ' $' .. fines[i].amount, + value = fines[i].id, + amount = fines[i].amount, + fineLabel = fines[i].label + }) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'fine_category', - { - title = _U('fine'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'fine_category', + { + title = _U('fine'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - local label = data.current.fineLabel - local amount = data.current.amount + local label = data.current.fineLabel + local amount = data.current.amount - menu.close() + menu.close() - if Config.EnablePlayerManagement then - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', _U('fine_total') .. label, amount) - else - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', _U('fine_total') .. label, amount) - end + if Config.EnablePlayerManagement then + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', _U('fine_total') .. label, amount) + else + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', _U('fine_total') .. label, amount) + end - ESX.SetTimeout(300, function() - OpenFineCategoryMenu(player, category) - end) + ESX.SetTimeout(300, function() + OpenFineCategoryMenu(player, category) + end) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end, category) + end, category) end function OpenVehicleInfosMenu(vehicleData) - ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(infos) + ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(infos) - local elements = {} + local elements = {} - table.insert(elements, {label = _U('plate') .. infos.plate, value = nil}) + table.insert(elements, {label = _U('plate') .. infos.plate, value = nil}) - if infos.owner == nil then - table.insert(elements, {label = _U('owner_unknown'), value = nil}) - else - table.insert(elements, {label = _U('owner') .. infos.owner, value = nil}) - end + if infos.owner == nil then + table.insert(elements, {label = _U('owner_unknown'), value = nil}) + else + table.insert(elements, {label = _U('owner') .. infos.owner, value = nil}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_infos', - { - title = _U('vehicle_info'), - align = 'top-left', - elements = elements, - }, - nil, - function(data, menu) - menu.close() - end - ) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_infos', + { + title = _U('vehicle_info'), + align = 'top-left', + elements = elements, + }, + nil, + function(data, menu) + menu.close() + end + ) - end, vehicleData.plate) + end, vehicleData.plate) end function OpenGetWeaponMenu() - ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) + ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) - local elements = {} + local elements = {} - for i=1, #weapons, 1 do - if weapons[i].count > 0 then - table.insert(elements, {label = 'x' .. weapons[i].count .. ' ' .. ESX.GetWeaponLabel(weapons[i].name), value = weapons[i].name}) - end - end + for i=1, #weapons, 1 do + if weapons[i].count > 0 then + table.insert(elements, {label = 'x' .. weapons[i].count .. ' ' .. ESX.GetWeaponLabel(weapons[i].name), value = weapons[i].name}) + end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'armory_get_weapon', - { - title = _U('get_weapon_menu'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'armory_get_weapon', + { + title = _U('get_weapon_menu'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - menu.close() + menu.close() - ESX.TriggerServerCallback('esx_policejob:removeArmoryWeapon', function() - OpenGetWeaponMenu() - end, data.current.value) + ESX.TriggerServerCallback('esx_policejob:removeArmoryWeapon', function() + OpenGetWeaponMenu() + end, data.current.value) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end) + end) end function OpenPutWeaponMenu() - local elements = {} - local playerPed = GetPlayerPed(-1) - local weaponList = ESX.GetWeaponList() + local elements = {} + local playerPed = GetPlayerPed(-1) + local weaponList = ESX.GetWeaponList() - for i=1, #weaponList, 1 do + for i=1, #weaponList, 1 do - local weaponHash = GetHashKey(weaponList[i].name) + local weaponHash = GetHashKey(weaponList[i].name) - if HasPedGotWeapon(playerPed, weaponHash, false) and weaponList[i].name ~= 'WEAPON_UNARMED' then - local ammo = GetAmmoInPedWeapon(playerPed, weaponHash) - table.insert(elements, {label = weaponList[i].label, value = weaponList[i].name}) - end + if HasPedGotWeapon(playerPed, weaponHash, false) and weaponList[i].name ~= 'WEAPON_UNARMED' then + local ammo = GetAmmoInPedWeapon(playerPed, weaponHash) + table.insert(elements, {label = weaponList[i].label, value = weaponList[i].name}) + end - end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'armory_put_weapon', - { - title = _U('put_weapon_menu'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'armory_put_weapon', + { + title = _U('put_weapon_menu'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - menu.close() + menu.close() - ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() - OpenPutWeaponMenu() - end, data.current.value) + ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() + OpenPutWeaponMenu() + end, data.current.value) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) end function OpenBuyWeaponsMenu(station) - ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) + ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) - local elements = {} + local elements = {} - for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do + for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do - local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] - local count = 0 + local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] + local count = 0 - for i=1, #weapons, 1 do - if weapons[i].name == weapon.name then - count = weapons[i].count - break - end - end + for i=1, #weapons, 1 do + if weapons[i].name == weapon.name then + count = weapons[i].count + break + end + end - table.insert(elements, {label = 'x' .. count .. ' ' .. ESX.GetWeaponLabel(weapon.name) .. ' $' .. weapon.price, value = weapon.name, price = weapon.price}) + table.insert(elements, {label = 'x' .. count .. ' ' .. ESX.GetWeaponLabel(weapon.name) .. ' $' .. weapon.price, value = weapon.name, price = weapon.price}) - end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'armory_buy_weapons', - { - title = _U('buy_weapon_menu'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'armory_buy_weapons', + { + title = _U('buy_weapon_menu'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - ESX.TriggerServerCallback('esx_policejob:buy', function(hasEnoughMoney) + ESX.TriggerServerCallback('esx_policejob:buy', function(hasEnoughMoney) - if hasEnoughMoney then - ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() - OpenBuyWeaponsMenu(station) - end, data.current.value) - else - ESX.ShowNotification(_U('not_enough_money')) - end + if hasEnoughMoney then + ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() + OpenBuyWeaponsMenu(station) + end, data.current.value) + else + ESX.ShowNotification(_U('not_enough_money')) + end - end, data.current.price) + end, data.current.price) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end) + end) end function OpenGetStocksMenu() - ESX.TriggerServerCallback('esx_policejob:getStockItems', function(items) + ESX.TriggerServerCallback('esx_policejob:getStockItems', function(items) - print(json.encode(items)) + print(json.encode(items)) - local elements = {} + local elements = {} - for i=1, #items, 1 do - table.insert(elements, {label = 'x' .. items[i].count .. ' ' .. items[i].label, value = items[i].name}) - end + for i=1, #items, 1 do + table.insert(elements, {label = 'x' .. items[i].count .. ' ' .. items[i].label, value = items[i].name}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'stocks_menu', - { - title = _U('police_stock'), - elements = elements - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'stocks_menu', + { + title = _U('police_stock'), + elements = elements + }, + function(data, menu) - local itemName = data.current.value + local itemName = data.current.value - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', - { - title = _U('quantity') - }, - function(data2, menu2) + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', + { + title = _U('quantity') + }, + function(data2, menu2) - local count = tonumber(data2.value) + local count = tonumber(data2.value) - if count == nil then - ESX.ShowNotification(_U('quantity_invalid')) - else - menu2.close() - menu.close() - OpenGetStocksMenu() + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() + OpenGetStocksMenu() - TriggerServerEvent('esx_policejob:getStockItem', itemName, count) - end + TriggerServerEvent('esx_policejob:getStockItem', itemName, count) + end - end, - function(data2, menu2) - menu2.close() - end - ) + end, + function(data2, menu2) + menu2.close() + end + ) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end) + end) end function OpenPutStocksMenu() - ESX.TriggerServerCallback('esx_policejob:getPlayerInventory', function(inventory) + ESX.TriggerServerCallback('esx_policejob:getPlayerInventory', function(inventory) - local elements = {} + local elements = {} - for i=1, #inventory.items, 1 do + for i=1, #inventory.items, 1 do - local item = inventory.items[i] + local item = inventory.items[i] - if item.count > 0 then - table.insert(elements, {label = item.label .. ' x' .. item.count, type = 'item_standard', value = item.name}) - end + if item.count > 0 then + table.insert(elements, {label = item.label .. ' x' .. item.count, type = 'item_standard', value = item.name}) + end - end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'stocks_menu', - { - title = _U('inventory'), - elements = elements - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'stocks_menu', + { + title = _U('inventory'), + elements = elements + }, + function(data, menu) - local itemName = data.current.value + local itemName = data.current.value - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', - { - title = _U('quantity') - }, - function(data2, menu2) + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', + { + title = _U('quantity') + }, + function(data2, menu2) - local count = tonumber(data2.value) + local count = tonumber(data2.value) - if count == nil then - ESX.ShowNotification(_U('quantity_invalid')) - else - menu2.close() - menu.close() - OpenPutStocksMenu() + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() + OpenPutStocksMenu() - TriggerServerEvent('esx_policejob:putStockItems', itemName, count) - end + TriggerServerEvent('esx_policejob:putStockItems', itemName, count) + end - end, - function(data2, menu2) - menu2.close() - end - ) + end, + function(data2, menu2) + menu2.close() + end + ) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end) + end) end @@ -1241,204 +1242,204 @@ end) RegisterNetEvent('esx_phone:loaded') AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) - local specialContact = { - name = 'Police', - number = 'police', - base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDFGQTJDRkI0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDFGQTJDRkM0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0MUZBMkNGOTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0MUZBMkNGQTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoW66EYAAAjGSURBVHjapJcLcFTVGcd/u3cfSXaTLEk2j80TCI8ECI9ABCyoiBqhBVQqVG2ppVKBQqUVgUl5OU7HKqNOHUHU0oHamZZWoGkVS6cWAR2JPJuAQBPy2ISEvLN57+v2u2E33e4k6Ngz85+9d++95/zP9/h/39GpqsqiRYsIGz8QZAq28/8PRfC+4HT4fMXFxeiH+GC54NeCbYLLATLpYe/ECx4VnBTsF0wWhM6lXY8VbBE0Ch4IzLcpfDFD2P1TgrdC7nMCZLRxQ9AkiAkQCn77DcH3BC2COoFRkCSIG2JzLwqiQi0RSmCD4JXbmNKh0+kc/X19tLtc9Ll9sk9ZS1yoU71YIk3xsbEx8QaDEc2ttxmaJSKC1ggSKBK8MKwTFQVXRzs3WzpJGjmZgvxcMpMtWIwqsjztvSrlzjYul56jp+46qSmJmMwR+P3+4aZ8TtCprRkk0DvUW7JjmV6lsqoKW/pU1q9YQOE4Nxkx4ladE7zd8ivuVmJQfXZKW5dx5EwPRw4fxNx2g5SUVLw+33AkzoRaQDP9SkFu6OKqz0uF8yaz7vsOL6ycQVLkcSg/BlWNsjuFoKE1knqDSl5aNnmPLmThrE0UvXqQqvJPyMrMGorEHwQfEha57/3P7mXS684GFjy8kreLppPUuBXfyd/ibeoS2kb0mWPANhJdYjb61AxUvx5PdT3+4y+Tb3mTd19ZSebE+VTXVGNQlHAC7w4VhH8TbA36vKq6ilnzlvPSunHw6Trc7XpZ14AyfgYeyz18crGN1Alz6e3qwNNQSv4dZox1h/BW9+O7eIaEsVv41Y4XeHJDG83Nl4mLTwzGhJYtx0PzNTjOB9KMTlc7Nkcem39YAGU7cbeBKVLMPGMVf296nMd2VbBq1wmizHoqqm/wrS1/Zf0+N19YN2PIu1fcIda4Vk66Zx/rVi+jo9eIX9wZGGcFXUMR6BHUa76/2ezioYcXMtpyAl91DSaTfDxlJbtLprHm2ecpObqPuTPzSNV9yKz4a4zJSuLo71/j8Q17ON69EmXiPIlNMe6FoyzOqWPW/MU03Lw5EFcyKghTrNDh7+/vw545mcJcWbTiGKpRdGPMXbx90sGmDaux6sXk+kimjU+BjnMkx3kYP34cXrFuZ+3nrHi6iDMt92JITcPjk3R3naRwZhpuNSqoD93DKaFVU7j2dhcF8+YzNlpErbIBTVh8toVccbaysPB+4pMcuPw25kwSsau7BIlmHpy3guaOPtISYyi/UkaJM5Lpc5agq5Xkcl6gIHkmqaMn0dtylcjIyPThCNyhaXyfR2W0I1our0v6qBii07ih5rDtGSOxNVdk1y4R2SR8jR/g7hQD9l1jUeY/WLJB5m39AlZN4GZyIQ1fFJNsEgt0duBIc5GRkcZF53mNwIzhXPDgQPoZIkiMkbTxtstDMVnmFA4cOsbz2/aKjSQjev4Mp9ZAg+hIpFhB3EH5Yal16+X+Kq3dGfxkzRY+KauBjBzREvGN0kNCTARu94AejBLMHorAQ7cEQMGs2cXvkWshYLDi6e9l728O8P1XW6hKeB2yv42q18tjj+iFTGoSi+X9jJM9RTxS9E+OHT0krhNiZqlbqraoT7RAU5bBGrEknEBhgJks7KXbLS8qERI0ErVqF/Y4K6NHZfLZB+/wzJvncacvFd91oXO3o/O40MfZKJOKu/rne+mRQByXM4lYreb1tUnkizVVA/0SpfpbWaCNBeEE5gb/UH19NLqEgDF+oNDQWcn41Cj0EXFEWqzkOIyYekslFkThsvMxpIyE2hIc6lXGZ6cPyK7Nnk5OipixRdxgUESAYmhq68VsGgy5CYKCUAJTg0+izApXne3CJFmUTwg4L3FProFxU+6krqmXu3MskkhSD2av41jLdzlnfFrSdCZxyqfMnppN6ZUa7pwt0h3fiK9DCt4IO9e7YqisvI7VYgmNv7mhBKKD/9psNi5dOMv5ZjukjsLdr0ffWsyTi6eSlfcA+dmiVyOXs+/sHNZu3M6PdxzgVO9GmDSHsSNqmTz/R6y6Xxqma4fwaS5Mn85n1ZE0Vl3CHBER3lUNEhiURpPJRFdTOcVnpUJnPIhR7cZXfoH5UYc5+E4RzRH3sfSnl9m2dSMjE+Tz9msse+o5dr7UwcQ5T3HwlWUkNuzG3dKFSTbsNs7m/Y8vExOlC29UWkMJlAxKoRQMR3IC7x85zOn6fHS50+U/2Untx2R1voinu5no+DQmz7yPXmMKZnsu0wrm0Oe3YhOVHdm8A09dBQYhTv4T7C+xUPrZh8Qn2MMr4qcDSRfoirWgKAvtgOpv1JI8Zi77X15G7L+fxeOUOiUFxZiULD5fSlNzNM62W+k1yq5gjajGX/ZHvOIyxd+Fkj+P092rWP/si0Qr7VisMaEWuCiYonXFwbAUTWWPYLV245NITnGkUXnpI9butLJn2y6iba+hlp7C09qBcvoN7FYL9mhxo1/y/LoEXK8Pv6qIC8WbBY/xr9YlPLf9dZT+OqKTUwfmDBm/GOw7ws4FWpuUP2gJEZvKqmocuXPZuWYJMzKuSsH+SNwh3bo0p6hao6HeEqwYEZ2M6aKWd3PwTCy7du/D0F1DsmzE6/WGLr5LsDF4LggnYBacCOboQLHQ3FFfR58SR+HCR1iQH8ukhA5s5o5AYZMwUqOp74nl8xvRHDlRTsnxYpJsUjtsceHt2C8Fm0MPJrphTkZvBc4It9RKLOFx91Pf0Igu0k7W2MmkOewS2QYJUJVWVz9VNbXUVVwkyuAmKTFJayrDo/4Jwe/CT0aGYTrWVYEeUfsgXssMRcpyenraQJa0VX9O3ZU+Ma1fax4xGxUsUVFkOUbcama1hf+7+LmA9juHWshwmwOE1iMmCFYEzg1jtIm1BaxW6wCGGoFdewPfvyE4ertTiv4rHC73B855dwp2a23bbd4tC1hvhOCbX7b4VyUQKhxrtSOaYKngasizvwi0RmOS4O1QZf2yYfiaR+73AvhTQEVf+rpn9/8IMAChKDrDzfsdIQAAAABJRU5ErkJggg==' - } + local specialContact = { + name = 'Police', + number = 'police', + base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDFGQTJDRkI0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDFGQTJDRkM0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0MUZBMkNGOTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0MUZBMkNGQTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoW66EYAAAjGSURBVHjapJcLcFTVGcd/u3cfSXaTLEk2j80TCI8ECI9ABCyoiBqhBVQqVG2ppVKBQqUVgUl5OU7HKqNOHUHU0oHamZZWoGkVS6cWAR2JPJuAQBPy2ISEvLN57+v2u2E33e4k6Ngz85+9d++95/zP9/h/39GpqsqiRYsIGz8QZAq28/8PRfC+4HT4fMXFxeiH+GC54NeCbYLLATLpYe/ECx4VnBTsF0wWhM6lXY8VbBE0Ch4IzLcpfDFD2P1TgrdC7nMCZLRxQ9AkiAkQCn77DcH3BC2COoFRkCSIG2JzLwqiQi0RSmCD4JXbmNKh0+kc/X19tLtc9Ll9sk9ZS1yoU71YIk3xsbEx8QaDEc2ttxmaJSKC1ggSKBK8MKwTFQVXRzs3WzpJGjmZgvxcMpMtWIwqsjztvSrlzjYul56jp+46qSmJmMwR+P3+4aZ8TtCprRkk0DvUW7JjmV6lsqoKW/pU1q9YQOE4Nxkx4ladE7zd8ivuVmJQfXZKW5dx5EwPRw4fxNx2g5SUVLw+33AkzoRaQDP9SkFu6OKqz0uF8yaz7vsOL6ycQVLkcSg/BlWNsjuFoKE1knqDSl5aNnmPLmThrE0UvXqQqvJPyMrMGorEHwQfEha57/3P7mXS684GFjy8kreLppPUuBXfyd/ibeoS2kb0mWPANhJdYjb61AxUvx5PdT3+4y+Tb3mTd19ZSebE+VTXVGNQlHAC7w4VhH8TbA36vKq6ilnzlvPSunHw6Trc7XpZ14AyfgYeyz18crGN1Alz6e3qwNNQSv4dZox1h/BW9+O7eIaEsVv41Y4XeHJDG83Nl4mLTwzGhJYtx0PzNTjOB9KMTlc7Nkcem39YAGU7cbeBKVLMPGMVf296nMd2VbBq1wmizHoqqm/wrS1/Zf0+N19YN2PIu1fcIda4Vk66Zx/rVi+jo9eIX9wZGGcFXUMR6BHUa76/2ezioYcXMtpyAl91DSaTfDxlJbtLprHm2ecpObqPuTPzSNV9yKz4a4zJSuLo71/j8Q17ON69EmXiPIlNMe6FoyzOqWPW/MU03Lw5EFcyKghTrNDh7+/vw545mcJcWbTiGKpRdGPMXbx90sGmDaux6sXk+kimjU+BjnMkx3kYP34cXrFuZ+3nrHi6iDMt92JITcPjk3R3naRwZhpuNSqoD93DKaFVU7j2dhcF8+YzNlpErbIBTVh8toVccbaysPB+4pMcuPw25kwSsau7BIlmHpy3guaOPtISYyi/UkaJM5Lpc5agq5Xkcl6gIHkmqaMn0dtylcjIyPThCNyhaXyfR2W0I1our0v6qBii07ih5rDtGSOxNVdk1y4R2SR8jR/g7hQD9l1jUeY/WLJB5m39AlZN4GZyIQ1fFJNsEgt0duBIc5GRkcZF53mNwIzhXPDgQPoZIkiMkbTxtstDMVnmFA4cOsbz2/aKjSQjev4Mp9ZAg+hIpFhB3EH5Yal16+X+Kq3dGfxkzRY+KauBjBzREvGN0kNCTARu94AejBLMHorAQ7cEQMGs2cXvkWshYLDi6e9l728O8P1XW6hKeB2yv42q18tjj+iFTGoSi+X9jJM9RTxS9E+OHT0krhNiZqlbqraoT7RAU5bBGrEknEBhgJks7KXbLS8qERI0ErVqF/Y4K6NHZfLZB+/wzJvncacvFd91oXO3o/O40MfZKJOKu/rne+mRQByXM4lYreb1tUnkizVVA/0SpfpbWaCNBeEE5gb/UH19NLqEgDF+oNDQWcn41Cj0EXFEWqzkOIyYekslFkThsvMxpIyE2hIc6lXGZ6cPyK7Nnk5OipixRdxgUESAYmhq68VsGgy5CYKCUAJTg0+izApXne3CJFmUTwg4L3FProFxU+6krqmXu3MskkhSD2av41jLdzlnfFrSdCZxyqfMnppN6ZUa7pwt0h3fiK9DCt4IO9e7YqisvI7VYgmNv7mhBKKD/9psNi5dOMv5ZjukjsLdr0ffWsyTi6eSlfcA+dmiVyOXs+/sHNZu3M6PdxzgVO9GmDSHsSNqmTz/R6y6Xxqma4fwaS5Mn85n1ZE0Vl3CHBER3lUNEhiURpPJRFdTOcVnpUJnPIhR7cZXfoH5UYc5+E4RzRH3sfSnl9m2dSMjE+Tz9msse+o5dr7UwcQ5T3HwlWUkNuzG3dKFSTbsNs7m/Y8vExOlC29UWkMJlAxKoRQMR3IC7x85zOn6fHS50+U/2Untx2R1voinu5no+DQmz7yPXmMKZnsu0wrm0Oe3YhOVHdm8A09dBQYhTv4T7C+xUPrZh8Qn2MMr4qcDSRfoirWgKAvtgOpv1JI8Zi77X15G7L+fxeOUOiUFxZiULD5fSlNzNM62W+k1yq5gjajGX/ZHvOIyxd+Fkj+P092rWP/si0Qr7VisMaEWuCiYonXFwbAUTWWPYLV245NITnGkUXnpI9butLJn2y6iba+hlp7C09qBcvoN7FYL9mhxo1/y/LoEXK8Pv6qIC8WbBY/xr9YlPLf9dZT+OqKTUwfmDBm/GOw7ws4FWpuUP2gJEZvKqmocuXPZuWYJMzKuSsH+SNwh3bo0p6hao6HeEqwYEZ2M6aKWd3PwTCy7du/D0F1DsmzE6/WGLr5LsDF4LggnYBacCOboQLHQ3FFfR58SR+HCR1iQH8ukhA5s5o5AYZMwUqOp74nl8xvRHDlRTsnxYpJsUjtsceHt2C8Fm0MPJrphTkZvBc4It9RKLOFx91Pf0Igu0k7W2MmkOewS2QYJUJVWVz9VNbXUVVwkyuAmKTFJayrDo/4Jwe/CT0aGYTrWVYEeUfsgXssMRcpyenraQJa0VX9O3ZU+Ma1fax4xGxUsUVFkOUbcama1hf+7+LmA9juHWshwmwOE1iMmCFYEzg1jtIm1BaxW6wCGGoFdewPfvyE4ertTiv4rHC73B855dwp2a23bbd4tC1hvhOCbX7b4VyUQKhxrtSOaYKngasizvwi0RmOS4O1QZf2yYfiaR+73AvhTQEVf+rpn9/8IMAChKDrDzfsdIQAAAABJRU5ErkJggg==' + } - TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) + TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) end) AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNum) - if part == 'Cloakroom' then - CurrentAction = 'menu_cloakroom' - CurrentActionMsg = _U('open_cloackroom') - CurrentActionData = {} - end + if part == 'Cloakroom' then + CurrentAction = 'menu_cloakroom' + CurrentActionMsg = _U('open_cloackroom') + CurrentActionData = {} + end - if part == 'Armory' then - CurrentAction = 'menu_armory' - CurrentActionMsg = _U('open_armory') - CurrentActionData = {station = station} - end + if part == 'Armory' then + CurrentAction = 'menu_armory' + CurrentActionMsg = _U('open_armory') + CurrentActionData = {station = station} + end - if part == 'VehicleSpawner' then - CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = _U('vehicle_spawner') - CurrentActionData = {station = station, partNum = partNum} - end + if part == 'VehicleSpawner' then + CurrentAction = 'menu_vehicle_spawner' + CurrentActionMsg = _U('vehicle_spawner') + CurrentActionData = {station = station, partNum = partNum} + end - if part == 'HelicopterSpawner' then + if part == 'HelicopterSpawner' then - local helicopters = Config.PoliceStations[station].Helicopters + local helicopters = Config.PoliceStations[station].Helicopters - if not IsAnyVehicleNearPoint(helicopters[partNum].SpawnPoint.x, helicopters[partNum].SpawnPoint.y, helicopters[partNum].SpawnPoint.z, 3.0) then + if not IsAnyVehicleNearPoint(helicopters[partNum].SpawnPoint.x, helicopters[partNum].SpawnPoint.y, helicopters[partNum].SpawnPoint.z, 3.0) then - ESX.Game.SpawnVehicle('polmav', { - x = helicopters[partNum].SpawnPoint.x, - y = helicopters[partNum].SpawnPoint.y, - z = helicopters[partNum].SpawnPoint.z - }, helicopters[partNum].Heading, function(vehicle) - SetVehicleModKit(vehicle, 0) - SetVehicleLivery(vehicle, 0) - end) + ESX.Game.SpawnVehicle('polmav', { + x = helicopters[partNum].SpawnPoint.x, + y = helicopters[partNum].SpawnPoint.y, + z = helicopters[partNum].SpawnPoint.z + }, helicopters[partNum].Heading, function(vehicle) + SetVehicleModKit(vehicle, 0) + SetVehicleLivery(vehicle, 0) + end) - end + end - end + end - if part == 'VehicleDeleter' then + if part == 'VehicleDeleter' then - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - if IsPedInAnyVehicle(playerPed, false) then + if IsPedInAnyVehicle(playerPed, false) then - local vehicle = GetVehiclePedIsIn(playerPed, false) + local vehicle = GetVehiclePedIsIn(playerPed, false) - if DoesEntityExist(vehicle) then - CurrentAction = 'delete_vehicle' - CurrentActionMsg = _U('store_vehicle') - CurrentActionData = {vehicle = vehicle} - end + if DoesEntityExist(vehicle) then + CurrentAction = 'delete_vehicle' + CurrentActionMsg = _U('store_vehicle') + CurrentActionData = {vehicle = vehicle} + end - end + end - end + end - if part == 'BossActions' then - CurrentAction = 'menu_boss_actions' - CurrentActionMsg = _U('open_bossmenu') - CurrentActionData = {} - end + if part == 'BossActions' then + CurrentAction = 'menu_boss_actions' + CurrentActionMsg = _U('open_bossmenu') + CurrentActionData = {} + end end) AddEventHandler('esx_policejob:hasExitedMarker', function(station, part, partNum) - ESX.UI.Menu.CloseAll() - CurrentAction = nil + ESX.UI.Menu.CloseAll() + CurrentAction = nil end) AddEventHandler('esx_policejob:hasEnteredEntityZone', function(entity) - local playerPed = GetPlayerPed(-1) + local playerPed = GetPlayerPed(-1) - if PlayerData.job ~= nil and PlayerData.job.name == 'police' and not IsPedInAnyVehicle(playerPed, false) then - CurrentAction = 'remove_entity' - CurrentActionMsg = _U('remove_object') - CurrentActionData = {entity = entity} - end + if PlayerData.job ~= nil and PlayerData.job.name == 'police' and not IsPedInAnyVehicle(playerPed, false) then + CurrentAction = 'remove_entity' + CurrentActionMsg = _U('remove_object') + CurrentActionData = {entity = entity} + end - if GetEntityModel(entity) == GetHashKey('p_ld_stinger_s') then + if GetEntityModel(entity) == GetHashKey('p_ld_stinger_s') then - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - if IsPedInAnyVehicle(playerPed, false) then + if IsPedInAnyVehicle(playerPed, false) then - local vehicle = GetVehiclePedIsIn(playerPed) + local vehicle = GetVehiclePedIsIn(playerPed) - for i=0, 7, 1 do - SetVehicleTyreBurst(vehicle, i, true, 1000) - end + for i=0, 7, 1 do + SetVehicleTyreBurst(vehicle, i, true, 1000) + end - end + end - end + end end) AddEventHandler('esx_policejob:hasExitedEntityZone', function(entity) - if CurrentAction == 'remove_entity' then - CurrentAction = nil - end + if CurrentAction == 'remove_entity' then + CurrentAction = nil + end end) RegisterNetEvent('esx_policejob:handcuff') AddEventHandler('esx_policejob:handcuff', function() - IsHandcuffed = not IsHandcuffed; - local playerPed = GetPlayerPed(-1) + IsHandcuffed = not IsHandcuffed; + local playerPed = GetPlayerPed(-1) - Citizen.CreateThread(function() + Citizen.CreateThread(function() - if IsHandcuffed then + if IsHandcuffed then - RequestAnimDict('mp_arresting') + RequestAnimDict('mp_arresting') - while not HasAnimDictLoaded('mp_arresting') do - Wait(100) - end + while not HasAnimDictLoaded('mp_arresting') do + Wait(100) + end - TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) - SetEnableHandcuffs(playerPed, true) - SetPedCanPlayGestureAnims(playerPed, false) - FreezeEntityPosition(playerPed, true) + TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) + SetEnableHandcuffs(playerPed, true) + SetPedCanPlayGestureAnims(playerPed, false) + FreezeEntityPosition(playerPed, true) - else + else - ClearPedSecondaryTask(playerPed) - SetEnableHandcuffs(playerPed, false) - SetPedCanPlayGestureAnims(playerPed, true) - FreezeEntityPosition(playerPed, false) + ClearPedSecondaryTask(playerPed) + SetEnableHandcuffs(playerPed, false) + SetPedCanPlayGestureAnims(playerPed, true) + FreezeEntityPosition(playerPed, false) - end + end - end) + end) end) RegisterNetEvent('esx_policejob:drag') AddEventHandler('esx_policejob:drag', function(cop) - TriggerServerEvent('esx:clientLog', 'starting dragging') - IsDragged = not IsDragged - CopPed = tonumber(cop) + TriggerServerEvent('esx:clientLog', 'starting dragging') + IsDragged = not IsDragged + CopPed = tonumber(cop) end) Citizen.CreateThread(function() - while true do - Wait(0) - if IsHandcuffed then - if IsDragged then - local ped = GetPlayerPed(GetPlayerFromServerId(CopPed)) - local myped = GetPlayerPed(-1) - AttachEntityToEntity(myped, ped, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) - else - DetachEntity(GetPlayerPed(-1), true, false) - end - end - end + while true do + Wait(0) + if IsHandcuffed then + if IsDragged then + local ped = GetPlayerPed(GetPlayerFromServerId(CopPed)) + local myped = GetPlayerPed(-1) + AttachEntityToEntity(myped, ped, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) + else + DetachEntity(GetPlayerPed(-1), true, false) + end + end + end end) RegisterNetEvent('esx_policejob:putInVehicle') AddEventHandler('esx_policejob:putInVehicle', function() - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) + local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) if DoesEntityExist(vehicle) then - local maxSeats = GetVehicleMaxNumberOfPassengers(vehicle) - local freeSeat = nil + local maxSeats = GetVehicleMaxNumberOfPassengers(vehicle) + local freeSeat = nil - for i=maxSeats - 1, 0, -1 do - if IsVehicleSeatFree(vehicle, i) then - freeSeat = i - break - end - end + for i=maxSeats - 1, 0, -1 do + if IsVehicleSeatFree(vehicle, i) then + freeSeat = i + break + end + end - if freeSeat ~= nil then - TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) - end + if freeSeat ~= nil then + TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) + end end @@ -1453,365 +1454,365 @@ AddEventHandler('esx_policejob:OutVehicle', function(t) plyPos = GetEntityCoords(GetPlayerPed(-1), true) local xnew = plyPos.x+2 local ynew = plyPos.y+2 - + SetEntityCoords(GetPlayerPed(-1), xnew, ynew, plyPos.z) end) -- Handcuff Citizen.CreateThread(function() - while true do - Wait(0) - if IsHandcuffed then - DisableControlAction(0, 142, true) -- MeleeAttackAlternate - DisableControlAction(0, 30, true) -- MoveLeftRight - DisableControlAction(0, 31, true) -- MoveUpDown - end - end + while true do + Wait(0) + if IsHandcuffed then + DisableControlAction(0, 142, true) -- MeleeAttackAlternate + DisableControlAction(0, 30, true) -- MoveLeftRight + DisableControlAction(0, 31, true) -- MoveUpDown + end + end end) -- Create blips Citizen.CreateThread(function() - for k,v in pairs(Config.PoliceStations) do + for k,v in pairs(Config.PoliceStations) do - local blip = AddBlipForCoord(v.Blip.Pos.x, v.Blip.Pos.y, v.Blip.Pos.z) + local blip = AddBlipForCoord(v.Blip.Pos.x, v.Blip.Pos.y, v.Blip.Pos.z) - SetBlipSprite (blip, 60) - SetBlipDisplay(blip, 4) - SetBlipScale (blip, 1.2) - SetBlipColour (blip, v.Blip.Color) - SetBlipAsShortRange(blip, true) + SetBlipSprite (blip, 60) + SetBlipDisplay(blip, 4) + SetBlipScale (blip, 1.2) + SetBlipColour (blip, v.Blip.Color) + SetBlipAsShortRange(blip, true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('map_blip')) - EndTextCommandSetBlipName(blip) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(_U('map_blip')) + EndTextCommandSetBlipName(blip) - end + end end) -- Display markers Citizen.CreateThread(function() - while true do + while true do - Wait(0) + Wait(0) - if PlayerData.job ~= nil and PlayerData.job.name == 'police' then + if PlayerData.job ~= nil and PlayerData.job.name == 'police' then - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - for k,v in pairs(Config.PoliceStations) do + for k,v in pairs(Config.PoliceStations) do - for i=1, #v.Cloakrooms, 1 do - if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end + for i=1, #v.Cloakrooms, 1 do + if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end - for i=1, #v.Armories, 1 do - if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end + for i=1, #v.Armories, 1 do + if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end - for i=1, #v.Vehicles, 1 do - if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end + for i=1, #v.Vehicles, 1 do + if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end - for i=1, #v.VehicleDeleters, 1 do - if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end + for i=1, #v.VehicleDeleters, 1 do + if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end - if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'police' and PlayerData.job.grade_name == 'boss' then + if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'police' and PlayerData.job.grade_name == 'boss' then - for i=1, #v.BossActions, 1 do - if not v.BossActions[i].disabled and GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end + for i=1, #v.BossActions, 1 do + if not v.BossActions[i].disabled and GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end - end + end - end + end - end + end - end + end end) -- Enter / Exit marker events Citizen.CreateThread(function() - while true do + while true do - Wait(0) + Wait(0) - if PlayerData.job ~= nil and PlayerData.job.name == 'police' then + if PlayerData.job ~= nil and PlayerData.job.name == 'police' then - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) - local isInMarker = false - local currentStation = nil - local currentPart = nil - local currentPartNum = nil + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + local isInMarker = false + local currentStation = nil + local currentPart = nil + local currentPartNum = nil - for k,v in pairs(Config.PoliceStations) do + for k,v in pairs(Config.PoliceStations) do - for i=1, #v.Cloakrooms, 1 do - if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'Cloakroom' - currentPartNum = i - end - end + for i=1, #v.Cloakrooms, 1 do + if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'Cloakroom' + currentPartNum = i + end + end - for i=1, #v.Armories, 1 do - if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'Armory' - currentPartNum = i - end - end + for i=1, #v.Armories, 1 do + if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'Armory' + currentPartNum = i + end + end - for i=1, #v.Vehicles, 1 do + for i=1, #v.Vehicles, 1 do - if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'VehicleSpawner' - currentPartNum = i - end + if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'VehicleSpawner' + currentPartNum = i + end - if GetDistanceBetweenCoords(coords, v.Vehicles[i].SpawnPoint.x, v.Vehicles[i].SpawnPoint.y, v.Vehicles[i].SpawnPoint.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'VehicleSpawnPoint' - currentPartNum = i - end + if GetDistanceBetweenCoords(coords, v.Vehicles[i].SpawnPoint.x, v.Vehicles[i].SpawnPoint.y, v.Vehicles[i].SpawnPoint.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'VehicleSpawnPoint' + currentPartNum = i + end - end + end - for i=1, #v.Helicopters, 1 do + for i=1, #v.Helicopters, 1 do - if GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner.x, v.Helicopters[i].Spawner.y, v.Helicopters[i].Spawner.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'HelicopterSpawner' - currentPartNum = i - end + if GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner.x, v.Helicopters[i].Spawner.y, v.Helicopters[i].Spawner.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'HelicopterSpawner' + currentPartNum = i + end - if GetDistanceBetweenCoords(coords, v.Helicopters[i].SpawnPoint.x, v.Helicopters[i].SpawnPoint.y, v.Helicopters[i].SpawnPoint.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'HelicopterSpawnPoint' - currentPartNum = i - end + if GetDistanceBetweenCoords(coords, v.Helicopters[i].SpawnPoint.x, v.Helicopters[i].SpawnPoint.y, v.Helicopters[i].SpawnPoint.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'HelicopterSpawnPoint' + currentPartNum = i + end - end + end - for i=1, #v.VehicleDeleters, 1 do - if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'VehicleDeleter' - currentPartNum = i - end - end + for i=1, #v.VehicleDeleters, 1 do + if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'VehicleDeleter' + currentPartNum = i + end + end - if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'police' and PlayerData.job.grade_name == 'boss' then + if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'police' and PlayerData.job.grade_name == 'boss' then - for i=1, #v.BossActions, 1 do - if GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'BossActions' - currentPartNum = i - end - end + for i=1, #v.BossActions, 1 do + if GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'BossActions' + currentPartNum = i + end + end - end + end - end + end - local hasExited = false + local hasExited = false - if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) ) then + if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) ) then - if - (LastStation ~= nil and LastPart ~= nil and LastPartNum ~= nil) and - (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) - then - TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) - hasExited = true - end + if + (LastStation ~= nil and LastPart ~= nil and LastPartNum ~= nil) and + (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) + then + TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) + hasExited = true + end - HasAlreadyEnteredMarker = true - LastStation = currentStation - LastPart = currentPart - LastPartNum = currentPartNum + HasAlreadyEnteredMarker = true + LastStation = currentStation + LastPart = currentPart + LastPartNum = currentPartNum - TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) - end + TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) + end - if not hasExited and not isInMarker and HasAlreadyEnteredMarker then + if not hasExited and not isInMarker and HasAlreadyEnteredMarker then - HasAlreadyEnteredMarker = false + HasAlreadyEnteredMarker = false - TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) - end + TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) + end - end + end - end + end end) -- Enter / Exit entity zone events Citizen.CreateThread(function() - local trackedEntities = { - 'prop_roadcone02a', - 'prop_barrier_work06a', - 'p_ld_stinger_s', - 'prop_boxpile_07d', - 'hei_prop_cash_crate_half_full' - } + local trackedEntities = { + 'prop_roadcone02a', + 'prop_barrier_work06a', + 'p_ld_stinger_s', + 'prop_boxpile_07d', + 'hei_prop_cash_crate_half_full' + } - while true do + while true do - Citizen.Wait(0) + Citizen.Wait(0) - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) - local closestDistance = -1 - local closestEntity = nil + local closestDistance = -1 + local closestEntity = nil - for i=1, #trackedEntities, 1 do + for i=1, #trackedEntities, 1 do - local object = GetClosestObjectOfType(coords.x, coords.y, coords.z, 3.0, GetHashKey(trackedEntities[i]), false, false, false) + local object = GetClosestObjectOfType(coords.x, coords.y, coords.z, 3.0, GetHashKey(trackedEntities[i]), false, false, false) - if DoesEntityExist(object) then + if DoesEntityExist(object) then - local objCoords = GetEntityCoords(object) - local distance = GetDistanceBetweenCoords(coords.x, coords.y, coords.z, objCoords.x, objCoords.y, objCoords.z, true) + local objCoords = GetEntityCoords(object) + local distance = GetDistanceBetweenCoords(coords.x, coords.y, coords.z, objCoords.x, objCoords.y, objCoords.z, true) - if closestDistance == -1 or closestDistance > distance then - closestDistance = distance - closestEntity = object - end + if closestDistance == -1 or closestDistance > distance then + closestDistance = distance + closestEntity = object + end - end + end - end + end - if closestDistance ~= -1 and closestDistance <= 3.0 then + if closestDistance ~= -1 and closestDistance <= 3.0 then - if LastEntity ~= closestEntity then - TriggerEvent('esx_policejob:hasEnteredEntityZone', closestEntity) - LastEntity = closestEntity - end + if LastEntity ~= closestEntity then + TriggerEvent('esx_policejob:hasEnteredEntityZone', closestEntity) + LastEntity = closestEntity + end - else + else - if LastEntity ~= nil then - TriggerEvent('esx_policejob:hasExitedEntityZone', LastEntity) - LastEntity = nil - end + if LastEntity ~= nil then + TriggerEvent('esx_policejob:hasExitedEntityZone', LastEntity) + LastEntity = nil + end - end + end - end + end end) -- Key Controls Citizen.CreateThread(function() - while true do + while true do - Citizen.Wait(0) + Citizen.Wait(0) - if CurrentAction ~= nil then + if CurrentAction ~= nil then - SetTextComponentFormat('STRING') - AddTextComponentString(CurrentActionMsg) - DisplayHelpTextFromStringLabel(0, 0, 1, -1) + SetTextComponentFormat('STRING') + AddTextComponentString(CurrentActionMsg) + DisplayHelpTextFromStringLabel(0, 0, 1, -1) - if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' and (GetGameTimer() - GUI.Time) > 150 then + if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' and (GetGameTimer() - GUI.Time) > 150 then - if CurrentAction == 'menu_cloakroom' then - OpenCloakroomMenu() - end + if CurrentAction == 'menu_cloakroom' then + OpenCloakroomMenu() + end - if CurrentAction == 'menu_armory' then - OpenArmoryMenu(CurrentActionData.station) - end + if CurrentAction == 'menu_armory' then + OpenArmoryMenu(CurrentActionData.station) + end - if CurrentAction == 'menu_vehicle_spawner' then - OpenVehicleSpawnerMenu(CurrentActionData.station, CurrentActionData.partNum) - end + if CurrentAction == 'menu_vehicle_spawner' then + OpenVehicleSpawnerMenu(CurrentActionData.station, CurrentActionData.partNum) + end - if CurrentAction == 'delete_vehicle' then + if CurrentAction == 'delete_vehicle' then - if Config.EnableSocietyOwnedVehicles then + if Config.EnableSocietyOwnedVehicles then - local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) - TriggerServerEvent('esx_society:putVehicleInGarage', 'police', vehicleProps) + local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) + TriggerServerEvent('esx_society:putVehicleInGarage', 'police', vehicleProps) - else + else - if - GetEntityModel(vehicle) == GetHashKey('police') or - GetEntityModel(vehicle) == GetHashKey('police2') or - GetEntityModel(vehicle) == GetHashKey('police3') or - GetEntityModel(vehicle) == GetHashKey('police4') or - GetEntityModel(vehicle) == GetHashKey('policeb') or - GetEntityModel(vehicle) == GetHashKey('policet') - then - TriggerServerEvent('esx_service:disableService', 'police') - end - - end + if + GetEntityModel(vehicle) == GetHashKey('police') or + GetEntityModel(vehicle) == GetHashKey('police2') or + GetEntityModel(vehicle) == GetHashKey('police3') or + GetEntityModel(vehicle) == GetHashKey('police4') or + GetEntityModel(vehicle) == GetHashKey('policeb') or + GetEntityModel(vehicle) == GetHashKey('policet') + then + TriggerServerEvent('esx_service:disableService', 'police') + end - ESX.Game.DeleteVehicle(CurrentActionData.vehicle) - end + end - if CurrentAction == 'menu_boss_actions' then + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + end - ESX.UI.Menu.CloseAll() + if CurrentAction == 'menu_boss_actions' then - TriggerEvent('esx_society:openBossMenu', 'police', function(data, menu) + ESX.UI.Menu.CloseAll() - menu.close() + TriggerEvent('esx_society:openBossMenu', 'police', function(data, menu) - CurrentAction = 'menu_boss_actions' - CurrentActionMsg = _U('open_bossmenu') - CurrentActionData = {} + menu.close() - end) + CurrentAction = 'menu_boss_actions' + CurrentActionMsg = _U('open_bossmenu') + CurrentActionData = {} - end + end) - if CurrentAction == 'remove_entity' then - DeleteEntity(CurrentActionData.entity) - end + end - CurrentAction = nil - GUI.Time = GetGameTimer() + if CurrentAction == 'remove_entity' then + DeleteEntity(CurrentActionData.entity) + end - end + CurrentAction = nil + GUI.Time = GetGameTimer() - end + end - if IsControlPressed(0, Keys['F6']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') and (GetGameTimer() - GUI.Time) > 150 then - OpenPoliceActionsMenu() - GUI.Time = GetGameTimer() - end + end - end + if IsControlPressed(0, Keys['F6']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') and (GetGameTimer() - GUI.Time) > 150 then + OpenPoliceActionsMenu() + GUI.Time = GetGameTimer() + end + + end end) diff --git a/config.lua b/config.lua index 0fe93896..80af2f49 100644 --- a/config.lua +++ b/config.lua @@ -1,8 +1,8 @@ Config = {} Config.DrawDistance = 100.0 Config.MarkerType = 1 -Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} -Config.MarkerColor = {r = 50, g = 50, b = 204} +Config.MarkerSize = { x = 1.5, y = 1.5, z = 1.0 } +Config.MarkerColor = { r = 50, g = 50, b = 204 } Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity @@ -10,73 +10,73 @@ Config.EnableNonFreemodePeds = false -- turn this on if you want custom ped Config.EnableSocietyOwnedVehicles = false Config.EnableLicenses = false Config.MaxInService = -1 -Config.Locale = 'fr' +Config.Locale = 'fr' Config.PoliceStations = { - LSPD = { + LSPD = { - Blip = { - Pos = {x = 425.130, y = -979.558, z = 30.711}, - Color = 29 - }, + Blip = { + Pos = { x = 425.130, y = -979.558, z = 30.711 }, + Color = 29, + }, - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_ASSAULTRIFLE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - {name = 'WEAPON_STICKYBOMB', price = 250}, - {name = 'GADGET_PARACHUTE', price = 300}, - }, + AuthorizedWeapons = { + { name = 'WEAPON_NIGHTSTICK', price = 200 }, + { name = 'WEAPON_COMBATPISTOL', price = 300 }, + { name = 'WEAPON_ASSAULTSMG', price = 1250 }, + { name = 'WEAPON_ASSAULTRIFLE', price = 1500 }, + { name = 'WEAPON_PUMPSHOTGUN', price = 600 }, + { name = 'WEAPON_STUNGUN', price = 500 }, + { name = 'WEAPON_FLASHLIGHT', price = 80 }, + { name = 'WEAPON_FIREEXTINGUISHER', price = 120 }, + { name = 'WEAPON_FLAREGUN', price = 60 }, + { name = 'WEAPON_STICKYBOMB', price = 250 }, + { name = 'GADGET_PARACHUTE', price = 300 }, + }, - AuthorizedVehicles = { - {name = 'police' , label = 'Véhicule de patrouille 1'}, - {name = 'police2', label = 'Véhicule de patrouille 2'}, - {name = 'police3', label = 'Véhicule de patrouille 3'}, - {name = 'police4', label = 'Véhicule civil'}, - {name = 'policeb', label = 'Moto'}, - {name = 'policet', label = 'Van de transport'}, - }, + AuthorizedVehicles = { + { name = 'police', label = 'Véhicule de patrouille 1' }, + { name = 'police2', label = 'Véhicule de patrouille 2' }, + { name = 'police3', label = 'Véhicule de patrouille 3' }, + { name = 'police4', label = 'Véhicule civil' }, + { name = 'policeb', label = 'Moto' }, + { name = 'policet', label = 'Van de transport' }, + }, - Cloakrooms = { - {x = 452.600, y = -993.306, z = 29.750} - }, + Cloakrooms = { + { x = 452.600, y = -993.306, z = 29.750 }, + }, - Armories = { - {x = 451.699, y = -980.356, z = 29.689} - }, + Armories = { + { x = 451.699, y = -980.356, z = 29.689 }, + }, - Vehicles = { - { - Spawner = {x = 454.69, y = -1017.4, z = 27.430}, - SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, - Heading = 90.0 - } - }, + Vehicles = { + { + Spawner = { x = 454.69, y = -1017.4, z = 27.430 }, + SpawnPoint = { x = 438.42, y = -1018.3, z = 27.757 }, + Heading = 90.0, + } + }, - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, + Helicopters = { + { + Spawner = { x = 466.477, y = -982.819, z = 42.691 }, + SpawnPoint = { x = 450.04, y = -981.14, z = 42.691 }, + Heading = 0.0, + } + }, - VehicleDeleters = { - {x = 462.74, y = -1014.4, z = 27.065}, - {x = 462.40, y = -1019.7, z = 27.104} - }, + VehicleDeleters = { + { x = 462.74, y = -1014.4, z = 27.065 }, + { x = 462.40, y = -1019.7, z = 27.104 }, + }, - BossActions = { - {x = 448.417, y = -973.208, z = 29.689} - } + BossActions = { + { x = 448.417, y = -973.208, z = 29.689 } + }, - } + }, } diff --git a/locales/br.lua b/locales/br.lua index e8e67d9e..f8682ff8 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -1,91 +1,91 @@ Locales['br'] = { - --Cloackroom - ['cloakroom'] = 'Vestiário', - ['citizen_wear'] = 'Roupa casual', - ['police_wear'] = 'Uniforme da Polícia', - ['open_cloackroom'] = 'Pressione ~INPUT_CONTEXT~ para se trocar', - --Armory - ['get_weapon'] = 'Pegar arma', - ['put_weapon'] = 'Entregar arma', - ['buy_weapons'] = 'Comprar armas', - ['armory'] = 'Arsenal', - ['open_armory'] = 'Pressione ~INPUT_CONTEXT~ para acessar o arsenal', - --Vehicles - ['vehicle_menu'] = 'Veículo', - ['vehicle_out'] = 'Já existe um carro fora da garagem', - ['vehicle_spawner'] = 'Pressione ~INPUT_CONTEXT~ para escolher um veículo', - ['store_vehicle'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', - ['service_max'] = 'Maximo de oficiais em serviço : ', - --Action Menu - ['citizen_interaction'] = 'Interagir com o cidadão', - ['vehicle_interaction'] = 'Interagir com o veículo', - ['object_spawner'] = 'Interagir com as rodovias', + -- Cloackroom + ['cloakroom'] = 'Vestiário', + ['citizen_wear'] = 'Roupa casual', + ['police_wear'] = 'Uniforme da Polícia', + ['open_cloackroom'] = 'Pressione ~INPUT_CONTEXT~ para se trocar', + -- Armory + ['get_weapon'] = 'Pegar arma', + ['put_weapon'] = 'Entregar arma', + ['buy_weapons'] = 'Comprar armas', + ['armory'] = 'Arsenal', + ['open_armory'] = 'Pressione ~INPUT_CONTEXT~ para acessar o arsenal', + -- Vehicles + ['vehicle_menu'] = 'Veículo', + ['vehicle_out'] = 'Já existe um carro fora da garagem', + ['vehicle_spawner'] = 'Pressione ~INPUT_CONTEXT~ para escolher um veículo', + ['store_vehicle'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', + ['service_max'] = 'Maximo de oficiais em serviço : ', + -- Action Menu + ['citizen_interaction'] = 'Interagir com o cidadão', + ['vehicle_interaction'] = 'Interagir com o veículo', + ['object_spawner'] = 'Interagir com as rodovias', - ['id_card'] = 'Carteira de identidade', - ['search'] = 'Procurar', - ['handcuff'] = 'Algemar / Soltar', - ['put_in_vehicle'] = 'Colocar no veículo', - ['fine'] = 'Multa', - ['no_players_nearby'] = 'Nenhum jogador nas proximidades', + ['id_card'] = 'Carteira de identidade', + ['search'] = 'Procurar', + ['handcuff'] = 'Algemar / Soltar', + ['put_in_vehicle'] = 'Colocar no veículo', + ['fine'] = 'Multa', + ['no_players_nearby'] = 'Nenhum jogador nas proximidades', - ['vehicle_info'] = 'Informações', - ['pick_lock'] = 'Trancar veículo', - ['vehicle_unlocked'] = 'Veículo ~g~destravado~s~', - ['no_vehicles_nearby'] = 'Nenhum veículo nas proximidades', - ['traffic_interaction'] = 'Interagir com as rodovias', - ['cone'] = 'Cones', - ['barrier'] = 'Barreira', - ['spikestrips'] = 'Fita de pregos', - ['box'] = 'Caixa', - ['cash'] = 'Caixa de dinheiro', - --ID Card Menu - ['name'] = 'Nome : ', - ['bac'] = 'bAC : ', - --Body Search Menu - ['confiscate_dirty'] = 'Confiscar dinheiro sujo : $', - ['guns_label'] = '--- Armas ---', - ['confiscate'] = 'Confiscar ', - ['inventory_label'] = '--- Inventário ---', - ['confiscate_inv'] = 'Confiscar x', + ['vehicle_info'] = 'Informações', + ['pick_lock'] = 'Trancar veículo', + ['vehicle_unlocked'] = 'Veículo ~g~destravado~s~', + ['no_vehicles_nearby'] = 'Nenhum veículo nas proximidades', + ['traffic_interaction'] = 'Interagir com as rodovias', + ['cone'] = 'Cones', + ['barrier'] = 'Barreira', + ['spikestrips'] = 'Fita de pregos', + ['box'] = 'Caixa', + ['cash'] = 'Caixa de dinheiro', + -- ID Card Menu + ['name'] = 'Nome : ', + ['bac'] = 'bAC : ', + -- Body Search Menu + ['confiscate_dirty'] = 'Confiscar dinheiro sujo : $', + ['guns_label'] = '--- Armas ---', + ['confiscate'] = 'Confiscar ', + ['inventory_label'] = '--- Inventário ---', + ['confiscate_inv'] = 'Confiscar x', - ['traffic_offense'] = 'Infrações de transito', - ['minor_offense'] = 'Infração leve', - ['average_offense'] = 'Infração média', - ['major_offense'] = 'Infração grave', - ['fine_total'] = 'Multa : ', - --Vehicle Info Menu - ['plate'] = 'Placa: ', - ['owner_unknown'] = 'Proprietário : Desconhecido', - ['owner'] = 'Proprietário : ', - --Weapons Menus - ['get_weapon_menu'] = 'Arsenal - Pegar arma', - ['put_weapon_menu'] = 'Arsenal - Entregar arma', - ['buy_weapon_menu'] = 'Arsenal - Comprar armas', - ['not_enough_money'] = 'Você não tem dinheiro suficiente', - --Boss Menu - ['take_company_money'] = 'Retirar o dinheiro da empresa', - ['deposit_money'] = 'Depositar dinheiro', - ['amount_of_withdrawal'] = 'Quantidade de retirada', - ['invalid_amount'] = 'Quantidade inválida', - ['amount_of_deposit'] = 'Quantidade de depósito', - ['open_bossmenu'] = 'Pressione ~INPUT_CONTEXT~ para abrir o menu', - --Misc - ['remove_object'] = 'Pressione ~INPUT_CONTEXT~ para remover o objeto', - ['map_blip'] = 'Departamento de Polícia', - --Notifications - ['from'] = '~s~ de ~b~', - ['you_have_confinv'] = 'Você confiscou ~y~x', - ['confinv'] = '~s~ confiscado de você ~y~x', - ['you_have_confdm'] = 'Você confiscou ~y~$', - ['confdm'] = '~s~ confiscado de você ~y~$', - ['you_have_confweapon'] = 'Você confiscou ~y~x1 ', - ['confweapon'] = '~s~ confiscado de você ~y~x1 ', - ['alert_police'] = 'Alerta da Polícia', - --Authorized Vehicles - ['police'] = 'Viatura - Blazer', - ['police2'] = 'Viatura - Parati', - ['police3'] = 'viatura - Fluence', - ['police4'] = 'Viatura - Blazer cinza', - ['policeb'] = 'Moto da Polícia', - ['policet'] = 'Van de Transporte', -} \ No newline at end of file + ['traffic_offense'] = 'Infrações de transito', + ['minor_offense'] = 'Infração leve', + ['average_offense'] = 'Infração média', + ['major_offense'] = 'Infração grave', + ['fine_total'] = 'Multa : ', + -- Vehicle Info Menu + ['plate'] = 'Placa: ', + ['owner_unknown'] = 'Proprietário : Desconhecido', + ['owner'] = 'Proprietário : ', + -- Weapons Menus + ['get_weapon_menu'] = 'Arsenal - Pegar arma', + ['put_weapon_menu'] = 'Arsenal - Entregar arma', + ['buy_weapon_menu'] = 'Arsenal - Comprar armas', + ['not_enough_money'] = 'Você não tem dinheiro suficiente', + -- Boss Menu + ['take_company_money'] = 'Retirar o dinheiro da empresa', + ['deposit_money'] = 'Depositar dinheiro', + ['amount_of_withdrawal'] = 'Quantidade de retirada', + ['invalid_amount'] = 'Quantidade inválida', + ['amount_of_deposit'] = 'Quantidade de depósito', + ['open_bossmenu'] = 'Pressione ~INPUT_CONTEXT~ para abrir o menu', + -- Misc + ['remove_object'] = 'Pressione ~INPUT_CONTEXT~ para remover o objeto', + ['map_blip'] = 'Departamento de Polícia', + -- Notifications + ['from'] = '~s~ de ~b~', + ['you_have_confinv'] = 'Você confiscou ~y~x', + ['confinv'] = '~s~ confiscado de você ~y~x', + ['you_have_confdm'] = 'Você confiscou ~y~$', + ['confdm'] = '~s~ confiscado de você ~y~$', + ['you_have_confweapon'] = 'Você confiscou ~y~x1 ', + ['confweapon'] = '~s~ confiscado de você ~y~x1 ', + ['alert_police'] = 'Alerta da Polícia', + -- Authorized Vehicles + ['police'] = 'Viatura - Blazer', + ['police2'] = 'Viatura - Parati', + ['police3'] = 'viatura - Fluence', + ['police4'] = 'Viatura - Blazer cinza', + ['policeb'] = 'Moto da Polícia', + ['policet'] = 'Van de Transporte', +} diff --git a/locales/de.lua b/locales/de.lua index 2a06348e..d5a19a1f 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -1,91 +1,91 @@ Locales['de'] = { - --Cloackroom - ['cloakroom'] = 'Garderobe', - ['citizen_wear'] = 'Zivilkleidung', - ['police_wear'] = 'Arbeitskleidung', - ['open_cloackroom'] = 'Drücke ~INPUT_CONTEXT~ um dich umzuziehen', - --Armory - ['get_weapon'] = 'Waffen holen', - ['put_weapon'] = 'Waffen bringen', - ['buy_weapons'] = 'Waffen kaufen', - ['armory'] = 'Waffenkammer', - ['open_armory'] = 'Drücke ~INPUT_CONTEXT~ um die Waffenkammer zu öffnen', - --Vehicles - ['vehicle_menu'] = 'Fahrzeug', - ['vehicle_out'] = 'es ist bereits ein Fahrzeug draussen', - ['vehicle_spawner'] = 'Drücke ~INPUT_CONTEXT~ um ein Fahrzeug zu holen', - ['store_vehicle'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', - ['service_max'] = 'Max Polizisten im Dienst : ', - --Action Menu - ['citizen_interaction'] = 'Zivilistenaktionen', - ['vehicle_interaction'] = 'Fahrzeuginteraktionen', - ['object_spawner'] = 'Objekt Spawner', + -- Cloackroom + ['cloakroom'] = 'Garderobe', + ['citizen_wear'] = 'Zivilkleidung', + ['police_wear'] = 'Arbeitskleidung', + ['open_cloackroom'] = 'Drücke ~INPUT_CONTEXT~ um dich umzuziehen', + -- Armory + ['get_weapon'] = 'Waffen holen', + ['put_weapon'] = 'Waffen bringen', + ['buy_weapons'] = 'Waffen kaufen', + ['armory'] = 'Waffenkammer', + ['open_armory'] = 'Drücke ~INPUT_CONTEXT~ um die Waffenkammer zu öffnen', + -- Vehicles + ['vehicle_menu'] = 'Fahrzeug', + ['vehicle_out'] = 'es ist bereits ein Fahrzeug draussen', + ['vehicle_spawner'] = 'Drücke ~INPUT_CONTEXT~ um ein Fahrzeug zu holen', + ['store_vehicle'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', + ['service_max'] = 'Max Polizisten im Dienst : ', + -- Action Menu + ['citizen_interaction'] = 'Zivilistenaktionen', + ['vehicle_interaction'] = 'Fahrzeuginteraktionen', + ['object_spawner'] = 'Objekt Spawner', - ['id_card'] = 'ID Karte', - ['search'] = 'Suche', - ['handcuff'] = 'Festnehmen / Freilassen', - ['put_in_vehicle'] = 'In Fahrzeug setzen', - ['fine'] = 'Strafe', - ['no_players_nearby'] = 'Keine Spieler in der Nähe', + ['id_card'] = 'ID Karte', + ['search'] = 'Suche', + ['handcuff'] = 'Festnehmen / Freilassen', + ['put_in_vehicle'] = 'In Fahrzeug setzen', + ['fine'] = 'Strafe', + ['no_players_nearby'] = 'Keine Spieler in der Nähe', - ['vehicle_info'] = 'Fahrzeug Info', - ['pick_lock'] = 'Fahrzeug öffnen', - ['vehicle_unlocked'] = 'Fahrzeug ~g~offen~s~', - ['no_vehicles_nearby'] = 'Keine Fahrzeuge in der Nähe', - ['traffic_interaction'] = 'Straßeninteraktionen', - ['cone'] = 'Hütchen', - ['barrier'] = 'Barriere', - ['spikestrips'] = 'Nagelband', - ['box'] = 'Box', - ['cash'] = 'Box mit Geld', - --ID Card Menu - ['name'] = 'name : ', - ['bac'] = 'bAC : ', - --Body Search Menu - ['confiscate_dirty'] = 'Schwarzgeld konfesziert : $', - ['guns_label'] = '--- Waffen ---', - ['confiscate'] = 'konfeszieren ', - ['inventory_label'] = '--- Inventar ---', - ['confiscate_inv'] = 'konfeziere x', + ['vehicle_info'] = 'Fahrzeug Info', + ['pick_lock'] = 'Fahrzeug öffnen', + ['vehicle_unlocked'] = 'Fahrzeug ~g~offen~s~', + ['no_vehicles_nearby'] = 'Keine Fahrzeuge in der Nähe', + ['traffic_interaction'] = 'Straßeninteraktionen', + ['cone'] = 'Hütchen', + ['barrier'] = 'Barriere', + ['spikestrips'] = 'Nagelband', + ['box'] = 'Box', + ['cash'] = 'Box mit Geld', + -- ID Card Menu + ['name'] = 'name : ', + ['bac'] = 'bAC : ', + -- Body Search Menu + ['confiscate_dirty'] = 'Schwarzgeld konfesziert : $', + ['guns_label'] = '--- Waffen ---', + ['confiscate'] = 'konfeszieren ', + ['inventory_label'] = '--- Inventar ---', + ['confiscate_inv'] = 'konfeziere x', - ['traffic_offense'] = 'Verkehrs vergehen', - ['minor_offense'] = 'Geringes vergehen', - ['average_offense'] = 'Normales vergehen', - ['major_offense'] = 'Hohes vergehen', - ['fine_total'] = 'Strafe : ', - --Vehicle Info Menu - ['plate'] = 'Plate: ', - ['owner_unknown'] = 'Besitzer : Unbekannt', - ['owner'] = 'Besitzer : ', - --Weapons Menus - ['get_weapon_menu'] = 'Waffenkammer - Waffen nehmen', - ['put_weapon_menu'] = 'Waffenkammer - Waffen bringen', - ['buy_weapon_menu'] = 'Waffenkammer - Waffen kaufen', - ['not_enough_money'] = 'Du hast nicht genug Geld', - --Boss Menu - ['take_company_money'] = 'Firmengeld abheben', - ['deposit_money'] = 'Geld einzahlen', - ['amount_of_withdrawal'] = 'Betrag zum abheben', - ['invalid_amount'] = 'ungültiger Betrag', - ['amount_of_deposit'] = 'Betrag zum einzahlen', - ['open_bossmenu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', - --Misc - ['remove_object'] = 'Drücke ~INPUT_CONTEXT~ um das Objekt zu entfernen', - ['map_blip'] = 'Polizeistation', - --Notifications - ['from'] = '~s~ von ~b~', - ['you_have_confinv'] = 'du hast ~y~x konfesziert', - ['confinv'] = '~s~ hat von dir ~y~x konfesziert', - ['you_have_confdm'] = 'du hast ~y~$ konfesziert', - ['confdm'] = '~s~ hat von dir ~y~$ konfesziert', - ['you_have_confweapon'] = 'du hast ~y~x1 konfesziert', - ['confweapon'] = '~s~ hat von dir ~y~x1 konfesziert', - ['alert_police'] = 'Polizei alamieren', - --Authorized Vehicles - ['police'] = 'Streifenfahrzeug 1', - ['police2'] = 'Streifenfahrzeug 2', - ['police3'] = 'Streifenfahrzeug 3', - ['police4'] = 'Zivilfahrzeug', - ['policeb'] = 'Motorrad', - ['policet'] = 'Transporter', -} \ No newline at end of file + ['traffic_offense'] = 'Verkehrs vergehen', + ['minor_offense'] = 'Geringes vergehen', + ['average_offense'] = 'Normales vergehen', + ['major_offense'] = 'Hohes vergehen', + ['fine_total'] = 'Strafe : ', + -- Vehicle Info Menu + ['plate'] = 'Plate: ', + ['owner_unknown'] = 'Besitzer : Unbekannt', + ['owner'] = 'Besitzer : ', + -- Weapons Menus + ['get_weapon_menu'] = 'Waffenkammer - Waffen nehmen', + ['put_weapon_menu'] = 'Waffenkammer - Waffen bringen', + ['buy_weapon_menu'] = 'Waffenkammer - Waffen kaufen', + ['not_enough_money'] = 'Du hast nicht genug Geld', + -- Boss Menu + ['take_company_money'] = 'Firmengeld abheben', + ['deposit_money'] = 'Geld einzahlen', + ['amount_of_withdrawal'] = 'Betrag zum abheben', + ['invalid_amount'] = 'ungültiger Betrag', + ['amount_of_deposit'] = 'Betrag zum einzahlen', + ['open_bossmenu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', + -- Misc + ['remove_object'] = 'Drücke ~INPUT_CONTEXT~ um das Objekt zu entfernen', + ['map_blip'] = 'Polizeistation', + -- Notifications + ['from'] = '~s~ von ~b~', + ['you_have_confinv'] = 'du hast ~y~x konfesziert', + ['confinv'] = '~s~ hat von dir ~y~x konfesziert', + ['you_have_confdm'] = 'du hast ~y~$ konfesziert', + ['confdm'] = '~s~ hat von dir ~y~$ konfesziert', + ['you_have_confweapon'] = 'du hast ~y~x1 konfesziert', + ['confweapon'] = '~s~ hat von dir ~y~x1 konfesziert', + ['alert_police'] = 'Polizei alamieren', + -- Authorized Vehicles + ['police'] = 'Streifenfahrzeug 1', + ['police2'] = 'Streifenfahrzeug 2', + ['police3'] = 'Streifenfahrzeug 3', + ['police4'] = 'Zivilfahrzeug', + ['policeb'] = 'Motorrad', + ['policet'] = 'Transporter', +} diff --git a/locales/en.lua b/locales/en.lua index 06ea6dbc..dcc51ad5 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,135 +1,135 @@ Locales['en'] = { - --Cloackroom - ['cloakroom'] = 'locker room', - ['citizen_wear'] = 'civilian Outfit', - ['police_wear'] = 'police Outfit', - ['sheriff_wear'] = 'sheriff Outfit', - ['lieutenant_wear'] = 'Swatt outfit ', - ['commandant_wear'] = 'Fbi outfit', - ['statepd_wear'] = 'State Police outfit', - ['specops_wear'] = 'Spec OPS outfit', - ['open_cloackroom'] = 'press ~INPUT_CONTEXT~ to change', - --Armory - ['get_weapon'] = 'get Weapon', - ['put_weapon'] = 'put Weapon', - ['buy_weapons'] = 'buy Weapons', - ['armory'] = 'armory', - ['open_armory'] = 'press ~INPUT_CONTEXT~ to access the armory', - --Vehicles - ['vehicle_menu'] = 'vehicle', - ['vehicle_out'] = 'there is already a car out of the garage', - ['vehicle_spawner'] = 'press ~INPUT_CONTEXT~ to take out a vehicle', - ['store_vehicle'] = 'press ~INPUT_CONTEXT~ to store the vehicle', - ['service_max'] = 'Max officers in service: ', - --Action Menu - ['citizen_interaction'] = 'citizen Interaction', - ['vehicle_interaction'] = 'vehicle Interaction', - ['object_spawner'] = 'object Spawner', - ['animations'] = 'animations', + -- Cloackroom + ['cloakroom'] = 'locker room', + ['citizen_wear'] = 'civilian Outfit', + ['police_wear'] = 'police Outfit', + ['sheriff_wear'] = 'sheriff Outfit', + ['lieutenant_wear'] = 'Swatt outfit ', + ['commandant_wear'] = 'Fbi outfit', + ['statepd_wear'] = 'State Police outfit', + ['specops_wear'] = 'Spec OPS outfit', + ['open_cloackroom'] = 'press ~INPUT_CONTEXT~ to change', + -- Armory + ['get_weapon'] = 'get Weapon', + ['put_weapon'] = 'put Weapon', + ['buy_weapons'] = 'buy Weapons', + ['armory'] = 'armory', + ['open_armory'] = 'press ~INPUT_CONTEXT~ to access the armory', + -- Vehicles + ['vehicle_menu'] = 'vehicle', + ['vehicle_out'] = 'there is already a car out of the garage', + ['vehicle_spawner'] = 'press ~INPUT_CONTEXT~ to take out a vehicle', + ['store_vehicle'] = 'press ~INPUT_CONTEXT~ to store the vehicle', + ['service_max'] = 'Max officers in service: ', + -- Action Menu + ['citizen_interaction'] = 'citizen Interaction', + ['vehicle_interaction'] = 'vehicle Interaction', + ['object_spawner'] = 'object Spawner', + ['animations'] = 'animations', - ['id_card'] = 'iD Card', - ['search'] = 'search', - ['handcuff'] = 'cuff / Uncuff', - ['drag'] = 'drag', - ['put_in_vehicle'] = 'put in Vehicle', - ['out_the_vehicle'] = 'take out of vehicle', - ['fine'] = 'fine', - ['no_players_nearby'] = 'no players nearby', + ['id_card'] = 'iD Card', + ['search'] = 'search', + ['handcuff'] = 'cuff / Uncuff', + ['drag'] = 'drag', + ['put_in_vehicle'] = 'put in Vehicle', + ['out_the_vehicle'] = 'take out of vehicle', + ['fine'] = 'fine', + ['no_players_nearby'] = 'no players nearby', - ['vehicle_info'] = 'vehicle Info', - ['pick_lock'] = 'lockpick Vehicle', - ['vehicle_unlocked'] = 'vehicle ~g~Unlocked~s~', - ['no_vehicles_nearby'] = 'no vehicles nearby', - ['traffic_interaction'] = 'Interaction Voirie', - ['cone'] = 'cone', - ['barrier'] = 'barrier', - ['spikestrips'] = 'spikestrips', - ['box'] = 'box', - ['cash'] = 'Box of cash', - ['police_animations'] = 'Police Animations', - ['dotraffic'] = 'Do a traffic stop', - ['take_note'] = 'Take notes', - ['stand_by'] = 'Stand by', - ['stand_by_2'] = 'Stand by 2', - ['stand_by_3'] = 'Stand by 3', - ['crowd_control'] = 'Crowd control', - ['doinvestigate'] = 'Investigate', - ['dobinoculars'] = 'Use the binoculars', - ['taking_notes'] = 'Im done with taking notes', - ['dealing_with_traffic'] = 'Dealing with traffic is hard', - ['standing_cop'] = 'I cant be here anymore', - ['standing_cop_2'] = 'I cant be here anymore', - ['standing_cop_3'] = 'I cant be here anymore', - ['use_binoculars'] = 'I cant see nothing', - ['do_crowd_control'] = 'The crowd is contained', - ['investigate_done'] = 'My investigation is done', - ['docrouch'] = 'Crouch', - ['kneel'] = 'Let me get up', - ['hang_out'] = 'Free time 1', - ['hanging_out'] = 'Lets go work', - ['doleaning'] = 'Free time 2', - ['dosmoking'] = 'Free time 3', - ['dodrinking'] = 'Free time 4', - ['domobile'] = 'Free time 5', - ['aacoffe'] = 'Morning coffe', - ['push_ups'] = 'Exercise a little', - ['exercise'] = 'Im tired', - ['cancel_emote'] = 'Cancel animation', - ['emotecanceled'] = 'Animation stoped', - --ID Card Menu - ['name'] = 'name : ', - ['bac'] = 'bAC : ', - --Body Search Menu - ['confiscate_dirty'] = 'confiscate dirty money: $', - ['guns_label'] = '--- Guns ---', - ['confiscate'] = 'confiscate ', - ['inventory_label'] = '--- Inventory ---', - ['confiscate_inv'] = 'confiscate x', + ['vehicle_info'] = 'vehicle Info', + ['pick_lock'] = 'lockpick Vehicle', + ['vehicle_unlocked'] = 'vehicle ~g~Unlocked~s~', + ['no_vehicles_nearby'] = 'no vehicles nearby', + ['traffic_interaction'] = 'Interaction Voirie', + ['cone'] = 'cone', + ['barrier'] = 'barrier', + ['spikestrips'] = 'spikestrips', + ['box'] = 'box', + ['cash'] = 'Box of cash', + ['police_animations'] = 'Police Animations', + ['dotraffic'] = 'Do a traffic stop', + ['take_note'] = 'Take notes', + ['stand_by'] = 'Stand by', + ['stand_by_2'] = 'Stand by 2', + ['stand_by_3'] = 'Stand by 3', + ['crowd_control'] = 'Crowd control', + ['doinvestigate'] = 'Investigate', + ['dobinoculars'] = 'Use the binoculars', + ['taking_notes'] = 'Im done with taking notes', + ['dealing_with_traffic'] = 'Dealing with traffic is hard', + ['standing_cop'] = 'I cant be here anymore', + ['standing_cop_2'] = 'I cant be here anymore', + ['standing_cop_3'] = 'I cant be here anymore', + ['use_binoculars'] = 'I cant see nothing', + ['do_crowd_control'] = 'The crowd is contained', + ['investigate_done'] = 'My investigation is done', + ['docrouch'] = 'Crouch', + ['kneel'] = 'Let me get up', + ['hang_out'] = 'Free time 1', + ['hanging_out'] = 'Lets go work', + ['doleaning'] = 'Free time 2', + ['dosmoking'] = 'Free time 3', + ['dodrinking'] = 'Free time 4', + ['domobile'] = 'Free time 5', + ['aacoffe'] = 'Morning coffe', + ['push_ups'] = 'Exercise a little', + ['exercise'] = 'Im tired', + ['cancel_emote'] = 'Cancel animation', + ['emotecanceled'] = 'Animation stoped', + -- ID Card Menu + ['name'] = 'name : ', + ['bac'] = 'bAC : ', + -- Body Search Menu + ['confiscate_dirty'] = 'confiscate dirty money: $', + ['guns_label'] = '--- Guns ---', + ['confiscate'] = 'confiscate ', + ['inventory_label'] = '--- Inventory ---', + ['confiscate_inv'] = 'confiscate x', - ['traffic_offense'] = 'traffic Offense', - ['minor_offense'] = 'minor Offense', - ['average_offense'] = 'average Offense', - ['major_offense'] = 'major Offense', - ['fine_total'] = 'fine: ', - --Vehicle Info Menu - ['plate'] = 'Plate: ', - ['owner_unknown'] = 'owner: Unknown', - ['owner'] = 'owner: ', - --Weapons Menus - ['get_weapon_menu'] = 'armory - Take Weapon', - ['put_weapon_menu'] = 'armory - Put Weapon', - ['buy_weapon_menu'] = 'armory - Buy Guns', - ['not_enough_money'] = 'you do not have enough money', - --Boss Menu - ['take_company_money'] = 'withdraw Company Money', - ['deposit_money'] = 'deposit Money', - ['amount_of_withdrawal'] = 'amount of Withdrawal', - ['invalid_amount'] = 'amount Invalid', - ['amount_of_deposit'] = 'amount of Deposit', - ['open_bossmenu'] = 'press ~INPUT_CONTEXT~ to open the menu', - ['quantity_invalid'] = 'invalid quantity', - ['have_withdraw'] = 'you have withdrawn x', - ['added'] = 'you added x', - ['quantity'] = 'quantity', - ['inventory'] = 'inventory', - ['police_stock'] = 'Police Stock', - --Misc - ['remove_object'] = 'press ~INPUT_CONTEXT~ to delete the object', - ['map_blip'] = 'police Station', - --Notifications - ['from'] = '~s~ from ~b~', - ['you_have_confinv'] = 'you have confiscated ~y~x', - ['confinv'] = '~s~ confiscated from you ~y~x', - ['you_have_confdm'] = 'you have confiscated ~y~$', - ['confdm'] = '~s~ confiscated from you ~y~$', - ['you_have_confweapon'] = 'you have confiscated ~y~x1 ', - ['confweapon'] = '~s~ confiscated from you ~y~x1 ', - ['alert_police'] = 'alert police', - --Authorized Vehicles - ['police'] = 'patrol Vehicle 1', - ['police2'] = 'patrol Vehicle 2', - ['police3'] = 'patrol Vehicle 3', - ['police4'] = 'unmarked Vehicle', - ['policeb'] = 'motorcycle', - ['policet'] = 'transport Van', + ['traffic_offense'] = 'traffic Offense', + ['minor_offense'] = 'minor Offense', + ['average_offense'] = 'average Offense', + ['major_offense'] = 'major Offense', + ['fine_total'] = 'fine: ', + -- Vehicle Info Menu + ['plate'] = 'Plate: ', + ['owner_unknown'] = 'owner: Unknown', + ['owner'] = 'owner: ', + -- Weapons Menus + ['get_weapon_menu'] = 'armory - Take Weapon', + ['put_weapon_menu'] = 'armory - Put Weapon', + ['buy_weapon_menu'] = 'armory - Buy Guns', + ['not_enough_money'] = 'you do not have enough money', + -- Boss Menu + ['take_company_money'] = 'withdraw Company Money', + ['deposit_money'] = 'deposit Money', + ['amount_of_withdrawal'] = 'amount of Withdrawal', + ['invalid_amount'] = 'amount Invalid', + ['amount_of_deposit'] = 'amount of Deposit', + ['open_bossmenu'] = 'press ~INPUT_CONTEXT~ to open the menu', + ['quantity_invalid'] = 'invalid quantity', + ['have_withdraw'] = 'you have withdrawn x', + ['added'] = 'you added x', + ['quantity'] = 'quantity', + ['inventory'] = 'inventory', + ['police_stock'] = 'Police Stock', + -- Misc + ['remove_object'] = 'press ~INPUT_CONTEXT~ to delete the object', + ['map_blip'] = 'police Station', + -- Notifications + ['from'] = '~s~ from ~b~', + ['you_have_confinv'] = 'you have confiscated ~y~x', + ['confinv'] = '~s~ confiscated from you ~y~x', + ['you_have_confdm'] = 'you have confiscated ~y~$', + ['confdm'] = '~s~ confiscated from you ~y~$', + ['you_have_confweapon'] = 'you have confiscated ~y~x1 ', + ['confweapon'] = '~s~ confiscated from you ~y~x1 ', + ['alert_police'] = 'alert police', + -- Authorized Vehicles + ['police'] = 'patrol Vehicle 1', + ['police2'] = 'patrol Vehicle 2', + ['police3'] = 'patrol Vehicle 3', + ['police4'] = 'unmarked Vehicle', + ['policeb'] = 'motorcycle', + ['policet'] = 'transport Van', } diff --git a/locales/es.lua b/locales/es.lua index 18d923c3..41b24ef2 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -1,107 +1,107 @@ -Locales['es'] = { - --Cloakroom - ['cloakroom'] = 'Taquilla', - ['citizen_wear'] = 'Ropa civil', - ['police_wear'] = 'Ropa CNP', - ['sheriff_wear'] = 'Ropa Oficial', - ['lieutenant_wear'] = 'Ropa Teniente', - ['commandant_wear'] = 'Ropa Secreta', - ['statepd_wear'] = 'Ropa Guardia Civil', - ['specops_wear'] = 'Ropa GEO', - ['open_cloackroom'] = 'Presionar ~INPUT_CONTEXT~ para abrir la taquilla', - --Armory - ['get_weapon'] = 'Coger arma', - ['put_weapon'] = 'Depositar arma', - ['buy_weapons'] = 'Comprar armas', - ['armory'] = 'Arsenal', - ['open_armory'] = 'Presionarr ~INPUT_CONTEXT~ para acceder a la armeria', - --Vehicles - ['vehicle_menu'] = 'Vehículo', - ['vehicle_out'] = 'Ya tienes un vehículo fuera', - ['vehicle_spawner'] = 'Presionar ~INPUT_CONTEXT~ para sacar un vehículo', - ['store_vehicle'] = 'Presionar ~INPUT_CONTEXT~ para guardar un vehículo', - ['service_max'] = 'Servicio completado : ', - --Action Menu - ['citizen_interaction'] = 'Interacción ciudadana', - ['vehicle_interaction'] = 'Interacción vehículo', - ['object_spawner'] = 'Colocar objetos', - - ['id_card'] = 'Documento de identidad', - ['search'] = 'Buscar', - ['handcuff'] = 'Poner/quitar Esposas', - ['drag'] = 'escoltar', - ['put_in_vehicle'] = 'Meter en el vehículo', - ['out_the_vehicle'] = 'Sacar del vehículo', - ['fine'] = 'Multa', - ['no_players_nearby'] = 'No hay jugadores cerca', - - ['vehicle_info'] = 'Información del vehículo', - ['pick_lock'] = 'Forzar coche', - ['vehicle_unlocked'] = 'Vehículo desbloqueado~s~', - ['no_vehicles_nearby'] = 'No hay vehículos cerca', - ['traffic_interaction'] = 'Rutas de interacción', - ['cone'] = 'Cono', - ['barrier'] = 'Barrera', - ['spikestrips'] = 'Grada', - ['box'] = 'Caja', - ['cash'] = 'Dinero', - --ID Card Menu - ['name'] = 'Nombre : ', - ['bac'] = 'Alcoolemia : ', - --Body Search Menu - ['confiscate_dirty'] = 'Confiscar dinero negro : €', - ['guns_label'] = '--- Armas ---', - ['confiscate'] = 'Confiscar ', - ['inventory_label'] = '--- Inventario ---', - ['confiscate_inv'] = 'Confiscar x', - - ['traffic_offense'] = 'Delito de tráfico', - ['minor_offense'] = 'Delito menor', - ['average_offense'] = 'Delito medio', - ['major_offense'] = 'Delito grave', - ['fine_total'] = 'Multa total : ', - --Vehicle Info Menu - ['plate'] = 'N°: ', - ['owner_unknown'] = 'Propietario : Desconocido', - ['owner'] = 'Propietario : ', - --Weapons Menus - ['get_weapon_menu'] = 'Arsenal - Coger armas', - ['put_weapon_menu'] = 'Arsenal - Depositar armas', - ['buy_weapon_menu'] = 'Arsenal - Comprar armas', - ['not_enough_money'] = 'No tienes suficiente dinero', - --Boss Menu - ['take_company_money'] = 'Retirar dinero de la empresa', - ['deposit_money'] = 'Depositar dinero en la empresa', - ['amount_of_withdrawal'] = 'Cantidad a retirar', - ['invalid_amount'] = 'Cantidad inválida', - ['amount_of_deposit'] = 'Cantidad a depositar', - ['open_bossmenu'] = 'Presionar ~INPUT_CONTEXT~ para abrir el menú', - ['quantity_invalid'] = 'Cantidad invalida', - ['have_withdrawn'] = 'Has retirado x', - ['added'] = 'Has metido x', - ['quantity'] = 'Cantidad', - ['inventory'] = 'inventario', - ['police_stock'] = 'Almacen Policial', - --Misc - ['remove_object'] = 'Presionar ~INPUT_CONTEXT~ para eliminar el objeto', - ['map_blip'] = 'Comisaría de policía', - --Notifications - ['from'] = '~s~ de ~b~', - ['you_have_confinv'] = 'Has confiscado ~y~x', - ['confinv'] = '~s~ Te han confiscado ~y~x', - ['you_have_confdm'] = 'Has confiscado ~y~€', - ['confdm'] = '~s~ Te han confiscado ~y~€', - ['you_have_confweapon'] = 'Has confiscado ~y~x1 ', - ['confweapon'] = '~s~ Te han confiscado ~y~x1 ', - ['alert_police'] = 'Alerta policia', - --Authorized Vehicles - ['policebike'] = 'Bicicleta Policía', - ['focuscnp'] = 'Vehículo patrulla 1', - ['tiguancnp'] = 'Vehículo patrulla 2', - ['police3'] = 'Vehículo patrulla 3', - ['police4'] = 'Vehículo Secreta', - ['policeb'] = 'Moto', - ['policet'] = 'Furgón policial', - ['polmav'] = 'Helicóptero de la policía', - ['buzzard2'] = 'Helicóptero de mando', -} \ No newline at end of file +Locales['es'] = { + -- Cloakroom + ['cloakroom'] = 'Taquilla', + ['citizen_wear'] = 'Ropa civil', + ['police_wear'] = 'Ropa CNP', + ['sheriff_wear'] = 'Ropa Oficial', + ['lieutenant_wear'] = 'Ropa Teniente', + ['commandant_wear'] = 'Ropa Secreta', + ['statepd_wear'] = 'Ropa Guardia Civil', + ['specops_wear'] = 'Ropa GEO', + ['open_cloackroom'] = 'Presionar ~INPUT_CONTEXT~ para abrir la taquilla', + -- Armory + ['get_weapon'] = 'Coger arma', + ['put_weapon'] = 'Depositar arma', + ['buy_weapons'] = 'Comprar armas', + ['armory'] = 'Arsenal', + ['open_armory'] = 'Presionarr ~INPUT_CONTEXT~ para acceder a la armeria', + -- Vehicles + ['vehicle_menu'] = 'Vehículo', + ['vehicle_out'] = 'Ya tienes un vehículo fuera', + ['vehicle_spawner'] = 'Presionar ~INPUT_CONTEXT~ para sacar un vehículo', + ['store_vehicle'] = 'Presionar ~INPUT_CONTEXT~ para guardar un vehículo', + ['service_max'] = 'Servicio completado : ', + -- Action Menu + ['citizen_interaction'] = 'Interacción ciudadana', + ['vehicle_interaction'] = 'Interacción vehículo', + ['object_spawner'] = 'Colocar objetos', + + ['id_card'] = 'Documento de identidad', + ['search'] = 'Buscar', + ['handcuff'] = 'Poner/quitar Esposas', + ['drag'] = 'escoltar', + ['put_in_vehicle'] = 'Meter en el vehículo', + ['out_the_vehicle'] = 'Sacar del vehículo', + ['fine'] = 'Multa', + ['no_players_nearby'] = 'No hay jugadores cerca', + + ['vehicle_info'] = 'Información del vehículo', + ['pick_lock'] = 'Forzar coche', + ['vehicle_unlocked'] = 'Vehículo desbloqueado~s~', + ['no_vehicles_nearby'] = 'No hay vehículos cerca', + ['traffic_interaction'] = 'Rutas de interacción', + ['cone'] = 'Cono', + ['barrier'] = 'Barrera', + ['spikestrips'] = 'Grada', + ['box'] = 'Caja', + ['cash'] = 'Dinero', + -- ID Card Menu + ['name'] = 'Nombre : ', + ['bac'] = 'Alcoolemia : ', + -- Body Search Menu + ['confiscate_dirty'] = 'Confiscar dinero negro : €', + ['guns_label'] = '--- Armas ---', + ['confiscate'] = 'Confiscar ', + ['inventory_label'] = '--- Inventario ---', + ['confiscate_inv'] = 'Confiscar x', + + ['traffic_offense'] = 'Delito de tráfico', + ['minor_offense'] = 'Delito menor', + ['average_offense'] = 'Delito medio', + ['major_offense'] = 'Delito grave', + ['fine_total'] = 'Multa total : ', + -- Vehicle Info Menu + ['plate'] = 'N°: ', + ['owner_unknown'] = 'Propietario : Desconocido', + ['owner'] = 'Propietario : ', + -- Weapons Menus + ['get_weapon_menu'] = 'Arsenal - Coger armas', + ['put_weapon_menu'] = 'Arsenal - Depositar armas', + ['buy_weapon_menu'] = 'Arsenal - Comprar armas', + ['not_enough_money'] = 'No tienes suficiente dinero', + -- Boss Menu + ['take_company_money'] = 'Retirar dinero de la empresa', + ['deposit_money'] = 'Depositar dinero en la empresa', + ['amount_of_withdrawal'] = 'Cantidad a retirar', + ['invalid_amount'] = 'Cantidad inválida', + ['amount_of_deposit'] = 'Cantidad a depositar', + ['open_bossmenu'] = 'Presionar ~INPUT_CONTEXT~ para abrir el menú', + ['quantity_invalid'] = 'Cantidad invalida', + ['have_withdrawn'] = 'Has retirado x', + ['added'] = 'Has metido x', + ['quantity'] = 'Cantidad', + ['inventory'] = 'inventario', + ['police_stock'] = 'Almacen Policial', + -- Misc + ['remove_object'] = 'Presionar ~INPUT_CONTEXT~ para eliminar el objeto', + ['map_blip'] = 'Comisaría de policía', + -- Notifications + ['from'] = '~s~ de ~b~', + ['you_have_confinv'] = 'Has confiscado ~y~x', + ['confinv'] = '~s~ Te han confiscado ~y~x', + ['you_have_confdm'] = 'Has confiscado ~y~€', + ['confdm'] = '~s~ Te han confiscado ~y~€', + ['you_have_confweapon'] = 'Has confiscado ~y~x1 ', + ['confweapon'] = '~s~ Te han confiscado ~y~x1 ', + ['alert_police'] = 'Alerta policia', + -- Authorized Vehicles + ['policebike'] = 'Bicicleta Policía', + ['focuscnp'] = 'Vehículo patrulla 1', + ['tiguancnp'] = 'Vehículo patrulla 2', + ['police3'] = 'Vehículo patrulla 3', + ['police4'] = 'Vehículo Secreta', + ['policeb'] = 'Moto', + ['policet'] = 'Furgón policial', + ['polmav'] = 'Helicóptero de la policía', + ['buzzard2'] = 'Helicóptero de mando', +} diff --git a/locales/fr.lua b/locales/fr.lua index f034108b..e0262442 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,104 +1,104 @@ Locales['fr'] = { - --Cloakroom - ['cloakroom'] = 'vestiaire', - ['citizen_wear'] = 'tenue Civil', - ['police_wear'] = 'tenue Policier', - ['sheriff_wear'] = 'sheriff Outfit', - ['lieutenant_wear'] = 'Swatt outfit ', - ['commandant_wear'] = 'Fbi outfit', - ['statepd_wear'] = 'State Police outfit', - ['specops_wear'] = 'Spec OPS outfit', - ['open_cloackroom'] = 'appuez sur ~INPUT_CONTEXT~ pour vous changer', - --Armory - ['get_weapon'] = 'prendre Arme', - ['put_weapon'] = 'déposer Arme', - ['buy_weapons'] = 'acheter Armes', - ['armory'] = 'armurerie', - ['open_armory'] = 'appuez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie', - --Vehicles - ['vehicle_menu'] = 'véhicule', - ['vehicle_out'] = 'il y a déja un véhicule de sorti', - ['vehicle_spawner'] = 'appuez sur ~INPUT_CONTEXT~ pour sortir un véhicule', - ['store_vehicle'] = 'appuez sur ~INPUT_CONTEXT~ pour ranger le véhicule', - ['service_max'] = 'Service complet : ', - --Action Menu - ['citizen_interaction'] = 'interaction citoyen', - ['vehicle_interaction'] = 'interaction véhicule', - ['object_spawner'] = 'placer objets', + -- Cloakroom + ['cloakroom'] = 'vestiaire', + ['citizen_wear'] = 'tenue Civil', + ['police_wear'] = 'tenue Policier', + ['sheriff_wear'] = 'sheriff Outfit', + ['lieutenant_wear'] = 'Swatt outfit ', + ['commandant_wear'] = 'Fbi outfit', + ['statepd_wear'] = 'State Police outfit', + ['specops_wear'] = 'Spec OPS outfit', + ['open_cloackroom'] = 'appuez sur ~INPUT_CONTEXT~ pour vous changer', + -- Armory + ['get_weapon'] = 'prendre Arme', + ['put_weapon'] = 'déposer Arme', + ['buy_weapons'] = 'acheter Armes', + ['armory'] = 'armurerie', + ['open_armory'] = 'appuez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie', + -- Vehicles + ['vehicle_menu'] = 'véhicule', + ['vehicle_out'] = 'il y a déja un véhicule de sorti', + ['vehicle_spawner'] = 'appuez sur ~INPUT_CONTEXT~ pour sortir un véhicule', + ['store_vehicle'] = 'appuez sur ~INPUT_CONTEXT~ pour ranger le véhicule', + ['service_max'] = 'Service complet : ', + -- Action Menu + ['citizen_interaction'] = 'interaction citoyen', + ['vehicle_interaction'] = 'interaction véhicule', + ['object_spawner'] = 'placer objets', - ['id_card'] = 'carte d\'identité', - ['search'] = 'fouiller', - ['handcuff'] = 'menotter / Démenotter', - ['drag'] = 'escorter', - ['put_in_vehicle'] = 'mettre dans véhicule', - ['out_the_vehicle'] = 'sortir du véhicule', - ['fine'] = 'Amende', - ['no_players_nearby'] = 'aucun joueur à proximité', + ['id_card'] = 'carte d\'identité', + ['search'] = 'fouiller', + ['handcuff'] = 'menotter / Démenotter', + ['drag'] = 'escorter', + ['put_in_vehicle'] = 'mettre dans véhicule', + ['out_the_vehicle'] = 'sortir du véhicule', + ['fine'] = 'Amende', + ['no_players_nearby'] = 'aucun joueur à proximité', - ['vehicle_info'] = 'infos véhicule', - ['pick_lock'] = 'crocheter véhicule', - ['vehicle_unlocked'] = 'véhicule ~g~déverouillé~s~', - ['no_vehicles_nearby'] = 'aucun véhicule à proximité', - ['traffic_interaction'] = 'Interaction Voirie', - ['cone'] = 'plot', - ['barrier'] = 'barrière', - ['spikestrips'] = 'herse', - ['box'] = 'caisse', - ['cash'] = 'caisse', - --ID Card Menu - ['name'] = 'nom : ', - ['bac'] = 'alcoolémie : ', - --Body Search Menu - ['confiscate_dirty'] = 'confisquer argent sale : $', - ['guns_label'] = '--- Armes ---', - ['confiscate'] = 'confisquer ', - ['inventory_label'] = '--- Inventaire ---', - ['confiscate_inv'] = 'confisquer x', + ['vehicle_info'] = 'infos véhicule', + ['pick_lock'] = 'crocheter véhicule', + ['vehicle_unlocked'] = 'véhicule ~g~déverouillé~s~', + ['no_vehicles_nearby'] = 'aucun véhicule à proximité', + ['traffic_interaction'] = 'Interaction Voirie', + ['cone'] = 'plot', + ['barrier'] = 'barrière', + ['spikestrips'] = 'herse', + ['box'] = 'caisse', + ['cash'] = 'caisse', + -- ID Card Menu + ['name'] = 'nom : ', + ['bac'] = 'alcoolémie : ', + -- Body Search Menu + ['confiscate_dirty'] = 'confisquer argent sale : $', + ['guns_label'] = '--- Armes ---', + ['confiscate'] = 'confisquer ', + ['inventory_label'] = '--- Inventaire ---', + ['confiscate_inv'] = 'confisquer x', - ['traffic_offense'] = 'code de la route', - ['minor_offense'] = 'délit mineur', - ['average_offense'] = 'délit moyen', - ['major_offense'] = 'délit grave', - ['fine_total'] = 'amende : ', - --Vehicle Info Menu - ['plate'] = 'N°: ', - ['owner_unknown'] = 'propriétaire : Inconnu', - ['owner'] = 'propriétaire : ', - --Weapons Menus - ['get_weapon_menu'] = 'armurerie - Prendre Arme', - ['put_weapon_menu'] = 'armurerie - Déposer Arme', - ['buy_weapon_menu'] = 'armurerie - Acheter Armes', - ['not_enough_money'] = 'vous n\'avez pas assez d\'argent', - --Boss Menu - ['take_company_money'] = 'retirer argent société', - ['deposit_money'] = 'déposer argent', - ['amount_of_withdrawal'] = 'montant du retrait', - ['invalid_amount'] = 'montant invalide', - ['amount_of_deposit'] = 'montant du dépôt', - ['open_bossmenu'] = 'appuez sur ~INPUT_CONTEXT~ pour ouvrir le menu', - ['quantity_invalid'] = 'Quantité invalide', - ['have_withdrawn'] = 'Vous avez retiré x', - ['added'] = 'Vous avez ajouté x', - ['quantity'] = 'Quantité', - ['inventory'] = 'inventaire', - ['police_stock'] = 'Police Stock', - --Misc - ['remove_object'] = 'appuez sur ~INPUT_CONTEXT~ pour enlever l\'objet', - ['map_blip'] = 'Commissariat', - --Notifications - ['from'] = '~s~ à ~b~', - ['you_have_confinv'] = 'vous avez confisqué ~y~x', - ['confinv'] = '~s~ vous a confisqué ~y~x', - ['you_have_confdm'] = 'vous avez confisqué ~y~$', - ['confdm'] = '~s~ vous a confisqué ~y~$', - ['you_have_confweapon'] = 'vous avez confisqué ~y~x1 ', - ['confweapon'] = '~s~ vous a confisqué ~y~x1 ', - ['alert_police'] = 'alerte police', - --Authorized Vehicles - ['police'] = 'véhicule de patrouille 1', - ['police2'] = 'véhicule de patrouille 2', - ['police3'] = 'véhicule de patrouille 3', - ['police4'] = 'véhicule civil', - ['policeb'] = 'moto', - ['policet'] = 'van de transport', -} \ No newline at end of file + ['traffic_offense'] = 'code de la route', + ['minor_offense'] = 'délit mineur', + ['average_offense'] = 'délit moyen', + ['major_offense'] = 'délit grave', + ['fine_total'] = 'amende : ', + -- Vehicle Info Menu + ['plate'] = 'N°: ', + ['owner_unknown'] = 'propriétaire : Inconnu', + ['owner'] = 'propriétaire : ', + -- Weapons Menus + ['get_weapon_menu'] = 'armurerie - Prendre Arme', + ['put_weapon_menu'] = 'armurerie - Déposer Arme', + ['buy_weapon_menu'] = 'armurerie - Acheter Armes', + ['not_enough_money'] = 'vous n\'avez pas assez d\'argent', + -- Boss Menu + ['take_company_money'] = 'retirer argent société', + ['deposit_money'] = 'déposer argent', + ['amount_of_withdrawal'] = 'montant du retrait', + ['invalid_amount'] = 'montant invalide', + ['amount_of_deposit'] = 'montant du dépôt', + ['open_bossmenu'] = 'appuez sur ~INPUT_CONTEXT~ pour ouvrir le menu', + ['quantity_invalid'] = 'Quantité invalide', + ['have_withdrawn'] = 'Vous avez retiré x', + ['added'] = 'Vous avez ajouté x', + ['quantity'] = 'Quantité', + ['inventory'] = 'inventaire', + ['police_stock'] = 'Police Stock', + -- Misc + ['remove_object'] = 'appuez sur ~INPUT_CONTEXT~ pour enlever l\'objet', + ['map_blip'] = 'Commissariat', + -- Notifications + ['from'] = '~s~ à ~b~', + ['you_have_confinv'] = 'vous avez confisqué ~y~x', + ['confinv'] = '~s~ vous a confisqué ~y~x', + ['you_have_confdm'] = 'vous avez confisqué ~y~$', + ['confdm'] = '~s~ vous a confisqué ~y~$', + ['you_have_confweapon'] = 'vous avez confisqué ~y~x1 ', + ['confweapon'] = '~s~ vous a confisqué ~y~x1 ', + ['alert_police'] = 'alerte police', + -- Authorized Vehicles + ['police'] = 'véhicule de patrouille 1', + ['police2'] = 'véhicule de patrouille 2', + ['police3'] = 'véhicule de patrouille 3', + ['police4'] = 'véhicule civil', + ['policeb'] = 'moto', + ['policet'] = 'van de transport', +} diff --git a/localization/de_config.lua b/localization/de_config.lua index bd6585e8..15753302 100644 --- a/localization/de_config.lua +++ b/localization/de_config.lua @@ -9,74 +9,74 @@ Config.EnableESXIdentity = false -- only turn this on if you are using Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false Config.MaxInService = -1 -Config.Locale = 'de' +Config.Locale = 'de' Config.PoliceStations = { - - LSPD = { - Blip = { - Pos = {x = 425.130, y = -979.558, z = 30.711}, - Color = 29 - }, + LSPD = { - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_ASSAULTRIFLE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - {name = 'WEAPON_STICKYBOMB', price = 250}, - {name = 'GADGET_PARACHUTE', price = 300}, - }, + Blip = { + Pos = {x = 425.130, y = -979.558, z = 30.711}, + Color = 29 + }, - AuthorizedVehicles = { - {name = 'police' , label = 'Streifenfahrzeug 1'}, - {name = 'police2', label = 'Streifenfahrzeug 2'}, - {name = 'police3', label = 'Streifenfahrzeug 3'}, - {name = 'police4', label = 'Zivilfahrzeug'}, - {name = 'policeb', label = 'Motorrad'}, - {name = 'policet', label = 'Transporter'}, - }, + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_ASSAULTRIFLE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + {name = 'WEAPON_STICKYBOMB', price = 250}, + {name = 'GADGET_PARACHUTE', price = 300}, + }, - Cloakrooms = { - {x = 452.600, y = -993.306, z = 29.750} - }, + AuthorizedVehicles = { + {name = 'police' , label = 'Streifenfahrzeug 1'}, + {name = 'police2', label = 'Streifenfahrzeug 2'}, + {name = 'police3', label = 'Streifenfahrzeug 3'}, + {name = 'police4', label = 'Zivilfahrzeug'}, + {name = 'policeb', label = 'Motorrad'}, + {name = 'policet', label = 'Transporter'}, + }, - Armories = { - {x = 451.699, y = -980.356, z = 29.689} - }, + Cloakrooms = { + {x = 452.600, y = -993.306, z = 29.750} + }, - Vehicles = { - { - Spawner = {x = 454.69, y = -1017.4, z = 27.430}, - SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, - Heading = 90.0 - } - }, + Armories = { + {x = 451.699, y = -980.356, z = 29.689} + }, - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, + Vehicles = { + { + Spawner = {x = 454.69, y = -1017.4, z = 27.430}, + SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, + Heading = 90.0 + } + }, - VehicleDeleters = { - {x = 462.74, y = -1014.4, z = 27.065}, - {x = 462.40, y = -1019.7, z = 27.104} - }, + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, - BossActions = { - {x = 448.417, y = -973.208, z = 29.689} - } + VehicleDeleters = { + {x = 462.74, y = -1014.4, z = 27.065}, + {x = 462.40, y = -1019.7, z = 27.104} + }, - } + BossActions = { + {x = 448.417, y = -973.208, z = 29.689} + } + + } } diff --git a/localization/de_esx_policejob.sql b/localization/de_esx_policejob.sql index 7889aae5..3a10f65d 100644 --- a/localization/de_esx_policejob.sql +++ b/localization/de_esx_policejob.sql @@ -1,33 +1,33 @@ -INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_police','Polizei',1) +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police','Polizei',1) ; -INSERT INTO `datastore` (name, label, shared) VALUES - ('society_police','Polizei',1) +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police','Polizei',1) ; -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_police', 'Polizei', 1) +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Polizei', 1) ; -INSERT INTO `jobs` (name, label) VALUES - ('police','LSPD') +INSERT INTO `jobs` (name, label) VALUES + ('police','LSPD') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recruit','Rekrut',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') + ('police',0,'recruit','Rekrut',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; CREATE TABLE `fine_types` ( - + `id` int(11) NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, `amount` int(11) DEFAULT NULL, `category` int(11) DEFAULT NULL, - + PRIMARY KEY (`id`) ); @@ -83,4 +83,4 @@ INSERT INTO `fine_types` VALUES ('49', 'Mord an Zivilisten', '10000', '3'); INSERT INTO `fine_types` VALUES ('50', 'Mord an Beamten', '30000', '3'); INSERT INTO `fine_types` VALUES ('51', 'versehentlicher Mord', '1800', '3'); INSERT INTO `fine_types` VALUES ('52', 'Firmenbetrug', '2000', '2'); -; \ No newline at end of file +; diff --git a/localization/en_config.lua b/localization/en_config.lua index 880efeba..3d14bb2a 100644 --- a/localization/en_config.lua +++ b/localization/en_config.lua @@ -9,253 +9,253 @@ Config.EnableESXIdentity = false -- only turn this on if you are using Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false Config.MaxInService = -1 -Config.Locale = 'en' +Config.Locale = 'en' Config.PoliceStations = { - LSPD1 = { - Blip = { - Pos = {x = 425.130, y = -979.558, z = 30.711}, - Color = 29 - }, + LSPD1 = { + Blip = { + Pos = {x = 425.130, y = -979.558, z = 30.711}, + Color = 29 + }, - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + }, - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, - Cloakrooms = { - {x = 452.600, y = -993.306, z = 29.750} - }, + Cloakrooms = { + {x = 452.600, y = -993.306, z = 29.750} + }, - Armories = { - {x = 451.699, y = -980.356, z = 29.689} - }, + Armories = { + {x = 451.699, y = -980.356, z = 29.689} + }, - Vehicles = { - { - Spawner = {x = 454.69, y = -1017.4, z = 27.430}, - SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, - Heading = 90.0 - } - }, + Vehicles = { + { + Spawner = {x = 454.69, y = -1017.4, z = 27.430}, + SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, + Heading = 90.0 + } + }, - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, - VehicleDeleters = { - {x = 462.74, y = -1014.4, z = 27.065}, - {x = 462.40, y = -1019.7, z = 27.104} - }, + VehicleDeleters = { + {x = 462.74, y = -1014.4, z = 27.065}, + {x = 462.40, y = -1019.7, z = 27.104} + }, - BossActions = { - {x = 448.417, y = -973.208, z = 29.689} - } + BossActions = { + {x = 448.417, y = -973.208, z = 29.689} + } - }, + }, - SASP1 = { - Blip = { - Pos = {x = 825.34204101563, y = -1290.0471191406, z = 28.240659713745 }, - Color = 40 - }, + SASP1 = { + Blip = { + Pos = {x = 825.34204101563, y = -1290.0471191406, z = 28.240659713745 }, + Color = 40 + }, - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + }, - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, - Cloakrooms = { - {x = 830.11590576172, y = -1311.4512939453, z = 28.13673210144 } -- state pd - }, + Cloakrooms = { + {x = 830.11590576172, y = -1311.4512939453, z = 28.13673210144 } -- state pd + }, - Armories = { - {x = 858.25366210938, y = -1321.5992431641, z = 28.136734008789 } -- state pd - }, + Armories = { + {x = 858.25366210938, y = -1321.5992431641, z = 28.136734008789 } -- state pd + }, - Vehicles = { - { - Spawner = {x = 863.17700195313, y = -1346.2406005859, z = 26.039228439331 }, --state pd - SpawnPoint = {x = 871.07720947266, y = -1350.00390625, z = 26.3092918396 }, -- state pd - Heading = 90.0 --state pd - } - }, + Vehicles = { + { + Spawner = {x = 863.17700195313, y = -1346.2406005859, z = 26.039228439331 }, --state pd + SpawnPoint = {x = 871.07720947266, y = -1350.00390625, z = 26.3092918396 }, -- state pd + Heading = 90.0 --state pd + } + }, - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, - VehicleDeleters = { - {x = 823.95031738281, y = -1371.1483154297, z = 26.136753082275 } --state pd - }, + VehicleDeleters = { + {x = 823.95031738281, y = -1371.1483154297, z = 26.136753082275 } --state pd + }, - BossActions = { - {x = 850.228515625, y = -1284.50390625, z = 28.004758834839 } --state pd - } + BossActions = { + {x = 850.228515625, y = -1284.50390625, z = 28.004758834839 } --state pd + } - }, + }, - LSPD2 = { - Blip = { - Pos = {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, - Color = 29 - }, + LSPD2 = { + Blip = { + Pos = {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, + Color = 29 + }, - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + }, - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, - Cloakrooms = { - {x = -450.2878112793, y = 6016.482421875, z = 31.716369628906 }, - }, + Cloakrooms = { + {x = -450.2878112793, y = 6016.482421875, z = 31.716369628906 }, + }, - Armories = { - {x = -448.04425048828, y = 6007.7104492188, z = 31.716369628906 }, - }, + Armories = { + {x = -448.04425048828, y = 6007.7104492188, z = 31.716369628906 }, + }, - Vehicles = { - { - Spawner = {x = -452.30313110352, y = 6005.6704101563, z = 31.840929031372 }, - SpawnPoint = {x = -454.96899414063, y = 6001.8876953125, z = 31.340549468994 }, - Heading = 87.0 - } - }, + Vehicles = { + { + Spawner = {x = -452.30313110352, y = 6005.6704101563, z = 31.840929031372 }, + SpawnPoint = {x = -454.96899414063, y = 6001.8876953125, z = 31.340549468994 }, + Heading = 87.0 + } + }, - Helicopters = { - { - Spawner = {x = -462.88317871094, y = 5993.7685546875, z = 31.245756149292 }, - SpawnPoint = {x = -475.48043823242, y = 5988.326171875, z = 31.336708068848 }, - Heading = 270.0 - } - }, + Helicopters = { + { + Spawner = {x = -462.88317871094, y = 5993.7685546875, z = 31.245756149292 }, + SpawnPoint = {x = -475.48043823242, y = 5988.326171875, z = 31.336708068848 }, + Heading = 270.0 + } + }, - VehicleDeleters = { - {x = -447.64434814453, y = 5994.5024414063, z = 31.340551376343 }, - }, + VehicleDeleters = { + {x = -447.64434814453, y = 5994.5024414063, z = 31.340551376343 }, + }, - BossActions = { - {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, - } + BossActions = { + {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, + } - }, + }, - SASP2 = { - Blip = { - Pos = {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, - Color = 40 - }, + SASP2 = { + Blip = { + Pos = {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, + Color = 40 + }, - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, + AuthorizedWeapons = { + {name = 'WEAPON_NIGHTSTICK', price = 200}, + {name = 'WEAPON_COMBATPISTOL', price = 300}, + {name = 'WEAPON_ASSAULTSMG', price = 1250}, + {name = 'WEAPON_SPECIALCARBINE', price = 1500}, + {name = 'WEAPON_PUMPSHOTGUN', price = 600}, + {name = 'WEAPON_STUNGUN', price = 500}, + {name = 'WEAPON_FLASHLIGHT', price = 80}, + {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, + {name = 'WEAPON_FLAREGUN', price = 60}, + }, - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, + AuthorizedVehicles = { + {name = 'police' , label = 'Police Vehicle 1'}, + {name = 'police2', label = 'Police Vehicle 2'}, + {name = 'police3', label = 'Police Vehicle 3'}, + {name = 'police4', label = 'Police Vehicle 4'}, + {name = 'policeb', label = 'Motorcycle'}, + {name = 'policet', label = 'Transport Van'}, + }, - Cloakrooms = { - {x = 1857.2354736328, y = 3689.8408203125, z = 34.26708984375 }, -- state pd - }, + Cloakrooms = { + {x = 1857.2354736328, y = 3689.8408203125, z = 34.26708984375 }, -- state pd + }, - Armories = { - {x = 1848.3413085938, y = 3690.1345214844, z = 34.26708984375 }, -- state pd - }, + Armories = { + {x = 1848.3413085938, y = 3690.1345214844, z = 34.26708984375 }, -- state pd + }, - Vehicles = { - { - Spawner = {x = 1866.208984375, y = 3693.8125, z = 33.737236022949 }, --state pd - SpawnPoint = {x = 1872.9417724609, y = 3690.5759277344, z = 33.569362640381 }, -- state pd - Heading = 90.0 --state pd - } - }, + Vehicles = { + { + Spawner = {x = 1866.208984375, y = 3693.8125, z = 33.737236022949 }, --state pd + SpawnPoint = {x = 1872.9417724609, y = 3690.5759277344, z = 33.569362640381 }, -- state pd + Heading = 90.0 --state pd + } + }, - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, + Helicopters = { + { + Spawner = {x = 466.477, y = -982.819, z = 42.691}, + SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, + Heading = 0.0 + } + }, - VehicleDeleters = { - {x = 1866.4152832031, y = 3699.6052246094, z = 33.535938262939 }, --state pd - }, + VehicleDeleters = { + {x = 1866.4152832031, y = 3699.6052246094, z = 33.535938262939 }, --state pd + }, - BossActions = { - {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, --state pd - } + BossActions = { + {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, --state pd + } - }, + }, } diff --git a/localization/esx_policejob_en.sql b/localization/esx_policejob_en.sql index 204e54df..ac8ee619 100644 --- a/localization/esx_policejob_en.sql +++ b/localization/esx_policejob_en.sql @@ -1,87 +1,87 @@ -INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_police','Police',1) +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police','Police',1) ; -INSERT INTO `datastore` (name, label, shared) VALUES - ('society_police','Police',1) +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police','Police',1) ; -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_police', 'Police', 1) +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Police', 1) ; -INSERT INTO `jobs` (name, label) VALUES - ('police','LSPD') +INSERT INTO `jobs` (name, label) VALUES + ('police','LSPD') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recruit','Recruit',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',1,'sergeant','Sergeant',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'boss','Chief',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') + ('police',0,'recruit','Recruit',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',1,'sergeant','Sergeant',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',3,'boss','Chief',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; CREATE TABLE `fine_types` ( - + `id` int(11) NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, `amount` int(11) DEFAULT NULL, `category` int(11) DEFAULT NULL, - + PRIMARY KEY (`id`) ); -INSERT INTO `fine_types` (label, amount, category) VALUES - ('Misuse of a horn', 30, 0), - ('Illegally Crossing a continuous Line', 40, 0), - ('Driving on the wrong side of the road', 250, 0), - ('Illegal U-Turn', 250, 0), - ('Illegally Driving Off-road', 170, 0), - ('Refusing a Lawful Command', 30, 0), - ('Illegally Stoped of a Vehicle', 150, 0), - ('Illegal Parking', 70, 0), - ('Failing to Yield to the right', 70, 0), - ('Failure to comply with Vehicle Information', 90, 0), - ('Failing to stop at a Stop Sign ', 105, 0), - ('Failing to stop at a Red Light', 130, 0), - ('Illegal Passing', 100, 0), - ('Driving an illegal Vehicle', 100, 0), - ('Driving without a License', 1500, 0), - ('Hit and Run', 800, 0), - ('Exceeding Speeds Over < 5 mph', 90, 0), - ('Exceeding Speeds Over 5-15 mph', 120, 0), - ('Exceeding Speeds Over 15-30 mph', 180, 0), - ('Exceeding Speeds Over > 30 mph', 300, 0), - ('Impeding traffic flow', 110, 1), - ('Public Intoxication', 90, 1), - ('Disorderly conduct', 90, 1), - ('Obstruction of Justice', 130, 1), - ('Insults towards Civilans', 75, 1), - ('Disrespecting of an LEO', 110, 1), - ('Verbal Threat towards a Civilan', 90, 1), - ('Verbal Threat towards an LEO', 150, 1), - ('Providing False Information', 250, 1), - ('Attempt of Corruption', 1500, 1), - ('Brandishing a weapon in city Limits', 120, 2), - ('Brandishing a Lethal Weapon in city Limits', 300, 2), - ('No Firearms License', 600, 2), - ('Possession of an Illegal Weapon', 700, 2), - ('Possession of Burglary Tools', 300, 2), - ('Grand Theft Auto', 1800, 2), - ('Intent to Sell/Distrube of an illegal Substance', 1500, 2), - ('Frabrication of an Illegal Substance', 1500, 2), - ('Possession of an Illegal Substance ', 650, 2), - ('Kidnapping of a Civilan', 1500, 2), - ('Kidnapping of an LEO', 2000, 2), - ('Robbery', 650, 2), - ('Armed Robbery of a Store', 650, 2), - ('Armed Robbery of a Bank', 1500, 2), - ('Assault on a Civilian', 2000, 3), - ('Assault of an LEO', 2500, 3), - ('Attempt of Murder of a Civilian', 3000, 3), - ('Attempt of Murder of an LEO', 5000, 3), - ('Murder of a Civilian', 10000, 3), - ('Murder of an LEO', 30000, 3), - ('Involuntary manslaughter', 1800, 3), - ('Fraud', 2000, 2); +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Misuse of a horn', 30, 0), + ('Illegally Crossing a continuous Line', 40, 0), + ('Driving on the wrong side of the road', 250, 0), + ('Illegal U-Turn', 250, 0), + ('Illegally Driving Off-road', 170, 0), + ('Refusing a Lawful Command', 30, 0), + ('Illegally Stoped of a Vehicle', 150, 0), + ('Illegal Parking', 70, 0), + ('Failing to Yield to the right', 70, 0), + ('Failure to comply with Vehicle Information', 90, 0), + ('Failing to stop at a Stop Sign ', 105, 0), + ('Failing to stop at a Red Light', 130, 0), + ('Illegal Passing', 100, 0), + ('Driving an illegal Vehicle', 100, 0), + ('Driving without a License', 1500, 0), + ('Hit and Run', 800, 0), + ('Exceeding Speeds Over < 5 mph', 90, 0), + ('Exceeding Speeds Over 5-15 mph', 120, 0), + ('Exceeding Speeds Over 15-30 mph', 180, 0), + ('Exceeding Speeds Over > 30 mph', 300, 0), + ('Impeding traffic flow', 110, 1), + ('Public Intoxication', 90, 1), + ('Disorderly conduct', 90, 1), + ('Obstruction of Justice', 130, 1), + ('Insults towards Civilans', 75, 1), + ('Disrespecting of an LEO', 110, 1), + ('Verbal Threat towards a Civilan', 90, 1), + ('Verbal Threat towards an LEO', 150, 1), + ('Providing False Information', 250, 1), + ('Attempt of Corruption', 1500, 1), + ('Brandishing a weapon in city Limits', 120, 2), + ('Brandishing a Lethal Weapon in city Limits', 300, 2), + ('No Firearms License', 600, 2), + ('Possession of an Illegal Weapon', 700, 2), + ('Possession of Burglary Tools', 300, 2), + ('Grand Theft Auto', 1800, 2), + ('Intent to Sell/Distrube of an illegal Substance', 1500, 2), + ('Frabrication of an Illegal Substance', 1500, 2), + ('Possession of an Illegal Substance ', 650, 2), + ('Kidnapping of a Civilan', 1500, 2), + ('Kidnapping of an LEO', 2000, 2), + ('Robbery', 650, 2), + ('Armed Robbery of a Store', 650, 2), + ('Armed Robbery of a Bank', 1500, 2), + ('Assault on a Civilian', 2000, 3), + ('Assault of an LEO', 2500, 3), + ('Attempt of Murder of a Civilian', 3000, 3), + ('Attempt of Murder of an LEO', 5000, 3), + ('Murder of a Civilian', 10000, 3), + ('Murder of an LEO', 30000, 3), + ('Involuntary manslaughter', 1800, 3), + ('Fraud', 2000, 2); ; diff --git a/server/main.lua b/server/main.lua index a20a550e..53ffb312 100644 --- a/server/main.lua +++ b/server/main.lua @@ -3,7 +3,7 @@ ESX = nil TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) if Config.MaxInService ~= -1 then - TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) + TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) end TriggerEvent('esx_phone:registerNumber', 'police', _U('alert_police'), true, true) @@ -11,64 +11,64 @@ TriggerEvent('esx_society:registerSociety', 'police', 'Police', 'society_police' RegisterServerEvent('esx_policejob:giveWeapon') AddEventHandler('esx_policejob:giveWeapon', function(weapon, ammo) - local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.addWeapon(weapon, ammo) + local xPlayer = ESX.GetPlayerFromId(source) + xPlayer.addWeapon(weapon, ammo) end) RegisterServerEvent('esx_policejob:confiscatePlayerItem') AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, itemName, amount) - - local sourceXPlayer = ESX.GetPlayerFromId(source) - local targetXPlayer = ESX.GetPlayerFromId(target) - if itemType == 'item_standard' then + local sourceXPlayer = ESX.GetPlayerFromId(source) + local targetXPlayer = ESX.GetPlayerFromId(target) - local label = sourceXPlayer.getInventoryItem(itemName).label + if itemType == 'item_standard' then - targetXPlayer.removeInventoryItem(itemName, amount) - sourceXPlayer.addInventoryItem(itemName, amount) + local label = sourceXPlayer.getInventoryItem(itemName).label - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confinv') .. amount .. ' ' .. label .. _U('from') .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confinv') .. amount .. ' ' .. label ) + targetXPlayer.removeInventoryItem(itemName, amount) + sourceXPlayer.addInventoryItem(itemName, amount) - end + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confinv') .. amount .. ' ' .. label .. _U('from') .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confinv') .. amount .. ' ' .. label ) - if itemType == 'item_account' then + end - targetXPlayer.removeAccountMoney(itemName, amount) - sourceXPlayer.addAccountMoney(itemName, amount) + if itemType == 'item_account' then - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confdm') .. amount .. _U('from') .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confdm') .. amount) + targetXPlayer.removeAccountMoney(itemName, amount) + sourceXPlayer.addAccountMoney(itemName, amount) - end + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confdm') .. amount .. _U('from') .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confdm') .. amount) - if itemType == 'item_weapon' then + end - targetXPlayer.removeWeapon(itemName) - sourceXPlayer.addWeapon(itemName, amount) + if itemType == 'item_weapon' then - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confweapon') .. ESX.GetWeaponLabel(itemName) .. _U('from') .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confweapon') .. ESX.GetWeaponLabel(itemName)) + targetXPlayer.removeWeapon(itemName) + sourceXPlayer.addWeapon(itemName, amount) - end + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confweapon') .. ESX.GetWeaponLabel(itemName) .. _U('from') .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confweapon') .. ESX.GetWeaponLabel(itemName)) + + end end) RegisterServerEvent('esx_policejob:handcuff') AddEventHandler('esx_policejob:handcuff', function(target) - TriggerClientEvent('esx_policejob:handcuff', target) + TriggerClientEvent('esx_policejob:handcuff', target) end) RegisterServerEvent('esx_policejob:drag') AddEventHandler('esx_policejob:drag', function(target) - local _source = source - TriggerClientEvent('esx_policejob:drag', target, _source) + local _source = source + TriggerClientEvent('esx_policejob:drag', target, _source) end) RegisterServerEvent('esx_policejob:putInVehicle') AddEventHandler('esx_policejob:putInVehicle', function(target) - TriggerClientEvent('esx_policejob:putInVehicle', target) + TriggerClientEvent('esx_policejob:putInVehicle', target) end) RegisterServerEvent('esx_policejob:OutVehicle') @@ -79,380 +79,380 @@ end) RegisterServerEvent('esx_policejob:getStockItem') AddEventHandler('esx_policejob:getStockItem', function(itemName, count) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) - local item = inventory.getItem(itemName) + local item = inventory.getItem(itemName) - if item.count >= count then - inventory.removeItem(itemName, count) - xPlayer.addInventoryItem(itemName, count) - else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) - end + if item.count >= count then + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) + end - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) - end) + end) end) RegisterServerEvent('esx_policejob:putStockItems') AddEventHandler('esx_policejob:putStockItems', function(itemName, count) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) - local item = inventory.getItem(itemName) + local item = inventory.getItem(itemName) - if item.count >= 0 then - xPlayer.removeInventoryItem(itemName, count) - inventory.addItem(itemName, count) - else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) - end + if item.count >= 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) + end - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('added') .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('added') .. count .. ' ' .. item.label) - end) + end) end) ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, cb, target) - if Config.EnableESXIdentity then - - local xPlayer = ESX.GetPlayerFromId(target) - - local identifier = GetPlayerIdentifiers(target)[1] - - local result = MySQL.Sync.fetchAll("SELECT * FROM characters WHERE identifier = @identifier", { - ['@identifier'] = identifier - }) - - local user = result[1] - local firstname = user['firstname'] - local lastname = user['lastname'] - local sex = user['sex'] - local dob = user['dateofbirth'] - local heightInit = user['height'] - local heightFeet = tonumber(string.format("%.0f",heightInit / 12, 0)) - local heightInches = tonumber(string.format("%.0f",heightInit % 12, 0)) - local height = heightFeet .. "\' " .. heightInches .. "\"" - - local data = { - name = GetPlayerName(target), - job = xPlayer.job, - inventory = xPlayer.inventory, - accounts = xPlayer.accounts, - weapons = xPlayer.loadout, - firstname = firstname, - lastname = lastname, - sex = sex, - dob = dob, - height = height - } - - TriggerEvent('esx_status:getStatus', source, 'drunk', function(status) + if Config.EnableESXIdentity then - if status ~= nil then - data.drunk = math.floor(status.percent) - end - - end) + local xPlayer = ESX.GetPlayerFromId(target) - if Config.EnableLicenses then + local identifier = GetPlayerIdentifiers(target)[1] - TriggerEvent('esx_license:getLicenses', source, function(licenses) - data.licenses = licenses - cb(data) - end) + local result = MySQL.Sync.fetchAll("SELECT * FROM characters WHERE identifier = @identifier", { + ['@identifier'] = identifier + }) - else - cb(data) - end - - else - - local xPlayer = ESX.GetPlayerFromId(target) + local user = result[1] + local firstname = user['firstname'] + local lastname = user['lastname'] + local sex = user['sex'] + local dob = user['dateofbirth'] + local heightInit = user['height'] + local heightFeet = tonumber(string.format("%.0f",heightInit / 12, 0)) + local heightInches = tonumber(string.format("%.0f",heightInit % 12, 0)) + local height = heightFeet .. "\' " .. heightInches .. "\"" - local data = { - name = GetPlayerName(target), - job = xPlayer.job, - inventory = xPlayer.inventory, - accounts = xPlayer.accounts, - weapons = xPlayer.loadout - } - - TriggerEvent('esx_status:getStatus', _source, 'drunk', function(status) + local data = { + name = GetPlayerName(target), + job = xPlayer.job, + inventory = xPlayer.inventory, + accounts = xPlayer.accounts, + weapons = xPlayer.loadout, + firstname = firstname, + lastname = lastname, + sex = sex, + dob = dob, + height = height + } - if status ~= nil then - data.drunk = status.getPercent() - end - - end) + TriggerEvent('esx_status:getStatus', source, 'drunk', function(status) - TriggerEvent('esx_license:getLicenses', _source, function(licenses) - data.licenses = licenses - end) + if status ~= nil then + data.drunk = math.floor(status.percent) + end - cb(data) - - end + end) + + if Config.EnableLicenses then + + TriggerEvent('esx_license:getLicenses', source, function(licenses) + data.licenses = licenses + cb(data) + end) + + else + cb(data) + end + + else + + local xPlayer = ESX.GetPlayerFromId(target) + + local data = { + name = GetPlayerName(target), + job = xPlayer.job, + inventory = xPlayer.inventory, + accounts = xPlayer.accounts, + weapons = xPlayer.loadout + } + + TriggerEvent('esx_status:getStatus', _source, 'drunk', function(status) + + if status ~= nil then + data.drunk = status.getPercent() + end + + end) + + TriggerEvent('esx_license:getLicenses', _source, function(licenses) + data.licenses = licenses + end) + + cb(data) + + end end) ESX.RegisterServerCallback('esx_policejob:getFineList', function(source, cb, category) - MySQL.Async.fetchAll( - 'SELECT * FROM fine_types WHERE category = @category', - { - ['@category'] = category - }, - function(fines) - cb(fines) - end - ) + MySQL.Async.fetchAll( + 'SELECT * FROM fine_types WHERE category = @category', + { + ['@category'] = category + }, + function(fines) + cb(fines) + end + ) end) ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, plate) - if Config.EnableESXIdentity then - - MySQL.Async.fetchAll( - 'SELECT * FROM owned_vehicles', - {}, - function(result) - - local foundIdentifier = nil + if Config.EnableESXIdentity then - for i=1, #result, 1 do - - local vehicleData = json.decode(result[i].vehicle) + MySQL.Async.fetchAll( + 'SELECT * FROM owned_vehicles', + {}, + function(result) - if vehicleData.plate == plate then - foundIdentifier = result[i].owner - break - end + local foundIdentifier = nil - end + for i=1, #result, 1 do - if foundIdentifier ~= nil then + local vehicleData = json.decode(result[i].vehicle) - MySQL.Async.fetchAll( - 'SELECT * FROM characters WHERE identifier = @identifier', - { - ['@identifier'] = foundIdentifier - }, - function(result) - - local ownerName = result[1].firstname .. " " .. result[1].lastname + if vehicleData.plate == plate then + foundIdentifier = result[i].owner + break + end - local infos = { - plate = plate, - owner = ownerName - } + end - cb(infos) + if foundIdentifier ~= nil then - end - ) - - else + MySQL.Async.fetchAll( + 'SELECT * FROM characters WHERE identifier = @identifier', + { + ['@identifier'] = foundIdentifier + }, + function(result) - local infos = { - plate = plate - } + local ownerName = result[1].firstname .. " " .. result[1].lastname - cb(infos) + local infos = { + plate = plate, + owner = ownerName + } - end + cb(infos) - end - ) - - else - - MySQL.Async.fetchAll( - 'SELECT * FROM owned_vehicles', - {}, - function(result) - - local foundIdentifier = nil + end + ) - for i=1, #result, 1 do - - local vehicleData = json.decode(result[i].vehicle) + else - if vehicleData.plate == plate then - foundIdentifier = result[i].owner - break - end + local infos = { + plate = plate + } - end + cb(infos) - if foundIdentifier ~= nil then + end - MySQL.Async.fetchAll( - 'SELECT * FROM users WHERE identifier = @identifier', - { - ['@identifier'] = foundIdentifier - }, - function(result) + end + ) - local infos = { - plate = plate, - owner = result[1].name - } + else - cb(infos) + MySQL.Async.fetchAll( + 'SELECT * FROM owned_vehicles', + {}, + function(result) - end - ) - - else + local foundIdentifier = nil - local infos = { - plate = plate - } + for i=1, #result, 1 do - cb(infos) + local vehicleData = json.decode(result[i].vehicle) - end + if vehicleData.plate == plate then + foundIdentifier = result[i].owner + break + end - end - ) - - end + end + + if foundIdentifier ~= nil then + + MySQL.Async.fetchAll( + 'SELECT * FROM users WHERE identifier = @identifier', + { + ['@identifier'] = foundIdentifier + }, + function(result) + + local infos = { + plate = plate, + owner = result[1].name + } + + cb(infos) + + end + ) + + else + + local infos = { + plate = plate + } + + cb(infos) + + end + + end + ) + + end end) ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb) - TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) - local weapons = store.get('weapons') + local weapons = store.get('weapons') - if weapons == nil then - weapons = {} - end + if weapons == nil then + weapons = {} + end - cb(weapons) + cb(weapons) - end) + end) end) ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, weaponName) - - local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.removeWeapon(weaponName) + local xPlayer = ESX.GetPlayerFromId(source) - TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + xPlayer.removeWeapon(weaponName) - local weapons = store.get('weapons') + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) - if weapons == nil then - weapons = {} - end + local weapons = store.get('weapons') - local foundWeapon = false + if weapons == nil then + weapons = {} + end - for i=1, #weapons, 1 do - if weapons[i].name == weaponName then - weapons[i].count = weapons[i].count + 1 - foundWeapon = true - end - end + local foundWeapon = false - if not foundWeapon then - table.insert(weapons, { - name = weaponName, - count = 1 - }) - end + for i=1, #weapons, 1 do + if weapons[i].name == weaponName then + weapons[i].count = weapons[i].count + 1 + foundWeapon = true + end + end - store.set('weapons', weapons) + if not foundWeapon then + table.insert(weapons, { + name = weaponName, + count = 1 + }) + end - cb() + store.set('weapons', weapons) - end) + cb() + + end) end) ESX.RegisterServerCallback('esx_policejob:removeArmoryWeapon', function(source, cb, weaponName) - - local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.addWeapon(weaponName, 1000) + local xPlayer = ESX.GetPlayerFromId(source) - TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + xPlayer.addWeapon(weaponName, 1000) - local weapons = store.get('weapons') + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) - if weapons == nil then - weapons = {} - end + local weapons = store.get('weapons') - local foundWeapon = false + if weapons == nil then + weapons = {} + end - for i=1, #weapons, 1 do - if weapons[i].name == weaponName then - weapons[i].count = (weapons[i].count > 0 and weapons[i].count - 1 or 0) - foundWeapon = true - end - end + local foundWeapon = false - if not foundWeapon then - table.insert(weapons, { - name = weaponName, - count = 0 - }) - end + for i=1, #weapons, 1 do + if weapons[i].name == weaponName then + weapons[i].count = (weapons[i].count > 0 and weapons[i].count - 1 or 0) + foundWeapon = true + end + end - store.set('weapons', weapons) + if not foundWeapon then + table.insert(weapons, { + name = weaponName, + count = 0 + }) + end - cb() + store.set('weapons', weapons) - end) + cb() + + end) end) ESX.RegisterServerCallback('esx_policejob:buy', function(source, cb, amount) - - TriggerEvent('esx_addonaccount:getSharedAccount', 'society_police', function(account) - if account.money >= amount then - account.removeMoney(amount) - cb(true) - else - cb(false) - end + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_police', function(account) - end) + if account.money >= amount then + account.removeMoney(amount) + cb(true) + else + cb(false) + end + + end) end) ESX.RegisterServerCallback('esx_policejob:getStockItems', function(source, cb) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) - cb(inventory.items) - end) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) + cb(inventory.items) + end) end) ESX.RegisterServerCallback('esx_policejob:getPlayerInventory', function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) - local items = xPlayer.inventory + local xPlayer = ESX.GetPlayerFromId(source) + local items = xPlayer.inventory - cb({ - items = items - }) + cb({ + items = items + }) end) From 3c75b44ad74cf662a58eaa95a8059544561edf27 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Thu, 14 Sep 2017 21:58:37 +0200 Subject: [PATCH 076/253] chore(coding-style): fix indentation --- client/main.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/main.lua b/client/main.lua index bfadf5e5..890629da 100644 --- a/client/main.lua +++ b/client/main.lua @@ -666,9 +666,9 @@ function OpenIdentityCardMenu(player) local jobLabel = nil local sexLabel = nil - local sex = nil + local sex = nil local dobLabel = nil - local heightLabel = nil + local heightLabel = nil local idLabel = nil if data.job.grade_label ~= nil and data.job.grade_label ~= '' then @@ -708,11 +708,11 @@ function OpenIdentityCardMenu(player) local elements = { {label = _U('name') .. data.firstname .. " " .. data.lastname, value = nil}, - {label = sexLabel, value = nil}, - {label = dobLabel, value = nil}, - {label = heightLabel, value = nil}, - {label = jobLabel, value = nil}, - {label = idLabel, value = nil}, + {label = sexLabel, value = nil}, + {label = dobLabel, value = nil}, + {label = heightLabel, value = nil}, + {label = jobLabel, value = nil}, + {label = idLabel, value = nil}, } if data.drunk ~= nil then From ff88b76ef018223f7f70699e05dd4695bcb79630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Thu, 14 Sep 2017 23:18:09 +0200 Subject: [PATCH 077/253] Update LICENSE.txt --- LICENSE.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 30ace6a8..49c66f5e 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -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. - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} + fxserver-esx_policejob + Copyright (C) 2015 Jérémie N'gadi 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 @@ -652,7 +652,7 @@ 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: - {project} Copyright (C) {year} {fullname} + fxserver-esx_policejob Copyright (C) 2015 Jérémie N'gadi 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. From f82551b84e0df5295372bc5f6312293e5500720e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Fri, 15 Sep 2017 15:30:40 +0200 Subject: [PATCH 078/253] chore(resource): Add version --- __resource.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/__resource.lua b/__resource.lua index dc62d8b1..8984049d 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,6 +2,8 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' +version '1.0.0' + server_scripts { '@es_extended/locale.lua', 'locales/br.lua', From 9a0edde5c00c5b3692176008c349a3e373c29f52 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sat, 16 Sep 2017 21:52:28 +0200 Subject: [PATCH 079/253] chore(blip): extract configuration to config file --- client/main.lua | 6 +++--- config.lua | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/main.lua b/client/main.lua index 890629da..0c824465 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1477,9 +1477,9 @@ Citizen.CreateThread(function() local blip = AddBlipForCoord(v.Blip.Pos.x, v.Blip.Pos.y, v.Blip.Pos.z) - SetBlipSprite (blip, 60) - SetBlipDisplay(blip, 4) - SetBlipScale (blip, 1.2) + SetBlipSprite (blip, v.Blip.Sprite) + SetBlipDisplay(blip, v.Blip.Display) + SetBlipScale (blip, v.Blip.Scale) SetBlipColour (blip, v.Blip.Color) SetBlipAsShortRange(blip, true) diff --git a/config.lua b/config.lua index 80af2f49..a7cb0b3a 100644 --- a/config.lua +++ b/config.lua @@ -17,8 +17,11 @@ Config.PoliceStations = { LSPD = { Blip = { - Pos = { x = 425.130, y = -979.558, z = 30.711 }, - Color = 29, + Pos = { x = 425.130, y = -979.558, z = 30.711 }, + Sprite = 60, + Display = 4, + Scale = 1.2, + Color = 29, }, AuthorizedWeapons = { From 74a6906e40a3890f7adc05f692d52722b978c1c3 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Mon, 18 Sep 2017 19:00:02 +0200 Subject: [PATCH 080/253] chore(blip): extract in other locale --- client/main.lua | 2 +- config.lua | 2 +- localization/de_config.lua | 7 +++++-- localization/en_config.lua | 8 ++++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/client/main.lua b/client/main.lua index 0c824465..ebc28b8a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1480,7 +1480,7 @@ Citizen.CreateThread(function() SetBlipSprite (blip, v.Blip.Sprite) SetBlipDisplay(blip, v.Blip.Display) SetBlipScale (blip, v.Blip.Scale) - SetBlipColour (blip, v.Blip.Color) + SetBlipColour (blip, v.Blip.Colour) SetBlipAsShortRange(blip, true) BeginTextCommandSetBlipName("STRING") diff --git a/config.lua b/config.lua index a7cb0b3a..9443a8bd 100644 --- a/config.lua +++ b/config.lua @@ -21,7 +21,7 @@ Config.PoliceStations = { Sprite = 60, Display = 4, Scale = 1.2, - Color = 29, + Colour = 29, }, AuthorizedWeapons = { diff --git a/localization/de_config.lua b/localization/de_config.lua index 15753302..bddb3d23 100644 --- a/localization/de_config.lua +++ b/localization/de_config.lua @@ -17,8 +17,11 @@ Config.PoliceStations = { LSPD = { Blip = { - Pos = {x = 425.130, y = -979.558, z = 30.711}, - Color = 29 + Pos = { x = 425.130, y = -979.558, z = 30.711 }, + Sprite = 60, + Display = 4, + Scale = 1.2, + Colour = 29, }, AuthorizedWeapons = { diff --git a/localization/en_config.lua b/localization/en_config.lua index 3d14bb2a..c9eec719 100644 --- a/localization/en_config.lua +++ b/localization/en_config.lua @@ -14,9 +14,13 @@ Config.Locale = 'en' Config.PoliceStations = { LSPD1 = { + Blip = { - Pos = {x = 425.130, y = -979.558, z = 30.711}, - Color = 29 + Pos = { x = 425.130, y = -979.558, z = 30.711 }, + Sprite = 60, + Display = 4, + Scale = 1.2, + Colour = 29, }, AuthorizedWeapons = { From 343d7a4f38c734ec2bceb792f860fcdc989b763c Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 19 Sep 2017 12:39:10 -0500 Subject: [PATCH 081/253] Update main.lua --- server/main.lua | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/server/main.lua b/server/main.lua index 53ffb312..ef3536a4 100644 --- a/server/main.lua +++ b/server/main.lua @@ -128,19 +128,16 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, local identifier = GetPlayerIdentifiers(target)[1] - local result = MySQL.Sync.fetchAll("SELECT * FROM characters WHERE identifier = @identifier", { + local result = MySQL.Sync.fetchAll("SELECT * FROM users WHERE identifier = @identifier", { ['@identifier'] = identifier }) local user = result[1] local firstname = user['firstname'] local lastname = user['lastname'] - local sex = user['sex'] - local dob = user['dateofbirth'] - local heightInit = user['height'] - local heightFeet = tonumber(string.format("%.0f",heightInit / 12, 0)) - local heightInches = tonumber(string.format("%.0f",heightInit % 12, 0)) - local height = heightFeet .. "\' " .. heightInches .. "\"" + local sex = user['sex'] + local dob = user['dateofbirth'] + local height = user['height'] local data = { name = GetPlayerName(target), @@ -150,9 +147,9 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, weapons = xPlayer.loadout, firstname = firstname, lastname = lastname, - sex = sex, - dob = dob, - height = height + sex = sex, + dob = dob, + height = height } TriggerEvent('esx_status:getStatus', source, 'drunk', function(status) @@ -243,7 +240,7 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, if foundIdentifier ~= nil then MySQL.Async.fetchAll( - 'SELECT * FROM characters WHERE identifier = @identifier', + 'SELECT * FROM users WHERE identifier = @identifier', { ['@identifier'] = foundIdentifier }, From 1ce0a164c7ac0108a200b62a2890211687f3a5b5 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Tue, 19 Sep 2017 12:40:07 -0500 Subject: [PATCH 082/253] Update main.lua --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index ef3536a4..9f17b884 100644 --- a/server/main.lua +++ b/server/main.lua @@ -137,7 +137,7 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, local lastname = user['lastname'] local sex = user['sex'] local dob = user['dateofbirth'] - local height = user['height'] + local height = user['height'] .. " Inches" local data = { name = GetPlayerName(target), From 52cf4e67e619a9035c6181c39017c667af8e5a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 19 Sep 2017 20:20:37 +0200 Subject: [PATCH 083/253] chore(version): Increment version --- __resource.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__resource.lua b/__resource.lua index 8984049d..8078cc90 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' -version '1.0.0' +version '1.0.1' server_scripts { '@es_extended/locale.lua', From bf17559bfb9649989f605a6b0764f1995f1f40b8 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sat, 14 Oct 2017 14:20:41 +0200 Subject: [PATCH 084/253] feat(clothes): add proper clothes --- client/main.lua | 151 +++++++++++++++++++++++++++++++++++++++++++--- esx_policejob.sql | 21 ++++--- 2 files changed, 155 insertions(+), 17 deletions(-) diff --git a/client/main.lua b/client/main.lua index ebc28b8a..f7887a60 100644 --- a/client/main.lua +++ b/client/main.lua @@ -51,10 +51,32 @@ end function OpenCloakroomMenu() local elements = { - {label = _U('citizen_wear'), value = 'citizen_wear'}, - {label = _U('police_wear'), value = 'police_wear'} + { label = _U('citizen_wear'), value = 'citizen_wear' } } + if PlayerData.job.grade_name == 'recruit' then + table.insert(elements, {label = _U('cadet_wear'), value = 'cadet_wear'}) + end + + if PlayerData.job.grade_name == 'officer' then + table.insert(elements, {label = _U('police_wear'), value = 'police_wear'}) + end + + if PlayerData.job.grade_name == 'sergeant' then + table.insert(elements, {label = _U('sergent_wear'), value = 'sergent_wear'}) + end + + if PlayerData.job.grade_name == 'lieutenant' then + table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear'}) + end + + if PlayerData.job.grade_name == 'boss' then + table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear'}) + end + + table.insert(elements, {label = _U('veste_wear'), value = 'veste_wear'}) + table.insert(elements, {label = _U('gilet_wear'), value = 'gilet_wear'}) + ESX.UI.Menu.CloseAll() if Config.EnableNonFreemodePeds then @@ -100,18 +122,133 @@ function OpenCloakroomMenu() end) end - if data.current.value == 'police_wear' then - + if data.current.value == 'cadet_wear' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male) + SetPedComponentVariation(GetPlayerPed(-1), 3, 30, 0, 0) --Gants + SetPedComponentVariation(GetPlayerPed(-1), 4, 35, 0, 0) --Jean + SetPedComponentVariation(GetPlayerPed(-1), 6, 24, 0, 0) --Chaussure + SetPedComponentVariation(GetPlayerPed(-1), 8, 58, 0, 0) --mattraque + SetPedComponentVariation(GetPlayerPed(-1), 11, 55, 0, 0)--Veste + SetPedComponentVariation(GetPlayerPed(-1), 10, 8, 0, 0) --Grade + SetPedComponentVariation(GetPlayerPed(-1), 8, 59, 0, 0) --GiletJaune + SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 0, 2) --Bag + SetPedPropIndex(GetPlayerPed(-1), 2, 2, 0, 1) --Oreillete + SetPedPropIndex(GetPlayerPed(-1), 6, 3, 0, 1) --Montre + + ClearPedProp(GetPlayerPed(-1), 0) -- Helmet else TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) end - end) + end + if data.current.value == 'police_wear' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + if skin.sex == 0 then + SetPedComponentVariation(GetPlayerPed(-1), 3, 30, 0, 0)--Gants + SetPedComponentVariation(GetPlayerPed(-1), 4, 35, 0, 0)--Jean + SetPedComponentVariation(GetPlayerPed(-1), 6, 24, 0, 0)--Chaussure + SetPedComponentVariation(GetPlayerPed(-1), 8, 58, 0, 0)--mattraque + SetPedComponentVariation(GetPlayerPed(-1), 11, 55, 0, 0)--Veste + SetPedComponentVariation(GetPlayerPed(-1), 10, 8, 0, 0)--Grade + SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 0, 2) --Bag + SetPedPropIndex(GetPlayerPed(-1), 2, 2, 0, 1)--Oreillete + SetPedPropIndex(GetPlayerPed(-1), 6, 3, 0, 1)--Montre + + ClearPedProp(GetPlayerPed(-1), 0) -- Helmet + else + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) + end + end) + end + + if data.current.value == 'sergent_wear' then --Ajout de tenue par grades + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + if skin.sex == 0 then + SetPedComponentVariation(GetPlayerPed(-1), 3, 30, 0, 0)--Gants + SetPedComponentVariation(GetPlayerPed(-1), 4, 35, 0, 0)--Jean + SetPedComponentVariation(GetPlayerPed(-1), 6, 24, 0, 0)--Chaussure + SetPedComponentVariation(GetPlayerPed(-1), 8, 58, 0, 0)--mattraque + SetPedComponentVariation(GetPlayerPed(-1), 11, 55, 0, 0)--Veste + SetPedComponentVariation(GetPlayerPed(-1), 10, 8, 1, 0)--Grade + SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 0, 2) --Bag + SetPedPropIndex(GetPlayerPed(-1), 2, 2, 0, 1)--Oreillete + SetPedPropIndex(GetPlayerPed(-1), 6, 3, 0, 1)--Montre + + ClearPedProp(GetPlayerPed(-1), 0) -- Helmet + else + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) + end + end) + end + + if data.current.value == 'lieutenant_wear' then --Ajout de tenue par grades + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + if skin.sex == 0 then + SetPedComponentVariation(GetPlayerPed(-1), 3, 30, 0, 0)--Gants + SetPedComponentVariation(GetPlayerPed(-1), 4, 35, 0, 0)--Jean + SetPedComponentVariation(GetPlayerPed(-1), 6, 24, 0, 0)--Chaussure + SetPedComponentVariation(GetPlayerPed(-1), 8, 58, 0, 0)--mattraque + SetPedComponentVariation(GetPlayerPed(-1), 11, 55, 0, 0)--Veste + SetPedComponentVariation(GetPlayerPed(-1), 10, 8, 2, 0)--Grade + SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 0, 2) --Bag + SetPedPropIndex(GetPlayerPed(-1), 2, 2, 0, 1)--Oreillete + SetPedPropIndex(GetPlayerPed(-1), 6, 3, 0, 1)--Montre + + ClearPedProp(GetPlayerPed(-1), 0) -- Helmet + else + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) + end + end) + end + + if data.current.value == 'commandant_wear' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + if skin.sex == 0 then + SetPedComponentVariation(GetPlayerPed(-1), 3, 30, 0, 0)--Gants + SetPedComponentVariation(GetPlayerPed(-1), 4, 35, 0, 0)--Jean + SetPedComponentVariation(GetPlayerPed(-1), 6, 24, 0, 0)--Chaussure + SetPedComponentVariation(GetPlayerPed(-1), 8, 58, 0, 0)--mattraque + SetPedComponentVariation(GetPlayerPed(-1), 11, 55, 0, 0)--Veste + SetPedComponentVariation(GetPlayerPed(-1), 10, 8, 3, 0)--Grade + SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 0, 2) --Bag + SetPedPropIndex(GetPlayerPed(-1), 2, 2, 0, 1)--Oreillete + SetPedPropIndex(GetPlayerPed(-1), 6, 3, 0, 1)--Montre + + ClearPedProp(GetPlayerPed(-1), 0) -- Helmet + else + TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) + end + end) + end + + if data.current.value == 'veste_wear' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function() + SetPedComponentVariation(GetPlayerPed(-1), 9, 10, 1, 2)--Gilet + local playerPed = GetPlayerPed(-1) + SetPedArmour(playerPed, 100) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + end) + end + + if data.current.value == 'veste_wear' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function() + SetPedComponentVariation(GetPlayerPed(-1), 9, 10, 1, 2)--Gilet + end) + end + + if data.current.value == 'gilet_wear' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function() + SetPedComponentVariation(GetPlayerPed(-1), 9, 14, 1, 2)--Sans Gilet + local playerPed = GetPlayerPed(-1) + SetPedArmour(playerPed, 0) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + end) end if data.current.value == 'sheriff_wear' then diff --git a/esx_policejob.sql b/esx_policejob.sql index f0eb8786..78fd3915 100644 --- a/esx_policejob.sql +++ b/esx_policejob.sql @@ -1,37 +1,38 @@ -INSERT INTO `addon_account` (name, label, shared) VALUES +INSERT INTO `addon_account` (name, label, shared) VALUES ('society_police','Police',1) ; -INSERT INTO `datastore` (name, label, shared) VALUES +INSERT INTO `datastore` (name, label, shared) VALUES ('society_police','Police',1) ; -INSERT INTO `addon_inventory` (name, label, shared) VALUES +INSERT INTO `addon_inventory` (name, label, shared) VALUES ('society_police', 'Police', 1) ; -INSERT INTO `jobs` (name, label) VALUES +INSERT INTO `jobs` (name, label) VALUES ('police','LSPD') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES ('police',0,'recruit','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') + ('police',4,'officer','Officier',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',1,'sergeant','Sergent',60,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',2,'lieutenant','Lieutenant',85,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',3,'boss','Commandant',100,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; CREATE TABLE `fine_types` ( - + `id` int(11) NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, `amount` int(11) DEFAULT NULL, `category` int(11) DEFAULT NULL, - + PRIMARY KEY (`id`) ); -INSERT INTO `fine_types` (label, amount, category) VALUES +INSERT INTO `fine_types` (label, amount, category) VALUES ('Usage abusif du klaxon',30,0), ('Franchir une ligne continue',40,0), ('Circulation à contresens',250,0), From 0de35f874ff3e5a6abad6b3e6920a6f6cfc2c105 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sat, 14 Oct 2017 14:21:54 +0200 Subject: [PATCH 085/253] feat(vehicles): add proper vehicles --- client/main.lua | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index f7887a60..0a3d6388 100644 --- a/client/main.lua +++ b/client/main.lua @@ -512,9 +512,47 @@ function OpenVehicleSpawnerMenu(station, partNum) local elements = {} - for i=1, #Config.PoliceStations[station].AuthorizedVehicles, 1 do - local vehicle = Config.PoliceStations[station].AuthorizedVehicles[i] - table.insert(elements, {label = vehicle.label, value = vehicle.name}) + table.insert(elements, { label = 'Vélo', value = 'fixter' }) + table.insert(elements, { label = 'Cruiser', value = 'police' }) + table.insert(elements, { label = 'Sheriff Cruiser', value = 'sheriff' }) + + if PlayerData.job.grade_name == 'officer' then + table.insert(elements, { label = 'Interceptor', value = 'police3'}) + end + + if PlayerData.job.grade_name == 'sergean' then + table.insert(elements, { label = 'Sheriff SUV', value = 'sheriff2'}) + table.insert(elements, { label = 'Interceptor', value = 'police3'}) + table.insert(elements, { label = 'Buffalo', value = 'police2'}) + table.insert(elements, { label = 'Moto', value = 'policeb'}) + table.insert(elements, { label = 'Bus pénitentiaire', value = 'pbus'}) + table.insert(elements, { label = 'Bus de transport', value = 'policet'}) + table.insert(elements, { label = 'Antiémeute', value = 'riot'}) + end + + if PlayerData.job.grade_name == 'lieutenant' then + table.insert(elements, { label = 'Sheriff SUV', value = 'sheriff2'}) + table.insert(elements, { label = 'Interceptor', value = 'police3'}) + table.insert(elements, { label = 'Buffalo', value = 'police2'}) + table.insert(elements, { label = 'Moto', value = 'policeb'}) + table.insert(elements, { label = 'Bus pénitentiaire', value = 'pbus'}) + table.insert(elements, { label = 'Bus de transport', value = 'policet'}) + table.insert(elements, { label = 'Antiémeute', value = 'riot'}) + table.insert(elements, { label = 'FBI', value = 'fbi'}) + table.insert(elements, { label = 'FBI SUV', value = 'fbi2'}) + end + + if PlayerData.job.grade_name == 'boss' then + table.insert(elements, { label = 'Sheriff SUV', value = 'sheriff2'}) + table.insert(elements, { label = 'Interceptor', value = 'police3'}) + table.insert(elements, { label = 'Buffalo', value = 'police2'}) + table.insert(elements, { label = 'Moto', value = 'policeb'}) + table.insert(elements, { label = 'Bus pénitentiaire', value = 'pbus'}) + table.insert(elements, { label = 'Bus de transport', value = 'policet'}) + table.insert(elements, { label = 'Antiémeute', value = 'riot'}) + table.insert(elements, { label = 'FBI', value = 'fbi'}) + table.insert(elements, { label = 'FBI SUV', value = 'fbi2'}) + table.insert(elements, { label = 'Voiture Banalisée ', value = 'police4'}) end ESX.UI.Menu.Open( From b83545e0d84078a7ce5f00156421f3ecb1d6d4f5 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sat, 14 Oct 2017 19:13:19 +0200 Subject: [PATCH 086/253] chore: be compatible with NonFreemodePeds --- client/main.lua | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/client/main.lua b/client/main.lua index 0a3d6388..c6cb47d7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -74,27 +74,25 @@ function OpenCloakroomMenu() table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear'}) end + if Config.EnableNonFreemodePeds then + table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear_freemode'}) + table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear_freemode'}) + table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear_freemode'}) + end + table.insert(elements, {label = _U('veste_wear'), value = 'veste_wear'}) table.insert(elements, {label = _U('gilet_wear'), value = 'gilet_wear'}) ESX.UI.Menu.CloseAll() - if Config.EnableNonFreemodePeds then - table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear'}) - table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear'}) - table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear'}) - end - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'cloakroom', - { - title = _U('cloakroom'), - align = 'top-left', - elements = elements, - }, - - function(data, menu) - + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'cloakroom', + { + title = _U('cloakroom'), + align = 'top-left', + elements = elements, + }, + function(data, menu) menu.close() --Taken from SuperCoolNinja @@ -251,8 +249,7 @@ function OpenCloakroomMenu() end) end - if data.current.value == 'sheriff_wear' then - + if data.current.value == 'sheriff_wear_freemode' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) if skin.sex == 0 then @@ -283,7 +280,7 @@ function OpenCloakroomMenu() end) end - if data.current.value == 'lieutenant_wear' then + if data.current.value == 'lieutenant_wear_freemode' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) @@ -314,7 +311,7 @@ function OpenCloakroomMenu() end) end - if data.current.value == 'commandant_wear' then + if data.current.value == 'commandant_wear_freemode' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) From 5336f7b1c930050229f3cf427ba07bfef12623ed Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sun, 15 Oct 2017 00:15:13 +0200 Subject: [PATCH 087/253] fix(licenses): display the correct license --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 9f17b884..b497bc04 100644 --- a/server/main.lua +++ b/server/main.lua @@ -162,7 +162,7 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, if Config.EnableLicenses then - TriggerEvent('esx_license:getLicenses', source, function(licenses) + TriggerEvent('esx_license:getLicenses', target, function(licenses) data.licenses = licenses cb(data) end) From f0123dc1aa0ab8e11073dddafb5c96c39eefad33 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sun, 15 Oct 2017 00:15:38 +0200 Subject: [PATCH 088/253] chore: bump version --- __resource.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__resource.lua b/__resource.lua index 8078cc90..73e44c26 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' -version '1.0.1' +version '1.0.2' server_scripts { '@es_extended/locale.lua', From d6db6414e381b73d1c8cee2315c581771319642a Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sun, 15 Oct 2017 00:37:22 +0200 Subject: [PATCH 089/253] fix(target): correct target when checking peds --- server/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/main.lua b/server/main.lua index b497bc04..1bfd2e32 100644 --- a/server/main.lua +++ b/server/main.lua @@ -152,7 +152,7 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, height = height } - TriggerEvent('esx_status:getStatus', source, 'drunk', function(status) + TriggerEvent('esx_status:getStatus', target, 'drunk', function(status) if status ~= nil then data.drunk = math.floor(status.percent) @@ -183,7 +183,7 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, weapons = xPlayer.loadout } - TriggerEvent('esx_status:getStatus', _source, 'drunk', function(status) + TriggerEvent('esx_status:getStatus', target, 'drunk', function(status) if status ~= nil then data.drunk = status.getPercent() @@ -191,7 +191,7 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, end) - TriggerEvent('esx_license:getLicenses', _source, function(licenses) + TriggerEvent('esx_license:getLicenses', target, function(licenses) data.licenses = licenses end) From b47c3cb54b472c7c010f7cb101d0f16ec0dfbec9 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sun, 15 Oct 2017 00:37:33 +0200 Subject: [PATCH 090/253] chore: bump version --- __resource.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__resource.lua b/__resource.lua index 73e44c26..647ae1d1 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' -version '1.0.2' +version '1.0.3' server_scripts { '@es_extended/locale.lua', From 5323f5d21693e2df22626cecac312d76324d0416 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Wed, 18 Oct 2017 13:24:55 +0200 Subject: [PATCH 091/253] chore: typo --- client/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index c6cb47d7..c2affeba 100644 --- a/client/main.lua +++ b/client/main.lua @@ -63,7 +63,7 @@ function OpenCloakroomMenu() end if PlayerData.job.grade_name == 'sergeant' then - table.insert(elements, {label = _U('sergent_wear'), value = 'sergent_wear'}) + table.insert(elements, {label = _U('sergeant_wear'), value = 'sergeant_wear'}) end if PlayerData.job.grade_name == 'lieutenant' then @@ -161,7 +161,7 @@ function OpenCloakroomMenu() end) end - if data.current.value == 'sergent_wear' then --Ajout de tenue par grades + if data.current.value == 'sergeant_wear' then --Ajout de tenue par grades ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) if skin.sex == 0 then SetPedComponentVariation(GetPlayerPed(-1), 3, 30, 0, 0)--Gants @@ -517,7 +517,7 @@ function OpenVehicleSpawnerMenu(station, partNum) table.insert(elements, { label = 'Interceptor', value = 'police3'}) end - if PlayerData.job.grade_name == 'sergean' then + if PlayerData.job.grade_name == 'sergeant' then table.insert(elements, { label = 'Sheriff SUV', value = 'sheriff2'}) table.insert(elements, { label = 'Interceptor', value = 'police3'}) table.insert(elements, { label = 'Buffalo', value = 'police2'}) From a47648e852a2db80253082bf8ffebd013345542b Mon Sep 17 00:00:00 2001 From: Sylundef Date: Fri, 10 Nov 2017 02:12:55 +0100 Subject: [PATCH 092/253] Avoid getting more item than possible --- server/main.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index 1bfd2e32..ddb9d615 100644 --- a/server/main.lua +++ b/server/main.lua @@ -24,9 +24,14 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, if itemType == 'item_standard' then local label = sourceXPlayer.getInventoryItem(itemName).label + local playerItemCount = targetXPlayer.getInventoryItem(itemName).count - targetXPlayer.removeInventoryItem(itemName, amount) - sourceXPlayer.addInventoryItem(itemName, amount) + if playerItemCount <= amount then + targetXPlayer.removeInventoryItem(itemName, amount) + sourceXPlayer.addInventoryItem(itemName, amount) + else + TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + end TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confinv') .. amount .. ' ' .. label .. _U('from') .. targetXPlayer.name) TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confinv') .. amount .. ' ' .. label ) From 2fd52985953aa6c1140530cb04eab83e07e0d93a Mon Sep 17 00:00:00 2001 From: LuaDeldu Date: Sat, 2 Dec 2017 14:42:27 +0100 Subject: [PATCH 093/253] fix(locales): remove useless translations --- locales/en.lua | 33 ++------------------------------- locales/fr.lua | 2 ++ 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/locales/en.lua b/locales/en.lua index dcc51ad5..8b338a25 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -8,6 +8,8 @@ Locales['en'] = { ['commandant_wear'] = 'Fbi outfit', ['statepd_wear'] = 'State Police outfit', ['specops_wear'] = 'Spec OPS outfit', + ['gilet_wear'] = 'orange reflective jacket', + ['bullet_wear'] = 'bulletproof vest', ['open_cloackroom'] = 'press ~INPUT_CONTEXT~ to change', -- Armory ['get_weapon'] = 'get Weapon', @@ -25,7 +27,6 @@ Locales['en'] = { ['citizen_interaction'] = 'citizen Interaction', ['vehicle_interaction'] = 'vehicle Interaction', ['object_spawner'] = 'object Spawner', - ['animations'] = 'animations', ['id_card'] = 'iD Card', ['search'] = 'search', @@ -46,36 +47,6 @@ Locales['en'] = { ['spikestrips'] = 'spikestrips', ['box'] = 'box', ['cash'] = 'Box of cash', - ['police_animations'] = 'Police Animations', - ['dotraffic'] = 'Do a traffic stop', - ['take_note'] = 'Take notes', - ['stand_by'] = 'Stand by', - ['stand_by_2'] = 'Stand by 2', - ['stand_by_3'] = 'Stand by 3', - ['crowd_control'] = 'Crowd control', - ['doinvestigate'] = 'Investigate', - ['dobinoculars'] = 'Use the binoculars', - ['taking_notes'] = 'Im done with taking notes', - ['dealing_with_traffic'] = 'Dealing with traffic is hard', - ['standing_cop'] = 'I cant be here anymore', - ['standing_cop_2'] = 'I cant be here anymore', - ['standing_cop_3'] = 'I cant be here anymore', - ['use_binoculars'] = 'I cant see nothing', - ['do_crowd_control'] = 'The crowd is contained', - ['investigate_done'] = 'My investigation is done', - ['docrouch'] = 'Crouch', - ['kneel'] = 'Let me get up', - ['hang_out'] = 'Free time 1', - ['hanging_out'] = 'Lets go work', - ['doleaning'] = 'Free time 2', - ['dosmoking'] = 'Free time 3', - ['dodrinking'] = 'Free time 4', - ['domobile'] = 'Free time 5', - ['aacoffe'] = 'Morning coffe', - ['push_ups'] = 'Exercise a little', - ['exercise'] = 'Im tired', - ['cancel_emote'] = 'Cancel animation', - ['emotecanceled'] = 'Animation stoped', -- ID Card Menu ['name'] = 'name : ', ['bac'] = 'bAC : ', diff --git a/locales/fr.lua b/locales/fr.lua index e0262442..9f2c5c54 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -8,6 +8,8 @@ Locales['fr'] = { ['commandant_wear'] = 'Fbi outfit', ['statepd_wear'] = 'State Police outfit', ['specops_wear'] = 'Spec OPS outfit', + ['gilet_wear'] = 'Gilet orange', + ['bullet_wear'] = 'Gilet pare-balles', ['open_cloackroom'] = 'appuez sur ~INPUT_CONTEXT~ pour vous changer', -- Armory ['get_weapon'] = 'prendre Arme', From 7087bc30ed094ca8881a25d4f02c44805f0d1c63 Mon Sep 17 00:00:00 2001 From: LuaDeldu Date: Sat, 2 Dec 2017 14:45:58 +0100 Subject: [PATCH 094/253] feat(clothes): better clothing system Feature to work with esx_accessories --- client/main.lua | 356 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 251 insertions(+), 105 deletions(-) diff --git a/client/main.lua b/client/main.lua index c2affeba..824bd994 100644 --- a/client/main.lua +++ b/client/main.lua @@ -55,7 +55,7 @@ function OpenCloakroomMenu() } if PlayerData.job.grade_name == 'recruit' then - table.insert(elements, {label = _U('cadet_wear'), value = 'cadet_wear'}) + table.insert(elements, {label = _U('police_wear'), value = 'cadet_wear'}) end if PlayerData.job.grade_name == 'officer' then @@ -63,15 +63,15 @@ function OpenCloakroomMenu() end if PlayerData.job.grade_name == 'sergeant' then - table.insert(elements, {label = _U('sergeant_wear'), value = 'sergeant_wear'}) + table.insert(elements, {label = _U('police_wear'), value = 'sergeant_wear'}) end if PlayerData.job.grade_name == 'lieutenant' then - table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear'}) + table.insert(elements, {label = _U('police_wear'), value = 'lieutenant_wear'}) end if PlayerData.job.grade_name == 'boss' then - table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear'}) + table.insert(elements, {label = _U('police_wear'), value = 'commandant_wear'}) end if Config.EnableNonFreemodePeds then @@ -80,7 +80,7 @@ function OpenCloakroomMenu() table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear_freemode'}) end - table.insert(elements, {label = _U('veste_wear'), value = 'veste_wear'}) + table.insert(elements, {label = _U('bullet_wear'), value = 'bullet_wear'}) table.insert(elements, {label = _U('gilet_wear'), value = 'gilet_wear'}) ESX.UI.Menu.CloseAll() @@ -95,7 +95,6 @@ function OpenCloakroomMenu() function(data, menu) menu.close() - --Taken from SuperCoolNinja if data.current.value == 'citizen_wear' then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) local model = nil @@ -121,131 +120,278 @@ function OpenCloakroomMenu() end if data.current.value == 'cadet_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - SetPedComponentVariation(GetPlayerPed(-1), 3, 30, 0, 0) --Gants - SetPedComponentVariation(GetPlayerPed(-1), 4, 35, 0, 0) --Jean - SetPedComponentVariation(GetPlayerPed(-1), 6, 24, 0, 0) --Chaussure - SetPedComponentVariation(GetPlayerPed(-1), 8, 58, 0, 0) --mattraque - SetPedComponentVariation(GetPlayerPed(-1), 11, 55, 0, 0)--Veste - SetPedComponentVariation(GetPlayerPed(-1), 10, 8, 0, 0) --Grade - SetPedComponentVariation(GetPlayerPed(-1), 8, 59, 0, 0) --GiletJaune - SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 0, 2) --Bag - SetPedPropIndex(GetPlayerPed(-1), 2, 2, 0, 1) --Oreillete - SetPedPropIndex(GetPlayerPed(-1), 6, 3, 0, 1) --Montre + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + + if skin.sex == 0 then - ClearPedProp(GetPlayerPed(-1), 0) -- Helmet - else - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) - end + local clothesSkin = { + ['tshirt_1'] = 59, ['tshirt_2'] = 1, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = 46, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + else + + local clothesSkin = { + ['tshirt_1'] = 36, ['tshirt_2'] = 1, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = 45, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + end + + local playerPed = GetPlayerPed(-1) + SetPedArmour(playerPed, 0) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + end) end if data.current.value == 'police_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - SetPedComponentVariation(GetPlayerPed(-1), 3, 30, 0, 0)--Gants - SetPedComponentVariation(GetPlayerPed(-1), 4, 35, 0, 0)--Jean - SetPedComponentVariation(GetPlayerPed(-1), 6, 24, 0, 0)--Chaussure - SetPedComponentVariation(GetPlayerPed(-1), 8, 58, 0, 0)--mattraque - SetPedComponentVariation(GetPlayerPed(-1), 11, 55, 0, 0)--Veste - SetPedComponentVariation(GetPlayerPed(-1), 10, 8, 0, 0)--Grade - SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 0, 2) --Bag - SetPedPropIndex(GetPlayerPed(-1), 2, 2, 0, 1)--Oreillete - SetPedPropIndex(GetPlayerPed(-1), 6, 3, 0, 1)--Montre + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + + if skin.sex == 0 then - ClearPedProp(GetPlayerPed(-1), 0) -- Helmet - else - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) - end + local clothesSkin = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + else + + local clothesSkin = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + end + + local playerPed = GetPlayerPed(-1) + SetPedArmour(playerPed, 0) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + end) end - if data.current.value == 'sergeant_wear' then --Ajout de tenue par grades - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - SetPedComponentVariation(GetPlayerPed(-1), 3, 30, 0, 0)--Gants - SetPedComponentVariation(GetPlayerPed(-1), 4, 35, 0, 0)--Jean - SetPedComponentVariation(GetPlayerPed(-1), 6, 24, 0, 0)--Chaussure - SetPedComponentVariation(GetPlayerPed(-1), 8, 58, 0, 0)--mattraque - SetPedComponentVariation(GetPlayerPed(-1), 11, 55, 0, 0)--Veste - SetPedComponentVariation(GetPlayerPed(-1), 10, 8, 1, 0)--Grade - SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 0, 2) --Bag - SetPedPropIndex(GetPlayerPed(-1), 2, 2, 0, 1)--Oreillete - SetPedPropIndex(GetPlayerPed(-1), 6, 3, 0, 1)--Montre + if data.current.value == 'sergeant_wear' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + + if skin.sex == 0 then - ClearPedProp(GetPlayerPed(-1), 0) -- Helmet - else - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) - end + local clothesSkin = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 8, ['decals_2'] = 1, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + else + + local clothesSkin = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 7, ['decals_2'] = 1, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + end + + local playerPed = GetPlayerPed(-1) + SetPedArmour(playerPed, 0) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + end) end - if data.current.value == 'lieutenant_wear' then --Ajout de tenue par grades - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - SetPedComponentVariation(GetPlayerPed(-1), 3, 30, 0, 0)--Gants - SetPedComponentVariation(GetPlayerPed(-1), 4, 35, 0, 0)--Jean - SetPedComponentVariation(GetPlayerPed(-1), 6, 24, 0, 0)--Chaussure - SetPedComponentVariation(GetPlayerPed(-1), 8, 58, 0, 0)--mattraque - SetPedComponentVariation(GetPlayerPed(-1), 11, 55, 0, 0)--Veste - SetPedComponentVariation(GetPlayerPed(-1), 10, 8, 2, 0)--Grade - SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 0, 2) --Bag - SetPedPropIndex(GetPlayerPed(-1), 2, 2, 0, 1)--Oreillete - SetPedPropIndex(GetPlayerPed(-1), 6, 3, 0, 1)--Montre + if data.current.value == 'lieutenant_wear' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + + if skin.sex == 0 then - ClearPedProp(GetPlayerPed(-1), 0) -- Helmet - else - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) - end + local clothesSkin = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 8, ['decals_2'] = 2, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + else + + local clothesSkin = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 7, ['decals_2'] = 2, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + end + + local playerPed = GetPlayerPed(-1) + SetPedArmour(playerPed, 0) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + end) end if data.current.value == 'commandant_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - SetPedComponentVariation(GetPlayerPed(-1), 3, 30, 0, 0)--Gants - SetPedComponentVariation(GetPlayerPed(-1), 4, 35, 0, 0)--Jean - SetPedComponentVariation(GetPlayerPed(-1), 6, 24, 0, 0)--Chaussure - SetPedComponentVariation(GetPlayerPed(-1), 8, 58, 0, 0)--mattraque - SetPedComponentVariation(GetPlayerPed(-1), 11, 55, 0, 0)--Veste - SetPedComponentVariation(GetPlayerPed(-1), 10, 8, 3, 0)--Grade - SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 0, 2) --Bag - SetPedPropIndex(GetPlayerPed(-1), 2, 2, 0, 1)--Oreillete - SetPedPropIndex(GetPlayerPed(-1), 6, 3, 0, 1)--Montre + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + + if skin.sex == 0 then - ClearPedProp(GetPlayerPed(-1), 0) -- Helmet - else - TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) - end + local clothesSkin = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 8, ['decals_2'] = 3, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + else + + local clothesSkin = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 7, ['decals_2'] = 3, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + end + + local playerPed = GetPlayerPed(-1) + SetPedArmour(playerPed, 0) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + end) end - if data.current.value == 'veste_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function() - SetPedComponentVariation(GetPlayerPed(-1), 9, 10, 1, 2)--Gilet - local playerPed = GetPlayerPed(-1) - SetPedArmour(playerPed, 100) - ClearPedBloodDamage(playerPed) - ResetPedVisibleDamage(playerPed) - ClearPedLastWeaponDamage(playerPed) - end) - end + if data.current.value == 'bullet_wear' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + + if skin.sex == 0 then - if data.current.value == 'veste_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function() - SetPedComponentVariation(GetPlayerPed(-1), 9, 10, 1, 2)--Gilet - end) + local clothesSkin = { + ['bproof_1'] = 11, ['bproof_2'] = 1 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + else + + local clothesSkin = { + ['bproof_1'] = 13, ['bproof_2'] = 1 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + end + + local playerPed = GetPlayerPed(-1) + SetPedArmour(playerPed, 100) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + + end) end if data.current.value == 'gilet_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function() - SetPedComponentVariation(GetPlayerPed(-1), 9, 14, 1, 2)--Sans Gilet - local playerPed = GetPlayerPed(-1) - SetPedArmour(playerPed, 0) - ClearPedBloodDamage(playerPed) - ResetPedVisibleDamage(playerPed) - ClearPedLastWeaponDamage(playerPed) + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + + if skin.sex == 0 then + + local clothesSkin = { + ['tshirt_1'] = 59, ['tshirt_2'] = 1 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + else + + local clothesSkin = { + ['tshirt_1'] = 36, ['tshirt_2'] = 1 + } + TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) + + end + + local playerPed = GetPlayerPed(-1) + SetPedArmour(playerPed, 0) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + end) end From cb65dd622927bb3276cdec01f6d3d3a34b6ffa89 Mon Sep 17 00:00:00 2001 From: LuaDeldu Date: Sat, 2 Dec 2017 14:46:16 +0100 Subject: [PATCH 095/253] chore(version): Increment version --- __resource.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__resource.lua b/__resource.lua index 647ae1d1..125b3d7b 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' -version '1.0.3' +version '1.0.4' server_scripts { '@es_extended/locale.lua', From 42a8ca7869748d4a22fb0fe8d681ea58e14603e5 Mon Sep 17 00:00:00 2001 From: LuaDeldu Date: Sat, 2 Dec 2017 17:36:52 +0100 Subject: [PATCH 096/253] feat(clothes): better clothing system - fix --- client/main.lua | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/client/main.lua b/client/main.lua index 824bd994..01da2cbc 100644 --- a/client/main.lua +++ b/client/main.lua @@ -116,11 +116,16 @@ function OpenCloakroomMenu() TriggerEvent('skinchanger:loadSkin', skin) TriggerEvent('esx:restoreLoadout') + local playerPed = GetPlayerPed(-1) + SetPedArmour(playerPed, 0) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) end) end if data.current.value == 'cadet_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:getSkin', function(skin) if skin.sex == 0 then @@ -164,7 +169,7 @@ function OpenCloakroomMenu() end if data.current.value == 'police_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:getSkin', function(skin) if skin.sex == 0 then @@ -208,7 +213,7 @@ function OpenCloakroomMenu() end if data.current.value == 'sergeant_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:getSkin', function(skin) if skin.sex == 0 then @@ -252,7 +257,7 @@ function OpenCloakroomMenu() end if data.current.value == 'lieutenant_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:getSkin', function(skin) if skin.sex == 0 then @@ -296,7 +301,7 @@ function OpenCloakroomMenu() end if data.current.value == 'commandant_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:getSkin', function(skin) if skin.sex == 0 then @@ -340,7 +345,7 @@ function OpenCloakroomMenu() end if data.current.value == 'bullet_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:getSkin', function(skin) if skin.sex == 0 then @@ -368,7 +373,7 @@ function OpenCloakroomMenu() end if data.current.value == 'gilet_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:getSkin', function(skin) if skin.sex == 0 then @@ -488,7 +493,6 @@ function OpenCloakroomMenu() end) end - CurrentAction = 'menu_cloakroom' CurrentActionMsg = _U('open_cloackroom') CurrentActionData = {} From 2423c431a60d09cbe718ab2216bab57fb9f9e43b Mon Sep 17 00:00:00 2001 From: LuaDeldu Date: Thu, 18 Jan 2018 15:57:41 +0100 Subject: [PATCH 097/253] Code optimization - Better cloakroom system - Easy clothes configuration (config.lua) Thanks to renaiku --- client/main.lua | 451 ++++++------------------------------------------ config.lua | 144 ++++++++++++++++ locales/en.lua | 1 + locales/fr.lua | 15 +- 4 files changed, 205 insertions(+), 406 deletions(-) diff --git a/client/main.lua b/client/main.lua index 01da2cbc..3f52e0ee 100644 --- a/client/main.lua +++ b/client/main.lua @@ -48,10 +48,48 @@ function SetVehicleMaxMods(vehicle) end +function cleanPlayer(playerPed) + SetPedArmour(playerPed, 0) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + ResetPedMovementClipset(playerPed, 0) +end + +function setUniform(job, playerPed) + TriggerEvent('skinchanger:getSkin', function(skin) + + if skin.sex == 0 then + if Config.Uniforms[job].male ~= nil then + TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].male) + else + ESX.ShowNotification(_U('no_outfit')) + end + if job == 'bullet_wear' then + SetPedArmour(playerPed, 100) + end + else + if Config.Uniforms[job].female ~= nil then + TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].female) + else + ESX.ShowNotification(_U('no_outfit')) + end + if job == 'bullet_wear' then + SetPedArmour(playerPed, 100) + end + end + + end) +end + function OpenCloakroomMenu() + local playerPed = GetPlayerPed(-1) + local elements = { - { label = _U('citizen_wear'), value = 'citizen_wear' } + { label = _U('citizen_wear'), value = 'citizen_wear' }, + { label = _U('bullet_wear'), value = 'bullet_wear' }, + { label = _U('gilet_wear'), value = 'gilet_wear' } } if PlayerData.job.grade_name == 'recruit' then @@ -80,9 +118,6 @@ function OpenCloakroomMenu() table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear_freemode'}) end - table.insert(elements, {label = _U('bullet_wear'), value = 'bullet_wear'}) - table.insert(elements, {label = _U('gilet_wear'), value = 'gilet_wear'}) - ESX.UI.Menu.CloseAll() ESX.UI.Menu.Open( @@ -93,404 +128,25 @@ function OpenCloakroomMenu() elements = elements, }, function(data, menu) - menu.close() + + cleanPlayer(playerPed) if data.current.value == 'citizen_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - local model = nil - - if skin.sex == 0 then - model = GetHashKey("mp_m_freemode_01") - else - model = GetHashKey("mp_f_freemode_01") - end - - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(1) - end - - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) TriggerEvent('skinchanger:loadSkin', skin) - TriggerEvent('esx:restoreLoadout') - local playerPed = GetPlayerPed(-1) - SetPedArmour(playerPed, 0) - ClearPedBloodDamage(playerPed) - ResetPedVisibleDamage(playerPed) - ClearPedLastWeaponDamage(playerPed) end) end - if data.current.value == 'cadet_wear' then - TriggerEvent('skinchanger:getSkin', function(skin) - - if skin.sex == 0 then - - local clothesSkin = { - ['tshirt_1'] = 59, ['tshirt_2'] = 1, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = 46, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - else - - local clothesSkin = { - ['tshirt_1'] = 36, ['tshirt_2'] = 1, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = 45, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - end - - local playerPed = GetPlayerPed(-1) - SetPedArmour(playerPed, 0) - ClearPedBloodDamage(playerPed) - ResetPedVisibleDamage(playerPed) - ClearPedLastWeaponDamage(playerPed) - - end) - end - - if data.current.value == 'police_wear' then - TriggerEvent('skinchanger:getSkin', function(skin) - - if skin.sex == 0 then - - local clothesSkin = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - else - - local clothesSkin = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - end - - local playerPed = GetPlayerPed(-1) - SetPedArmour(playerPed, 0) - ClearPedBloodDamage(playerPed) - ResetPedVisibleDamage(playerPed) - ClearPedLastWeaponDamage(playerPed) - - end) - end - - if data.current.value == 'sergeant_wear' then - TriggerEvent('skinchanger:getSkin', function(skin) - - if skin.sex == 0 then - - local clothesSkin = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 8, ['decals_2'] = 1, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - else - - local clothesSkin = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 7, ['decals_2'] = 1, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - end - - local playerPed = GetPlayerPed(-1) - SetPedArmour(playerPed, 0) - ClearPedBloodDamage(playerPed) - ResetPedVisibleDamage(playerPed) - ClearPedLastWeaponDamage(playerPed) - - end) - end - - if data.current.value == 'lieutenant_wear' then - TriggerEvent('skinchanger:getSkin', function(skin) - - if skin.sex == 0 then - - local clothesSkin = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 8, ['decals_2'] = 2, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - else - - local clothesSkin = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 7, ['decals_2'] = 2, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - end - - local playerPed = GetPlayerPed(-1) - SetPedArmour(playerPed, 0) - ClearPedBloodDamage(playerPed) - ResetPedVisibleDamage(playerPed) - ClearPedLastWeaponDamage(playerPed) - - end) - end - - if data.current.value == 'commandant_wear' then - TriggerEvent('skinchanger:getSkin', function(skin) - - if skin.sex == 0 then - - local clothesSkin = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 8, ['decals_2'] = 3, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - else - - local clothesSkin = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 7, ['decals_2'] = 3, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - end - - local playerPed = GetPlayerPed(-1) - SetPedArmour(playerPed, 0) - ClearPedBloodDamage(playerPed) - ResetPedVisibleDamage(playerPed) - ClearPedLastWeaponDamage(playerPed) - - end) - end - - if data.current.value == 'bullet_wear' then - TriggerEvent('skinchanger:getSkin', function(skin) - - if skin.sex == 0 then - - local clothesSkin = { - ['bproof_1'] = 11, ['bproof_2'] = 1 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - else - - local clothesSkin = { - ['bproof_1'] = 13, ['bproof_2'] = 1 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - end - - local playerPed = GetPlayerPed(-1) - SetPedArmour(playerPed, 100) - ClearPedBloodDamage(playerPed) - ResetPedVisibleDamage(playerPed) - ClearPedLastWeaponDamage(playerPed) - - end) - end - - if data.current.value == 'gilet_wear' then - TriggerEvent('skinchanger:getSkin', function(skin) - - if skin.sex == 0 then - - local clothesSkin = { - ['tshirt_1'] = 59, ['tshirt_2'] = 1 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - else - - local clothesSkin = { - ['tshirt_1'] = 36, ['tshirt_2'] = 1 - } - TriggerEvent('skinchanger:loadClothes', skin, clothesSkin) - - end - - local playerPed = GetPlayerPed(-1) - SetPedArmour(playerPed, 0) - ClearPedBloodDamage(playerPed) - ResetPedVisibleDamage(playerPed) - ClearPedLastWeaponDamage(playerPed) - - end) - end - - if data.current.value == 'sheriff_wear_freemode' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - - if skin.sex == 0 then - - local model = GetHashKey("s_m_y_sheriff_01") - - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end - - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - else - local model = GetHashKey("s_f_y_sheriff_01") - - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end - - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - end - - end) - end - - if data.current.value == 'lieutenant_wear_freemode' then - - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - - if skin.sex == 0 then - local model = GetHashKey("s_m_y_swat_01") - - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end - - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - else - local model = GetHashKey("s_m_y_swat_01") - - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end - - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - end - - end) - end - - if data.current.value == 'commandant_wear_freemode' then - - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - - if skin.sex == 0 then - local model = GetHashKey("s_m_y_swat_01") - - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end - - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - else - local model = GetHashKey("s_m_y_swat_01") - - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(0) - end - - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - end - - end) + if + data.current.value == 'cadet_wear' or + data.current.value == 'police_wear' or + data.current.value == 'sergeant_wear' or + data.current.value == 'lieutenant_wear' or + data.current.value == 'commandant_wear' or + data.current.value == 'bullet_wear' or + data.current.value == 'gilet_wear' + then + setUniform(data.current.value, playerPed) end CurrentAction = 'menu_cloakroom' @@ -499,15 +155,12 @@ function OpenCloakroomMenu() end, function(data, menu) - menu.close() - CurrentAction = 'menu_cloakroom' CurrentActionMsg = _U('open_cloackroom') CurrentActionData = {} end ) - end function OpenArmoryMenu(station) diff --git a/config.lua b/config.lua index 9443a8bd..b5169dbe 100644 --- a/config.lua +++ b/config.lua @@ -83,3 +83,147 @@ Config.PoliceStations = { }, } + + +-- CHECK SKINCHANGER CLIENT MAIN.LUA for matching elements + +Config.Uniforms = { + + cadet_wear = { + male = { + ['tshirt_1'] = 59, ['tshirt_2'] = 1, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = 46, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 36, ['tshirt_2'] = 1, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = 45, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + police_wear = { + male = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + sergeant_wear = { + male = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 8, ['decals_2'] = 1, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 7, ['decals_2'] = 1, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + lieutenant_wear = { + male = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 8, ['decals_2'] = 2, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 7, ['decals_2'] = 2, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + commandant_wear = { + male = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 8, ['decals_2'] = 3, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 7, ['decals_2'] = 3, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + bullet_wear = { + male = { + ['bproof_1'] = 11, ['bproof_2'] = 1 + }, + female = { + ['bproof_1'] = 13, ['bproof_2'] = 1 + } + }, + gilet_wear = { + male = { + ['tshirt_1'] = 59, ['tshirt_2'] = 1 + }, + female = { + ['tshirt_1'] = 36, ['tshirt_2'] = 1 + } + } + +} \ No newline at end of file diff --git a/locales/en.lua b/locales/en.lua index 8b338a25..58fea438 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -10,6 +10,7 @@ Locales['en'] = { ['specops_wear'] = 'Spec OPS outfit', ['gilet_wear'] = 'orange reflective jacket', ['bullet_wear'] = 'bulletproof vest', + ['no_outfit'] = 'there\'s no uniform to fit you...', ['open_cloackroom'] = 'press ~INPUT_CONTEXT~ to change', -- Armory ['get_weapon'] = 'get Weapon', diff --git a/locales/fr.lua b/locales/fr.lua index 9f2c5c54..1adb79b0 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -10,18 +10,19 @@ Locales['fr'] = { ['specops_wear'] = 'Spec OPS outfit', ['gilet_wear'] = 'Gilet orange', ['bullet_wear'] = 'Gilet pare-balles', - ['open_cloackroom'] = 'appuez sur ~INPUT_CONTEXT~ pour vous changer', + ['no_outfit'] = 'Il n\'y a pas d\'uniforme à votre taille...', + ['open_cloackroom'] = 'appuyez sur ~INPUT_CONTEXT~ pour vous changer', -- Armory ['get_weapon'] = 'prendre Arme', ['put_weapon'] = 'déposer Arme', ['buy_weapons'] = 'acheter Armes', ['armory'] = 'armurerie', - ['open_armory'] = 'appuez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie', + ['open_armory'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie', -- Vehicles ['vehicle_menu'] = 'véhicule', ['vehicle_out'] = 'il y a déja un véhicule de sorti', - ['vehicle_spawner'] = 'appuez sur ~INPUT_CONTEXT~ pour sortir un véhicule', - ['store_vehicle'] = 'appuez sur ~INPUT_CONTEXT~ pour ranger le véhicule', + ['vehicle_spawner'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir un véhicule', + ['store_vehicle'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', ['service_max'] = 'Service complet : ', -- Action Menu ['citizen_interaction'] = 'interaction citoyen', @@ -41,7 +42,7 @@ Locales['fr'] = { ['pick_lock'] = 'crocheter véhicule', ['vehicle_unlocked'] = 'véhicule ~g~déverouillé~s~', ['no_vehicles_nearby'] = 'aucun véhicule à proximité', - ['traffic_interaction'] = 'Interaction Voirie', + ['traffic_interaction'] = 'interaction routière', ['cone'] = 'plot', ['barrier'] = 'barrière', ['spikestrips'] = 'herse', @@ -77,7 +78,7 @@ Locales['fr'] = { ['amount_of_withdrawal'] = 'montant du retrait', ['invalid_amount'] = 'montant invalide', ['amount_of_deposit'] = 'montant du dépôt', - ['open_bossmenu'] = 'appuez sur ~INPUT_CONTEXT~ pour ouvrir le menu', + ['open_bossmenu'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir le menu', ['quantity_invalid'] = 'Quantité invalide', ['have_withdrawn'] = 'Vous avez retiré x', ['added'] = 'Vous avez ajouté x', @@ -85,7 +86,7 @@ Locales['fr'] = { ['inventory'] = 'inventaire', ['police_stock'] = 'Police Stock', -- Misc - ['remove_object'] = 'appuez sur ~INPUT_CONTEXT~ pour enlever l\'objet', + ['remove_object'] = 'appuyez sur ~INPUT_CONTEXT~ pour enlever l\'objet', ['map_blip'] = 'Commissariat', -- Notifications ['from'] = '~s~ à ~b~', From d08bcc6b7795877ce78b5c0fab59d2f5a05972b0 Mon Sep 17 00:00:00 2001 From: LuaDeldu Date: Thu, 18 Jan 2018 15:57:58 +0100 Subject: [PATCH 098/253] chore(version): Increment version --- __resource.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__resource.lua b/__resource.lua index 125b3d7b..c47b5188 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' -version '1.0.4' +version '1.0.5' server_scripts { '@es_extended/locale.lua', From ac3c7492bf6486b4610416a8252a45d62c5da8be Mon Sep 17 00:00:00 2001 From: LuaDeldu Date: Thu, 18 Jan 2018 16:01:05 +0100 Subject: [PATCH 099/253] Forgot Sylundef PR --- server/main.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index 1bfd2e32..ddb9d615 100644 --- a/server/main.lua +++ b/server/main.lua @@ -24,9 +24,14 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, if itemType == 'item_standard' then local label = sourceXPlayer.getInventoryItem(itemName).label + local playerItemCount = targetXPlayer.getInventoryItem(itemName).count - targetXPlayer.removeInventoryItem(itemName, amount) - sourceXPlayer.addInventoryItem(itemName, amount) + if playerItemCount <= amount then + targetXPlayer.removeInventoryItem(itemName, amount) + sourceXPlayer.addInventoryItem(itemName, amount) + else + TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + end TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confinv') .. amount .. ' ' .. label .. _U('from') .. targetXPlayer.name) TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confinv') .. amount .. ' ' .. label ) From 041e7e539b1a5be31424cb362c69dee66fcc1617 Mon Sep 17 00:00:00 2001 From: MagnanQC Date: Sun, 25 Feb 2018 01:24:32 -0500 Subject: [PATCH 100/253] update readme.md URL for Identity updated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d8d3dcb..27331b61 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ FXServer ESX Police Job * esx_datastore => https://github.com/FXServer-ESX/fxserver-esx_datastore * ESX Identity Support - * esx_identity => https://github.com/ArkSeyonet/fxserver-esx_identity + * esx_identity => https://github.com/ArkSeyonet/esx_identity_es5 [INSTALLATION] From 89c04752b8327b6522e38cdb8a3e6cc9a45b2cdc Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 7 Mar 2018 19:12:46 +0100 Subject: [PATCH 101/253] Cuffed people can no longer leave vehicle --- client/main.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/main.lua b/client/main.lua index 01da2cbc..7f08190b 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1788,6 +1788,9 @@ Citizen.CreateThread(function() DisableControlAction(0, 142, true) -- MeleeAttackAlternate DisableControlAction(0, 30, true) -- MoveLeftRight DisableControlAction(0, 31, true) -- MoveUpDown + DisableControlAction(0, 24, true) -- Shoot + DisableControlAction(0, 92, true) -- Shoot in car + DisableControlAction(0, 75, true) -- Leave Vehicle end end end) From c12a3e99465c87b1d8ae64bdf05e3895b2e3a54a Mon Sep 17 00:00:00 2001 From: ronnie123442 Date: Sat, 17 Mar 2018 17:36:36 -0700 Subject: [PATCH 102/253] Update en_config.lua to match config.lua in main directory. Added Config.EnableLicenses = false -- requires esx_license --- localization/en_config.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/localization/en_config.lua b/localization/en_config.lua index c9eec719..df49e4ac 100644 --- a/localization/en_config.lua +++ b/localization/en_config.lua @@ -8,6 +8,7 @@ Config.EnableArmoryManagement = false Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false +Config.EnableLicenses = false -- only turn this on if you are using esx_license Config.MaxInService = -1 Config.Locale = 'en' From aed4db306e13febe9f3c6ddacd304b05d05549b0 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 5 Apr 2018 12:32:36 +0200 Subject: [PATCH 103/253] Added blips for cops, closes #4 --- client/main.lua | 60 ++++++++++++++++++++++++++++++++++++++++++++++++- server/main.lua | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 4f838d23..a1947c94 100644 --- a/client/main.lua +++ b/client/main.lua @@ -23,6 +23,8 @@ local CurrentActionData = {} local IsHandcuffed = false local IsDragged = false local CopPed = 0 +local hasAlreadyJoined = false +local blipsCops = {} ESX = nil GUI.Time = 0 @@ -1211,7 +1213,10 @@ end) RegisterNetEvent('esx:setJob') AddEventHandler('esx:setJob', function(job) - PlayerData.job = job + PlayerData.job = job + + Citizen.Wait(5000) + TriggerServerEvent('esx_policejob:forceBlip') end) RegisterNetEvent('esx_phone:loaded') @@ -1794,3 +1799,56 @@ Citizen.CreateThread(function() end end) + +function createBlip(id) + ped = GetPlayerPed(id) + blip = GetBlipFromEntity(ped) + + if not DoesBlipExist(blip) then -- Add blip and create head display on player + blip = AddBlipForEntity(ped) + SetBlipSprite(blip, 1) + Citizen.InvokeNative(0x5FBCA48327B914DF, blip, true) -- Player Blip indicator + SetBlipRotation(blip, math.ceil(GetEntityHeading(veh))) -- update rotation + SetBlipNameToPlayerName(blip, id) -- update blip name + SetBlipScale(blip, 0.85) -- set scale + SetBlipAsShortRange(blip, true) + + table.insert(blipsCops, blip) -- add blip to array so we can remove it later + end +end + +RegisterNetEvent('esx_policejob:updateBlip') +AddEventHandler('esx_policejob:updateBlip', function() + + -- Refresh all blips + for k, existingBlip in pairs(blipsCops) do + RemoveBlip(existingBlip) + end + + -- Clean the blip table + blipsCops = {} + + ESX.TriggerServerCallback('esx_policejob:isCop', function(isCop) + if isCop then + ESX.TriggerServerCallback('esx_society:getOnlinePlayers', function(players) + for i=1, #players, 1 do + if players[i].job.name == 'police' then + for id = 0, 32 do + if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= GetPlayerPed(-1) and GetPlayerName(id) == players[i].name then + createBlip(id) + end + end + end + end + end) + end + end) -- You don't need to specify source + +end) + +AddEventHandler('playerSpawned', function(spawn) + if not hasAlreadyJoined then + TriggerServerEvent('esx_policejob:spawned') + end + hasAlreadyJoined = true +end) diff --git a/server/main.lua b/server/main.lua index ddb9d615..d6994a7e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -458,3 +458,47 @@ ESX.RegisterServerCallback('esx_policejob:getPlayerInventory', function(source, }) end) + +AddEventHandler('playerDropped', function() + -- Save the source in case we lose it (which happens a lot) + local _source = source + + -- Did the player ever join? + if _source ~= nil then + local xPlayer = ESX.GetPlayerFromId(_source) + + -- Is it worth telling all clients to refresh? + if xPlayer ~= nil and xPlayer.job ~= nil and xPlayer.job.name == 'police' then + Citizen.Wait(5000) + TriggerClientEvent('esx_policejob:updateBlip', -1) + end + end +end) + +RegisterServerEvent('esx_policejob:spawned') +AddEventHandler('esx_policejob:spawned', function() + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + + if xPlayer ~= nil and xPlayer.job ~= nil and xPlayer.job.name == 'police' then + Citizen.Wait(5000) + TriggerClientEvent('esx_policejob:updateBlip', -1) + end +end) + +RegisterServerEvent('esx_policejob:forceBlip') +AddEventHandler('esx_policejob:forceBlip', function() + TriggerClientEvent('esx_policejob:updateBlip', -1) +end) + +ESX.RegisterServerCallback('esx_policejob:isCop', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + cb(xPlayer ~= nil and xPlayer.job ~= nil and xPlayer.job.name == 'police') +end) + +AddEventHandler('onResourceStart', function(resource) + if resource == GetCurrentResourceName() then + Citizen.Wait(5000) + TriggerClientEvent('esx_policejob:updateBlip', -1) + end +end) \ No newline at end of file From 360d968e5b7ae50f068b37eda6c7b0c12317ec57 Mon Sep 17 00:00:00 2001 From: Bryz LARMITE <32412925+bryzvideo@users.noreply.github.com> Date: Fri, 6 Apr 2018 23:24:35 +0200 Subject: [PATCH 104/253] _source Add _source line 495 --- server/main.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index d6994a7e..7327c49e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -492,7 +492,8 @@ AddEventHandler('esx_policejob:forceBlip', function() end) ESX.RegisterServerCallback('esx_policejob:isCop', function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) cb(xPlayer ~= nil and xPlayer.job ~= nil and xPlayer.job.name == 'police') end) @@ -501,4 +502,4 @@ AddEventHandler('onResourceStart', function(resource) Citizen.Wait(5000) TriggerClientEvent('esx_policejob:updateBlip', -1) end -end) \ No newline at end of file +end) From 9084d6582f837c0d8b3197024dcc5e4747e662da Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 9 Apr 2018 02:44:04 +0200 Subject: [PATCH 105/253] Added revoking licenses, fixed hardcoded strings --- client/main.lua | 98 ++++++++++++++++++++++++++++++++----------------- locales/en.lua | 18 ++++++--- locales/fr.lua | 6 +++ 3 files changed, 83 insertions(+), 39 deletions(-) diff --git a/client/main.lua b/client/main.lua index a1947c94..c6fe7820 100644 --- a/client/main.lua +++ b/client/main.lua @@ -170,10 +170,10 @@ function OpenArmoryMenu(station) if Config.EnableArmoryManagement then local elements = { - {label = _U('get_weapon'), value = 'get_weapon'}, - {label = _U('put_weapon'), value = 'put_weapon'}, - {label = 'Prendre Objet', value = 'get_stock'}, - {label = 'Déposer objet', value = 'put_stock'} + {label = _U('get_weapon'), value = 'get_weapon'}, + {label = _U('put_weapon'), value = 'put_weapon'}, + {label = _U('remove_object'), value = 'get_stock'}, + {label = _U('deposit_object'), value = 'put_stock'} } if PlayerData.job.grade_name == 'boss' then @@ -204,12 +204,12 @@ function OpenArmoryMenu(station) end if data.current.value == 'put_stock' then - OpenPutStocksMenu() - end + OpenPutStocksMenu() + end - if data.current.value == 'get_stock' then - OpenGetStocksMenu() - end + if data.current.value == 'get_stock' then + OpenGetStocksMenu() + end end, function(data, menu) @@ -455,13 +455,14 @@ function OpenPoliceActionsMenu() title = _U('citizen_interaction'), align = 'top-left', elements = { - {label = _U('id_card'), value = 'identity_card'}, - {label = _U('search'), value = 'body_search'}, - {label = _U('handcuff'), value = 'handcuff'}, - {label = _U('drag'), value = 'drag'}, + {label = _U('id_card'), value = 'identity_card'}, + {label = _U('search'), value = 'body_search'}, + {label = _U('handcuff'), value = 'handcuff'}, + {label = _U('drag'), value = 'drag'}, {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, - {label = _U('fine'), value = 'fine'} + {label = _U('fine'), value = 'fine'}, + {label = _U('license_check'), value = 'license'} }, }, function(data2, menu2) @@ -469,33 +470,24 @@ function OpenPoliceActionsMenu() local player, distance = ESX.Game.GetClosestPlayer() if distance ~= -1 and distance <= 3.0 then + local action = data2.current.value - if data2.current.value == 'identity_card' then + if action == 'identity_card' then OpenIdentityCardMenu(player) - end - - if data2.current.value == 'body_search' then + elseif action == 'body_search' then OpenBodySearchMenu(player) - end - - if data2.current.value == 'handcuff' then + elseif action == 'handcuff' then TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(player)) - end - - if data2.current.value == 'drag' then + elseif action == 'drag' then TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(player)) - end - - if data2.current.value == 'put_in_vehicle' then + elseif action == 'put_in_vehicle' then TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(player)) - end - - if data2.current.value == 'out_the_vehicle' then + elseif action == 'out_the_vehicle' then TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(player)) - end - - if data2.current.value == 'fine' then + elseif action == 'fine' then OpenFineMenu(player) + elseif action == 'license' then + ShowPlayerLicense(player) end else @@ -927,6 +919,46 @@ function OpenFineCategoryMenu(player, category) end +function ShowPlayerLicense(player) + local elements = {} + local targetName + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + if data.licenses ~= nil then + for i=1, #data.licenses, 1 do + if data.licenses[i].label ~= nil and data.licenses[i].type ~= nil then + table.insert(elements, {label = data.licenses[i].label, value = data.licenses[i].type}) + end + end + end + + targetName = data.firstname .. ' ' .. data.lastname + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'manage_license', + { + title = _U('license_revoke'), + align = 'top-left', + elements = elements, + }, + function(data, menu) + TriggerEvent('esx:showNotification', _U('licence_you_revoked', data.current.label, targetName)) + --TriggerEvent('esx:showNotification', GetPlayerServerId(player), _U('license_revoked', data.current.label)) + + TriggerServerEvent('esx_license:removeLicense', GetPlayerServerId(player), data.current.value) + + ESX.SetTimeout(300, function() + ShowPlayerLicense(player) + end) + end, + function(data, menu) + menu.close() + end + ) + + end, GetPlayerServerId(player)) +end + + function OpenVehicleInfosMenu(vehicleData) ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(infos) diff --git a/locales/en.lua b/locales/en.lua index 58fea438..f7c71032 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,5 +1,5 @@ Locales['en'] = { - -- Cloackroom + -- Cloakroom ['cloakroom'] = 'locker room', ['citizen_wear'] = 'civilian Outfit', ['police_wear'] = 'police Outfit', @@ -10,12 +10,14 @@ Locales['en'] = { ['specops_wear'] = 'Spec OPS outfit', ['gilet_wear'] = 'orange reflective jacket', ['bullet_wear'] = 'bulletproof vest', - ['no_outfit'] = 'there\'s no uniform to fit you...', - ['open_cloackroom'] = 'press ~INPUT_CONTEXT~ to change', + ['no_outfit'] = 'there\'s no uniform that fits you!', + ['open_cloackroom'] = 'press ~INPUT_CONTEXT~ to change ~y~clothes~s~.', -- Armory - ['get_weapon'] = 'get Weapon', - ['put_weapon'] = 'put Weapon', - ['buy_weapons'] = 'buy Weapons', + ['remove_object'] = 'take object', + ['deposit_object'] = 'deposit object', + ['get_weapon'] = 'take weapon', + ['put_weapon'] = 'put weapon', + ['buy_weapons'] = 'buy weapons', ['armory'] = 'armory', ['open_armory'] = 'press ~INPUT_CONTEXT~ to access the armory', -- Vehicles @@ -36,6 +38,10 @@ Locales['en'] = { ['put_in_vehicle'] = 'put in Vehicle', ['out_the_vehicle'] = 'take out of vehicle', ['fine'] = 'fine', + ['license_check'] = 'manage license', + ['license_revoke'] = 'revoke license', + ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', + ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', ['no_players_nearby'] = 'no players nearby', ['vehicle_info'] = 'vehicle Info', diff --git a/locales/fr.lua b/locales/fr.lua index 1adb79b0..d56ed2e5 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -13,6 +13,8 @@ Locales['fr'] = { ['no_outfit'] = 'Il n\'y a pas d\'uniforme à votre taille...', ['open_cloackroom'] = 'appuyez sur ~INPUT_CONTEXT~ pour vous changer', -- Armory + ['remove_object'] = 'prendre Objet', + ['deposit_object'] = 'déposer objet', ['get_weapon'] = 'prendre Arme', ['put_weapon'] = 'déposer Arme', ['buy_weapons'] = 'acheter Armes', @@ -36,6 +38,10 @@ Locales['fr'] = { ['put_in_vehicle'] = 'mettre dans véhicule', ['out_the_vehicle'] = 'sortir du véhicule', ['fine'] = 'Amende', + ['license_check'] = 'manage license', + ['license_revoke'] = 'revoke license', + ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', + ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', ['no_players_nearby'] = 'aucun joueur à proximité', ['vehicle_info'] = 'infos véhicule', From 5a710cbf72d783a2f05cda01b397089066c85cf5 Mon Sep 17 00:00:00 2001 From: Manuel <38227219+Tindergarten@users.noreply.github.com> Date: Mon, 9 Apr 2018 21:47:01 +0200 Subject: [PATCH 106/253] Add files via upload --- locales/br.lua | 2 +- locales/de.lua | 2 +- locales/en.lua | 2 +- locales/es.lua | 2 +- locales/fr.lua | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/locales/br.lua b/locales/br.lua index f8682ff8..d7ce2f11 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -70,7 +70,7 @@ Locales['br'] = { ['amount_of_deposit'] = 'Quantidade de depósito', ['open_bossmenu'] = 'Pressione ~INPUT_CONTEXT~ para abrir o menu', -- Misc - ['remove_object'] = 'Pressione ~INPUT_CONTEXT~ para remover o objeto', + ['remove_prop'] = 'Pressione ~INPUT_CONTEXT~ para remover o objeto', ['map_blip'] = 'Departamento de Polícia', -- Notifications ['from'] = '~s~ de ~b~', diff --git a/locales/de.lua b/locales/de.lua index d5a19a1f..1221e268 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -70,7 +70,7 @@ Locales['de'] = { ['amount_of_deposit'] = 'Betrag zum einzahlen', ['open_bossmenu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', -- Misc - ['remove_object'] = 'Drücke ~INPUT_CONTEXT~ um das Objekt zu entfernen', + ['remove_prop'] = 'Drücke ~INPUT_CONTEXT~ um das Objekt zu entfernen', ['map_blip'] = 'Polizeistation', -- Notifications ['from'] = '~s~ von ~b~', diff --git a/locales/en.lua b/locales/en.lua index f7c71032..da052941 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -92,7 +92,7 @@ Locales['en'] = { ['inventory'] = 'inventory', ['police_stock'] = 'Police Stock', -- Misc - ['remove_object'] = 'press ~INPUT_CONTEXT~ to delete the object', + ['remove_prop'] = 'press ~INPUT_CONTEXT~ to delete the object', ['map_blip'] = 'police Station', -- Notifications ['from'] = '~s~ from ~b~', diff --git a/locales/es.lua b/locales/es.lua index 41b24ef2..bcee45d6 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -83,7 +83,7 @@ Locales['es'] = { ['inventory'] = 'inventario', ['police_stock'] = 'Almacen Policial', -- Misc - ['remove_object'] = 'Presionar ~INPUT_CONTEXT~ para eliminar el objeto', + ['remove_prop'] = 'Presionar ~INPUT_CONTEXT~ para eliminar el objeto', ['map_blip'] = 'Comisaría de policía', -- Notifications ['from'] = '~s~ de ~b~', diff --git a/locales/fr.lua b/locales/fr.lua index d56ed2e5..f941997a 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -92,7 +92,7 @@ Locales['fr'] = { ['inventory'] = 'inventaire', ['police_stock'] = 'Police Stock', -- Misc - ['remove_object'] = 'appuyez sur ~INPUT_CONTEXT~ pour enlever l\'objet', + ['remove_prop'] = 'appuyez sur ~INPUT_CONTEXT~ pour enlever l\'objet', ['map_blip'] = 'Commissariat', -- Notifications ['from'] = '~s~ à ~b~', From 9a131762c4cf27f2f6e2e72040c8516bd3c48f70 Mon Sep 17 00:00:00 2001 From: Manuel <38227219+Tindergarten@users.noreply.github.com> Date: Mon, 9 Apr 2018 21:47:39 +0200 Subject: [PATCH 107/253] Add files via upload --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index c6fe7820..7a2db92f 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1341,7 +1341,7 @@ AddEventHandler('esx_policejob:hasEnteredEntityZone', function(entity) if PlayerData.job ~= nil and PlayerData.job.name == 'police' and not IsPedInAnyVehicle(playerPed, false) then CurrentAction = 'remove_entity' - CurrentActionMsg = _U('remove_object') + CurrentActionMsg = _U('remove_prop') CurrentActionData = {entity = entity} end From dc2ebe9993f5e9f154341a90b11754f795607f23 Mon Sep 17 00:00:00 2001 From: Manuel <38227219+Tindergarten@users.noreply.github.com> Date: Mon, 9 Apr 2018 21:55:38 +0200 Subject: [PATCH 108/253] Added de.lua in __resource.lua No more 'local [de] does not exist' anymore --- __resource.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/__resource.lua b/__resource.lua index c47b5188..a4c6132a 100644 --- a/__resource.lua +++ b/__resource.lua @@ -7,6 +7,7 @@ version '1.0.5' server_scripts { '@es_extended/locale.lua', 'locales/br.lua', + 'locales/de.lua', 'locales/en.lua', 'locales/fr.lua', 'locales/es.lua', @@ -18,6 +19,7 @@ server_scripts { client_scripts { '@es_extended/locale.lua', 'locales/br.lua', + 'locales/de.lua', 'locales/en.lua', 'locales/fr.lua', 'locales/es.lua', From 0a50a0d2f90ba113d162ca2e52c9afb86ed9c4cb Mon Sep 17 00:00:00 2001 From: MHL1337 Date: Sat, 14 Apr 2018 13:07:00 +0200 Subject: [PATCH 109/253] Added Swedish lang --- __resource.lua | 36 +++++----- locales/sv.lua | 107 ++++++++++++++++++++++++++++++ localization/sv_esx_policejob.sql | 88 ++++++++++++++++++++++++ 3 files changed, 214 insertions(+), 17 deletions(-) create mode 100644 locales/sv.lua create mode 100644 localization/sv_esx_policejob.sql diff --git a/__resource.lua b/__resource.lua index a4c6132a..7766f428 100644 --- a/__resource.lua +++ b/__resource.lua @@ -5,24 +5,26 @@ description 'ESX Police Job' version '1.0.5' server_scripts { - '@es_extended/locale.lua', - 'locales/br.lua', - 'locales/de.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'locales/es.lua', - '@mysql-async/lib/MySQL.lua', - 'config.lua', - 'server/main.lua' + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/de.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'locales/es.lua', + 'locales/sv.lua', + '@mysql-async/lib/MySQL.lua', + 'config.lua', + 'server/main.lua' } client_scripts { - '@es_extended/locale.lua', - 'locales/br.lua', - 'locales/de.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'locales/es.lua', - 'config.lua', - 'client/main.lua' + '@es_extended/locale.lua', + 'locales/br.lua', + 'locales/de.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'locales/es.lua', + 'locales/sv.lua', + 'config.lua', + 'client/main.lua' } diff --git a/locales/sv.lua b/locales/sv.lua new file mode 100644 index 00000000..9529d362 --- /dev/null +++ b/locales/sv.lua @@ -0,0 +1,107 @@ +Locales['sv'] = { + -- Cloakroom + ['cloakroom'] = 'Omklädningsrum', + ['citizen_wear'] = 'Civila kläder', + ['police_wear'] = 'Polisuniform', + ['sheriff_wear'] = 'Inspektöruniform', + ['lieutenant_wear'] = 'Insatsstyrka', + ['gilet_wear'] = 'Reflektiv väst', + ['bullet_wear'] = 'Skottsäker väst', + ['no_outfit'] = 'Du har ingen uniform!', + ['open_cloackroom'] = 'Tryck ~INPUT_CONTEXT~ för att byta ~y~kläder~s~.', + -- Armory + ['remove_object'] = 'Ta ut objekt', + ['deposit_object'] = 'Lägg in objekt', + ['get_weapon'] = 'Ta ut vapen', + ['put_weapon'] = 'Lägg in vapen', + ['buy_weapons'] = 'Köp in vapen', + ['armory'] = 'Vapenförråd', + ['open_armory'] = 'tryck ~INPUT_CONTEXT~ för att komma åt förrådet', + -- Vehicles + ['vehicle_menu'] = 'Bilar', + ['vehicle_out'] = 'Det finns redan en bil ute!', + ['vehicle_spawner'] = 'Tryck ~INPUT_CONTEXT~ för att ta ut en bil', + ['store_vehicle'] = 'Tryck ~INPUT_CONTEXT~ för att parkera bilen', + -- Action Menu + ['citizen_interaction'] = 'Handlingar mot civila', + ['vehicle_interaction'] = 'Handlingar på bilar', + ['object_spawner'] = 'ta fram ett objekt', + + ['id_card'] = 'ID-Kort', + ['search'] = 'Sök igenom', + ['handcuff'] = 'Sätt på handfängel / Ta av handfängsel', + ['drag'] = 'Dra', + ['put_in_vehicle'] = 'Sätt in i fordon', + ['out_the_vehicle'] = 'Ta ut ur fordon', + ['fine'] = 'Ge böter', + ['license_check'] = 'Kolla körkort', + ['license_revoke'] = 'Neka körkort', + ['license_revoked'] = 'Ditt ~b~%s~s~ har blivit ~y~nekat~s~!', + ['licence_you_revoked'] = 'Du nekade ett ~b~%s~s~ som tillhörde ~y~%s~s~', + ['no_players_nearby'] = 'Ingen i närheten', + + ['vehicle_info'] = 'Fordons information', + ['pick_lock'] = 'Bryt upp fordon', + ['vehicle_unlocked'] = 'Fordon ~g~Upplåst~s~', + ['no_vehicles_nearby'] = 'Inga fordon i närheten', + ['traffic_interaction'] = 'Trafik handlingar', + ['cone'] = 'Kon', + ['barrier'] = 'Barriär', + ['spikestrips'] = 'Spikmatta', + -- ID Card Menu + ['name'] =' Namn: ', + ['bac'] = 'Procent alkohol i blodet : ', + -- Body Search Menu + ['confiscate_dirty'] = 'Konfiskera svarta pengar: $', + ['guns_label'] = '--- Guns ---', + ['confiscate'] = 'Konfiskera', + ['inventory_label'] = '--- Inventory ---', + ['confiscate_inv'] = 'Konfiskera x', + + ['traffic_offense'] = 'Brutit mot trafikregler', + ['minor_offense'] = 'Mindre lagbrott', + ['average_offense'] = 'Medel lagbrott', + ['major_offense'] = 'Grovt lagbrott', + ['fine_total'] = 'Böter: ', + -- Vehicle Info Menu + ['plate'] = 'Reg nummer: ', + ['owner_unknown'] = 'Ägare: Okänt', + ['owner'] = 'Ägare: ', + -- Weapons Menus + ['get_weapon_menu'] = 'Vapenförråd - Ta vapen', + ['put_weapon_menu'] = 'Vapenförråd - Lägg in vapen', + ['buy_weapon_menu'] = 'Vapenförråd - Köp in vapen', + ['not_enough_money'] = 'Du har inte tillräckligt mycket pengar', + -- Boss Menu + ['take_company_money'] = 'Ta ut företagspengar', + ['deposit_money'] = 'Lägg in pengar till företaget', + ['amount_of_withdrawal'] = 'Belopp att ta ut', + ['invalid_amount'] = 'Otillgängligt belopp', + ['amount_of_deposit'] = 'Belopp att lägga in', + ['open_bossmenu'] = 'Tryck ~INPUT_CONTEXT~ för att öppna menyn', + ['quantity_invalid'] = 'Otillgängligt antal', + ['have_withdraw'] = 'Du har tagit ut x', + ['added'] = 'Du la in x', + ['quantity'] = 'Antal', + ['inventory'] = 'Förråd', + ['police_stock'] = 'Polisförråd', + -- Misc + ['remove_prop'] = 'tryck ~INPUT_CONTEXT~ för att ta bort obejektet', + ['map_blip'] = 'Polisstation', + -- Notifications + ['from'] = '~s~ från ~b~', + ['you_have_confinv'] = 'Du har konfiskerat ~y~x', + ['confinv'] = '~s~ konfiskerade ~y~x', + ['you_have_confdm'] = 'Du har konfiskerat ~y~$', + ['confdm'] = '~s~ konfiskerade ~y~$', + ['you_have_confweapon'] = 'Du har konfiskerat ~y~x1 ', + ['confweapon'] = '~s~ konfiskerade ~y~x1 ', + ['alert_police'] = 'Meddela polisen', + -- Authorized Vehicles + ['police'] = 'Polisbil', + ['police2'] = 'Polisbil 2', + ['police3'] = 'Polisbil 3', + ['police4'] = 'Civil polisbil', + ['policeb'] = 'Polis motorcykel', + ['policet'] = 'Transport bil', +} diff --git a/localization/sv_esx_policejob.sql b/localization/sv_esx_policejob.sql new file mode 100644 index 00000000..407c0d86 --- /dev/null +++ b/localization/sv_esx_policejob.sql @@ -0,0 +1,88 @@ +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police','Polis',1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police','Polis',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Polis', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police','Polis') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Aspirant',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',4,'officer','Biträdande Rikspolischef',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',1,'sergeant','Assistent',60,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',2,'lieutenant','Inspektör',85,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',3,'boss','Rikspolischef',100,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') +; + +CREATE TABLE `fine_types` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Missbruk av tuta',30,0), + ('Köra över heldragen linje',40,0), + ('Kört i motsatt riktning i rondell',250,0), + ('Olaglig U-Sväng',250,0), + ('Olovlig körning i skogen',170,0), + ('Kört för nära bil framför',30,0), + ('Trafikfarligt stopp',150,0), + ('olaglig parkering',70,0), + ('Använder inte högerregeln',70,0), + ('Aktar sig inte för tjänstefordon i utryckning',90,0), + ('Kört förbi stoppskylt',105,0), + ('Kört mot rött',130,0), + ('Farlig omkörning',100,0), + ('Fordon i dåligt skick',100,0), + ('Kört utan körkort',1500,0), + ('smitning från olycka',800,0), + ('Kört för fort < 5 kmh',90,0), + ('Kört för fort 5-15 kmh',120,0), + ('Kört för fort 15-30 kmh',180,0), + ('Kört för fort > 30 kmh',300,0), + ('Blockerar trafiken',110,1), + ('Förstört allmän egendom',90,1), + ('Olaga diskriminering',90,1), + ('förhindrar polisens verksamhet',130,1), + ('Hets mot folkgrupp',75,1), + ('Dåligt beteende mot tjänsteman',110,1), + ('Verbalt hot mot annan person',90,1), + ('Verbalt hot mot en tjänsteman',150,1), + ('Olaglig protest',250,1), + ('Försök till mutning',1500,1), + ('Icke livshotande vapen på allmän plats ex. Hammare',120,2), + ('Dödligt vapen på allmän plats',300,2), + ('Vapen på allmän plats med licens (Licens Fel)',600,2), + ('Innehaft olaga vapen',700,2), + ('Försökt bryta sig in',300,2), + ('Bilstöld',1800,2), + ('Försäljning av droger',1500,2), + ('Tillverkning av droger',1500,2), + ('Innehav av droger',650,2), + ('Hålla gisslan/Hålla person mot dess vilja',1500,2), + ('Kidnappa en tjänsteman',2000,2), + ('Rån',650,2), + ('butiksrån',650,2), + ('bankrån',1500,2), + ('Skjutit en person',2000,3), + ('Skjutit en tjänsteman',2500,3), + ('mordförsök',3000,3), + ('Mordförsök på tjänsteman',5000,3), + ('mord',10000,3), + ('mord på tjänsteman',30000,3), + ('dråp',1800,3), + ('Olagliga aktiviteter inom ett företag',2000,2) +; From b5be66d486e1d98d9c659b437793c07bbb18ea21 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 14 Apr 2018 13:29:03 +0200 Subject: [PATCH 110/253] Only show esx_license menu if enabled in config --- README.md | 2 +- client/main.lua | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 27331b61..c3e06ab4 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,4 @@ start esx_policejob ``` 5) * If you want player management you have to set Config.EnablePlayerManagement to true in config.lua * If you want armory management you have to set Config.EnableArmoryManagement to true in config.lua - + * If you want license management you have to set Config.EnableLicenses to true in config.lua diff --git a/client/main.lua b/client/main.lua index 7a2db92f..9236cabc 100644 --- a/client/main.lua +++ b/client/main.lua @@ -448,22 +448,27 @@ function OpenPoliceActionsMenu() function(data, menu) if data.current.value == 'citizen_interaction' then - + local elements = { + {label = _U('id_card'), value = 'identity_card'}, + {label = _U('search'), value = 'body_search'}, + {label = _U('handcuff'), value = 'handcuff'}, + {label = _U('drag'), value = 'drag'}, + {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, + {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, + {label = _U('fine'), value = 'fine'}, + {label = _U('license_check'), value = 'license'} + } + + if Config.EnableLicenses then + table.insert(elements, { label = _U('license_check'), value = 'license' }) + end + ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'citizen_interaction', { title = _U('citizen_interaction'), align = 'top-left', - elements = { - {label = _U('id_card'), value = 'identity_card'}, - {label = _U('search'), value = 'body_search'}, - {label = _U('handcuff'), value = 'handcuff'}, - {label = _U('drag'), value = 'drag'}, - {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, - {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, - {label = _U('fine'), value = 'fine'}, - {label = _U('license_check'), value = 'license'} - }, + elements = elements }, function(data2, menu2) From 3428aea1b7bce21e5511cd00dac5afcce82dd887 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 15 Apr 2018 23:15:23 +0200 Subject: [PATCH 111/253] Don't let the dead open F6 menu --- client/main.lua | 78 ++++++++++++++++++++++++------------------------- server/main.lua | 6 ---- 2 files changed, 39 insertions(+), 45 deletions(-) diff --git a/client/main.lua b/client/main.lua index 9236cabc..b0487932 100644 --- a/client/main.lua +++ b/client/main.lua @@ -25,37 +25,38 @@ local IsDragged = false local CopPed = 0 local hasAlreadyJoined = false local blipsCops = {} +local isDead = false 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 + + PlayerData = ESX.GetPlayerData() end) function SetVehicleMaxMods(vehicle) - - local props = { - modEngine = 2, - modBrakes = 2, - modTransmission = 2, - modSuspension = 3, - modTurbo = true, - } - - ESX.Game.SetVehicleProperties(vehicle, props) - + local props = { + modEngine = 2, + modBrakes = 2, + modTransmission = 2, + modSuspension = 3, + modTurbo = true, + } + + ESX.Game.SetVehicleProperties(vehicle, props) end function cleanPlayer(playerPed) - SetPedArmour(playerPed, 0) - ClearPedBloodDamage(playerPed) - ResetPedVisibleDamage(playerPed) - ClearPedLastWeaponDamage(playerPed) - ResetPedMovementClipset(playerPed, 0) + SetPedArmour(playerPed, 0) + ClearPedBloodDamage(playerPed) + ResetPedVisibleDamage(playerPed) + ClearPedLastWeaponDamage(playerPed) + ResetPedMovementClipset(playerPed, 0) end function setUniform(job, playerPed) @@ -1243,11 +1244,6 @@ function OpenPutStocksMenu() end -RegisterNetEvent('esx:playerLoaded') -AddEventHandler('esx:playerLoaded', function(xPlayer) - PlayerData = xPlayer -end) - RegisterNetEvent('esx:setJob') AddEventHandler('esx:setJob', function(job) PlayerData.job = job @@ -1828,8 +1824,8 @@ Citizen.CreateThread(function() end end - - if IsControlPressed(0, Keys['F6']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') and (GetGameTimer() - GUI.Time) > 150 then + + if IsControlPressed(0, Keys['F6']) and not isDead and PlayerData.job ~= nil and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') and (GetGameTimer() - GUI.Time) > 150 then OpenPoliceActionsMenu() GUI.Time = GetGameTimer() end @@ -1865,27 +1861,31 @@ AddEventHandler('esx_policejob:updateBlip', function() -- Clean the blip table blipsCops = {} - ESX.TriggerServerCallback('esx_policejob:isCop', function(isCop) - if isCop then - ESX.TriggerServerCallback('esx_society:getOnlinePlayers', function(players) - for i=1, #players, 1 do - if players[i].job.name == 'police' then - for id = 0, 32 do - if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= GetPlayerPed(-1) and GetPlayerName(id) == players[i].name then - createBlip(id) - end + -- Is the player a cop? In that case show all the blips for other cops + if PlayerData.job ~= nil and PlayerData.job.name == 'police' then + ESX.TriggerServerCallback('esx_society:getOnlinePlayers', function(players) + for i=1, #players, 1 do + if players[i].job.name == 'police' then + for id = 0, 32 do + if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= GetPlayerPed(-1) and GetPlayerName(id) == players[i].name then + createBlip(id) end end end - end) - end - end) -- You don't need to specify source + end + end) + end end) AddEventHandler('playerSpawned', function(spawn) + isDead = false if not hasAlreadyJoined then TriggerServerEvent('esx_policejob:spawned') end hasAlreadyJoined = true end) + +AddEventHandler('esx:onPlayerDeath', function() + isDead = true +end) \ No newline at end of file diff --git a/server/main.lua b/server/main.lua index 7327c49e..a2082edf 100644 --- a/server/main.lua +++ b/server/main.lua @@ -491,12 +491,6 @@ AddEventHandler('esx_policejob:forceBlip', function() TriggerClientEvent('esx_policejob:updateBlip', -1) end) -ESX.RegisterServerCallback('esx_policejob:isCop', function(source, cb) - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - cb(xPlayer ~= nil and xPlayer.job ~= nil and xPlayer.job.name == 'police') -end) - AddEventHandler('onResourceStart', function(resource) if resource == GetCurrentResourceName() then Citizen.Wait(5000) From 6b9be3a1977c3217682d859634b942db8bcb480b Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 16 Apr 2018 21:13:10 +0200 Subject: [PATCH 112/253] Closes #69 --- client/main.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index b0487932..c3d99661 100644 --- a/client/main.lua +++ b/client/main.lua @@ -456,8 +456,7 @@ function OpenPoliceActionsMenu() {label = _U('drag'), value = 'drag'}, {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, - {label = _U('fine'), value = 'fine'}, - {label = _U('license_check'), value = 'license'} + {label = _U('fine'), value = 'fine'} } if Config.EnableLicenses then From 25b9be495700b00af22de0149c8234bf22feb3f4 Mon Sep 17 00:00:00 2001 From: Samuel Date: Wed, 18 Apr 2018 22:54:36 +0200 Subject: [PATCH 113/253] Updated links --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c3e06ab4..b32d148e 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,16 @@ -# fxserver-esx_policejob -FXServer ESX Police Job +# esx_policejob [REQUIREMENTS] * Auto mode - * esx_billing => https://github.com/FXServer-ESX/fxserver-esx_billing + * [esx_billing](https://github.com/FXServer-ESX/fxserver-esx_billing) * Player management (boss actions and armory with buyable weapons) - * esx_society => https://github.com/FXServer-ESX/fxserver-esx_society - * esx_datastore => https://github.com/FXServer-ESX/fxserver-esx_datastore + * [esx_society](https://github.com/FXServer-ESX/fxserver-esx_society) + * [esx_datastore](https://github.com/FXServer-ESX/fxserver-esx_datastore) * ESX Identity Support - * esx_identity => https://github.com/ArkSeyonet/esx_identity_es5 + * [esx_identity](https://github.com/ESX-Org/esx_identity) [INSTALLATION] @@ -30,3 +29,7 @@ start esx_policejob 5) * If you want player management you have to set Config.EnablePlayerManagement to true in config.lua * If you want armory management you have to set Config.EnableArmoryManagement to true in config.lua * If you want license management you have to set Config.EnableLicenses to true in config.lua + +# Legal +### License +The project is licensed under GPLv3, see the [license](LICENSE.TXT) for more information. From 833f3cc2325b843481711bec8246974da0560e8b Mon Sep 17 00:00:00 2001 From: Samuel Date: Wed, 18 Apr 2018 22:55:13 +0200 Subject: [PATCH 114/253] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b32d148e..0f4605a5 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,4 @@ start esx_policejob # Legal ### License -The project is licensed under GPLv3, see the [license](LICENSE.TXT) for more information. +The project is licensed under GPLv3, read the [license](LICENSE.txt) for more information. From 7b08e7a131f5c003197437901c4aad6a4da6de86 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 20 Apr 2018 23:03:04 +0200 Subject: [PATCH 115/253] Fixed revoking license --- client/main.lua | 10 +++++++--- server/main.lua | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index c3d99661..90bf346d 100644 --- a/client/main.lua +++ b/client/main.lua @@ -936,7 +936,11 @@ function ShowPlayerLicense(player) end end - targetName = data.firstname .. ' ' .. data.lastname + if Config.EnableESXIdentity then + targetName = data.firstname .. ' ' .. data.lastname + else + targetName = data.name + end ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'manage_license', @@ -946,8 +950,8 @@ function ShowPlayerLicense(player) elements = elements, }, function(data, menu) - TriggerEvent('esx:showNotification', _U('licence_you_revoked', data.current.label, targetName)) - --TriggerEvent('esx:showNotification', GetPlayerServerId(player), _U('license_revoked', data.current.label)) + ESX.ShowNotification(_U('licence_you_revoked', data.current.label, targetName)) + TriggerServerEvent('esx_policejob:message', GetPlayerServerId(player), _U('license_revoked', data.current.label)) TriggerServerEvent('esx_license:removeLicense', GetPlayerServerId(player), data.current.value) diff --git a/server/main.lua b/server/main.lua index a2082edf..1cc0be92 100644 --- a/server/main.lua +++ b/server/main.lua @@ -497,3 +497,8 @@ AddEventHandler('onResourceStart', function(resource) TriggerClientEvent('esx_policejob:updateBlip', -1) end end) + +RegisterServerEvent('esx_policejob:message') +AddEventHandler('esx_policejob:message', function(target, msg) + TriggerClientEvent('esx:showNotification', target, msg) +end) \ No newline at end of file From 505bb978dbd983dc9641bfb8e7fb25d190f1236a Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 24 Apr 2018 19:32:01 +0200 Subject: [PATCH 116/253] Possible fix for #70 --- client/main.lua | 1 + config.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 90bf346d..e9fdd4cb 100644 --- a/client/main.lua +++ b/client/main.lua @@ -36,6 +36,7 @@ Citizen.CreateThread(function() Citizen.Wait(0) end + Citizen.Wait(5000) PlayerData = ESX.GetPlayerData() end) diff --git a/config.lua b/config.lua index b5169dbe..80058ea3 100644 --- a/config.lua +++ b/config.lua @@ -8,7 +8,7 @@ Config.EnableArmoryManagement = false Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false -Config.EnableLicenses = false +Config.EnableLicenses = false -- only turn this on if you are using esx_license Config.MaxInService = -1 Config.Locale = 'fr' From e14c2a5957784d64da875ea9c14c7503083ec26c Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 2 May 2018 18:34:30 +0200 Subject: [PATCH 117/253] Implemented impounding vehicles (beta), endless i18n fixes, tab indents --- client/main.lua | 600 +++++++++++++++++++++++----------------------- esx_policejob.sql | 13 +- locales/br.lua | 33 ++- locales/de.lua | 33 ++- locales/en.lua | 33 +-- locales/es.lua | 35 +-- locales/fr.lua | 25 +- locales/sv.lua | 57 +++-- server/main.lua | 17 ++ 9 files changed, 462 insertions(+), 384 deletions(-) diff --git a/client/main.lua b/client/main.lua index e9fdd4cb..f0117a49 100644 --- a/client/main.lua +++ b/client/main.lua @@ -26,6 +26,7 @@ local CopPed = 0 local hasAlreadyJoined = false local blipsCops = {} local isDead = false +CurrentTask = {} ESX = nil GUI.Time = 0 @@ -433,204 +434,198 @@ function OpenVehicleSpawnerMenu(station, partNum) end function OpenPoliceActionsMenu() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'police_actions', + { + title = 'Police', + align = 'top-left', + elements = { + {label = _U('citizen_interaction'), value = 'citizen_interaction'}, + {label = _U('vehicle_interaction'), value = 'vehicle_interaction'}, + {label = _U('object_spawner'), value = 'object_spawner'}, + } + }, function(data, menu) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'police_actions', - { - title = 'Police', - align = 'top-left', - elements = { - {label = _U('citizen_interaction'), value = 'citizen_interaction'}, - {label = _U('vehicle_interaction'), value = 'vehicle_interaction'}, - {label = _U('object_spawner'), value = 'object_spawner'}, - }, - }, - function(data, menu) + if data.current.value == 'citizen_interaction' then + local elements = { + {label = _U('id_card'), value = 'identity_card'}, + {label = _U('search'), value = 'body_search'}, + {label = _U('handcuff'), value = 'handcuff'}, + {label = _U('drag'), value = 'drag'}, + {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, + {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, + {label = _U('fine'), value = 'fine'} + } + + if Config.EnableLicenses then + table.insert(elements, { label = _U('license_check'), value = 'license' }) + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = _U('citizen_interaction'), + align = 'top-left', + elements = elements + }, function(data2, menu2) + local player, distance = ESX.Game.GetClosestPlayer() + if distance ~= -1 and distance <= 3.0 then + local action = data2.current.value - if data.current.value == 'citizen_interaction' then - local elements = { - {label = _U('id_card'), value = 'identity_card'}, - {label = _U('search'), value = 'body_search'}, - {label = _U('handcuff'), value = 'handcuff'}, - {label = _U('drag'), value = 'drag'}, - {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, - {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, - {label = _U('fine'), value = 'fine'} - } - - if Config.EnableLicenses then - table.insert(elements, { label = _U('license_check'), value = 'license' }) - end - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { - title = _U('citizen_interaction'), - align = 'top-left', - elements = elements - }, - function(data2, menu2) + if action == 'identity_card' then + OpenIdentityCardMenu(player) + elseif action == 'body_search' then + OpenBodySearchMenu(player) + elseif action == 'handcuff' then + TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(player)) + elseif action == 'drag' then + TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(player)) + elseif action == 'put_in_vehicle' then + TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(player)) + elseif action == 'out_the_vehicle' then + TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(player)) + elseif action == 'fine' then + OpenFineMenu(player) + elseif action == 'license' then + ShowPlayerLicense(player) + end - local player, distance = ESX.Game.GetClosestPlayer() + else + ESX.ShowNotification(_U('no_players_nearby')) + end + end, function(data2, menu2) + menu2.close() + end) + elseif data.current.value == 'vehicle_interaction' then + local elements = {} + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) + + if DoesEntityExist(vehicle) then + table.insert(elements, {label = _U('vehicle_info'), value = 'vehicle_infos'}) + table.insert(elements, {label = _U('pick_lock'), value = 'hijack_vehicle'}) + table.insert(elements, {label = _U('impound'), value = 'impound'}) + end + + --table.insert(elements, {label = _U('search_database'), value = 'search_database'}) - if distance ~= -1 and distance <= 3.0 then - local action = data2.current.value + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'vehicle_interaction', + { + title = _U('vehicle_interaction'), + align = 'top-left', + elements = elements + }, function(data2, menu2) + coords = GetEntityCoords(playerPed) + vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) + action = data2.current.value + + if action == 'search_database' then + LookupVehicle() + elseif DoesEntityExist(vehicle) then + local vehicleData = ESX.Game.GetVehicleProperties(vehicle) + if action == 'vehicle_infos' then + OpenVehicleInfosMenu(vehicleData) + + elseif action == 'hijack_vehicle' then + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 3.0) then + TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_WELDING", 0, true) + Citizen.Wait(20000) + ClearPedTasksImmediately(playerPed) - if action == 'identity_card' then - OpenIdentityCardMenu(player) - elseif action == 'body_search' then - OpenBodySearchMenu(player) - elseif action == 'handcuff' then - TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(player)) - elseif action == 'drag' then - TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(player)) - elseif action == 'put_in_vehicle' then - TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(player)) - elseif action == 'out_the_vehicle' then - TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(player)) - elseif action == 'fine' then - OpenFineMenu(player) - elseif action == 'license' then - ShowPlayerLicense(player) - end + SetVehicleDoorsLocked(vehicle, 1) + SetVehicleDoorsLockedForAllPlayers(vehicle, false) + ESX.ShowNotification(_U('vehicle_unlocked')) + end + elseif action == 'impound' then + + -- is the script busy? + if CurrentTask.Busy then + return + end + + SetTextComponentFormat('STRING') + AddTextComponentString(_U('impound_prompt')) --press ~INPUT_CONTEXT~ to cancel the impound + DisplayHelpTextFromStringLabel(0, 0, 1, -1) + + TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) + + CurrentTask.Busy = true + CurrentTask.Task = ESX.SetTimeout(10000, function() + ClearPedTasks(playerPed) + ImpoundVehicle(vehicle) + Citizen.Wait(100) -- sleep the entire script to let stuff sink back to reality + end) + + -- keep track of that vehicle! + Citizen.CreateThread(function() + while CurrentTask.Busy do + Citizen.Wait(1000) + + vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) + if not DoesEntityExist(vehicle) and CurrentTask.Busy then + ESX.ShowNotification(_U('impound_canceled_moved')) + ESX.ClearTimeout(CurrentTask.Task) + ClearPedTasks(playerPed) + CurrentTask.Busy = false + break + end + end + end) + end + else + ESX.ShowNotification(_U('no_vehicles_nearby')) + end - else - ESX.ShowNotification(_U('no_players_nearby')) - end + end, function(data2, menu2) + menu2.close() + end + ) - end, - function(data2, menu2) - menu2.close() - end - ) + elseif data.current.value == 'object_spawner' then + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'citizen_interaction', + { + title = _U('traffic_interaction'), + align = 'top-left', + elements = { + {label = _U('cone'), value = 'prop_roadcone02a'}, + {label = _U('barrier'), value = 'prop_barrier_work06a'}, + {label = _U('spikestrips'), value = 'p_ld_stinger_s'}, + {label = _U('box'), value = 'prop_boxpile_07d'}, + {label = _U('cash'), value = 'hei_prop_cash_crate_half_full'} + } + }, function(data2, menu2) + local model = data2.current.value + local playerPed = GetPlayerPed(-1) + local coords = GetEntityCoords(playerPed) + local forward = GetEntityForwardVector(playerPed) + local x, y, z = table.unpack(coords + forward * 1.0) - end + if model == 'prop_roadcone02a' then + z = z - 2.0 + end - if data.current.value == 'vehicle_interaction' then + ESX.Game.SpawnObject(model, { + x = x, + y = y, + z = z + }, function(obj) + SetEntityHeading(obj, GetEntityHeading(playerPed)) + PlaceObjectOnGroundProperly(obj) + end) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_interaction', - { - title = _U('vehicle_interaction'), - align = 'top-left', - elements = { - {label = _U('vehicle_info'), value = 'vehicle_infos'}, - {label = _U('pick_lock'), value = 'hijack_vehicle'}, - }, - }, - function(data2, menu2) - - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) - local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) - - if DoesEntityExist(vehicle) then - - local vehicleData = ESX.Game.GetVehicleProperties(vehicle) - - if data2.current.value == 'vehicle_infos' then - OpenVehicleInfosMenu(vehicleData) - end - - if data2.current.value == 'hijack_vehicle' then - - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) - - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 3.0) then - - local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) - - if DoesEntityExist(vehicle) then - - Citizen.CreateThread(function() - - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_WELDING", 0, true) - - Wait(20000) - - ClearPedTasksImmediately(playerPed) - - SetVehicleDoorsLocked(vehicle, 1) - SetVehicleDoorsLockedForAllPlayers(vehicle, false) - - TriggerEvent('esx:showNotification', _U('vehicle_unlocked')) - - end) - - end - - end - - end - - else - ESX.ShowNotification(_U('no_vehicles_nearby')) - end - - end, - function(data2, menu2) - menu2.close() - end - ) - - end - - if data.current.value == 'object_spawner' then - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { - title = _U('traffic_interaction'), - align = 'top-left', - elements = { - {label = _U('cone'), value = 'prop_roadcone02a'}, - {label = _U('barrier'), value = 'prop_barrier_work06a'}, - {label = _U('spikestrips'), value = 'p_ld_stinger_s'}, - {label = _U('box'), value = 'prop_boxpile_07d'}, - {label = _U('cash'), value = 'hei_prop_cash_crate_half_full'} - }, - }, - function(data2, menu2) - - - local model = data2.current.value - local playerPed = GetPlayerPed(-1) - local coords = GetEntityCoords(playerPed) - local forward = GetEntityForwardVector(playerPed) - local x, y, z = table.unpack(coords + forward * 1.0) - - if model == 'prop_roadcone02a' then - z = z - 2.0 - end - - ESX.Game.SpawnObject(model, { - x = x, - y = y, - z = z - }, function(obj) - SetEntityHeading(obj, GetEntityHeading(playerPed)) - PlaceObjectOnGroundProperly(obj) - end) - - end, - function(data2, menu2) - menu2.close() - end - ) - - end - - end, - function(data, menu) - - menu.close() - - end - ) + end, function(data2, menu2) + menu2.close() + end) + end + end, function(data, menu) + menu.close() + end) end function OpenIdentityCardMenu(player) @@ -647,9 +642,9 @@ function OpenIdentityCardMenu(player) local idLabel = nil if data.job.grade_label ~= nil and data.job.grade_label ~= '' then - jobLabel = 'Job : ' .. data.job.label .. ' - ' .. data.job.grade_label + jobLabel = 'Job: ' .. data.job.label .. ' - ' .. data.job.grade_label else - jobLabel = 'Job : ' .. data.job.label + jobLabel = 'Job: ' .. data.job.label end if data.sex ~= nil then @@ -658,27 +653,27 @@ function OpenIdentityCardMenu(player) else sex = 'Female' end - sexLabel = 'Sex : ' .. sex + sexLabel = 'Sex: ' .. sex else - sexLabel = 'Sex : Unknown' + sexLabel = 'Sex: Unknown' end if data.dob ~= nil then - dobLabel = 'DOB : ' .. data.dob + dobLabel = 'DOB: ' .. data.dob else - dobLabel = 'DOB : Unknown' + dobLabel = 'DOB: Unknown' end if data.height ~= nil then - heightLabel = 'Height : ' .. data.height + heightLabel = 'Height: ' .. data.height else - heightLabel = 'Height : Unknown' + heightLabel = 'Height: Unknown' end if data.name ~= nil then - idLabel = 'ID : ' .. data.name + idLabel = 'ID: ' .. data.name else - idLabel = 'ID : Unknown' + idLabel = 'ID: Unknown' end local elements = { @@ -728,9 +723,9 @@ function OpenIdentityCardMenu(player) local jobLabel = nil if data.job.grade_label ~= nil and data.job.grade_label ~= '' then - jobLabel = 'Job : ' .. data.job.label .. ' - ' .. data.job.grade_label + jobLabel = 'Job: ' .. data.job.label .. ' - ' .. data.job.grade_label else - jobLabel = 'Job : ' .. data.job.label + jobLabel = 'Job: ' .. data.job.label end local elements = { @@ -925,6 +920,31 @@ function OpenFineCategoryMenu(player, category) end +function LookupVehicle() + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'lookup_vehicle', + { + title = _U('search_database_title'), + }, function (data, menu) + local length = string.len(data.value) + if data.value == nil or length < 8 or length > 13 then + ESX.ShowNotification(_U('search_database_error_invalid')) + else + ESX.TriggerServerCallback('esx_policejob:getVehicleFromPlate', function(owner, found) + if found then + ESX.ShowNotification(_U('search_database_found', owner)) + else + ESX.ShowNotification(_U('search_database_error_not_found')) + end + end, data.value) + menu.close() + end + end, function (data, menu) + menu.close() + end + ) +end + function ShowPlayerLicense(player) local elements = {} local targetName @@ -1134,7 +1154,6 @@ function OpenGetStocksMenu() ESX.TriggerServerCallback('esx_policejob:getStockItems', function(items) - print(json.encode(items)) local elements = {} @@ -1466,28 +1485,28 @@ end) RegisterNetEvent('esx_policejob:OutVehicle') AddEventHandler('esx_policejob:OutVehicle', function(t) - local ped = GetPlayerPed(t) - ClearPedTasksImmediately(ped) - plyPos = GetEntityCoords(GetPlayerPed(-1), true) - local xnew = plyPos.x+2 - local ynew = plyPos.y+2 + local ped = GetPlayerPed(t) + ClearPedTasksImmediately(ped) + plyPos = GetEntityCoords(GetPlayerPed(-1), true) + local xnew = plyPos.x+2 + local ynew = plyPos.y+2 - SetEntityCoords(GetPlayerPed(-1), xnew, ynew, plyPos.z) + SetEntityCoords(GetPlayerPed(-1), xnew, ynew, plyPos.z) end) -- Handcuff Citizen.CreateThread(function() - while true do - Wait(0) - if IsHandcuffed then - DisableControlAction(0, 142, true) -- MeleeAttackAlternate - DisableControlAction(0, 30, true) -- MoveLeftRight - DisableControlAction(0, 31, true) -- MoveUpDown - DisableControlAction(0, 24, true) -- Shoot - DisableControlAction(0, 92, true) -- Shoot in car - DisableControlAction(0, 75, true) -- Leave Vehicle - end - end + while true do + Citizen.Wait(10) + if IsHandcuffed then + DisableControlAction(0, 142, true) -- MeleeAttackAlternate + DisableControlAction(0, 30, true) -- MoveLeftRight + DisableControlAction(0, 31, true) -- MoveUpDown + DisableControlAction(0, 24, true) -- Shoot + DisableControlAction(0, 92, true) -- Shoot in car + DisableControlAction(0, 75, true) -- Leave Vehicle + end + end end) -- Create blips @@ -1753,88 +1772,69 @@ end) -- Key Controls Citizen.CreateThread(function() - while true do + while true do - Citizen.Wait(0) + Citizen.Wait(0) - if CurrentAction ~= nil then + if CurrentAction ~= nil then + SetTextComponentFormat('STRING') + AddTextComponentString(CurrentActionMsg) + DisplayHelpTextFromStringLabel(0, 0, 1, -1) - SetTextComponentFormat('STRING') - AddTextComponentString(CurrentActionMsg) - DisplayHelpTextFromStringLabel(0, 0, 1, -1) + if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' and (GetGameTimer() - GUI.Time) > 150 then - if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' and (GetGameTimer() - GUI.Time) > 150 then - - if CurrentAction == 'menu_cloakroom' then - OpenCloakroomMenu() - end - - if CurrentAction == 'menu_armory' then - OpenArmoryMenu(CurrentActionData.station) - end - - if CurrentAction == 'menu_vehicle_spawner' then - OpenVehicleSpawnerMenu(CurrentActionData.station, CurrentActionData.partNum) - end - - if CurrentAction == 'delete_vehicle' then - - if Config.EnableSocietyOwnedVehicles then - - local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) - TriggerServerEvent('esx_society:putVehicleInGarage', 'police', vehicleProps) - - else - - if - GetEntityModel(vehicle) == GetHashKey('police') or - GetEntityModel(vehicle) == GetHashKey('police2') or - GetEntityModel(vehicle) == GetHashKey('police3') or - GetEntityModel(vehicle) == GetHashKey('police4') or - GetEntityModel(vehicle) == GetHashKey('policeb') or - GetEntityModel(vehicle) == GetHashKey('policet') - then - TriggerServerEvent('esx_service:disableService', 'police') - end - - end - - ESX.Game.DeleteVehicle(CurrentActionData.vehicle) - end - - if CurrentAction == 'menu_boss_actions' then - - ESX.UI.Menu.CloseAll() - - TriggerEvent('esx_society:openBossMenu', 'police', function(data, menu) - - menu.close() - - CurrentAction = 'menu_boss_actions' - CurrentActionMsg = _U('open_bossmenu') - CurrentActionData = {} - - end) - - end - - if CurrentAction == 'remove_entity' then - DeleteEntity(CurrentActionData.entity) - end - - CurrentAction = nil - GUI.Time = GetGameTimer() - - end - - end - - if IsControlPressed(0, Keys['F6']) and not isDead and PlayerData.job ~= nil and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') and (GetGameTimer() - GUI.Time) > 150 then - OpenPoliceActionsMenu() - GUI.Time = GetGameTimer() - end - - end + if CurrentAction == 'menu_cloakroom' then + OpenCloakroomMenu() + elseif CurrentAction == 'menu_armory' then + OpenArmoryMenu(CurrentActionData.station) + elseif CurrentAction == 'menu_vehicle_spawner' then + OpenVehicleSpawnerMenu(CurrentActionData.station, CurrentActionData.partNum) + elseif CurrentAction == 'delete_vehicle' then + if Config.EnableSocietyOwnedVehicles then + local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) + TriggerServerEvent('esx_society:putVehicleInGarage', 'police', vehicleProps) + else + if GetEntityModel(vehicle) == GetHashKey('police') or + GetEntityModel(vehicle) == GetHashKey('police2') or + GetEntityModel(vehicle) == GetHashKey('police3') or + GetEntityModel(vehicle) == GetHashKey('police4') or + GetEntityModel(vehicle) == GetHashKey('policeb') or + GetEntityModel(vehicle) == GetHashKey('policet') + then + TriggerServerEvent('esx_service:disableService', 'police') + end + end + ESX.Game.DeleteVehicle(CurrentActionData.vehicle) + elseif CurrentAction == 'menu_boss_actions' then + ESX.UI.Menu.CloseAll() + TriggerEvent('esx_society:openBossMenu', 'police', function(data, menu) + menu.close() + CurrentAction = 'menu_boss_actions' + CurrentActionMsg = _U('open_bossmenu') + CurrentActionData = {} + end) + elseif CurrentAction == 'remove_entity' then + DeleteEntity(CurrentActionData.entity) + end + + CurrentAction = nil + GUI.Time = GetGameTimer() + end + end -- CurrentAction end + + if IsControlPressed(0, Keys['F6']) and not isDead and PlayerData.job ~= nil and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') and (GetGameTimer() - GUI.Time) > 150 then + OpenPoliceActionsMenu() + GUI.Time = GetGameTimer() + end + + if IsControlPressed(0, Keys['E']) and CurrentTask.Busy then + ESX.ShowNotification(_U('impound_canceled')) + ESX.ClearTimeout(CurrentTask.Task) + ClearPedTasks(GetPlayerPed(-1)) + + CurrentTask.Busy = false + end + end end) function createBlip(id) @@ -1892,4 +1892,14 @@ end) AddEventHandler('esx:onPlayerDeath', function() isDead = true -end) \ No newline at end of file +end) + +-- TODO +-- - return to garage if owned +-- - message owner that his vehicle has been impounded +function ImpoundVehicle(vehicle) + --local vehicleName = GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))) + ESX.Game.DeleteVehicle(vehicle) + ESX.ShowNotification(_U('impound_successful')) + CurrentTask.Busy = false +end \ No newline at end of file diff --git a/esx_policejob.sql b/esx_policejob.sql index 78fd3915..bac75ae4 100644 --- a/esx_policejob.sql +++ b/esx_policejob.sql @@ -16,20 +16,19 @@ INSERT INTO `jobs` (name, label) VALUES INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES ('police',0,'recruit','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',4,'officer','Officier',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), + ('police',4,'officer','Officier',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), ('police',1,'sergeant','Sergent',60,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), ('police',2,'lieutenant','Lieutenant',85,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), ('police',3,'boss','Commandant',100,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') ; CREATE TABLE `fine_types` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, - `id` int(11) NOT NULL AUTO_INCREMENT, - `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, - - PRIMARY KEY (`id`) + PRIMARY KEY (`id`) ); INSERT INTO `fine_types` (label, amount, category) VALUES diff --git a/locales/br.lua b/locales/br.lua index d7ce2f11..93333dfd 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -3,8 +3,15 @@ Locales['br'] = { ['cloakroom'] = 'Vestiário', ['citizen_wear'] = 'Roupa casual', ['police_wear'] = 'Uniforme da Polícia', + ['sheriff_wear'] = 'sheriff Outfit', + ['lieutenant_wear'] = 'Swatt outfit ', + ['gilet_wear'] = 'orange reflective jacket', + ['bullet_wear'] = 'bulletproof vest', + ['no_outfit'] = 'there\'s no uniform that fits you!', ['open_cloackroom'] = 'Pressione ~INPUT_CONTEXT~ para se trocar', -- Armory + ['remove_object'] = 'take object', + ['deposit_object'] = 'deposit object', ['get_weapon'] = 'Pegar arma', ['put_weapon'] = 'Entregar arma', ['buy_weapons'] = 'Comprar armas', @@ -24,14 +31,31 @@ Locales['br'] = { ['id_card'] = 'Carteira de identidade', ['search'] = 'Procurar', ['handcuff'] = 'Algemar / Soltar', + ['drag'] = 'drag', ['put_in_vehicle'] = 'Colocar no veículo', + ['out_the_vehicle'] = 'take out of vehicle', ['fine'] = 'Multa', + ['license_check'] = 'manage license', + ['license_revoke'] = 'revoke license', + ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', + ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', ['no_players_nearby'] = 'Nenhum jogador nas proximidades', - + -- Vehicle interaction ['vehicle_info'] = 'Informações', ['pick_lock'] = 'Trancar veículo', ['vehicle_unlocked'] = 'Veículo ~g~destravado~s~', ['no_vehicles_nearby'] = 'Nenhum veículo nas proximidades', + ['impound'] = 'impound vehicle', + ['impound_prompt'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~impound~s~', + ['impound_canceled'] = 'you canceled the impound', + ['impound_canceled_moved'] = 'the impound has been canceled because the vehicle moved', + ['impound_successful'] = 'you have impounded the vehicle', + ['search_database'] = 'vehicle information', + ['search_database_title'] = 'vehicle information - search with registration number', + ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', + ['search_database_error_not_found'] = 'that ~y~registration number~s~ is ~r~not~s~ registered to an vehicle!', + ['search_database_found'] = 'the vehicle is ~y~registered~s~ to ~b~%s~s~', + -- Traffic interaction ['traffic_interaction'] = 'Interagir com as rodovias', ['cone'] = 'Cones', ['barrier'] = 'Barreira', @@ -81,11 +105,4 @@ Locales['br'] = { ['you_have_confweapon'] = 'Você confiscou ~y~x1 ', ['confweapon'] = '~s~ confiscado de você ~y~x1 ', ['alert_police'] = 'Alerta da Polícia', - -- Authorized Vehicles - ['police'] = 'Viatura - Blazer', - ['police2'] = 'Viatura - Parati', - ['police3'] = 'viatura - Fluence', - ['police4'] = 'Viatura - Blazer cinza', - ['policeb'] = 'Moto da Polícia', - ['policet'] = 'Van de Transporte', } diff --git a/locales/de.lua b/locales/de.lua index 1221e268..0cfd0ef2 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -3,8 +3,15 @@ Locales['de'] = { ['cloakroom'] = 'Garderobe', ['citizen_wear'] = 'Zivilkleidung', ['police_wear'] = 'Arbeitskleidung', + ['sheriff_wear'] = 'sheriff Outfit', + ['lieutenant_wear'] = 'Swatt outfit ', + ['gilet_wear'] = 'orange reflective jacket', + ['bullet_wear'] = 'bulletproof vest', + ['no_outfit'] = 'there\'s no uniform that fits you!', ['open_cloackroom'] = 'Drücke ~INPUT_CONTEXT~ um dich umzuziehen', -- Armory + ['remove_object'] = 'take object', + ['deposit_object'] = 'deposit object', ['get_weapon'] = 'Waffen holen', ['put_weapon'] = 'Waffen bringen', ['buy_weapons'] = 'Waffen kaufen', @@ -24,14 +31,31 @@ Locales['de'] = { ['id_card'] = 'ID Karte', ['search'] = 'Suche', ['handcuff'] = 'Festnehmen / Freilassen', + ['drag'] = 'drag', ['put_in_vehicle'] = 'In Fahrzeug setzen', + ['out_the_vehicle'] = 'take out of vehicle', ['fine'] = 'Strafe', + ['license_check'] = 'manage license', + ['license_revoke'] = 'revoke license', + ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', + ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', ['no_players_nearby'] = 'Keine Spieler in der Nähe', - + -- Vehicle interaction ['vehicle_info'] = 'Fahrzeug Info', ['pick_lock'] = 'Fahrzeug öffnen', ['vehicle_unlocked'] = 'Fahrzeug ~g~offen~s~', ['no_vehicles_nearby'] = 'Keine Fahrzeuge in der Nähe', + ['impound'] = 'impound vehicle', + ['impound_prompt'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~impound~s~', + ['impound_canceled'] = 'you canceled the impound', + ['impound_canceled_moved'] = 'the impound has been canceled because the vehicle moved', + ['impound_successful'] = 'you have impounded the vehicle', + ['search_database'] = 'vehicle information', + ['search_database_title'] = 'vehicle information - search with registration number', + ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', + ['search_database_error_not_found'] = 'that ~y~registration number~s~ is ~r~not~s~ registered to an vehicle!', + ['search_database_found'] = 'the vehicle is ~y~registered~s~ to ~b~%s~s~', + -- Traffic interaction ['traffic_interaction'] = 'Straßeninteraktionen', ['cone'] = 'Hütchen', ['barrier'] = 'Barriere', @@ -81,11 +105,4 @@ Locales['de'] = { ['you_have_confweapon'] = 'du hast ~y~x1 konfesziert', ['confweapon'] = '~s~ hat von dir ~y~x1 konfesziert', ['alert_police'] = 'Polizei alamieren', - -- Authorized Vehicles - ['police'] = 'Streifenfahrzeug 1', - ['police2'] = 'Streifenfahrzeug 2', - ['police3'] = 'Streifenfahrzeug 3', - ['police4'] = 'Zivilfahrzeug', - ['policeb'] = 'Motorrad', - ['policet'] = 'Transporter', } diff --git a/locales/en.lua b/locales/en.lua index da052941..d8cd8bd3 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -5,9 +5,6 @@ Locales['en'] = { ['police_wear'] = 'police Outfit', ['sheriff_wear'] = 'sheriff Outfit', ['lieutenant_wear'] = 'Swatt outfit ', - ['commandant_wear'] = 'Fbi outfit', - ['statepd_wear'] = 'State Police outfit', - ['specops_wear'] = 'Spec OPS outfit', ['gilet_wear'] = 'orange reflective jacket', ['bullet_wear'] = 'bulletproof vest', ['no_outfit'] = 'there\'s no uniform that fits you!', @@ -36,19 +33,30 @@ Locales['en'] = { ['handcuff'] = 'cuff / Uncuff', ['drag'] = 'drag', ['put_in_vehicle'] = 'put in Vehicle', - ['out_the_vehicle'] = 'take out of vehicle', + ['out_the_vehicle'] = 'drag out from vehicle', ['fine'] = 'fine', ['license_check'] = 'manage license', ['license_revoke'] = 'revoke license', ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', ['no_players_nearby'] = 'no players nearby', - + -- Vehicle interaction ['vehicle_info'] = 'vehicle Info', ['pick_lock'] = 'lockpick Vehicle', ['vehicle_unlocked'] = 'vehicle ~g~Unlocked~s~', - ['no_vehicles_nearby'] = 'no vehicles nearby', - ['traffic_interaction'] = 'Interaction Voirie', + ['no_vehicles_nearby'] = 'there is no vehicles nearby', + ['impound'] = 'impound vehicle', + ['impound_prompt'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~impound~s~', + ['impound_canceled'] = 'you canceled the impound', + ['impound_canceled_moved'] = 'the impound has been canceled because the vehicle moved', + ['impound_successful'] = 'you have impounded the vehicle', + ['search_database'] = 'vehicle information', + ['search_database_title'] = 'vehicle information - search with registration number', + ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', + ['search_database_error_not_found'] = 'that ~y~registration number~s~ is ~r~not~s~ registered to an vehicle!', + ['search_database_found'] = 'the vehicle is ~y~registered~s~ to ~b~%s~s~', + -- Traffic interaction + ['traffic_interaction'] = 'Interaction Traffic', ['cone'] = 'cone', ['barrier'] = 'barrier', ['spikestrips'] = 'spikestrips', @@ -86,7 +94,9 @@ Locales['en'] = { ['amount_of_deposit'] = 'amount of Deposit', ['open_bossmenu'] = 'press ~INPUT_CONTEXT~ to open the menu', ['quantity_invalid'] = 'invalid quantity', - ['have_withdraw'] = 'you have withdrawn x', + ['have_withdrawn'] = 'you have withdrawn x', + ['not_enough_in_society'] = 'there\'s not enough of ~r~that item~w~ in the society!', + ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', ['added'] = 'you added x', ['quantity'] = 'quantity', ['inventory'] = 'inventory', @@ -103,11 +113,4 @@ Locales['en'] = { ['you_have_confweapon'] = 'you have confiscated ~y~x1 ', ['confweapon'] = '~s~ confiscated from you ~y~x1 ', ['alert_police'] = 'alert police', - -- Authorized Vehicles - ['police'] = 'patrol Vehicle 1', - ['police2'] = 'patrol Vehicle 2', - ['police3'] = 'patrol Vehicle 3', - ['police4'] = 'unmarked Vehicle', - ['policeb'] = 'motorcycle', - ['policet'] = 'transport Van', } diff --git a/locales/es.lua b/locales/es.lua index bcee45d6..4aada580 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -5,11 +5,13 @@ Locales['es'] = { ['police_wear'] = 'Ropa CNP', ['sheriff_wear'] = 'Ropa Oficial', ['lieutenant_wear'] = 'Ropa Teniente', - ['commandant_wear'] = 'Ropa Secreta', - ['statepd_wear'] = 'Ropa Guardia Civil', - ['specops_wear'] = 'Ropa GEO', + ['gilet_wear'] = 'orange reflective jacket', + ['bullet_wear'] = 'bulletproof vest', + ['no_outfit'] = 'there\'s no uniform that fits you!', ['open_cloackroom'] = 'Presionar ~INPUT_CONTEXT~ para abrir la taquilla', -- Armory + ['remove_object'] = 'take object', + ['deposit_object'] = 'deposit object', ['get_weapon'] = 'Coger arma', ['put_weapon'] = 'Depositar arma', ['buy_weapons'] = 'Comprar armas', @@ -33,12 +35,27 @@ Locales['es'] = { ['put_in_vehicle'] = 'Meter en el vehículo', ['out_the_vehicle'] = 'Sacar del vehículo', ['fine'] = 'Multa', + ['license_check'] = 'manage license', + ['license_revoke'] = 'revoke license', + ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', + ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', ['no_players_nearby'] = 'No hay jugadores cerca', - + -- Vehicle interaction ['vehicle_info'] = 'Información del vehículo', ['pick_lock'] = 'Forzar coche', ['vehicle_unlocked'] = 'Vehículo desbloqueado~s~', ['no_vehicles_nearby'] = 'No hay vehículos cerca', + ['impound'] = 'impound vehicle', + ['impound_prompt'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~impound~s~', + ['impound_canceled'] = 'you canceled the impound', + ['impound_canceled_moved'] = 'the impound has been canceled because the vehicle moved', + ['impound_successful'] = 'you have impounded the vehicle', + ['search_database'] = 'vehicle information', + ['search_database_title'] = 'vehicle information - search with registration number', + ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', + ['search_database_error_not_found'] = 'that ~y~registration number~s~ is ~r~not~s~ registered to an vehicle!', + ['search_database_found'] = 'the vehicle is ~y~registered~s~ to ~b~%s~s~', + -- Traffic interaction ['traffic_interaction'] = 'Rutas de interacción', ['cone'] = 'Cono', ['barrier'] = 'Barrera', @@ -94,14 +111,4 @@ Locales['es'] = { ['you_have_confweapon'] = 'Has confiscado ~y~x1 ', ['confweapon'] = '~s~ Te han confiscado ~y~x1 ', ['alert_police'] = 'Alerta policia', - -- Authorized Vehicles - ['policebike'] = 'Bicicleta Policía', - ['focuscnp'] = 'Vehículo patrulla 1', - ['tiguancnp'] = 'Vehículo patrulla 2', - ['police3'] = 'Vehículo patrulla 3', - ['police4'] = 'Vehículo Secreta', - ['policeb'] = 'Moto', - ['policet'] = 'Furgón policial', - ['polmav'] = 'Helicóptero de la policía', - ['buzzard2'] = 'Helicóptero de mando', } diff --git a/locales/fr.lua b/locales/fr.lua index f941997a..34447920 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -4,10 +4,7 @@ Locales['fr'] = { ['citizen_wear'] = 'tenue Civil', ['police_wear'] = 'tenue Policier', ['sheriff_wear'] = 'sheriff Outfit', - ['lieutenant_wear'] = 'Swatt outfit ', - ['commandant_wear'] = 'Fbi outfit', - ['statepd_wear'] = 'State Police outfit', - ['specops_wear'] = 'Spec OPS outfit', + ['lieutenant_wear'] = 'Swatt outfit', ['gilet_wear'] = 'Gilet orange', ['bullet_wear'] = 'Gilet pare-balles', ['no_outfit'] = 'Il n\'y a pas d\'uniforme à votre taille...', @@ -43,11 +40,22 @@ Locales['fr'] = { ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', ['no_players_nearby'] = 'aucun joueur à proximité', - + -- Vehicle interaction ['vehicle_info'] = 'infos véhicule', ['pick_lock'] = 'crocheter véhicule', ['vehicle_unlocked'] = 'véhicule ~g~déverouillé~s~', ['no_vehicles_nearby'] = 'aucun véhicule à proximité', + ['impound'] = 'impound vehicle', + ['impound_prompt'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~impound~s~', + ['impound_canceled'] = 'you canceled the impound', + ['impound_canceled_moved'] = 'the impound has been canceled because the vehicle moved', + ['impound_successful'] = 'you have impounded the vehicle', + ['search_database'] = 'vehicle information', + ['search_database_title'] = 'vehicle information - search with registration number', + ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', + ['search_database_error_not_found'] = 'that ~y~registration number~s~ is ~r~not~s~ registered to an vehicle!', + ['search_database_found'] = 'the vehicle is ~y~registered~s~ to ~b~%s~s~', + -- Traffic interaction ['traffic_interaction'] = 'interaction routière', ['cone'] = 'plot', ['barrier'] = 'barrière', @@ -103,11 +111,4 @@ Locales['fr'] = { ['you_have_confweapon'] = 'vous avez confisqué ~y~x1 ', ['confweapon'] = '~s~ vous a confisqué ~y~x1 ', ['alert_police'] = 'alerte police', - -- Authorized Vehicles - ['police'] = 'véhicule de patrouille 1', - ['police2'] = 'véhicule de patrouille 2', - ['police3'] = 'véhicule de patrouille 3', - ['police4'] = 'véhicule civil', - ['policeb'] = 'moto', - ['policet'] = 'van de transport', } diff --git a/locales/sv.lua b/locales/sv.lua index 9529d362..35279762 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -8,7 +8,7 @@ Locales['sv'] = { ['gilet_wear'] = 'Reflektiv väst', ['bullet_wear'] = 'Skottsäker väst', ['no_outfit'] = 'Du har ingen uniform!', - ['open_cloackroom'] = 'Tryck ~INPUT_CONTEXT~ för att byta ~y~kläder~s~.', + ['open_cloackroom'] = 'tryck ~INPUT_CONTEXT~ för att byta ~y~kläder~s~.', -- Armory ['remove_object'] = 'Ta ut objekt', ['deposit_object'] = 'Lägg in objekt', @@ -22,35 +22,49 @@ Locales['sv'] = { ['vehicle_out'] = 'Det finns redan en bil ute!', ['vehicle_spawner'] = 'Tryck ~INPUT_CONTEXT~ för att ta ut en bil', ['store_vehicle'] = 'Tryck ~INPUT_CONTEXT~ för att parkera bilen', + ['service_max'] = 'Max officers in service: ', -- Action Menu ['citizen_interaction'] = 'Handlingar mot civila', ['vehicle_interaction'] = 'Handlingar på bilar', ['object_spawner'] = 'ta fram ett objekt', ['id_card'] = 'ID-Kort', - ['search'] = 'Sök igenom', - ['handcuff'] = 'Sätt på handfängel / Ta av handfängsel', - ['drag'] = 'Dra', - ['put_in_vehicle'] = 'Sätt in i fordon', - ['out_the_vehicle'] = 'Ta ut ur fordon', + ['search'] = 'sök igenom', + ['handcuff'] = 'handbojor', + ['drag'] = 'dra', + ['put_in_vehicle'] = 'sätt in i fordon', + ['out_the_vehicle'] = 'dra ut ur fordon', ['fine'] = 'Ge böter', - ['license_check'] = 'Kolla körkort', - ['license_revoke'] = 'Neka körkort', - ['license_revoked'] = 'Ditt ~b~%s~s~ har blivit ~y~nekat~s~!', - ['licence_you_revoked'] = 'Du nekade ett ~b~%s~s~ som tillhörde ~y~%s~s~', - ['no_players_nearby'] = 'Ingen i närheten', - - ['vehicle_info'] = 'Fordons information', - ['pick_lock'] = 'Bryt upp fordon', - ['vehicle_unlocked'] = 'Fordon ~g~Upplåst~s~', - ['no_vehicles_nearby'] = 'Inga fordon i närheten', - ['traffic_interaction'] = 'Trafik handlingar', + ['license_check'] = 'se licenser', + ['license_revoke'] = 'återkalla licenser', + ['license_revoked'] = 'Ditt ~b~%s~s~ har blivit ~y~återkallat~s~!', + ['licence_you_revoked'] = 'du återkallade ett ~b~%s~s~ som tillhörde ~y~%s~s~', + ['no_players_nearby'] = 'det finns ingen i närheten', + -- Vehicle interaction + ['vehicle_info'] = 'fordon', + ['pick_lock'] = 'bryt upp fordon', + ['vehicle_unlocked'] = 'fordonet har ~g~låsts upp~s~', + ['no_vehicles_nearby'] = 'inga fordon i närheten', + ['impound'] = 'bärga fordonet', + ['impound_prompt'] = 'tryck ~INPUT_CONTEXT~ för att avbryta ~y~bärgningen~s~', + ['impound_canceled'] = 'du avbröt bärgningen', + ['impound_canceled_moved'] = 'bärgningen avbröts på grund av att fordonet har rört sig', + ['impound_successful'] = 'du har bärgat fordonet', + ['search_database'] = 'fordonsuppgifter', + ['search_database_title'] = 'fordonsuppgifter - sök med registreringsnummer', + ['search_database_error_invalid'] = 'det är ~r~inte~s~ ett ~y~giltigt~s~ registreringsnummer', + ['search_database_error_not_found'] = 'det ~y~registreringsnummeret~s~ är ~r~inte~s~ registrerat till något fordon!', + ['search_database_found'] = 'detta fordon är ~y~registrerat~s~ till ~b~%s~s~', + -- Traffic interaction + ['traffic_interaction'] = 'trafiksåtgärder', ['cone'] = 'Kon', ['barrier'] = 'Barriär', ['spikestrips'] = 'Spikmatta', + ['box'] = 'låda', + ['cash'] = 'låda med pengar', -- ID Card Menu ['name'] =' Namn: ', - ['bac'] = 'Procent alkohol i blodet : ', + ['bac'] = 'Procent alkohol i blodet: ', -- Body Search Menu ['confiscate_dirty'] = 'Konfiskera svarta pengar: $', ['guns_label'] = '--- Guns ---', @@ -97,11 +111,4 @@ Locales['sv'] = { ['you_have_confweapon'] = 'Du har konfiskerat ~y~x1 ', ['confweapon'] = '~s~ konfiskerade ~y~x1 ', ['alert_police'] = 'Meddela polisen', - -- Authorized Vehicles - ['police'] = 'Polisbil', - ['police2'] = 'Polisbil 2', - ['police3'] = 'Polisbil 3', - ['police4'] = 'Civil polisbil', - ['policeb'] = 'Polis motorcykel', - ['policet'] = 'Transport bil', } diff --git a/server/main.lua b/server/main.lua index 1cc0be92..0f0928cd 100644 --- a/server/main.lua +++ b/server/main.lua @@ -332,6 +332,23 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, end) +ESX.RegisterServerCallback('esx_policejob:getVehicleFromPlate', function(source, cb, plate) + MySQL.Async.fetchAll( + 'SELECT * FROM owned_vehicles WHERE plate = @plate', + { + ['@plate'] = plate + }, + function(result) + if result[1] ~= nil then + local playerName = ESX.GetPlayerFromIdentifier(result[1].owner).name + cb(playerName, true) + else + cb('unknown', false) + end + end + ) +end) + ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb) TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) From f0d563ae1ad11abeee9a30b7fbdb467b872e5af4 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 16 May 2018 20:49:38 +0200 Subject: [PATCH 118/253] Fixed exploits / possible dupes confiscating, fixes #64 --- server/main.lua | 67 +++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/server/main.lua b/server/main.lua index 0f0928cd..9a506265 100644 --- a/server/main.lua +++ b/server/main.lua @@ -17,47 +17,44 @@ end) RegisterServerEvent('esx_policejob:confiscatePlayerItem') AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, itemName, amount) + local _source = source + local sourceXPlayer = ESX.GetPlayerFromId(_source) + local targetXPlayer = ESX.GetPlayerFromId(target) - local sourceXPlayer = ESX.GetPlayerFromId(source) - local targetXPlayer = ESX.GetPlayerFromId(target) + if itemType == 'item_standard' then + local targetItem = targetXPlayer.getInventoryItem(itemName) + local sourceItem = sourceXPlayer.getInventoryItem(itemName) - if itemType == 'item_standard' then + -- does the target player have enough in their inventory? + if targetItem.count > 0 and targetItem.count <= amount then + + -- can the player carry the said amount of x item? + if sourceItem.limit ~= -1 and (sourceItem.count + amount) > sourceItem.limit then + TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + else + targetXPlayer.removeInventoryItem(itemName, amount) + sourceXPlayer.addInventoryItem(itemName, amount) + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confinv') .. amount .. ' ' .. sourceItem.label .. _U('from') .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confinv') .. amount .. ' ' .. sourceItem.label) + end + else + TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + end - local label = sourceXPlayer.getInventoryItem(itemName).label - local playerItemCount = targetXPlayer.getInventoryItem(itemName).count + elseif itemType == 'item_account' then + targetXPlayer.removeAccountMoney(itemName, amount) + sourceXPlayer.addAccountMoney(itemName, amount) - if playerItemCount <= amount then - targetXPlayer.removeInventoryItem(itemName, amount) - sourceXPlayer.addInventoryItem(itemName, amount) - else - TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) - end + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confdm') .. amount .. _U('from') .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confdm') .. amount) - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confinv') .. amount .. ' ' .. label .. _U('from') .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confinv') .. amount .. ' ' .. label ) - - end - - if itemType == 'item_account' then - - targetXPlayer.removeAccountMoney(itemName, amount) - sourceXPlayer.addAccountMoney(itemName, amount) - - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confdm') .. amount .. _U('from') .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confdm') .. amount) - - end - - if itemType == 'item_weapon' then - - targetXPlayer.removeWeapon(itemName) - sourceXPlayer.addWeapon(itemName, amount) - - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confweapon') .. ESX.GetWeaponLabel(itemName) .. _U('from') .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confweapon') .. ESX.GetWeaponLabel(itemName)) - - end + elseif itemType == 'item_weapon' then + targetXPlayer.removeWeapon(itemName) + sourceXPlayer.addWeapon(itemName, amount) + TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confweapon') .. ESX.GetWeaponLabel(itemName) .. _U('from') .. targetXPlayer.name) + TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confweapon') .. ESX.GetWeaponLabel(itemName)) + end end) RegisterServerEvent('esx_policejob:handcuff') From a81866bce826438a6ef747a2dc01ed82404a5c77 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 19 May 2018 09:58:42 +0200 Subject: [PATCH 119/253] Moved authorized vehicles to config --- client/main.lua | 79 ++---- config.lua | 429 ++++++++++++++++-------------- esx_policejob.sql | 14 +- localization/de_config.lua | 85 ------ localization/de_esx_policejob.sql | 27 +- localization/en_config.lua | 266 ------------------ localization/en_esx_policejob.sql | 88 ++++++ localization/esx_policejob_en.sql | 87 ------ localization/sv_esx_policejob.sql | 10 +- 9 files changed, 369 insertions(+), 716 deletions(-) delete mode 100644 localization/de_config.lua delete mode 100644 localization/en_config.lua create mode 100644 localization/en_esx_policejob.sql delete mode 100644 localization/esx_policejob_en.sql diff --git a/client/main.lua b/client/main.lua index f0117a49..79743614 100644 --- a/client/main.lua +++ b/client/main.lua @@ -36,7 +36,7 @@ Citizen.CreateThread(function() TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) Citizen.Wait(0) end - + Citizen.Wait(5000) PlayerData = ESX.GetPlayerData() end) @@ -49,7 +49,7 @@ function SetVehicleMaxMods(vehicle) modSuspension = 3, modTurbo = true, } - + ESX.Game.SetVehicleProperties(vehicle, props) end @@ -294,7 +294,7 @@ function OpenVehicleSpawnerMenu(station, partNum) ESX.Game.SpawnVehicle(vehicleProps.model, vehicles[partNum].SpawnPoint, 270.0, function(vehicle) ESX.Game.SetVehicleProperties(vehicle, vehicleProps) local playerPed = GetPlayerPed(-1) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) end) TriggerServerEvent('esx_society:removeVehicleFromGarage', 'police', vehicleProps) @@ -315,51 +315,12 @@ function OpenVehicleSpawnerMenu(station, partNum) else - local elements = {} - - table.insert(elements, { label = 'Vélo', value = 'fixter' }) - table.insert(elements, { label = 'Cruiser', value = 'police' }) - table.insert(elements, { label = 'Sheriff Cruiser', value = 'sheriff' }) - - if PlayerData.job.grade_name == 'officer' then - table.insert(elements, { label = 'Interceptor', value = 'police3'}) + local elements = Config.AuthorizedVehicles.Shared + local authorizedVehicles = Config.AuthorizedVehicles[PlayerData.job.grade_name] + + for i=1, #authorizedVehicles, 1 do + table.insert(elements, { label = authorizedVehicles[i].label, model = authorizedVehicles[i].model}) end - - if PlayerData.job.grade_name == 'sergeant' then - table.insert(elements, { label = 'Sheriff SUV', value = 'sheriff2'}) - table.insert(elements, { label = 'Interceptor', value = 'police3'}) - table.insert(elements, { label = 'Buffalo', value = 'police2'}) - table.insert(elements, { label = 'Moto', value = 'policeb'}) - table.insert(elements, { label = 'Bus pénitentiaire', value = 'pbus'}) - table.insert(elements, { label = 'Bus de transport', value = 'policet'}) - table.insert(elements, { label = 'Antiémeute', value = 'riot'}) - end - - if PlayerData.job.grade_name == 'lieutenant' then - table.insert(elements, { label = 'Sheriff SUV', value = 'sheriff2'}) - table.insert(elements, { label = 'Interceptor', value = 'police3'}) - table.insert(elements, { label = 'Buffalo', value = 'police2'}) - table.insert(elements, { label = 'Moto', value = 'policeb'}) - table.insert(elements, { label = 'Bus pénitentiaire', value = 'pbus'}) - table.insert(elements, { label = 'Bus de transport', value = 'policet'}) - table.insert(elements, { label = 'Antiémeute', value = 'riot'}) - table.insert(elements, { label = 'FBI', value = 'fbi'}) - table.insert(elements, { label = 'FBI SUV', value = 'fbi2'}) - end - - if PlayerData.job.grade_name == 'boss' then - table.insert(elements, { label = 'Sheriff SUV', value = 'sheriff2'}) - table.insert(elements, { label = 'Interceptor', value = 'police3'}) - table.insert(elements, { label = 'Buffalo', value = 'police2'}) - table.insert(elements, { label = 'Moto', value = 'policeb'}) - table.insert(elements, { label = 'Bus pénitentiaire', value = 'pbus'}) - table.insert(elements, { label = 'Bus de transport', value = 'policet'}) - table.insert(elements, { label = 'Antiémeute', value = 'riot'}) - table.insert(elements, { label = 'FBI', value = 'fbi'}) - table.insert(elements, { label = 'FBI SUV', value = 'fbi2'}) - table.insert(elements, { label = 'Voiture Banalisée ', value = 'police4'}) - end - ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'vehicle_spawner', { @@ -371,7 +332,7 @@ function OpenVehicleSpawnerMenu(station, partNum) menu.close() - local model = data.current.value + local model = data.current.model local vehicle = GetClosestVehicle(vehicles[partNum].SpawnPoint.x, vehicles[partNum].SpawnPoint.y, vehicles[partNum].SpawnPoint.z, 3.0, 0, 71) @@ -470,26 +431,26 @@ function OpenPoliceActionsMenu() align = 'top-left', elements = elements }, function(data2, menu2) - local player, distance = ESX.Game.GetClosestPlayer() - if distance ~= -1 and distance <= 3.0 then + local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() + if closestPlayer ~= -1 and closestDistance <= 3.0 then local action = data2.current.value if action == 'identity_card' then - OpenIdentityCardMenu(player) + OpenIdentityCardMenu(closestPlayer) elseif action == 'body_search' then - OpenBodySearchMenu(player) + OpenBodySearchMenu(closestPlayer) elseif action == 'handcuff' then - TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(player)) + TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(closestPlayer)) elseif action == 'drag' then - TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(player)) + TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(closestPlayer)) elseif action == 'put_in_vehicle' then - TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(player)) + TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(closestPlayer)) elseif action == 'out_the_vehicle' then - TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(player)) + TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(closestPlayer)) elseif action == 'fine' then - OpenFineMenu(player) + OpenFineMenu(closestPlayer) elseif action == 'license' then - ShowPlayerLicense(player) + ShowPlayerLicense(closestPlayer) end else @@ -548,7 +509,7 @@ function OpenPoliceActionsMenu() end SetTextComponentFormat('STRING') - AddTextComponentString(_U('impound_prompt')) --press ~INPUT_CONTEXT~ to cancel the impound + AddTextComponentString(_U('impound_prompt')) DisplayHelpTextFromStringLabel(0, 0, 1, -1) TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) diff --git a/config.lua b/config.lua index 80058ea3..4c03be7e 100644 --- a/config.lua +++ b/config.lua @@ -14,216 +14,257 @@ Config.Locale = 'fr' Config.PoliceStations = { - LSPD = { + LSPD = { - Blip = { - Pos = { x = 425.130, y = -979.558, z = 30.711 }, - Sprite = 60, - Display = 4, - Scale = 1.2, - Colour = 29, - }, + Blip = { + Pos = { x = 425.130, y = -979.558, z = 30.711 }, + Sprite = 60, + Display = 4, + Scale = 1.2, + Colour = 29, + }, + -- https://wiki.fivem.net/wiki/Weapons + AuthorizedWeapons = { + { name = 'WEAPON_NIGHTSTICK', price = 200 }, + { name = 'WEAPON_COMBATPISTOL', price = 300 }, + { name = 'WEAPON_ASSAULTSMG', price = 1250 }, + { name = 'WEAPON_ASSAULTRIFLE', price = 1500 }, + { name = 'WEAPON_PUMPSHOTGUN', price = 600 }, + { name = 'WEAPON_STUNGUN', price = 500 }, + { name = 'WEAPON_FLASHLIGHT', price = 80 }, + { name = 'WEAPON_FIREEXTINGUISHER', price = 120 }, + { name = 'WEAPON_FLAREGUN', price = 60 }, + { name = 'WEAPON_STICKYBOMB', price = 250 }, + { name = 'GADGET_PARACHUTE', price = 300 }, + }, - AuthorizedWeapons = { - { name = 'WEAPON_NIGHTSTICK', price = 200 }, - { name = 'WEAPON_COMBATPISTOL', price = 300 }, - { name = 'WEAPON_ASSAULTSMG', price = 1250 }, - { name = 'WEAPON_ASSAULTRIFLE', price = 1500 }, - { name = 'WEAPON_PUMPSHOTGUN', price = 600 }, - { name = 'WEAPON_STUNGUN', price = 500 }, - { name = 'WEAPON_FLASHLIGHT', price = 80 }, - { name = 'WEAPON_FIREEXTINGUISHER', price = 120 }, - { name = 'WEAPON_FLAREGUN', price = 60 }, - { name = 'WEAPON_STICKYBOMB', price = 250 }, - { name = 'GADGET_PARACHUTE', price = 300 }, - }, + Cloakrooms = { + { x = 452.600, y = -993.306, z = 29.750 }, + }, - AuthorizedVehicles = { - { name = 'police', label = 'Véhicule de patrouille 1' }, - { name = 'police2', label = 'Véhicule de patrouille 2' }, - { name = 'police3', label = 'Véhicule de patrouille 3' }, - { name = 'police4', label = 'Véhicule civil' }, - { name = 'policeb', label = 'Moto' }, - { name = 'policet', label = 'Van de transport' }, - }, + Armories = { + { x = 451.699, y = -980.356, z = 29.689 }, + }, - Cloakrooms = { - { x = 452.600, y = -993.306, z = 29.750 }, - }, + Vehicles = { + { + Spawner = { x = 454.69, y = -1017.4, z = 27.430 }, + SpawnPoint = { x = 438.42, y = -1018.3, z = 27.757 }, + Heading = 90.0, + } + }, - Armories = { - { x = 451.699, y = -980.356, z = 29.689 }, - }, + Helicopters = { + { + Spawner = { x = 466.477, y = -982.819, z = 42.691 }, + SpawnPoint = { x = 450.04, y = -981.14, z = 42.691 }, + Heading = 0.0, + } + }, - Vehicles = { - { - Spawner = { x = 454.69, y = -1017.4, z = 27.430 }, - SpawnPoint = { x = 438.42, y = -1018.3, z = 27.757 }, - Heading = 90.0, - } - }, + VehicleDeleters = { + { x = 462.74, y = -1014.4, z = 27.065 }, + { x = 462.40, y = -1019.7, z = 27.104 }, + }, - Helicopters = { - { - Spawner = { x = 466.477, y = -982.819, z = 42.691 }, - SpawnPoint = { x = 450.04, y = -981.14, z = 42.691 }, - Heading = 0.0, - } - }, + BossActions = { + { x = 448.417, y = -973.208, z = 29.689 } + }, - VehicleDeleters = { - { x = 462.74, y = -1014.4, z = 27.065 }, - { x = 462.40, y = -1019.7, z = 27.104 }, - }, + }, - BossActions = { - { x = 448.417, y = -973.208, z = 29.689 } - }, +} - }, +-- https://wiki.fivem.net/wiki/Vehicles +Config.AuthorizedVehicles = { + Shared = { + { + model = 'police', + label = 'Police Cruiser' + }, + { + model = 'pbus', + label = 'Police Prison Bus' + } + }, + recruit = { + + }, + + officer = { + { + model = 'police3', + label = 'Police Interceptor' + } + }, + + sergeant = { + { + model = 'policet', + label = 'Police Transporter' + }, + { + model = 'policeb', + label = 'Police Bike' + } + }, + + lieutenant = { + { + model = 'riot', + label = 'Police Riot' + }, + { + model = 'fbi2', + label = 'FIB SUV' + } + }, + + boss = { + + } } -- CHECK SKINCHANGER CLIENT MAIN.LUA for matching elements Config.Uniforms = { - - cadet_wear = { - male = { - ['tshirt_1'] = 59, ['tshirt_2'] = 1, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = 46, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - }, - female = { - ['tshirt_1'] = 36, ['tshirt_2'] = 1, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = 45, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - }, - police_wear = { - male = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - }, - female = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - }, - sergeant_wear = { - male = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 8, ['decals_2'] = 1, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - }, - female = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 7, ['decals_2'] = 1, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - }, - lieutenant_wear = { - male = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 8, ['decals_2'] = 2, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - }, - female = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 7, ['decals_2'] = 2, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - }, - commandant_wear = { - male = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 8, ['decals_2'] = 3, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - }, - female = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 7, ['decals_2'] = 3, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 - } - }, - bullet_wear = { - male = { - ['bproof_1'] = 11, ['bproof_2'] = 1 - }, - female = { - ['bproof_1'] = 13, ['bproof_2'] = 1 - } - }, - gilet_wear = { - male = { - ['tshirt_1'] = 59, ['tshirt_2'] = 1 - }, - female = { - ['tshirt_1'] = 36, ['tshirt_2'] = 1 - } - } + cadet_wear = { + male = { + ['tshirt_1'] = 59, ['tshirt_2'] = 1, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = 46, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 36, ['tshirt_2'] = 1, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = 45, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + police_wear = { + male = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 0, ['decals_2'] = 0, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + sergeant_wear = { + male = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 8, ['decals_2'] = 1, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 7, ['decals_2'] = 1, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + lieutenant_wear = { + male = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 8, ['decals_2'] = 2, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 7, ['decals_2'] = 2, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + commandant_wear = { + male = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 8, ['decals_2'] = 3, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 7, ['decals_2'] = 3, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + bullet_wear = { + male = { + ['bproof_1'] = 11, ['bproof_2'] = 1 + }, + female = { + ['bproof_1'] = 13, ['bproof_2'] = 1 + } + }, + gilet_wear = { + male = { + ['tshirt_1'] = 59, ['tshirt_2'] = 1 + }, + female = { + ['tshirt_1'] = 36, ['tshirt_2'] = 1 + } + } } \ No newline at end of file diff --git a/esx_policejob.sql b/esx_policejob.sql index bac75ae4..dc820f41 100644 --- a/esx_policejob.sql +++ b/esx_policejob.sql @@ -1,9 +1,9 @@ INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_police','Police',1) + ('society_police', 'Police', 1) ; INSERT INTO `datastore` (name, label, shared) VALUES - ('society_police','Police',1) + ('society_police', 'Police', 1) ; INSERT INTO `addon_inventory` (name, label, shared) VALUES @@ -15,11 +15,11 @@ INSERT INTO `jobs` (name, label) VALUES ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recruit','Recrue',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',4,'officer','Officier',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',1,'sergeant','Sergent',60,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',2,'lieutenant','Lieutenant',85,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'boss','Commandant',100,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') + ('police',0,'recruit','Recrue',20,'{}','{}'), + ('police',1,'officer','Officier',40,'{}','{}'), + ('police',2,'sergeant','Sergent',60,'{}','{}'), + ('police',3,'lieutenant','Lieutenant',85,'{}','{}'), + ('police',4,'boss','Commandant',100,'{}','{}') ; CREATE TABLE `fine_types` ( diff --git a/localization/de_config.lua b/localization/de_config.lua deleted file mode 100644 index bddb3d23..00000000 --- a/localization/de_config.lua +++ /dev/null @@ -1,85 +0,0 @@ -Config = {} -Config.DrawDistance = 100.0 -Config.MarkerType = 1 -Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} -Config.MarkerColor = {r = 50, g = 50, b = 204} -Config.EnablePlayerManagement = false -Config.EnableArmoryManagement = false -Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity -Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds -Config.EnableSocietyOwnedVehicles = false -Config.MaxInService = -1 -Config.Locale = 'de' - - -Config.PoliceStations = { - - LSPD = { - - Blip = { - Pos = { x = 425.130, y = -979.558, z = 30.711 }, - Sprite = 60, - Display = 4, - Scale = 1.2, - Colour = 29, - }, - - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_ASSAULTRIFLE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - {name = 'WEAPON_STICKYBOMB', price = 250}, - {name = 'GADGET_PARACHUTE', price = 300}, - }, - - AuthorizedVehicles = { - {name = 'police' , label = 'Streifenfahrzeug 1'}, - {name = 'police2', label = 'Streifenfahrzeug 2'}, - {name = 'police3', label = 'Streifenfahrzeug 3'}, - {name = 'police4', label = 'Zivilfahrzeug'}, - {name = 'policeb', label = 'Motorrad'}, - {name = 'policet', label = 'Transporter'}, - }, - - Cloakrooms = { - {x = 452.600, y = -993.306, z = 29.750} - }, - - Armories = { - {x = 451.699, y = -980.356, z = 29.689} - }, - - Vehicles = { - { - Spawner = {x = 454.69, y = -1017.4, z = 27.430}, - SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, - Heading = 90.0 - } - }, - - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, - - VehicleDeleters = { - {x = 462.74, y = -1014.4, z = 27.065}, - {x = 462.40, y = -1019.7, z = 27.104} - }, - - BossActions = { - {x = 448.417, y = -973.208, z = 29.689} - } - - } - -} diff --git a/localization/de_esx_policejob.sql b/localization/de_esx_policejob.sql index 3a10f65d..97113aa6 100644 --- a/localization/de_esx_policejob.sql +++ b/localization/de_esx_policejob.sql @@ -1,34 +1,35 @@ INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_police','Polizei',1) + ('society_police','Polizei',1) ; INSERT INTO `datastore` (name, label, shared) VALUES - ('society_police','Polizei',1) + ('society_police','Polizei',1) ; INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_police', 'Polizei', 1) + ('society_police', 'Polizei', 1) ; INSERT INTO `jobs` (name, label) VALUES - ('police','LSPD') + ('police','LSPD') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recruit','Rekrut',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',1,'sergeant','Sergent',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'boss','Commandant',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') + ('police',0,'recruit','Rekrut',20,'{}','{}'), + ('police',1,'officer','Officier',40,'{}','{}'), + ('police',2,'sergeant','Sergent',40,'{}','{}'), + ('police',3,'lieutenant','Lieutenant',65,'{}','{}'), + ('police',4,'boss','Commandant',80,'{}','{}') ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`) ); INSERT INTO `fine_types` VALUES ('1', 'Missbrauchen der Hupe', '30', '0'); diff --git a/localization/en_config.lua b/localization/en_config.lua deleted file mode 100644 index df49e4ac..00000000 --- a/localization/en_config.lua +++ /dev/null @@ -1,266 +0,0 @@ -Config = {} -Config.DrawDistance = 100.0 -Config.MarkerType = 1 -Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} -Config.MarkerColor = {r = 50, g = 50, b = 204} -Config.EnablePlayerManagement = false -Config.EnableArmoryManagement = false -Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity -Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds -Config.EnableSocietyOwnedVehicles = false -Config.EnableLicenses = false -- only turn this on if you are using esx_license -Config.MaxInService = -1 -Config.Locale = 'en' - -Config.PoliceStations = { - - LSPD1 = { - - Blip = { - Pos = { x = 425.130, y = -979.558, z = 30.711 }, - Sprite = 60, - Display = 4, - Scale = 1.2, - Colour = 29, - }, - - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, - - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, - - Cloakrooms = { - {x = 452.600, y = -993.306, z = 29.750} - }, - - Armories = { - {x = 451.699, y = -980.356, z = 29.689} - }, - - Vehicles = { - { - Spawner = {x = 454.69, y = -1017.4, z = 27.430}, - SpawnPoint = {x = 438.42, y = -1018.3, z = 27.757}, - Heading = 90.0 - } - }, - - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, - - VehicleDeleters = { - {x = 462.74, y = -1014.4, z = 27.065}, - {x = 462.40, y = -1019.7, z = 27.104} - }, - - BossActions = { - {x = 448.417, y = -973.208, z = 29.689} - } - - }, - - SASP1 = { - Blip = { - Pos = {x = 825.34204101563, y = -1290.0471191406, z = 28.240659713745 }, - Color = 40 - }, - - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, - - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, - - Cloakrooms = { - {x = 830.11590576172, y = -1311.4512939453, z = 28.13673210144 } -- state pd - }, - - Armories = { - {x = 858.25366210938, y = -1321.5992431641, z = 28.136734008789 } -- state pd - }, - - Vehicles = { - { - Spawner = {x = 863.17700195313, y = -1346.2406005859, z = 26.039228439331 }, --state pd - SpawnPoint = {x = 871.07720947266, y = -1350.00390625, z = 26.3092918396 }, -- state pd - Heading = 90.0 --state pd - } - }, - - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, - - VehicleDeleters = { - {x = 823.95031738281, y = -1371.1483154297, z = 26.136753082275 } --state pd - }, - - BossActions = { - {x = 850.228515625, y = -1284.50390625, z = 28.004758834839 } --state pd - } - - }, - - LSPD2 = { - Blip = { - Pos = {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, - Color = 29 - }, - - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, - - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, - - Cloakrooms = { - {x = -450.2878112793, y = 6016.482421875, z = 31.716369628906 }, - }, - - Armories = { - {x = -448.04425048828, y = 6007.7104492188, z = 31.716369628906 }, - }, - - Vehicles = { - { - Spawner = {x = -452.30313110352, y = 6005.6704101563, z = 31.840929031372 }, - SpawnPoint = {x = -454.96899414063, y = 6001.8876953125, z = 31.340549468994 }, - Heading = 87.0 - } - }, - - Helicopters = { - { - Spawner = {x = -462.88317871094, y = 5993.7685546875, z = 31.245756149292 }, - SpawnPoint = {x = -475.48043823242, y = 5988.326171875, z = 31.336708068848 }, - Heading = 270.0 - } - }, - - VehicleDeleters = { - {x = -447.64434814453, y = 5994.5024414063, z = 31.340551376343 }, - }, - - BossActions = { - {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 }, - } - - }, - - SASP2 = { - Blip = { - Pos = {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, - Color = 40 - }, - - AuthorizedWeapons = { - {name = 'WEAPON_NIGHTSTICK', price = 200}, - {name = 'WEAPON_COMBATPISTOL', price = 300}, - {name = 'WEAPON_ASSAULTSMG', price = 1250}, - {name = 'WEAPON_SPECIALCARBINE', price = 1500}, - {name = 'WEAPON_PUMPSHOTGUN', price = 600}, - {name = 'WEAPON_STUNGUN', price = 500}, - {name = 'WEAPON_FLASHLIGHT', price = 80}, - {name = 'WEAPON_FIREEXTINGUISHER', price = 120}, - {name = 'WEAPON_FLAREGUN', price = 60}, - }, - - AuthorizedVehicles = { - {name = 'police' , label = 'Police Vehicle 1'}, - {name = 'police2', label = 'Police Vehicle 2'}, - {name = 'police3', label = 'Police Vehicle 3'}, - {name = 'police4', label = 'Police Vehicle 4'}, - {name = 'policeb', label = 'Motorcycle'}, - {name = 'policet', label = 'Transport Van'}, - }, - - Cloakrooms = { - {x = 1857.2354736328, y = 3689.8408203125, z = 34.26708984375 }, -- state pd - }, - - Armories = { - {x = 1848.3413085938, y = 3690.1345214844, z = 34.26708984375 }, -- state pd - }, - - Vehicles = { - { - Spawner = {x = 1866.208984375, y = 3693.8125, z = 33.737236022949 }, --state pd - SpawnPoint = {x = 1872.9417724609, y = 3690.5759277344, z = 33.569362640381 }, -- state pd - Heading = 90.0 --state pd - } - }, - - Helicopters = { - { - Spawner = {x = 466.477, y = -982.819, z = 42.691}, - SpawnPoint = {x = 450.04, y = -981.14, z = 42.691}, - Heading = 0.0 - } - }, - - VehicleDeleters = { - {x = 1866.4152832031, y = 3699.6052246094, z = 33.535938262939 }, --state pd - }, - - BossActions = { - {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, --state pd - } - - }, - -} diff --git a/localization/en_esx_policejob.sql b/localization/en_esx_policejob.sql new file mode 100644 index 00000000..d48ebba6 --- /dev/null +++ b/localization/en_esx_policejob.sql @@ -0,0 +1,88 @@ +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police','Police',1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police','Police',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police','LSPD') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Recruit',20,'{}','{}'), + ('police',1,'officer','Officier',40,'{}','{}'), + ('police',2,'sergeant','Sergeant',60,'{}','{}'), + ('police',3,'lieutenant','Lieutenant',85,'{}','{}'), + ('police',4,'boss','Chief',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Misuse of a horn', 30, 0), + ('Illegally Crossing a continuous Line', 40, 0), + ('Driving on the wrong side of the road', 250, 0), + ('Illegal U-Turn', 250, 0), + ('Illegally Driving Off-road', 170, 0), + ('Refusing a Lawful Command', 30, 0), + ('Illegally Stoped of a Vehicle', 150, 0), + ('Illegal Parking', 70, 0), + ('Failing to Yield to the right', 70, 0), + ('Failure to comply with Vehicle Information', 90, 0), + ('Failing to stop at a Stop Sign ', 105, 0), + ('Failing to stop at a Red Light', 130, 0), + ('Illegal Passing', 100, 0), + ('Driving an illegal Vehicle', 100, 0), + ('Driving without a License', 1500, 0), + ('Hit and Run', 800, 0), + ('Exceeding Speeds Over < 5 mph', 90, 0), + ('Exceeding Speeds Over 5-15 mph', 120, 0), + ('Exceeding Speeds Over 15-30 mph', 180, 0), + ('Exceeding Speeds Over > 30 mph', 300, 0), + ('Impeding traffic flow', 110, 1), + ('Public Intoxication', 90, 1), + ('Disorderly conduct', 90, 1), + ('Obstruction of Justice', 130, 1), + ('Insults towards Civilans', 75, 1), + ('Disrespecting of an LEO', 110, 1), + ('Verbal Threat towards a Civilan', 90, 1), + ('Verbal Threat towards an LEO', 150, 1), + ('Providing False Information', 250, 1), + ('Attempt of Corruption', 1500, 1), + ('Brandishing a weapon in city Limits', 120, 2), + ('Brandishing a Lethal Weapon in city Limits', 300, 2), + ('No Firearms License', 600, 2), + ('Possession of an Illegal Weapon', 700, 2), + ('Possession of Burglary Tools', 300, 2), + ('Grand Theft Auto', 1800, 2), + ('Intent to Sell/Distrube of an illegal Substance', 1500, 2), + ('Frabrication of an Illegal Substance', 1500, 2), + ('Possession of an Illegal Substance ', 650, 2), + ('Kidnapping of a Civilan', 1500, 2), + ('Kidnapping of an LEO', 2000, 2), + ('Robbery', 650, 2), + ('Armed Robbery of a Store', 650, 2), + ('Armed Robbery of a Bank', 1500, 2), + ('Assault on a Civilian', 2000, 3), + ('Assault of an LEO', 2500, 3), + ('Attempt of Murder of a Civilian', 3000, 3), + ('Attempt of Murder of an LEO', 5000, 3), + ('Murder of a Civilian', 10000, 3), + ('Murder of an LEO', 30000, 3), + ('Involuntary manslaughter', 1800, 3), + ('Fraud', 2000, 2); +; diff --git a/localization/esx_policejob_en.sql b/localization/esx_policejob_en.sql deleted file mode 100644 index ac8ee619..00000000 --- a/localization/esx_policejob_en.sql +++ /dev/null @@ -1,87 +0,0 @@ -INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_police','Police',1) -; - -INSERT INTO `datastore` (name, label, shared) VALUES - ('society_police','Police',1) -; - -INSERT INTO `addon_inventory` (name, label, shared) VALUES - ('society_police', 'Police', 1) -; - -INSERT INTO `jobs` (name, label) VALUES - ('police','LSPD') -; - -INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recruit','Recruit',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',1,'sergeant','Sergeant',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',2,'lieutenant','Lieutenant',65,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'boss','Chief',80,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') -; - -CREATE TABLE `fine_types` ( - - `id` int(11) NOT NULL AUTO_INCREMENT, - `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, - - PRIMARY KEY (`id`) -); - -INSERT INTO `fine_types` (label, amount, category) VALUES - ('Misuse of a horn', 30, 0), - ('Illegally Crossing a continuous Line', 40, 0), - ('Driving on the wrong side of the road', 250, 0), - ('Illegal U-Turn', 250, 0), - ('Illegally Driving Off-road', 170, 0), - ('Refusing a Lawful Command', 30, 0), - ('Illegally Stoped of a Vehicle', 150, 0), - ('Illegal Parking', 70, 0), - ('Failing to Yield to the right', 70, 0), - ('Failure to comply with Vehicle Information', 90, 0), - ('Failing to stop at a Stop Sign ', 105, 0), - ('Failing to stop at a Red Light', 130, 0), - ('Illegal Passing', 100, 0), - ('Driving an illegal Vehicle', 100, 0), - ('Driving without a License', 1500, 0), - ('Hit and Run', 800, 0), - ('Exceeding Speeds Over < 5 mph', 90, 0), - ('Exceeding Speeds Over 5-15 mph', 120, 0), - ('Exceeding Speeds Over 15-30 mph', 180, 0), - ('Exceeding Speeds Over > 30 mph', 300, 0), - ('Impeding traffic flow', 110, 1), - ('Public Intoxication', 90, 1), - ('Disorderly conduct', 90, 1), - ('Obstruction of Justice', 130, 1), - ('Insults towards Civilans', 75, 1), - ('Disrespecting of an LEO', 110, 1), - ('Verbal Threat towards a Civilan', 90, 1), - ('Verbal Threat towards an LEO', 150, 1), - ('Providing False Information', 250, 1), - ('Attempt of Corruption', 1500, 1), - ('Brandishing a weapon in city Limits', 120, 2), - ('Brandishing a Lethal Weapon in city Limits', 300, 2), - ('No Firearms License', 600, 2), - ('Possession of an Illegal Weapon', 700, 2), - ('Possession of Burglary Tools', 300, 2), - ('Grand Theft Auto', 1800, 2), - ('Intent to Sell/Distrube of an illegal Substance', 1500, 2), - ('Frabrication of an Illegal Substance', 1500, 2), - ('Possession of an Illegal Substance ', 650, 2), - ('Kidnapping of a Civilan', 1500, 2), - ('Kidnapping of an LEO', 2000, 2), - ('Robbery', 650, 2), - ('Armed Robbery of a Store', 650, 2), - ('Armed Robbery of a Bank', 1500, 2), - ('Assault on a Civilian', 2000, 3), - ('Assault of an LEO', 2500, 3), - ('Attempt of Murder of a Civilian', 3000, 3), - ('Attempt of Murder of an LEO', 5000, 3), - ('Murder of a Civilian', 10000, 3), - ('Murder of an LEO', 30000, 3), - ('Involuntary manslaughter', 1800, 3), - ('Fraud', 2000, 2); -; diff --git a/localization/sv_esx_policejob.sql b/localization/sv_esx_policejob.sql index 407c0d86..020aabbf 100644 --- a/localization/sv_esx_policejob.sql +++ b/localization/sv_esx_policejob.sql @@ -15,11 +15,11 @@ INSERT INTO `jobs` (name, label) VALUES ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES - ('police',0,'recruit','Aspirant',20,'{\"tshirt_1\":57,\"torso_1\":55,\"arms\":0,\"pants_1\":35,\"glasses\":0,\"decals_2\":0,\"hair_color_2\":0,\"helmet_2\":0,\"hair_color_1\":5,\"face\":19,\"glasses_2\":1,\"torso_2\":0,\"shoes\":24,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"pants_2\":0,\"hair_2\":0,\"decals_1\":0,\"tshirt_2\":0,\"helmet_1\":8}','{\"tshirt_1\":34,\"torso_1\":48,\"shoes\":24,\"pants_1\":34,\"torso_2\":0,\"decals_2\":0,\"hair_color_2\":0,\"glasses\":0,\"helmet_2\":0,\"hair_2\":3,\"face\":21,\"decals_1\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"arms\":14,\"hair_color_1\":10,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',4,'officer','Biträdande Rikspolischef',40,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',1,'sergeant','Assistent',60,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":0,\"decals_1\":8,\"torso_2\":0,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"hair_color_1\":5,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":14,\"pants_1\":34,\"pants_2\":0,\"decals_2\":1,\"hair_color_2\":0,\"shoes\":24,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"face\":21,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"hair_color_1\":10,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',2,'lieutenant','Inspektör',85,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":2,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"glasses\":0,\"decals_1\":8,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"torso_2\":0,\"arms\":41,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"hair_2\":3,\"decals_2\":2,\"hair_color_2\":0,\"hair_color_1\":10,\"helmet_2\":0,\"face\":21,\"shoes\":24,\"torso_2\":0,\"glasses_2\":1,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"pants_2\":0,\"decals_1\":7,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}'), - ('police',3,'boss','Rikspolischef',100,'{\"tshirt_1\":58,\"torso_1\":55,\"shoes\":24,\"pants_1\":35,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":19,\"helmet_2\":0,\"hair_2\":0,\"arms\":41,\"torso_2\":0,\"hair_color_1\":5,\"hair_1\":2,\"skin\":34,\"sex\":0,\"glasses_1\":0,\"glasses_2\":1,\"decals_1\":8,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":11}','{\"tshirt_1\":35,\"torso_1\":48,\"arms\":44,\"pants_1\":34,\"pants_2\":0,\"decals_2\":3,\"hair_color_2\":0,\"face\":21,\"helmet_2\":0,\"hair_2\":3,\"decals_1\":7,\"torso_2\":0,\"hair_color_1\":10,\"hair_1\":11,\"skin\":34,\"sex\":1,\"glasses_1\":5,\"glasses_2\":1,\"shoes\":24,\"glasses\":0,\"tshirt_2\":0,\"helmet_1\":57}') + ('police',0,'recruit','Aspirant',20,'{}','{}'), + ('police',1,'officer','Biträdande Rikspolischef',40,'{}','{}'), + ('police',2,'sergeant','Assistent',60,'{}','{}'), + ('police',3,'lieutenant','Inspektör',85,'{}','{}'), + ('police',4,'boss','Rikspolischef',100,'{}','{}') ; CREATE TABLE `fine_types` ( From c1c4b585aa86ac25c2cb207b6ca22d5e15b7de64 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 19 May 2018 10:45:39 +0200 Subject: [PATCH 120/253] Buying weapon no longer removes it from the players inventory, fixes #74 --- client/main.lua | 4 ++-- server/main.lua | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client/main.lua b/client/main.lua index 79743614..663b492d 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1048,7 +1048,7 @@ function OpenPutWeaponMenu() ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() OpenPutWeaponMenu() - end, data.current.value) + end, data.current.value, true) end, function(data, menu) @@ -1094,7 +1094,7 @@ function OpenBuyWeaponsMenu(station) if hasEnoughMoney then ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() OpenBuyWeaponsMenu(station) - end, data.current.value) + end, data.current.value, false) else ESX.ShowNotification(_U('not_enough_money')) end diff --git a/server/main.lua b/server/main.lua index 9a506265..d66eb4dd 100644 --- a/server/main.lua +++ b/server/main.lua @@ -362,11 +362,13 @@ ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb end) -ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, weaponName) +ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, weaponName, removeWeapon) local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.removeWeapon(weaponName) + if removeWeapon then + xPlayer.removeWeapon(weaponName) + end TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) From 9363bdce14666c16d6c81a1c68722af84d0ae4fd Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 22 May 2018 19:42:11 +0200 Subject: [PATCH 121/253] Improved handcuffs, follow #87 --- client/main.lua | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/client/main.lua b/client/main.lua index 663b492d..646df5d7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1460,12 +1460,18 @@ Citizen.CreateThread(function() while true do Citizen.Wait(10) if IsHandcuffed then - DisableControlAction(0, 142, true) -- MeleeAttackAlternate - DisableControlAction(0, 30, true) -- MoveLeftRight - DisableControlAction(0, 31, true) -- MoveUpDown - DisableControlAction(0, 24, true) -- Shoot - DisableControlAction(0, 92, true) -- Shoot in car - DisableControlAction(0, 75, true) -- Leave Vehicle + DisableControlAction(2, 24, true) -- Attack + DisableControlAction(2, 257, true) -- Attack 2 + DisableControlAction(2, 25, true) -- Aim + DisableControlAction(2, 263, true) -- Melee Attack 1 + DisableControlAction(2, Keys['R'], true) -- Reload + DisableControlAction(2, Keys['TOP'], true) -- Open phone (not needed?) + DisableControlAction(2, Keys['SPACE'], true) -- Jump + DisableControlAction(2, Keys['Q'], true) -- Cover + DisableControlAction(2, Keys['TAB'], true) -- Select Weapon + DisableControlAction(2, Keys['F'], true) -- Also 'enter'? + else + Citizen.Wait(1000) end end end) From b64cc569399d0b53e46ad64def2f160bc4acd3df Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 22 May 2018 19:43:51 +0200 Subject: [PATCH 122/253] Handcuff: also disable phone, inventory and animations --- client/main.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/main.lua b/client/main.lua index 646df5d7..dfb12352 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1470,6 +1470,9 @@ Citizen.CreateThread(function() DisableControlAction(2, Keys['Q'], true) -- Cover DisableControlAction(2, Keys['TAB'], true) -- Select Weapon DisableControlAction(2, Keys['F'], true) -- Also 'enter'? + DisableControlAction(2, Keys['F1'], true) -- Disable phone + DisableControlAction(2, Keys['F2'], true) -- Inventory + DisableControlAction(2, Keys['F3'], true) -- Animations else Citizen.Wait(1000) end From 2cfc8129da03ce684b5a24cc8d6bc687855e1ab0 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 22 May 2018 20:20:56 +0200 Subject: [PATCH 123/253] Re-implemented freemode peds, closes #81 --- README.md | 51 ++++++++++++++++++++++++++++++++++--------------- client/main.lua | 30 ++++++++++++++++++++++++++--- 2 files changed, 63 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 0f4605a5..c8757c21 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,56 @@ # esx_policejob -[REQUIREMENTS] - +### Requirements * Auto mode * [esx_billing](https://github.com/FXServer-ESX/fxserver-esx_billing) * Player management (boss actions and armory with buyable weapons) * [esx_society](https://github.com/FXServer-ESX/fxserver-esx_society) * [esx_datastore](https://github.com/FXServer-ESX/fxserver-esx_datastore) - + * ESX Identity Support * [esx_identity](https://github.com/ESX-Org/esx_identity) -[INSTALLATION] +* ESX License Support + * [esx_license](https://github.com/ESX-Org/esx_license) -1) CD in your resources/[esx] folder -2) Clone the repository -``` -git clone https://github.com/FXServer-ESX/fxserver-esx_policejob esx_policejob -``` -3) Import esx_policejob.sql in your database +## Download & Installation -4) Add this in your server.cfg : +### Using [fvm](https://github.com/qlaffont/fvm-installer) +``` +fvm install --save --folder=esx esx-org/esx_policejob +``` + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_policejob [esx]/esx_policejob +``` + +### Manually +- Download https://github.com/ESX-Org/esx_policejob/archive/master.zip +- Put it in the `[esx]` directory + + +## Installation +- Import `esx_policejob.sql` in your database +- Add this in your server.cfg : ``` start esx_policejob ``` -5) * If you want player management you have to set Config.EnablePlayerManagement to true in config.lua - * If you want armory management you have to set Config.EnableArmoryManagement to true in config.lua - * If you want license management you have to set Config.EnableLicenses to true in config.lua +- * If you want player management you have to set `Config.EnablePlayerManagement` to `true` in `config.lua` + * If you want armory management you have to set `Config.EnableArmoryManagement` to `true` in `config.lua` + * If you want license management you have to set `Config.EnableLicenses` to `true` in `config.lua` # Legal ### License -The project is licensed under GPLv3, read the [license](LICENSE.txt) for more information. +esx_policejob - police script for ESX + +Copyright (C) 2015-2018 Jérémie N'gadi + +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/. \ No newline at end of file diff --git a/client/main.lua b/client/main.lua index dfb12352..214572e5 100644 --- a/client/main.lua +++ b/client/main.lua @@ -118,9 +118,9 @@ function OpenCloakroomMenu() end if Config.EnableNonFreemodePeds then - table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear_freemode'}) - table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear_freemode'}) - table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear_freemode'}) + table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear_freemode', maleModel = 's_m_y_sheriff_01', femaleModel = 's_f_y_sheriff_01'}) + table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear_freemode', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'}) + table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear_freemode', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'}) end ESX.UI.Menu.CloseAll() @@ -154,6 +154,30 @@ function OpenCloakroomMenu() setUniform(data.current.value, playerPed) end + if + data.current.value == 'sheriff_wear_freemode' or + data.current.value == 'lieutenant_wear_freemode' or + data.current.value == 'commandant_wear_freemode' + then + local model = nil + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + if skin.sex == 0 then + model = GetHashKey(data.current.maleModel) + else + model = GetHashKey(data.current.femaleModel) + end + end) + + RequestModel(model) + while not HasModelLoaded(model) do + RequestModel(model) + Citizen.Wait(1) + end + + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + end + CurrentAction = 'menu_cloakroom' CurrentActionMsg = _U('open_cloackroom') CurrentActionData = {} From c74e05ba5bfbec0a4a1c6edff583a271d85b3811 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 22 May 2018 20:22:20 +0200 Subject: [PATCH 124/253] Version bump --- __resource.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__resource.lua b/__resource.lua index 7766f428..b0d92946 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' -version '1.0.5' +version '1.1.0' server_scripts { '@es_extended/locale.lua', From c22e1d8f9590bc1c04c3b355592a9f10a8926d59 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 9 Jun 2018 12:32:13 +0200 Subject: [PATCH 125/253] Fixed duplicated garage, closes #94 --- client/main.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/client/main.lua b/client/main.lua index 214572e5..edbdc9fa 100644 --- a/client/main.lua +++ b/client/main.lua @@ -339,12 +339,18 @@ function OpenVehicleSpawnerMenu(station, partNum) else - local elements = Config.AuthorizedVehicles.Shared - local authorizedVehicles = Config.AuthorizedVehicles[PlayerData.job.grade_name] - - for i=1, #authorizedVehicles, 1 do - table.insert(elements, { label = authorizedVehicles[i].label, model = authorizedVehicles[i].model}) - end + local elements = {} + + local sharedVehicles = Config.AuthorizedVehicles.Shared + for i=1, #sharedVehicles, 1 do + table.insert(elements, { label = sharedVehicles[i].label, model = sharedVehicles[i].model}) + end + + local authorizedVehicles = Config.AuthorizedVehicles[PlayerData.job.grade_name] + for i=1, #authorizedVehicles, 1 do + table.insert(elements, { label = authorizedVehicles[i].label, model = authorizedVehicles[i].model}) + end + ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'vehicle_spawner', { @@ -1831,6 +1837,7 @@ Citizen.CreateThread(function() end end) +-- Create blip for colleagues function createBlip(id) ped = GetPlayerPed(id) blip = GetBlipFromEntity(ped) @@ -1838,7 +1845,7 @@ function createBlip(id) if not DoesBlipExist(blip) then -- Add blip and create head display on player blip = AddBlipForEntity(ped) SetBlipSprite(blip, 1) - Citizen.InvokeNative(0x5FBCA48327B914DF, blip, true) -- Player Blip indicator + ShowHeadingIndicatorOnBlip(blip, true) -- Player Blip indicator SetBlipRotation(blip, math.ceil(GetEntityHeading(veh))) -- update rotation SetBlipNameToPlayerName(blip, id) -- update blip name SetBlipScale(blip, 0.85) -- set scale From 7909d9d89d062cb9a44125321ab74f9c85f3dbbf Mon Sep 17 00:00:00 2001 From: MajorMarcin Date: Sat, 9 Jun 2018 13:35:38 +0200 Subject: [PATCH 126/253] pl_translation and description config society veh --- config.lua | 2 +- locales/pl.lua | 117 ++++++++++++++++++++++++++++++ localization/pl_esx_policejob.sql | 88 ++++++++++++++++++++++ 3 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 locales/pl.lua create mode 100644 localization/pl_esx_policejob.sql diff --git a/config.lua b/config.lua index 4c03be7e..3782af79 100644 --- a/config.lua +++ b/config.lua @@ -7,7 +7,7 @@ Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds -Config.EnableSocietyOwnedVehicles = false +Config.EnableSocietyOwnedVehicles = false -- allows use a police garage Config.EnableLicenses = false -- only turn this on if you are using esx_license Config.MaxInService = -1 Config.Locale = 'fr' diff --git a/locales/pl.lua b/locales/pl.lua new file mode 100644 index 00000000..ea1da56e --- /dev/null +++ b/locales/pl.lua @@ -0,0 +1,117 @@ +Locales['en'] = { + -- Cloakroom + ['cloakroom'] = 'Szatnia', + ['citizen_wear'] = 'Ubranie Cywilne', + ['police_wear'] = 'Mundur', + ['sheriff_wear'] = 'Mundur Szeryfa', + ['lieutenant_wear'] = 'Mundur Porucznika', + ['gilet_wear'] = 'Kamizelka odblaskowa', + ['bullet_wear'] = 'Kamizelka kuloodporna', + ['no_outfit'] = 'Brak ubrania', + ['open_cloackroom'] = 'Naciśnij ~INPUT_CONTEXT~ aby zmienić ~y~ubranie~s~.', + -- Armory + ['remove_object'] = 'Weź przedmiot', + ['deposit_object'] = 'Zdeponuj przedmiot', + ['get_weapon'] = 'Weź broń', + ['put_weapon'] = 'Odłóż broń', + ['buy_weapons'] = 'Kup Broń', + ['armory'] = 'Zbrojownia', + ['open_armory'] = 'Naciśnij ~INPUT_CONTEXT~ żeby uzyskać dostęp do zbrojowni', + -- Vehicles + ['vehicle_menu'] = 'Pojazdy', + ['vehicle_out'] = 'Masz już pojazd poza garażem', + ['vehicle_spawner'] = 'Naciśnij ~INPUT_CONTEXT~ żeby wziąć pojazd', + ['store_vehicle'] = 'Naciśnij ~INPUT_CONTEXT~ żeby przechować pojazd', + ['service_max'] = 'Maksymalna ilość policjantów na służbie: ', + + -- Action Menu + ['citizen_interaction'] = 'Interakcja z cywilami', + ['vehicle_interaction'] = 'Interakcja z pojazdami', + ['object_spawner'] = 'Przedmioty do postawienia', + + ['id_card'] = 'Dowód osobisty', + ['search'] = 'Przeszukaj', + ['handcuff'] = 'Zakuj/Rozkuj Kajdanki ', + ['drag'] = 'Przemieść podejrzanego', + ['put_in_vehicle'] = 'Wsadź do pojazdu', + ['out_the_vehicle'] = 'Wyciągnij z pojazdu', + ['fine'] = 'Mandaty', + ['license_check'] = 'Zarządzaj licencjami', + ['license_revoke'] = 'Uniewaźnij licencje', + ['license_revoked'] = 'Twoja licencja ~b~%s~s~ została ~y~unieważniona~s~!', + ['licence_you_revoked'] = 'Unieważniłeś ~b~%s~s~ które należały do ~y~%s~s~', + ['no_players_nearby'] = 'Brak graczy w pobliżu', + -- Vehicle interaction + ['vehicle_info'] = 'Informacje o pojeździe', + ['pick_lock'] = 'Odblokuj pojazd', + ['vehicle_unlocked'] = 'Pojazd ~g~Odblokowany~s~', + ['no_vehicles_nearby'] = 'Brak pojazdu w pobliżu', + ['impound'] = 'Zajmij pojazd', + ['impound_prompt'] = 'Naciśnij ~INPUT_CONTEXT~ żeby unieważnić ~y~zajęcie~s~', + ['impound_canceled'] = 'Unieważniłeś/aś zajęcie', + ['impound_canceled_moved'] = 'Zajęcie zostało anulowane, ponieważ pojazd przemieścił się', + ['impound_successful'] = 'Zająłeś/aś pojazd', + ['search_database'] = 'Informacje o pojeździe', + ['search_database_title'] = 'Informacjeo pojeździe - przeszukaj używając numeru rejestracyjnego', + ['search_database_error_invalid'] = 'To ~r~nie~s~ jest ~y~poprawny~s~ rnumer rejestracyjny', + ['search_database_error_not_found'] = 'Ten ~y~numer rejestracyjny~s~ ~r~nie jest~s~ zarejestrowany do tego pojazdu!', + ['search_database_found'] = 'Pojazd jest ~y~zarejestrowany~s~ do ~b~%s~s~', + -- Traffic interaction + ['traffic_interaction'] = 'Interakcje dla ruchu drogowego', + ['cone'] = 'Pachołek', + ['barrier'] = 'Barierka', + ['spikestrips'] = 'Kolczatka', + ['box'] = 'Pudła', + ['cash'] = 'Paleta z pieniędzmi', + -- ID Card Menu + ['name'] = 'Nazwa : ', + ['bac'] = 'bAC : ', + -- Body Search Menu + ['confiscate_dirty'] = 'Skonfiskuj brudne pieniądze: $', + ['guns_label'] = '--- Bronie ---', + ['confiscate'] = 'Skonfiskuj ', + ['inventory_label'] = '--- Ekwipunek ---', + ['confiscate_inv'] = 'Skonfiskuj x', + + ['traffic_offense'] = 'Wykroczenia drogowe', + ['minor_offense'] = 'Niewielkie wykroczenia', + ['average_offense'] = 'Średnie wykroczenia', + ['major_offense'] = 'Duże wykroczenia', + ['fine_total'] = 'Mandat: ', + -- Vehicle Info Menu + ['plate'] = 'Tablica rejestracyjna: ', + ['owner_unknown'] = 'Właściciel: Nieznany', + ['owner'] = 'Właściciel: ', + -- Weapons Menus + ['get_weapon_menu'] = 'Zbrojownia - Weź broń', + ['put_weapon_menu'] = 'Zbrojownia - Odłóż broń', + ['buy_weapon_menu'] = 'Zbrojownia - Kup broń', + ['not_enough_money'] = 'Nie masz wystarczającej ilości pieniędzy', + -- Boss Menu + ['take_company_money'] = 'Wypłać firmowe pieniądze', + ['deposit_money'] = 'Zdeponuj pieniądze', + ['amount_of_withdrawal'] = 'Wartość wypłaty', + ['invalid_amount'] = 'Nieprawidłowa wartość', + ['amount_of_deposit'] = 'Wartość depozytu', + ['open_bossmenu'] = 'Naciśnij ~INPUT_CONTEXT~ aby otworzyć menu', + ['quantity_invalid'] = 'Nieprawidłowa ilość', + ['have_withdrawn'] = 'Wypłaciłeś x', + ['not_enough_in_society'] = 'Niewystarczająca ilość przedmiotu w społeczeństwie!', + ['player_cannot_hold'] = '~r~Nie masz~w~ wystarczająco ~y~wolnego miejsca~w~ w ekwipunku!', + ['added'] = 'Dodałeś x', + ['quantity'] = 'Ilość', + ['inventory'] = 'Ekwipunek', + ['police_stock'] = 'Zapasy policji', + -- Misc + ['remove_prop'] = 'Naciśnij ~INPUT_CONTEXT~ aby usunąć ten obiekt', + ['map_blip'] = 'Komisariat Policji', + -- Notifications + ['from'] = '~s~ od ~b~', + ['you_have_confinv'] = 'Skonfiskowałeś ~y~x', + ['confinv'] = '~s~ skonfiskowane przez Ciebie ~y~x', + ['you_have_confdm'] = 'Skonfiskowałeś ~y~$', + ['confdm'] = '~s~ skonfiskowane przez Ciebie ~y~$', + ['you_have_confweapon'] = 'Skonfiskowałeś ~y~x1 ', + ['confweapon'] = '~s~ skonfiskowane przez Ciebie ~y~x1 ', + ['alert_police'] = 'Ostrzeż policję', +} diff --git a/localization/pl_esx_policejob.sql b/localization/pl_esx_policejob.sql new file mode 100644 index 00000000..bf9201b1 --- /dev/null +++ b/localization/pl_esx_policejob.sql @@ -0,0 +1,88 @@ +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police','Police',1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police','Police',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Police', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police','LSPD') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Posterunkowy',20,'{}','{}'), + ('police',1,'officer','Sierżant',40,'{}','{}'), + ('police',2,'sergeant','Aspirant',60,'{}','{}'), + ('police',3,'lieutenant','Komisarz',85,'{}','{}'), + ('police',4,'boss','Generalny Inspektor',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Nadużywanie klaksonu', 30, 0), + ('Przekroczenie lini ciągłej', 40, 0), + ('Jechanie po złej stronie drogi', 250, 0), + ('Nieprawidłowe zawracanie', 250, 0), + ('Nielegalna jazda Off-road', 170, 0), + ('Niedostosowanie się do poleceń Policji', 30, 0), + ('Nieprawidłowe zatrzymanie pojazdu', 150, 0), + ('Nieprawidłowe parkownie', 70, 0), + ('Niezastosowanie się do ruchu prawostronnego (jazda lewym pasem)', 70, 0), + ('Brak informacji o pojeździe', 90, 0), + ('Niezastosowanie się do znaku SOTP', 105, 0), + ('Niezatrzymanie się na czerwonym świetle', 130, 0), + ('Przechodzenie w niedozwolonym miejscu', 100, 0), + ('Jazda nielegalnym pojazdem', 100, 0), + ('Brak prawa jazdy', 1500, 0), + ('Ucieczka z miejsca zdarzenia', 800, 0), + ('Przekroczenie prędkości < 5 mph', 90, 0), + ('Przekroczenie prędkości 5-15 mph', 120, 0), + ('Przekroczenie prędkości 15-30 mph', 180, 0), + ('Przekroczenie prędkości > 30 mph', 300, 0), + ('Utrudnianie przemieszczania się', 110, 1), + ('Publiczne zgorszenie', 90, 1), + ('Niepoprawne zachowanie', 90, 1), + ('Utrudnianie postępowania', 130, 1), + ('Obraza cywilów', 75, 1), + ('Obraza graczy', 110, 1), + ('Groźby werbalne', 90, 1), + ('Przeklinanie na graczy', 150, 1), + ('Dostarczanie fałszywych informacji', 250, 1), + ('Próba korupcji', 1500, 1), + ('Wymachiwanie bronią w mieście', 120, 2), + ('Wymachiwanie niebezpieczną bronią w mieście', 300, 2), + ('Brak pozwolenia na broń', 600, 2), + ('Posiadanie nielegalnej broni', 700, 2), + ('Posiadanie narzędzi do włamań', 300, 2), + ('Złodziej - recydywista', 1800, 2), + ('Rozprowadzanie nielegalnych substancji', 1500, 2), + ('Wytwarzanie nielegalnych substancji', 1500, 2), + ('Posiadanie zakazanych substancji', 650, 2), + ('Porwanie cywila', 1500, 2), + ('Porwanie gracza', 2000, 2), + ('Rabunek', 650, 2), + ('Kradzież z bronią w ręku', 650, 2), + ('Napad na Bank', 1500, 2), + ('Atak na cywila', 2000, 3), + ('Atak na gracza', 2500, 3), + ('Próba morderstwa cywila', 3000, 3), + ('Próba morderstwa gracza', 5000, 3), + ('Zabójstwo cywila z premedytacją', 10000, 3), + ('Zabójstwo gracza z premedytacją', 30000, 3), + ('Nieumyślne spowodowanie śmierci', 1800, 3), + ('Oszustwo', 2000, 2); +; From 849e1a3d51d5b42e5ee36e4167787e64dd609b45 Mon Sep 17 00:00:00 2001 From: MajorMarcin Date: Sat, 9 Jun 2018 20:13:46 +0200 Subject: [PATCH 127/253] fix --- config.lua | 2 +- locales/pl.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.lua b/config.lua index 3782af79..4c03be7e 100644 --- a/config.lua +++ b/config.lua @@ -7,7 +7,7 @@ Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds -Config.EnableSocietyOwnedVehicles = false -- allows use a police garage +Config.EnableSocietyOwnedVehicles = false Config.EnableLicenses = false -- only turn this on if you are using esx_license Config.MaxInService = -1 Config.Locale = 'fr' diff --git a/locales/pl.lua b/locales/pl.lua index ea1da56e..e475bcbf 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -1,4 +1,4 @@ -Locales['en'] = { +Locales['pl'] = { -- Cloakroom ['cloakroom'] = 'Szatnia', ['citizen_wear'] = 'Ubranie Cywilne', From 7a47f651b39a34175aefdf4cc85a6502cf231b9d Mon Sep 17 00:00:00 2001 From: AdrineX Date: Tue, 12 Jun 2018 20:06:55 +0300 Subject: [PATCH 128/253] Add Finnish lang... --- __resource.lua | 2 + locales/fi.lua | 114 ++++++++++++++++++++++++++++++ localization/fi_esx_policejob.sql | 88 +++++++++++++++++++++++ 3 files changed, 204 insertions(+) create mode 100644 locales/fi.lua create mode 100644 localization/fi_esx_policejob.sql diff --git a/__resource.lua b/__resource.lua index b0d92946..1c08a61f 100644 --- a/__resource.lua +++ b/__resource.lua @@ -10,6 +10,7 @@ server_scripts { 'locales/de.lua', 'locales/en.lua', 'locales/fr.lua', + 'locales/fi.lua', 'locales/es.lua', 'locales/sv.lua', '@mysql-async/lib/MySQL.lua', @@ -23,6 +24,7 @@ client_scripts { 'locales/de.lua', 'locales/en.lua', 'locales/fr.lua', + 'locales/fi.lua', 'locales/es.lua', 'locales/sv.lua', 'config.lua', diff --git a/locales/fi.lua b/locales/fi.lua new file mode 100644 index 00000000..86d4a82a --- /dev/null +++ b/locales/fi.lua @@ -0,0 +1,114 @@ +Locales['fi'] = { + -- Cloakroom + ['cloakroom'] = 'vaatelokero', + ['citizen_wear'] = 'siviiliasu', + ['police_wear'] = 'poliisiasu', + ['sheriff_wear'] = 'sheriffiasu', + ['lieutenant_wear'] = 'swattiasu', + ['gilet_wear'] = 'huomioliivi', + ['bullet_wear'] = 'Luotiliivi', + ['no_outfit'] = 'täällä ei ole sinulle sopivaa asua', + ['open_cloackroom'] = 'paina ~INPUT_CONTEXT~ vaihtaaksesi ~y~vaatteita~s~.', + -- Armory + ['remove_object'] = 'ota esine', + ['deposit_object'] = 'talleta esine', + ['get_weapon'] = 'ota ase', + ['put_weapon'] = 'laita ase pois', + ['buy_weapons'] = 'osta aseita', + ['armory'] = 'asevarasto', + ['open_armory'] = 'paina ~INPUT_CONTEXT~ avataksesi asevarasto', + -- Vehicles + ['vehicle_menu'] = 'ajoneuvo', + ['vehicle_out'] = 'ajoneuvo on jo ulkona tallista', + ['vehicle_spawner'] = 'paina ~INPUT_CONTEXT~ ottaaksesi auton ulos', + ['store_vehicle'] = 'paina ~INPUT_CONTEXT~ laittaaksesi auto talliin', + ['service_max'] = 'maksimi määrä poliiseja: ', + -- Action Menu + ['citizen_interaction'] = 'siviilin vuorovaikutus', + ['vehicle_interaction'] = 'ajoneuvon vuorovaikutus', + ['object_spawner'] = 'objekti spawneri', + + ['id_card'] = 'Henkilöllisyystodistus', + ['search'] = 'tutki', + ['handcuff'] = 'Raudat On/Off', + ['drag'] = 'raahaa', + ['put_in_vehicle'] = 'laita ajoneuvoon', + ['out_the_vehicle'] = 'ota ulos ajoneuvosta', + ['fine'] = 'sakko', + ['license_check'] = 'hallitse lisenssejä', + ['license_revoke'] = 'kumoa lisenssi', + ['license_revoked'] = 'sinun ~b~%s~s~ ~y~kumottiin~s~!', + ['licence_you_revoked'] = 'sinä kumosit ~b~%s~s~ mikä kuului henkilölle ~y~%s~s~', + ['no_players_nearby'] = 'ei pelaajia lähettyvillä', + -- Vehicle interaction + ['vehicle_info'] = 'ajoneuvon tiedot', + ['pick_lock'] = 'tiirikoi ovet', + ['vehicle_unlocked'] = 'ajoneuvo ~g~Avattu~s~', + ['no_vehicles_nearby'] = 'ei ajoneuvoja lähettyvillä', + ['impound'] = 'takavarikoi ajoneuvo', + ['impound_prompt'] = 'paina ~INPUT_CONTEXT~ peruaksesi ~y~takavarikointi~s~', + ['impound_canceled'] = 'sinä peruit takavarikoinnin', + ['impound_canceled_moved'] = 'takavarikointi peruuntui koska ajoneuvo liikku', + ['impound_successful'] = 'takavarikoit ajoneuvon', + ['search_database'] = 'ajoneuvon tiedot', + ['search_database_title'] = 'ajoneuvon tiedot - etsi rekisterinumerolla', + ['search_database_error_invalid'] = 'tämä ~r~ei ole~s~ ~y~voimassa oleva~s~ rekisterinumero', + ['search_database_error_not_found'] = 'tämä ~y~rekisterinumero~s~ ~r~ei~s~ ole rekistöröity ajoneuvoon!', + ['search_database_found'] = 'ajoneuvo on ~y~rekistöröity~s~ henkilölle ~b~%s~s~', + -- Traffic interaction + ['traffic_interaction'] = 'Liikenne vuorovaikutus', + ['cone'] = 'kartio', + ['barrier'] = 'este', + ['spikestrips'] = 'piikkimatto', + ['box'] = 'laatikko', + ['cash'] = 'rahalaatikko', + -- ID Card Menu + ['name'] = 'nimi : ', + ['bac'] = 'alkometri : ', + -- Body Search Menu + ['confiscate_dirty'] = 'takavarikoi likainen raha: €', + ['guns_label'] = '--- Aseet ---', + ['confiscate'] = 'takavarikoi ', + ['inventory_label'] = '--- Reppu ---', + ['confiscate_inv'] = 'takavarikoi x', + + ['traffic_offense'] = 'liikenne rikokset', + ['minor_offense'] = 'lievät rikokset', + ['average_offense'] = 'keskisuuret rikokset', + ['major_offense'] = 'vakavat rikokset', + ['fine_total'] = 'sakko: ', + --Vehicle Info Menu + ['plate'] = 'kilpi: ', + ['owner_unknown'] = 'omistaja: Tuntematon', + ['owner'] = 'omistaja: ', + -- Weapons Menus + ['get_weapon_menu'] = 'asevarasto - Ota ase', + ['put_weapon_menu'] = 'asevarasto - Laita ase pois', + ['buy_weapon_menu'] = 'asevarasto - Osta aseet', + ['not_enough_money'] = 'sinulla ei ole tarpeeksi rahaa', + --Boss Menu + ['take_company_money'] = 'nosta yrityksen varoja', + ['deposit_money'] = 'talleta rahaa', + ['amount_of_withdrawal'] = 'noston määrä', + ['invalid_amount'] = 'virheellinen summa', + ['amount_of_deposit'] = 'talletuksen määrä', + ['open_bossmenu'] = 'paina ~INPUT_CONTEXT~ avataksesi valikon', + ['quantity_invalid'] = 'invalid quantity', + ['have_withdrawn'] = 'sinä nostit x', + ['added'] = 'sinä lisäsit varastoon x', + ['quantity'] = 'määrä', + ['inventory'] = 'varasto', + ['police_stock'] = 'Poliisin Varasto', + -- Misc + ['remove_object'] = 'Paina ~INPUT_CONTEXT~ poistaaksesi objektin', + ['map_blip'] = 'Poliisilaitos', + -- Notifications + ['from'] = '~s~ henkilöltä ~b~', + ['you_have_confinv'] = 'Takavarikoit ~y~x', + ['confinv'] = '~s~ takavarikoi sinulta ~y~x', + ['you_have_confdm'] = 'Sinä takavarikoit ~y~€ ', + ['confdm'] = '~s~ takavarikoi sinulta ~y~€ ', + ['you_have_confweapon'] = 'Takavarikoit ~y~x1 ', + ['confweapon'] = '~s~ takavarikoitiin sinulta ~y~x1 ', + ['alert_police'] = 'hälyytys Poliisi', +} \ No newline at end of file diff --git a/localization/fi_esx_policejob.sql b/localization/fi_esx_policejob.sql new file mode 100644 index 00000000..8710d8c5 --- /dev/null +++ b/localization/fi_esx_policejob.sql @@ -0,0 +1,88 @@ +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police','Poliisi',1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police','Poliisi',1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Poliisi', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police','Poliisi') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Tulokas',20,'{}','{}'), + ('police',1,'officer','Konstaapeli',40,'{}','{}'), + ('police',2,'sergeant','Ylikonstaapeli',60,'{}','{}'), + ('police',3,'lieutenant','Kersantti',85,'{}','{}'), + ('police',4,'boss','Komentaja',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Äänimerkin väärinkäyttö', 30, 0), + ('Laiton jatkuvan linjan ylitys', 40, 0), + ('Ajaminen tien väärällä puolella', 250, 0), + ('Laiton U-käännös', 250, 0), + ('Laiton maastossa ajaminen', 170, 0), + ('Virkavallan käskyn laiminlyönti', 30, 0), + ('Laiton pysähtyminen', 150, 0), + ('Laiton parkkeeraus', 70, 0), + ('Väistöolovelvollisuuden laiminlyönti', 70, 0), + ('Väärän ajoneuvontiedon antaminen', 90, 0), + ('Stop merkin laiminlyönti', 105, 0), + ('Punaisten valojen laiminlyönti', 130, 0), + ('Laiton ohitus', 100, 0), + ('Laittomalla ajoneuvolla ajaminen', 100, 0), + ('Ajokortitta ajo', 1500, 0), + ('Yliajo', 800, 0), + ('Ylinopeus < 5 kmh', 90, 0), + ('Ylinopeus 5-15 kmh', 120, 0), + ('Ylinopeus 15-30 kmh', 180, 0), + ('Ylinopeus > 30 kmh', 300, 0), + ('Liikenteen pysäytys tahallisesti', 110, 1), + ('Julkinen päihtyminen', 90, 1), + ('Sopimaton käytös', 90, 1), + ('Oikeusjärjestelmän estäminen', 130, 1), + ('Siviilin loukkaaminen', 75, 1), + ('Virkavallan halventaminen', 110, 1), + ('Sanallainen uhkaus siviiliä kohtaan', 90, 1), + ('Sanallinen uhkaus virkavaltaa kohtaan', 150, 1), + ('Virheellisen tiedon antaminen', 250, 1), + ('Korruptioyritys', 1500, 1), + ('Aseella heiluminen kaupungin sisällä', 120, 2), + ('Tappavalla aseella heiluminen kaupungin sisällä', 300, 2), + ('Ei aselupaa', 600, 2), + ('Laittoman aseen hallusapito', 700, 2), + ('Murtotyökalujen hallussapito', 300, 2), + ('Autovarkaus', 1800, 2), + ('Tarkoitus myydä/levittää laitonta ainetta', 1500, 2), + ('Laittoman aineen valmistus', 1500, 2), + ('Laittoman aineen hallusapito ', 650, 2), + ('Siviilin kidnappaus', 1500, 2), + ('Virkavallan kidnappaus', 2000, 2), + ('Ryöstö', 650, 2), + ('Aseellinen kaupparyöstö', 650, 2), + ('Aseellinen pankkiryöstö', 1500, 2), + ('Siviiliä kohtaan kohdistunut hyökkäys', 2000, 3), + ('Virkavaltaa kohtaan kohdistunut hyökkäys', 2500, 3), + ('Siviilin murhanyritys', 3000, 3), + ('Virkavallan murhanyirtys', 5000, 3), + ('Siviilin murha', 10000, 3), + ('Virkavallan murha', 30000, 3), + ('Väkivaltainan tappo', 1800, 3), + ('Petos', 2000, 2); +; From 3b99766257d758ebd478d8fb504b1cf608e8e028 Mon Sep 17 00:00:00 2001 From: AdrineX Date: Wed, 13 Jun 2018 04:02:16 +0300 Subject: [PATCH 129/253] lil fix --- locales/fi.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/fi.lua b/locales/fi.lua index 86d4a82a..062d9efb 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -100,7 +100,7 @@ Locales['fi'] = { ['inventory'] = 'varasto', ['police_stock'] = 'Poliisin Varasto', -- Misc - ['remove_object'] = 'Paina ~INPUT_CONTEXT~ poistaaksesi objektin', + ['remove_prop'] = 'Paina ~INPUT_CONTEXT~ poistaaksesi objektin', ['map_blip'] = 'Poliisilaitos', -- Notifications ['from'] = '~s~ henkilöltä ~b~', From 5a004dd663787aaf187d184c90c6d51b11218c5e Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 13 Jun 2018 21:54:46 +0200 Subject: [PATCH 130/253] Fixed #20 and fixed #21 --- client/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index edbdc9fa..f549c4a4 100644 --- a/client/main.lua +++ b/client/main.lua @@ -493,7 +493,7 @@ function OpenPoliceActionsMenu() local elements = {} local playerPed = GetPlayerPed(-1) local coords = GetEntityCoords(playerPed) - local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) + local vehicle = ESX.Game.GetVehicleInDirection() if DoesEntityExist(vehicle) then table.insert(elements, {label = _U('vehicle_info'), value = 'vehicle_infos'}) @@ -511,7 +511,7 @@ function OpenPoliceActionsMenu() elements = elements }, function(data2, menu2) coords = GetEntityCoords(playerPed) - vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) + vehicle = ESX.Game.GetVehicleInDirection() action = data2.current.value if action == 'search_database' then @@ -1422,7 +1422,6 @@ end) RegisterNetEvent('esx_policejob:drag') AddEventHandler('esx_policejob:drag', function(cop) - TriggerServerEvent('esx:clientLog', 'starting dragging') IsDragged = not IsDragged CopPed = tonumber(cop) end) @@ -1889,6 +1888,7 @@ AddEventHandler('playerSpawned', function(spawn) TriggerServerEvent('esx_policejob:spawned') end hasAlreadyJoined = true + IsHandcuffed = false end) AddEventHandler('esx:onPlayerDeath', function() From a27e58fd01b264d88d51a38fc820c9d8c6319d21 Mon Sep 17 00:00:00 2001 From: Bryz LARMITE <32412925+bryzvideo@users.noreply.github.com> Date: Sat, 16 Jun 2018 11:28:30 +0200 Subject: [PATCH 131/253] Traduction fr.lua Traduction de la saisie --- locales/fr.lua | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/locales/fr.lua b/locales/fr.lua index 34447920..6934ad2c 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -3,8 +3,8 @@ Locales['fr'] = { ['cloakroom'] = 'vestiaire', ['citizen_wear'] = 'tenue Civil', ['police_wear'] = 'tenue Policier', - ['sheriff_wear'] = 'sheriff Outfit', - ['lieutenant_wear'] = 'Swatt outfit', + ['sheriff_wear'] = 'Tenue sheriff', + ['lieutenant_wear'] = 'Tenue Swatt', ['gilet_wear'] = 'Gilet orange', ['bullet_wear'] = 'Gilet pare-balles', ['no_outfit'] = 'Il n\'y a pas d\'uniforme à votre taille...', @@ -35,26 +35,26 @@ Locales['fr'] = { ['put_in_vehicle'] = 'mettre dans véhicule', ['out_the_vehicle'] = 'sortir du véhicule', ['fine'] = 'Amende', - ['license_check'] = 'manage license', - ['license_revoke'] = 'revoke license', - ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', - ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', + ['license_check'] = 'gérer les licences', + ['license_revoke'] = 'révoquer la licence', + ['license_revoked'] = 'votre ~b~%s~s~ a été ~y~révoqué~s~!', + ['licence_you_revoked'] = 'vous avez révoqué un ~b~%s~s~ qui appartenait à ~y~%s~s~', ['no_players_nearby'] = 'aucun joueur à proximité', -- Vehicle interaction ['vehicle_info'] = 'infos véhicule', ['pick_lock'] = 'crocheter véhicule', ['vehicle_unlocked'] = 'véhicule ~g~déverouillé~s~', ['no_vehicles_nearby'] = 'aucun véhicule à proximité', - ['impound'] = 'impound vehicle', - ['impound_prompt'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~impound~s~', - ['impound_canceled'] = 'you canceled the impound', - ['impound_canceled_moved'] = 'the impound has been canceled because the vehicle moved', - ['impound_successful'] = 'you have impounded the vehicle', + ['impound'] = 'véhicule en fourrière', + ['impound_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour annuler la ~y~saisie du véhicule~s~', + ['impound_canceled'] = 'vous avez annulé la saisie', + ['impound_canceled_moved'] = 'la saisie a été annulée parce que le véhicule a déménagé', + ['impound_successful'] = 'vous avez saisi le véhicule', ['search_database'] = 'vehicle information', - ['search_database_title'] = 'vehicle information - search with registration number', - ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', - ['search_database_error_not_found'] = 'that ~y~registration number~s~ is ~r~not~s~ registered to an vehicle!', - ['search_database_found'] = 'the vehicle is ~y~registered~s~ to ~b~%s~s~', + ['search_database_title'] = 'informations sur le véhicule - recherche avec numéro d\'enregistrement', + ['search_database_error_invalid'] = 'Ce n\'est ~r~pas~s~ un ~y~numéro d\'enregistrement valide~s~', + ['search_database_error_not_found'] = 'ce ~y~numéro d\'enregistrement ~s~est~r~ pas ~s~ enregistré sur un véhicule!', + ['search_database_found'] = 'le véhicule est ~y~enregistré~s~ à ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'interaction routière', ['cone'] = 'plot', From d36a62a0f2018a1d9a54477d5cc67f3033365e10 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 22 Jun 2018 21:54:00 +0200 Subject: [PATCH 132/253] Improved confiscate messages, closes #107 --- __resource.lua | 2 + client/main.lua | 20 +++++----- locales/br.lua | 34 ++++++++--------- locales/de.lua | 34 ++++++++--------- locales/en.lua | 42 ++++++++++----------- locales/es.lua | 34 ++++++++--------- locales/fi.lua | 32 ++++++++-------- locales/fr.lua | 34 ++++++++--------- locales/pl.lua | 35 ++++++++--------- locales/sv.lua | 62 +++++++++++++++---------------- localization/de_esx_policejob.sql | 4 +- localization/en_esx_policejob.sql | 8 ++-- localization/fi_esx_policejob.sql | 8 ++-- localization/pl_esx_policejob.sql | 9 +++-- localization/sv_esx_policejob.sql | 32 ++++++++-------- server/main.lua | 23 ++++++------ 16 files changed, 204 insertions(+), 209 deletions(-) diff --git a/__resource.lua b/__resource.lua index 1c08a61f..f5e4992b 100644 --- a/__resource.lua +++ b/__resource.lua @@ -30,3 +30,5 @@ client_scripts { 'config.lua', 'client/main.lua' } + +dependency 'es_extended' \ No newline at end of file diff --git a/client/main.lua b/client/main.lua index f549c4a4..8df1711e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -397,7 +397,7 @@ function OpenVehicleSpawnerMenu(station, partNum) end) else - ESX.ShowNotification(_U('service_max') .. inServiceCount .. '/' .. maxInService) + ESX.ShowNotification(_U('service_max', inServiceCount, maxInService) .. inServiceCount .. '/' .. maxInService) end end, 'police') @@ -774,17 +774,17 @@ function OpenBodySearchMenu(player) end table.insert(elements, { - label = _U('confiscate_dirty') .. blackMoney, + label = _U('confiscate_dirty', blackMoney), value = 'black_money', itemType = 'item_account', amount = blackMoney }) - table.insert(elements, {label = '--- Armes ---', value = nil}) + table.insert(elements, {label = _U('guns_label'), value = nil}) for i=1, #data.weapons, 1 do table.insert(elements, { - label = _U('confiscate') .. ESX.GetWeaponLabel(data.weapons[i].name), + label = _U('confiscate', ESX.GetWeaponLabel(data.weapons[i].name)), value = data.weapons[i].name, itemType = 'item_weapon', amount = data.ammo, @@ -796,7 +796,7 @@ function OpenBodySearchMenu(player) for i=1, #data.inventory, 1 do if data.inventory[i].count > 0 then table.insert(elements, { - label = _U('confiscate_inv') .. data.inventory[i].count .. ' ' .. data.inventory[i].label, + label = _U('confiscate_inv', data.inventory[i].count, data.inventory[i].label), value = data.inventory[i].name, itemType = 'item_standard', amount = data.inventory[i].count, @@ -892,9 +892,9 @@ function OpenFineCategoryMenu(player, category) menu.close() if Config.EnablePlayerManagement then - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', _U('fine_total') .. label, amount) + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', _U('fine_total', label), amount) else - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', _U('fine_total') .. label, amount) + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', _U('fine_total', label), amount) end ESX.SetTimeout(300, function() @@ -986,12 +986,12 @@ function OpenVehicleInfosMenu(vehicleData) local elements = {} - table.insert(elements, {label = _U('plate') .. infos.plate, value = nil}) + table.insert(elements, {label = _U('plate', infos.plate), value = nil}) if infos.owner == nil then table.insert(elements, {label = _U('owner_unknown'), value = nil}) else - table.insert(elements, {label = _U('owner') .. infos.owner, value = nil}) + table.insert(elements, {label = _U('owner', infos.owner), value = nil}) end ESX.UI.Menu.Open( @@ -1059,7 +1059,7 @@ function OpenPutWeaponMenu() local weaponHash = GetHashKey(weaponList[i].name) if HasPedGotWeapon(playerPed, weaponHash, false) and weaponList[i].name ~= 'WEAPON_UNARMED' then - local ammo = GetAmmoInPedWeapon(playerPed, weaponHash) + --local ammo = GetAmmoInPedWeapon(playerPed, weaponHash) table.insert(elements, {label = weaponList[i].label, value = weaponList[i].name}) end diff --git a/locales/br.lua b/locales/br.lua index 93333dfd..254db92b 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -22,7 +22,7 @@ Locales['br'] = { ['vehicle_out'] = 'Já existe um carro fora da garagem', ['vehicle_spawner'] = 'Pressione ~INPUT_CONTEXT~ para escolher um veículo', ['store_vehicle'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', - ['service_max'] = 'Maximo de oficiais em serviço : ', + ['service_max'] = 'maximo de oficiais em serviço: %s/%s', -- Action Menu ['citizen_interaction'] = 'Interagir com o cidadão', ['vehicle_interaction'] = 'Interagir com o veículo', @@ -63,24 +63,29 @@ Locales['br'] = { ['box'] = 'Caixa', ['cash'] = 'Caixa de dinheiro', -- ID Card Menu - ['name'] = 'Nome : ', - ['bac'] = 'bAC : ', + ['name'] = 'Nome: %s', + ['bac'] = 'BAC: %s', -- Body Search Menu - ['confiscate_dirty'] = 'Confiscar dinheiro sujo : $', ['guns_label'] = '--- Armas ---', - ['confiscate'] = 'Confiscar ', ['inventory_label'] = '--- Inventário ---', - ['confiscate_inv'] = 'Confiscar x', - + ['confiscate'] = 'confiscar %s', + ['confiscate_inv'] = 'Confiscar %sx %s', + ['confiscate_dirty'] = 'Confiscar dinheiro sujo: $%s', + ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'you confiscated ~g~$%s~s~ (%s) from ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) was confiscated by ~y~%s~s~', + ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', + ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', ['traffic_offense'] = 'Infrações de transito', ['minor_offense'] = 'Infração leve', ['average_offense'] = 'Infração média', ['major_offense'] = 'Infração grave', - ['fine_total'] = 'Multa : ', + ['fine_total'] = 'multa: %s', -- Vehicle Info Menu - ['plate'] = 'Placa: ', - ['owner_unknown'] = 'Proprietário : Desconhecido', - ['owner'] = 'Proprietário : ', + ['plate'] = 'placa: %s', + ['owner_unknown'] = 'proprietário: Desconhecido', + ['owner'] = 'proprietário: %s', -- Weapons Menus ['get_weapon_menu'] = 'Arsenal - Pegar arma', ['put_weapon_menu'] = 'Arsenal - Entregar arma', @@ -97,12 +102,5 @@ Locales['br'] = { ['remove_prop'] = 'Pressione ~INPUT_CONTEXT~ para remover o objeto', ['map_blip'] = 'Departamento de Polícia', -- Notifications - ['from'] = '~s~ de ~b~', - ['you_have_confinv'] = 'Você confiscou ~y~x', - ['confinv'] = '~s~ confiscado de você ~y~x', - ['you_have_confdm'] = 'Você confiscou ~y~$', - ['confdm'] = '~s~ confiscado de você ~y~$', - ['you_have_confweapon'] = 'Você confiscou ~y~x1 ', - ['confweapon'] = '~s~ confiscado de você ~y~x1 ', ['alert_police'] = 'Alerta da Polícia', } diff --git a/locales/de.lua b/locales/de.lua index 0cfd0ef2..5e517869 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -22,7 +22,7 @@ Locales['de'] = { ['vehicle_out'] = 'es ist bereits ein Fahrzeug draussen', ['vehicle_spawner'] = 'Drücke ~INPUT_CONTEXT~ um ein Fahrzeug zu holen', ['store_vehicle'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', - ['service_max'] = 'Max Polizisten im Dienst : ', + ['service_max'] = 'max Polizisten im Dienst: %s/%s', -- Action Menu ['citizen_interaction'] = 'Zivilistenaktionen', ['vehicle_interaction'] = 'Fahrzeuginteraktionen', @@ -63,24 +63,29 @@ Locales['de'] = { ['box'] = 'Box', ['cash'] = 'Box mit Geld', -- ID Card Menu - ['name'] = 'name : ', - ['bac'] = 'bAC : ', + ['name'] = 'name: %s', + ['bac'] = 'BAC: %s', -- Body Search Menu - ['confiscate_dirty'] = 'Schwarzgeld konfesziert : $', ['guns_label'] = '--- Waffen ---', - ['confiscate'] = 'konfeszieren ', ['inventory_label'] = '--- Inventar ---', - ['confiscate_inv'] = 'konfeziere x', - + ['confiscate'] = 'konfeszieren %s', + ['confiscate_inv'] = 'konfeziere %sx %s', + ['confiscate_dirty'] = 'schwarzgeld konfesziert: $%s', + ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'you confiscated ~g~$%s~s~ (%s) from ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) was confiscated by ~y~%s~s~', + ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', + ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', ['traffic_offense'] = 'Verkehrs vergehen', ['minor_offense'] = 'Geringes vergehen', ['average_offense'] = 'Normales vergehen', ['major_offense'] = 'Hohes vergehen', - ['fine_total'] = 'Strafe : ', + ['fine_total'] = 'strafe: %s', -- Vehicle Info Menu - ['plate'] = 'Plate: ', - ['owner_unknown'] = 'Besitzer : Unbekannt', - ['owner'] = 'Besitzer : ', + ['plate'] = 'plate: %s', + ['owner_unknown'] = 'besitzer: Unbekannt', + ['owner'] = 'besitzer: %s', -- Weapons Menus ['get_weapon_menu'] = 'Waffenkammer - Waffen nehmen', ['put_weapon_menu'] = 'Waffenkammer - Waffen bringen', @@ -97,12 +102,5 @@ Locales['de'] = { ['remove_prop'] = 'Drücke ~INPUT_CONTEXT~ um das Objekt zu entfernen', ['map_blip'] = 'Polizeistation', -- Notifications - ['from'] = '~s~ von ~b~', - ['you_have_confinv'] = 'du hast ~y~x konfesziert', - ['confinv'] = '~s~ hat von dir ~y~x konfesziert', - ['you_have_confdm'] = 'du hast ~y~$ konfesziert', - ['confdm'] = '~s~ hat von dir ~y~$ konfesziert', - ['you_have_confweapon'] = 'du hast ~y~x1 konfesziert', - ['confweapon'] = '~s~ hat von dir ~y~x1 konfesziert', ['alert_police'] = 'Polizei alamieren', } diff --git a/locales/en.lua b/locales/en.lua index d8cd8bd3..14a4a825 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -22,7 +22,7 @@ Locales['en'] = { ['vehicle_out'] = 'there is already a car out of the garage', ['vehicle_spawner'] = 'press ~INPUT_CONTEXT~ to take out a vehicle', ['store_vehicle'] = 'press ~INPUT_CONTEXT~ to store the vehicle', - ['service_max'] = 'Max officers in service: ', + ['service_max'] = 'max officers in service: %s/%s', -- Action Menu ['citizen_interaction'] = 'citizen Interaction', ['vehicle_interaction'] = 'vehicle Interaction', @@ -56,31 +56,36 @@ Locales['en'] = { ['search_database_error_not_found'] = 'that ~y~registration number~s~ is ~r~not~s~ registered to an vehicle!', ['search_database_found'] = 'the vehicle is ~y~registered~s~ to ~b~%s~s~', -- Traffic interaction - ['traffic_interaction'] = 'Interaction Traffic', + ['traffic_interaction'] = 'interaction Traffic', ['cone'] = 'cone', ['barrier'] = 'barrier', ['spikestrips'] = 'spikestrips', ['box'] = 'box', ['cash'] = 'Box of cash', -- ID Card Menu - ['name'] = 'name : ', - ['bac'] = 'bAC : ', + ['name'] = 'name: %s', + ['bac'] = 'BAC: %s', -- Body Search Menu - ['confiscate_dirty'] = 'confiscate dirty money: $', ['guns_label'] = '--- Guns ---', - ['confiscate'] = 'confiscate ', ['inventory_label'] = '--- Inventory ---', - ['confiscate_inv'] = 'confiscate x', - + ['confiscate'] = 'confiscate %s', + ['confiscate_inv'] = 'confiscate %sx %s', + ['confiscate_dirty'] = 'confiscate dirty money: $%s', + ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'you confiscated ~g~$%s~s~ (%s) from ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) was confiscated by ~y~%s~s~', + ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', + ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', ['traffic_offense'] = 'traffic Offense', ['minor_offense'] = 'minor Offense', ['average_offense'] = 'average Offense', ['major_offense'] = 'major Offense', - ['fine_total'] = 'fine: ', + ['fine_total'] = 'fine: %s', -- Vehicle Info Menu - ['plate'] = 'Plate: ', + ['plate'] = 'plate: %s', ['owner_unknown'] = 'owner: Unknown', - ['owner'] = 'owner: ', + ['owner'] = 'owner: %s', -- Weapons Menus ['get_weapon_menu'] = 'armory - Take Weapon', ['put_weapon_menu'] = 'armory - Put Weapon', @@ -90,13 +95,13 @@ Locales['en'] = { ['take_company_money'] = 'withdraw Company Money', ['deposit_money'] = 'deposit Money', ['amount_of_withdrawal'] = 'amount of Withdrawal', - ['invalid_amount'] = 'amount Invalid', - ['amount_of_deposit'] = 'amount of Deposit', + ['invalid_amount'] = 'amount invalid', + ['amount_of_deposit'] = 'amount of deposit', ['open_bossmenu'] = 'press ~INPUT_CONTEXT~ to open the menu', ['quantity_invalid'] = 'invalid quantity', ['have_withdrawn'] = 'you have withdrawn x', - ['not_enough_in_society'] = 'there\'s not enough of ~r~that item~w~ in the society!', - ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', + ['not_enough_in_society'] = 'there\'s not enough of ~r~that item~s~ in the society!', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', ['added'] = 'you added x', ['quantity'] = 'quantity', ['inventory'] = 'inventory', @@ -105,12 +110,5 @@ Locales['en'] = { ['remove_prop'] = 'press ~INPUT_CONTEXT~ to delete the object', ['map_blip'] = 'police Station', -- Notifications - ['from'] = '~s~ from ~b~', - ['you_have_confinv'] = 'you have confiscated ~y~x', - ['confinv'] = '~s~ confiscated from you ~y~x', - ['you_have_confdm'] = 'you have confiscated ~y~$', - ['confdm'] = '~s~ confiscated from you ~y~$', - ['you_have_confweapon'] = 'you have confiscated ~y~x1 ', - ['confweapon'] = '~s~ confiscated from you ~y~x1 ', ['alert_police'] = 'alert police', } diff --git a/locales/es.lua b/locales/es.lua index 4aada580..103e70cb 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -22,7 +22,7 @@ Locales['es'] = { ['vehicle_out'] = 'Ya tienes un vehículo fuera', ['vehicle_spawner'] = 'Presionar ~INPUT_CONTEXT~ para sacar un vehículo', ['store_vehicle'] = 'Presionar ~INPUT_CONTEXT~ para guardar un vehículo', - ['service_max'] = 'Servicio completado : ', + ['service_max'] = 'Servicio completado: %s/%s', -- Action Menu ['citizen_interaction'] = 'Interacción ciudadana', ['vehicle_interaction'] = 'Interacción vehículo', @@ -63,24 +63,29 @@ Locales['es'] = { ['box'] = 'Caja', ['cash'] = 'Dinero', -- ID Card Menu - ['name'] = 'Nombre : ', - ['bac'] = 'Alcoolemia : ', + ['name'] = 'nombre: %s', + ['bac'] = 'alcoolemia: %s', -- Body Search Menu - ['confiscate_dirty'] = 'Confiscar dinero negro : €', ['guns_label'] = '--- Armas ---', - ['confiscate'] = 'Confiscar ', ['inventory_label'] = '--- Inventario ---', - ['confiscate_inv'] = 'Confiscar x', - + ['confiscate'] = 'confiscar %s', + ['confiscate_inv'] = 'confiscar %sx %s', + ['confiscate_dirty'] = 'confiscar dinero negro: €%s', + ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'you confiscated ~g~€%s~s~ (%s) from ~b~%s~s~', + ['got_confiscated_account'] = '~g~€%s~s~ (%s) was confiscated by ~y~%s~s~', + ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', + ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', ['traffic_offense'] = 'Delito de tráfico', ['minor_offense'] = 'Delito menor', ['average_offense'] = 'Delito medio', ['major_offense'] = 'Delito grave', - ['fine_total'] = 'Multa total : ', + ['fine_total'] = 'Multa total: %s', -- Vehicle Info Menu - ['plate'] = 'N°: ', - ['owner_unknown'] = 'Propietario : Desconocido', - ['owner'] = 'Propietario : ', + ['plate'] = 'n°: %s', + ['owner_unknown'] = 'propietario: Desconocido', + ['owner'] = 'propietario: %s', -- Weapons Menus ['get_weapon_menu'] = 'Arsenal - Coger armas', ['put_weapon_menu'] = 'Arsenal - Depositar armas', @@ -103,12 +108,5 @@ Locales['es'] = { ['remove_prop'] = 'Presionar ~INPUT_CONTEXT~ para eliminar el objeto', ['map_blip'] = 'Comisaría de policía', -- Notifications - ['from'] = '~s~ de ~b~', - ['you_have_confinv'] = 'Has confiscado ~y~x', - ['confinv'] = '~s~ Te han confiscado ~y~x', - ['you_have_confdm'] = 'Has confiscado ~y~€', - ['confdm'] = '~s~ Te han confiscado ~y~€', - ['you_have_confweapon'] = 'Has confiscado ~y~x1 ', - ['confweapon'] = '~s~ Te han confiscado ~y~x1 ', ['alert_police'] = 'Alerta policia', } diff --git a/locales/fi.lua b/locales/fi.lua index 062d9efb..86f909c2 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -22,7 +22,7 @@ Locales['fi'] = { ['vehicle_out'] = 'ajoneuvo on jo ulkona tallista', ['vehicle_spawner'] = 'paina ~INPUT_CONTEXT~ ottaaksesi auton ulos', ['store_vehicle'] = 'paina ~INPUT_CONTEXT~ laittaaksesi auto talliin', - ['service_max'] = 'maksimi määrä poliiseja: ', + ['service_max'] = 'maksimi määrä poliiseja: %s/%s', -- Action Menu ['citizen_interaction'] = 'siviilin vuorovaikutus', ['vehicle_interaction'] = 'ajoneuvon vuorovaikutus', @@ -63,24 +63,29 @@ Locales['fi'] = { ['box'] = 'laatikko', ['cash'] = 'rahalaatikko', -- ID Card Menu - ['name'] = 'nimi : ', - ['bac'] = 'alkometri : ', + ['name'] = 'nimi: %s', + ['bac'] = 'alkometri: %s', -- Body Search Menu - ['confiscate_dirty'] = 'takavarikoi likainen raha: €', ['guns_label'] = '--- Aseet ---', - ['confiscate'] = 'takavarikoi ', ['inventory_label'] = '--- Reppu ---', - ['confiscate_inv'] = 'takavarikoi x', - + ['confiscate'] = 'takavarikoi %s', + ['confiscate_inv'] = 'takavarikoi %sx %s', + ['confiscate_dirty'] = 'takavarikoi likainen raha: €%s', + ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'you confiscated ~g~$%s~s~ (%s) from ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) was confiscated by ~y~%s~s~', + ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', + ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', ['traffic_offense'] = 'liikenne rikokset', ['minor_offense'] = 'lievät rikokset', ['average_offense'] = 'keskisuuret rikokset', ['major_offense'] = 'vakavat rikokset', - ['fine_total'] = 'sakko: ', + ['fine_total'] = 'sakko: %s', --Vehicle Info Menu - ['plate'] = 'kilpi: ', + ['plate'] = 'kilpi: %s', ['owner_unknown'] = 'omistaja: Tuntematon', - ['owner'] = 'omistaja: ', + ['owner'] = 'omistaja: %s', -- Weapons Menus ['get_weapon_menu'] = 'asevarasto - Ota ase', ['put_weapon_menu'] = 'asevarasto - Laita ase pois', @@ -103,12 +108,5 @@ Locales['fi'] = { ['remove_prop'] = 'Paina ~INPUT_CONTEXT~ poistaaksesi objektin', ['map_blip'] = 'Poliisilaitos', -- Notifications - ['from'] = '~s~ henkilöltä ~b~', - ['you_have_confinv'] = 'Takavarikoit ~y~x', - ['confinv'] = '~s~ takavarikoi sinulta ~y~x', - ['you_have_confdm'] = 'Sinä takavarikoit ~y~€ ', - ['confdm'] = '~s~ takavarikoi sinulta ~y~€ ', - ['you_have_confweapon'] = 'Takavarikoit ~y~x1 ', - ['confweapon'] = '~s~ takavarikoitiin sinulta ~y~x1 ', ['alert_police'] = 'hälyytys Poliisi', } \ No newline at end of file diff --git a/locales/fr.lua b/locales/fr.lua index 34447920..3115ab39 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -22,7 +22,7 @@ Locales['fr'] = { ['vehicle_out'] = 'il y a déja un véhicule de sorti', ['vehicle_spawner'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir un véhicule', ['store_vehicle'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', - ['service_max'] = 'Service complet : ', + ['service_max'] = 'service complet: %s/%s', -- Action Menu ['citizen_interaction'] = 'interaction citoyen', ['vehicle_interaction'] = 'interaction véhicule', @@ -63,24 +63,29 @@ Locales['fr'] = { ['box'] = 'caisse', ['cash'] = 'caisse', -- ID Card Menu - ['name'] = 'nom : ', - ['bac'] = 'alcoolémie : ', + ['name'] = 'nom: %s', + ['bac'] = 'alcoolémie: %s', -- Body Search Menu - ['confiscate_dirty'] = 'confisquer argent sale : $', ['guns_label'] = '--- Armes ---', - ['confiscate'] = 'confisquer ', ['inventory_label'] = '--- Inventaire ---', - ['confiscate_inv'] = 'confisquer x', - + ['confiscate'] = 'confisquer %s', + ['confiscate_inv'] = 'confisquer %sx %s', + ['confiscate_dirty'] = 'confisquer argent sale: €%s', + ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'you confiscated ~g~€%s~s~ (%s) from ~b~%s~s~', + ['got_confiscated_account'] = '~g~€%s~s~ (%s) was confiscated by ~y~%s~s~', + ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', + ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', ['traffic_offense'] = 'code de la route', ['minor_offense'] = 'délit mineur', ['average_offense'] = 'délit moyen', ['major_offense'] = 'délit grave', - ['fine_total'] = 'amende : ', + ['fine_total'] = 'amende: %s', -- Vehicle Info Menu - ['plate'] = 'N°: ', - ['owner_unknown'] = 'propriétaire : Inconnu', - ['owner'] = 'propriétaire : ', + ['plate'] = 'n°: %s', + ['owner_unknown'] = 'propriétaire: Inconnu', + ['owner'] = 'propriétaire: %s', -- Weapons Menus ['get_weapon_menu'] = 'armurerie - Prendre Arme', ['put_weapon_menu'] = 'armurerie - Déposer Arme', @@ -103,12 +108,5 @@ Locales['fr'] = { ['remove_prop'] = 'appuyez sur ~INPUT_CONTEXT~ pour enlever l\'objet', ['map_blip'] = 'Commissariat', -- Notifications - ['from'] = '~s~ à ~b~', - ['you_have_confinv'] = 'vous avez confisqué ~y~x', - ['confinv'] = '~s~ vous a confisqué ~y~x', - ['you_have_confdm'] = 'vous avez confisqué ~y~$', - ['confdm'] = '~s~ vous a confisqué ~y~$', - ['you_have_confweapon'] = 'vous avez confisqué ~y~x1 ', - ['confweapon'] = '~s~ vous a confisqué ~y~x1 ', ['alert_police'] = 'alerte police', } diff --git a/locales/pl.lua b/locales/pl.lua index e475bcbf..aca981cd 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -22,8 +22,7 @@ Locales['pl'] = { ['vehicle_out'] = 'Masz już pojazd poza garażem', ['vehicle_spawner'] = 'Naciśnij ~INPUT_CONTEXT~ żeby wziąć pojazd', ['store_vehicle'] = 'Naciśnij ~INPUT_CONTEXT~ żeby przechować pojazd', - ['service_max'] = 'Maksymalna ilość policjantów na służbie: ', - + ['service_max'] = 'maksymalna ilość policjantów na służbie: %s/%s', -- Action Menu ['citizen_interaction'] = 'Interakcja z cywilami', ['vehicle_interaction'] = 'Interakcja z pojazdami', @@ -64,24 +63,29 @@ Locales['pl'] = { ['box'] = 'Pudła', ['cash'] = 'Paleta z pieniędzmi', -- ID Card Menu - ['name'] = 'Nazwa : ', - ['bac'] = 'bAC : ', + ['name'] = 'nazwa: %s', + ['bac'] = 'BAC: %s', -- Body Search Menu - ['confiscate_dirty'] = 'Skonfiskuj brudne pieniądze: $', ['guns_label'] = '--- Bronie ---', - ['confiscate'] = 'Skonfiskuj ', ['inventory_label'] = '--- Ekwipunek ---', - ['confiscate_inv'] = 'Skonfiskuj x', - + ['confiscate'] = 'skonfiskuj %s', + ['confiscate_inv'] = 'skonfiskuj %sx %s', + ['confiscate_dirty'] = 'skonfiskuj brudne pieniądze: $%s', + ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'you confiscated ~g~$%s~s~ (%s) from ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) was confiscated by ~y~%s~s~', + ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', + ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', ['traffic_offense'] = 'Wykroczenia drogowe', ['minor_offense'] = 'Niewielkie wykroczenia', ['average_offense'] = 'Średnie wykroczenia', ['major_offense'] = 'Duże wykroczenia', - ['fine_total'] = 'Mandat: ', + ['fine_total'] = 'mandat: %s', -- Vehicle Info Menu - ['plate'] = 'Tablica rejestracyjna: ', - ['owner_unknown'] = 'Właściciel: Nieznany', - ['owner'] = 'Właściciel: ', + ['plate'] = 'tablica rejestracyjna: %s', + ['owner_unknown'] = 'właściciel: Nieznany', + ['owner'] = 'właściciel: %s', -- Weapons Menus ['get_weapon_menu'] = 'Zbrojownia - Weź broń', ['put_weapon_menu'] = 'Zbrojownia - Odłóż broń', @@ -106,12 +110,5 @@ Locales['pl'] = { ['remove_prop'] = 'Naciśnij ~INPUT_CONTEXT~ aby usunąć ten obiekt', ['map_blip'] = 'Komisariat Policji', -- Notifications - ['from'] = '~s~ od ~b~', - ['you_have_confinv'] = 'Skonfiskowałeś ~y~x', - ['confinv'] = '~s~ skonfiskowane przez Ciebie ~y~x', - ['you_have_confdm'] = 'Skonfiskowałeś ~y~$', - ['confdm'] = '~s~ skonfiskowane przez Ciebie ~y~$', - ['you_have_confweapon'] = 'Skonfiskowałeś ~y~x1 ', - ['confweapon'] = '~s~ skonfiskowane przez Ciebie ~y~x1 ', ['alert_police'] = 'Ostrzeż policję', } diff --git a/locales/sv.lua b/locales/sv.lua index 35279762..b69560ca 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -1,14 +1,14 @@ Locales['sv'] = { -- Cloakroom - ['cloakroom'] = 'Omklädningsrum', - ['citizen_wear'] = 'Civila kläder', - ['police_wear'] = 'Polisuniform', - ['sheriff_wear'] = 'Inspektöruniform', - ['lieutenant_wear'] = 'Insatsstyrka', - ['gilet_wear'] = 'Reflektiv väst', - ['bullet_wear'] = 'Skottsäker väst', - ['no_outfit'] = 'Du har ingen uniform!', - ['open_cloackroom'] = 'tryck ~INPUT_CONTEXT~ för att byta ~y~kläder~s~.', + ['cloakroom'] = 'omklädningsrum', + ['citizen_wear'] = 'civila kläder', + ['police_wear'] = 'polisuniform', + ['sheriff_wear'] = 'inspektöruniform', + ['lieutenant_wear'] = 'insatsstyrka', + ['gilet_wear'] = 'reflektiv väst', + ['bullet_wear'] = 'skottsäker väst', + ['no_outfit'] = 'det finns ingen uniform som passar dig!', + ['open_cloackroom'] = 'tryck ~INPUT_CONTEXT~ för att välja ~y~kläder~s~.', -- Armory ['remove_object'] = 'Ta ut objekt', ['deposit_object'] = 'Lägg in objekt', @@ -22,7 +22,7 @@ Locales['sv'] = { ['vehicle_out'] = 'Det finns redan en bil ute!', ['vehicle_spawner'] = 'Tryck ~INPUT_CONTEXT~ för att ta ut en bil', ['store_vehicle'] = 'Tryck ~INPUT_CONTEXT~ för att parkera bilen', - ['service_max'] = 'Max officers in service: ', + ['service_max'] = 'max antal poliser i tjänst: %s/%s', -- Action Menu ['citizen_interaction'] = 'Handlingar mot civila', ['vehicle_interaction'] = 'Handlingar på bilar', @@ -63,24 +63,29 @@ Locales['sv'] = { ['box'] = 'låda', ['cash'] = 'låda med pengar', -- ID Card Menu - ['name'] =' Namn: ', - ['bac'] = 'Procent alkohol i blodet: ', + ['name'] ='namn: %s', + ['bac'] = 'procent alkohol i blodet: %s', -- Body Search Menu - ['confiscate_dirty'] = 'Konfiskera svarta pengar: $', - ['guns_label'] = '--- Guns ---', - ['confiscate'] = 'Konfiskera', + ['guns_label'] = '--- Vapen ---', ['inventory_label'] = '--- Inventory ---', - ['confiscate_inv'] = 'Konfiskera x', - - ['traffic_offense'] = 'Brutit mot trafikregler', - ['minor_offense'] = 'Mindre lagbrott', - ['average_offense'] = 'Medel lagbrott', - ['major_offense'] = 'Grovt lagbrott', - ['fine_total'] = 'Böter: ', + ['confiscate'] = 'beslagta %s', + ['confiscate_inv'] = 'beslagta %sx %s', + ['confiscate_dirty'] = 'beslagta svarta pengar: $%s', + ['you_confiscated'] = 'du beslagtog ~y~%sx~s~ ~b~%s~s~ från ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ beslagtogs av ~y~%s~s~', + ['you_confiscated_account'] = 'du beslagtog ~g~$%s~s~ (%s) från ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) beslagtogs av ~y~%s~s~', + ['you_confiscated_weapon'] = 'du beslagtog ~b~%s~s~ från ~b~%s~s~ med ~o~%s~s~ skott', + ['got_confiscated_weapon'] = 'din ~b~%s~s~ med ~o~%s~s~ skott beslagtogs av ~y~%s~s~', + ['traffic_offense'] = 'brott mot trafikregler', + ['minor_offense'] = 'mindre lagbrott', + ['average_offense'] = 'medel lagbrott', + ['major_offense'] = 'grovt lagbrott', + ['fine_total'] = 'böter: %s', -- Vehicle Info Menu - ['plate'] = 'Reg nummer: ', - ['owner_unknown'] = 'Ägare: Okänt', - ['owner'] = 'Ägare: ', + ['plate'] = 'reg nummer: %s', + ['owner_unknown'] = 'ägare: Okänt', + ['owner'] = 'ägare: %s', -- Weapons Menus ['get_weapon_menu'] = 'Vapenförråd - Ta vapen', ['put_weapon_menu'] = 'Vapenförråd - Lägg in vapen', @@ -103,12 +108,5 @@ Locales['sv'] = { ['remove_prop'] = 'tryck ~INPUT_CONTEXT~ för att ta bort obejektet', ['map_blip'] = 'Polisstation', -- Notifications - ['from'] = '~s~ från ~b~', - ['you_have_confinv'] = 'Du har konfiskerat ~y~x', - ['confinv'] = '~s~ konfiskerade ~y~x', - ['you_have_confdm'] = 'Du har konfiskerat ~y~$', - ['confdm'] = '~s~ konfiskerade ~y~$', - ['you_have_confweapon'] = 'Du har konfiskerat ~y~x1 ', - ['confweapon'] = '~s~ konfiskerade ~y~x1 ', ['alert_police'] = 'Meddela polisen', } diff --git a/localization/de_esx_policejob.sql b/localization/de_esx_policejob.sql index 97113aa6..dee8b026 100644 --- a/localization/de_esx_policejob.sql +++ b/localization/de_esx_policejob.sql @@ -1,3 +1,5 @@ +USE `essentialmode`; + INSERT INTO `addon_account` (name, label, shared) VALUES ('society_police','Polizei',1) ; @@ -11,7 +13,7 @@ INSERT INTO `addon_inventory` (name, label, shared) VALUES ; INSERT INTO `jobs` (name, label) VALUES - ('police','LSPD') + ('police', 'Polizei') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES diff --git a/localization/en_esx_policejob.sql b/localization/en_esx_policejob.sql index d48ebba6..ad1f7601 100644 --- a/localization/en_esx_policejob.sql +++ b/localization/en_esx_policejob.sql @@ -1,9 +1,11 @@ +USE `essentialmode`; + INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_police','Police',1) + ('society_police', 'Police', 1) ; INSERT INTO `datastore` (name, label, shared) VALUES - ('society_police','Police',1) + ('society_police', 'Police', 1) ; INSERT INTO `addon_inventory` (name, label, shared) VALUES @@ -11,7 +13,7 @@ INSERT INTO `addon_inventory` (name, label, shared) VALUES ; INSERT INTO `jobs` (name, label) VALUES - ('police','LSPD') + ('police', 'Police') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES diff --git a/localization/fi_esx_policejob.sql b/localization/fi_esx_policejob.sql index 8710d8c5..dd51d4cf 100644 --- a/localization/fi_esx_policejob.sql +++ b/localization/fi_esx_policejob.sql @@ -1,9 +1,11 @@ +USE `essentialmode`; + INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_police','Poliisi',1) + ('society_police', 'Poliisi', 1) ; INSERT INTO `datastore` (name, label, shared) VALUES - ('society_police','Poliisi',1) + ('society_police', 'Poliisi', 1) ; INSERT INTO `addon_inventory` (name, label, shared) VALUES @@ -11,7 +13,7 @@ INSERT INTO `addon_inventory` (name, label, shared) VALUES ; INSERT INTO `jobs` (name, label) VALUES - ('police','Poliisi') + ('police', 'Poliisi') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES diff --git a/localization/pl_esx_policejob.sql b/localization/pl_esx_policejob.sql index bf9201b1..1512644e 100644 --- a/localization/pl_esx_policejob.sql +++ b/localization/pl_esx_policejob.sql @@ -1,9 +1,11 @@ +USE `essentialmode`; + INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_police','Police',1) + ('society_police', 'Police', 1) ; INSERT INTO `datastore` (name, label, shared) VALUES - ('society_police','Police',1) + ('society_police', 'Police', 1) ; INSERT INTO `addon_inventory` (name, label, shared) VALUES @@ -11,7 +13,7 @@ INSERT INTO `addon_inventory` (name, label, shared) VALUES ; INSERT INTO `jobs` (name, label) VALUES - ('police','LSPD') + ('police', 'Police') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES @@ -23,7 +25,6 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, `amount` int(11) DEFAULT NULL, diff --git a/localization/sv_esx_policejob.sql b/localization/sv_esx_policejob.sql index 020aabbf..d880d38e 100644 --- a/localization/sv_esx_policejob.sql +++ b/localization/sv_esx_policejob.sql @@ -1,9 +1,11 @@ +USE `essentialmode`; + INSERT INTO `addon_account` (name, label, shared) VALUES - ('society_police','Polis',1) + ('society_police', 'Polis', 1) ; INSERT INTO `datastore` (name, label, shared) VALUES - ('society_police','Polis',1) + ('society_police', 'Polis', 1) ; INSERT INTO `addon_inventory` (name, label, shared) VALUES @@ -11,7 +13,7 @@ INSERT INTO `addon_inventory` (name, label, shared) VALUES ; INSERT INTO `jobs` (name, label) VALUES - ('police','Polis') + ('police', 'Polis') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES @@ -36,11 +38,11 @@ INSERT INTO `fine_types` (label, amount, category) VALUES ('Missbruk av tuta',30,0), ('Köra över heldragen linje',40,0), ('Kört i motsatt riktning i rondell',250,0), - ('Olaglig U-Sväng',250,0), - ('Olovlig körning i skogen',170,0), + ('Olaglig u-sväng',250,0), + ('Olovlig körning i terräng',170,0), ('Kört för nära bil framför',30,0), - ('Trafikfarligt stopp',150,0), - ('olaglig parkering',70,0), + ('Trafikfarlig stopp',150,0), + ('Olaglig parkering',70,0), ('Använder inte högerregeln',70,0), ('Aktar sig inte för tjänstefordon i utryckning',90,0), ('Kört förbi stoppskylt',105,0), @@ -48,7 +50,7 @@ INSERT INTO `fine_types` (label, amount, category) VALUES ('Farlig omkörning',100,0), ('Fordon i dåligt skick',100,0), ('Kört utan körkort',1500,0), - ('smitning från olycka',800,0), + ('Smitning från olycka',800,0), ('Kört för fort < 5 kmh',90,0), ('Kört för fort 5-15 kmh',120,0), ('Kört för fort 15-30 kmh',180,0), @@ -75,14 +77,14 @@ INSERT INTO `fine_types` (label, amount, category) VALUES ('Hålla gisslan/Hålla person mot dess vilja',1500,2), ('Kidnappa en tjänsteman',2000,2), ('Rån',650,2), - ('butiksrån',650,2), - ('bankrån',1500,2), + ('Butiksrån',650,2), + ('Bankrån',1500,2), ('Skjutit en person',2000,3), ('Skjutit en tjänsteman',2500,3), - ('mordförsök',3000,3), - ('Mordförsök på tjänsteman',5000,3), - ('mord',10000,3), - ('mord på tjänsteman',30000,3), - ('dråp',1800,3), + ('Mordförsök',3000,3), + ('Mordförsök på tjänsteman',6000,3), + ('Mord',10000,3), + ('Mord på tjänsteman',30000,3), + ('Dråp',1800,3), ('Olagliga aktiviteter inom ett företag',2000,2) ; diff --git a/server/main.lua b/server/main.lua index d66eb4dd..e5448896 100644 --- a/server/main.lua +++ b/server/main.lua @@ -33,9 +33,9 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) else targetXPlayer.removeInventoryItem(itemName, amount) - sourceXPlayer.addInventoryItem(itemName, amount) - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confinv') .. amount .. ' ' .. sourceItem.label .. _U('from') .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confinv') .. amount .. ' ' .. sourceItem.label) + sourceXPlayer.addInventoryItem (itemName, amount) + TriggerClientEvent('esx:showNotification', _source, _U('you_confiscated', amount, sourceItem.label, targetXPlayer.name)) + TriggerClientEvent('esx:showNotification', target, _U('got_confiscated', amount, sourceItem.label, sourceXPlayer.name)) end else TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) @@ -43,17 +43,18 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, elseif itemType == 'item_account' then targetXPlayer.removeAccountMoney(itemName, amount) - sourceXPlayer.addAccountMoney(itemName, amount) + sourceXPlayer.addAccountMoney (itemName, amount) - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confdm') .. amount .. _U('from') .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confdm') .. amount) + TriggerClientEvent('esx:showNotification', _source, _U('you_confiscated_account', amount, itemName, targetXPlayer.name)) + TriggerClientEvent('esx:showNotification', target, _U('got_confiscated_account', amount, itemName, sourceXPlayer.name)) elseif itemType == 'item_weapon' then - targetXPlayer.removeWeapon(itemName) - sourceXPlayer.addWeapon(itemName, amount) + if amount == nil then amount = 0 end + targetXPlayer.removeWeapon(itemName, amount) + sourceXPlayer.addWeapon (itemName, amount) - TriggerClientEvent('esx:showNotification', sourceXPlayer.source, _U('you_have_confweapon') .. ESX.GetWeaponLabel(itemName) .. _U('from') .. targetXPlayer.name) - TriggerClientEvent('esx:showNotification', targetXPlayer.source, '~b~' .. targetXPlayer.name .. _U('confweapon') .. ESX.GetWeaponLabel(itemName)) + TriggerClientEvent('esx:showNotification', _source, _U('you_confiscated_weapon', ESX.GetWeaponLabel(itemName), targetXPlayer.name, amount)) + TriggerClientEvent('esx:showNotification', target, _U('got_confiscated_weapon', ESX.GetWeaponLabel(itemName), amount, sourceXPlayer.name)) end end) @@ -488,7 +489,7 @@ AddEventHandler('playerDropped', function() Citizen.Wait(5000) TriggerClientEvent('esx_policejob:updateBlip', -1) end - end + end end) RegisterServerEvent('esx_policejob:spawned') From 56442503b7cd9d3a44d675a4b0e66bc9ba76e8fc Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 23 Jun 2018 19:52:51 +0200 Subject: [PATCH 133/253] Fixed ESX identity string formatting, closes #112 --- client/main.lua | 4 ++-- locales/br.lua | 2 +- locales/de.lua | 2 +- locales/en.lua | 2 +- locales/es.lua | 2 +- locales/fi.lua | 2 +- locales/fr.lua | 2 +- locales/pl.lua | 2 +- locales/sv.lua | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/main.lua b/client/main.lua index 8df1711e..97cbf376 100644 --- a/client/main.lua +++ b/client/main.lua @@ -668,7 +668,7 @@ function OpenIdentityCardMenu(player) end local elements = { - {label = _U('name') .. data.firstname .. " " .. data.lastname, value = nil}, + {label = _U('name', data.firstname .. ' ' .. data.lastname), value = nil}, {label = sexLabel, value = nil}, {label = dobLabel, value = nil}, {label = heightLabel, value = nil}, @@ -677,7 +677,7 @@ function OpenIdentityCardMenu(player) } if data.drunk ~= nil then - table.insert(elements, {label = _U('bac') .. data.drunk .. '%', value = nil}) + table.insert(elements, {label = _U('bac', data.drunk), value = nil}) end if data.licenses ~= nil then diff --git a/locales/br.lua b/locales/br.lua index 254db92b..b49d77d1 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -64,7 +64,7 @@ Locales['br'] = { ['cash'] = 'Caixa de dinheiro', -- ID Card Menu ['name'] = 'Nome: %s', - ['bac'] = 'BAC: %s', + ['bac'] = 'BAC: %s %', -- Body Search Menu ['guns_label'] = '--- Armas ---', ['inventory_label'] = '--- Inventário ---', diff --git a/locales/de.lua b/locales/de.lua index 5e517869..7b295c22 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -64,7 +64,7 @@ Locales['de'] = { ['cash'] = 'Box mit Geld', -- ID Card Menu ['name'] = 'name: %s', - ['bac'] = 'BAC: %s', + ['bac'] = 'BAC: %s %', -- Body Search Menu ['guns_label'] = '--- Waffen ---', ['inventory_label'] = '--- Inventar ---', diff --git a/locales/en.lua b/locales/en.lua index 14a4a825..d5933c7c 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -64,7 +64,7 @@ Locales['en'] = { ['cash'] = 'Box of cash', -- ID Card Menu ['name'] = 'name: %s', - ['bac'] = 'BAC: %s', + ['bac'] = 'BAC: %s %', -- Body Search Menu ['guns_label'] = '--- Guns ---', ['inventory_label'] = '--- Inventory ---', diff --git a/locales/es.lua b/locales/es.lua index 103e70cb..5097b594 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -64,7 +64,7 @@ Locales['es'] = { ['cash'] = 'Dinero', -- ID Card Menu ['name'] = 'nombre: %s', - ['bac'] = 'alcoolemia: %s', + ['bac'] = 'alcoolemia: %s %', -- Body Search Menu ['guns_label'] = '--- Armas ---', ['inventory_label'] = '--- Inventario ---', diff --git a/locales/fi.lua b/locales/fi.lua index 86f909c2..4d2aba13 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -64,7 +64,7 @@ Locales['fi'] = { ['cash'] = 'rahalaatikko', -- ID Card Menu ['name'] = 'nimi: %s', - ['bac'] = 'alkometri: %s', + ['bac'] = 'alkometri: %s %', -- Body Search Menu ['guns_label'] = '--- Aseet ---', ['inventory_label'] = '--- Reppu ---', diff --git a/locales/fr.lua b/locales/fr.lua index 3115ab39..8110c2d7 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -64,7 +64,7 @@ Locales['fr'] = { ['cash'] = 'caisse', -- ID Card Menu ['name'] = 'nom: %s', - ['bac'] = 'alcoolémie: %s', + ['bac'] = 'alcoolémie: %s %', -- Body Search Menu ['guns_label'] = '--- Armes ---', ['inventory_label'] = '--- Inventaire ---', diff --git a/locales/pl.lua b/locales/pl.lua index aca981cd..2ec51fcf 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -64,7 +64,7 @@ Locales['pl'] = { ['cash'] = 'Paleta z pieniędzmi', -- ID Card Menu ['name'] = 'nazwa: %s', - ['bac'] = 'BAC: %s', + ['bac'] = 'BAC: %s %', -- Body Search Menu ['guns_label'] = '--- Bronie ---', ['inventory_label'] = '--- Ekwipunek ---', diff --git a/locales/sv.lua b/locales/sv.lua index b69560ca..1378d1af 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -64,7 +64,7 @@ Locales['sv'] = { ['cash'] = 'låda med pengar', -- ID Card Menu ['name'] ='namn: %s', - ['bac'] = 'procent alkohol i blodet: %s', + ['bac'] = 'alkohol i blodet: %s %', -- Body Search Menu ['guns_label'] = '--- Vapen ---', ['inventory_label'] = '--- Inventory ---', From 85d35a44bd3a631e5ef6a5c9a395e149d6224955 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 23 Jun 2018 23:19:03 +0200 Subject: [PATCH 134/253] Fixed pl locale --- __resource.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/__resource.lua b/__resource.lua index f5e4992b..9af78312 100644 --- a/__resource.lua +++ b/__resource.lua @@ -9,6 +9,7 @@ server_scripts { 'locales/br.lua', 'locales/de.lua', 'locales/en.lua', + 'locales/pl.lua', 'locales/fr.lua', 'locales/fi.lua', 'locales/es.lua', @@ -23,6 +24,7 @@ client_scripts { 'locales/br.lua', 'locales/de.lua', 'locales/en.lua', + 'locales/pl.lua', 'locales/fr.lua', 'locales/fi.lua', 'locales/es.lua', From a571717d937a231e7312018cfc044028b42da7b6 Mon Sep 17 00:00:00 2001 From: renildomarcio Date: Mon, 25 Jun 2018 17:04:43 -0300 Subject: [PATCH 135/253] Update br.lua update in translation! --- locales/br.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/locales/br.lua b/locales/br.lua index b49d77d1..4688d743 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -45,16 +45,16 @@ Locales['br'] = { ['pick_lock'] = 'Trancar veículo', ['vehicle_unlocked'] = 'Veículo ~g~destravado~s~', ['no_vehicles_nearby'] = 'Nenhum veículo nas proximidades', - ['impound'] = 'impound vehicle', - ['impound_prompt'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~impound~s~', + ['impound'] = 'apreender carro', + ['impound_prompt'] = 'Pressione ~INPUT_CONTEXT~ para cancelar a ~y~apreender~s~', ['impound_canceled'] = 'you canceled the impound', - ['impound_canceled_moved'] = 'the impound has been canceled because the vehicle moved', - ['impound_successful'] = 'you have impounded the vehicle', - ['search_database'] = 'vehicle information', - ['search_database_title'] = 'vehicle information - search with registration number', - ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', - ['search_database_error_not_found'] = 'that ~y~registration number~s~ is ~r~not~s~ registered to an vehicle!', - ['search_database_found'] = 'the vehicle is ~y~registered~s~ to ~b~%s~s~', + ['impound_canceled_moved'] = 'o apreender foi cancelado porque o veículo mudou', + ['impound_successful'] = 'você apreendeu o veículo', + ['search_database'] = 'informação do veículo', + ['search_database_title'] = 'informações do veículo - pesquisa com número de registro', + ['search_database_error_invalid'] = 'que ~r~não~s~ é um número de registro ~y~válido~s~', + ['search_database_error_not_found'] = 'esse número de ~y~registror~s~ ~r~não~s~ está registrado em um veículo!', + ['search_database_found'] = 'o veículo está ~y~registrado~s~ para ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'Interagir com as rodovias', ['cone'] = 'Cones', From 778da1ca3ecb95419bcdd763c03868b8cdd0c357 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 26 Jun 2018 21:26:04 +0200 Subject: [PATCH 136/253] Fixed id check #113 --- locales/br.lua | 2 +- locales/de.lua | 2 +- locales/en.lua | 2 +- locales/es.lua | 2 +- locales/fi.lua | 2 +- locales/fr.lua | 2 +- locales/pl.lua | 2 +- locales/sv.lua | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/locales/br.lua b/locales/br.lua index b49d77d1..254db92b 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -64,7 +64,7 @@ Locales['br'] = { ['cash'] = 'Caixa de dinheiro', -- ID Card Menu ['name'] = 'Nome: %s', - ['bac'] = 'BAC: %s %', + ['bac'] = 'BAC: %s', -- Body Search Menu ['guns_label'] = '--- Armas ---', ['inventory_label'] = '--- Inventário ---', diff --git a/locales/de.lua b/locales/de.lua index 7b295c22..5e517869 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -64,7 +64,7 @@ Locales['de'] = { ['cash'] = 'Box mit Geld', -- ID Card Menu ['name'] = 'name: %s', - ['bac'] = 'BAC: %s %', + ['bac'] = 'BAC: %s', -- Body Search Menu ['guns_label'] = '--- Waffen ---', ['inventory_label'] = '--- Inventar ---', diff --git a/locales/en.lua b/locales/en.lua index d5933c7c..14a4a825 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -64,7 +64,7 @@ Locales['en'] = { ['cash'] = 'Box of cash', -- ID Card Menu ['name'] = 'name: %s', - ['bac'] = 'BAC: %s %', + ['bac'] = 'BAC: %s', -- Body Search Menu ['guns_label'] = '--- Guns ---', ['inventory_label'] = '--- Inventory ---', diff --git a/locales/es.lua b/locales/es.lua index 5097b594..103e70cb 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -64,7 +64,7 @@ Locales['es'] = { ['cash'] = 'Dinero', -- ID Card Menu ['name'] = 'nombre: %s', - ['bac'] = 'alcoolemia: %s %', + ['bac'] = 'alcoolemia: %s', -- Body Search Menu ['guns_label'] = '--- Armas ---', ['inventory_label'] = '--- Inventario ---', diff --git a/locales/fi.lua b/locales/fi.lua index 4d2aba13..86f909c2 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -64,7 +64,7 @@ Locales['fi'] = { ['cash'] = 'rahalaatikko', -- ID Card Menu ['name'] = 'nimi: %s', - ['bac'] = 'alkometri: %s %', + ['bac'] = 'alkometri: %s', -- Body Search Menu ['guns_label'] = '--- Aseet ---', ['inventory_label'] = '--- Reppu ---', diff --git a/locales/fr.lua b/locales/fr.lua index 8110c2d7..3115ab39 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -64,7 +64,7 @@ Locales['fr'] = { ['cash'] = 'caisse', -- ID Card Menu ['name'] = 'nom: %s', - ['bac'] = 'alcoolémie: %s %', + ['bac'] = 'alcoolémie: %s', -- Body Search Menu ['guns_label'] = '--- Armes ---', ['inventory_label'] = '--- Inventaire ---', diff --git a/locales/pl.lua b/locales/pl.lua index 2ec51fcf..aca981cd 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -64,7 +64,7 @@ Locales['pl'] = { ['cash'] = 'Paleta z pieniędzmi', -- ID Card Menu ['name'] = 'nazwa: %s', - ['bac'] = 'BAC: %s %', + ['bac'] = 'BAC: %s', -- Body Search Menu ['guns_label'] = '--- Bronie ---', ['inventory_label'] = '--- Ekwipunek ---', diff --git a/locales/sv.lua b/locales/sv.lua index 1378d1af..45955cb5 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -64,7 +64,7 @@ Locales['sv'] = { ['cash'] = 'låda med pengar', -- ID Card Menu ['name'] ='namn: %s', - ['bac'] = 'alkohol i blodet: %s %', + ['bac'] = 'alkohol i blodet: %s', -- Body Search Menu ['guns_label'] = '--- Vapen ---', ['inventory_label'] = '--- Inventory ---', From 9594e4751f76d0c42741004d378a30edb3788f1e Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 12 Jul 2018 16:20:09 +0200 Subject: [PATCH 137/253] Fixed handcuff once and for all, implemented handcuff timer, closes #120 , closes #118 - You can no longer escape the handcuffs, e.g pan and tilt is also disabled now. --- .editorconfig | 4 +- client/main.lua | 222 ++++++++++++++++++++++++++++++------------------ config.lua | 6 ++ locales/br.lua | 1 + locales/de.lua | 1 + locales/en.lua | 1 + locales/es.lua | 1 + locales/fi.lua | 1 + locales/fr.lua | 1 + locales/pl.lua | 1 + locales/sv.lua | 1 + 11 files changed, 157 insertions(+), 83 deletions(-) diff --git a/.editorconfig b/.editorconfig index 41c2aaf2..6866fb40 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,8 +1,8 @@ root = true [*] -indent_size = 2 -indent_style = space +indent_size = 4 +indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true diff --git a/client/main.lua b/client/main.lua index 97cbf376..9c7b5134 100644 --- a/client/main.lua +++ b/client/main.lua @@ -10,26 +10,25 @@ local Keys = { ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 } -local PlayerData = {} -local GUI = {} -local HasAlreadyEnteredMarker = false -local LastStation = nil -local LastPart = nil -local LastPartNum = nil -local LastEntity = nil -local CurrentAction = nil -local CurrentActionMsg = '' -local CurrentActionData = {} -local IsHandcuffed = false -local IsDragged = false -local CopPed = 0 -local hasAlreadyJoined = false -local blipsCops = {} -local isDead = false -CurrentTask = {} +local PlayerData = {} +local HasAlreadyEnteredMarker = false +local LastStation = nil +local LastPart = nil +local LastPartNum = nil +local LastEntity = nil +local CurrentAction = nil +local CurrentActionMsg = '' +local CurrentActionData = {} +local IsHandcuffed = false +local HandcuffTimer = nil +local IsDragged = false +local CopPed = 0 +local hasAlreadyJoined = false +local blipsCops = {} +local isDead = false +local CurrentTask = {} -ESX = nil -GUI.Time = 0 +ESX = nil Citizen.CreateThread(function() while ESX == nil do @@ -89,7 +88,7 @@ end function OpenCloakroomMenu() - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() local elements = { { label = _U('citizen_wear'), value = 'citizen_wear' }, @@ -317,7 +316,7 @@ function OpenVehicleSpawnerMenu(station, partNum) ESX.Game.SpawnVehicle(vehicleProps.model, vehicles[partNum].SpawnPoint, 270.0, function(vehicle) ESX.Game.SetVehicleProperties(vehicle, vehicleProps) - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() TaskWarpPedIntoVehicle(playerPed, vehicle, -1) end) @@ -368,7 +367,7 @@ function OpenVehicleSpawnerMenu(station, partNum) if not DoesEntityExist(vehicle) then - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() if Config.MaxInService == -1 then @@ -491,7 +490,7 @@ function OpenPoliceActionsMenu() end) elseif data.current.value == 'vehicle_interaction' then local elements = {} - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) local vehicle = ESX.Game.GetVehicleInDirection() @@ -591,7 +590,7 @@ function OpenPoliceActionsMenu() } }, function(data2, menu2) local model = data2.current.value - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) local forward = GetEntityForwardVector(playerPed) local x, y, z = table.unpack(coords + forward * 1.0) @@ -1051,7 +1050,7 @@ end function OpenPutWeaponMenu() local elements = {} - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() local weaponList = ESX.GetWeaponList() for i=1, #weaponList, 1 do @@ -1320,7 +1319,7 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu if part == 'VehicleDeleter' then - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) if IsPedInAnyVehicle(playerPed, false) then @@ -1352,7 +1351,7 @@ end) AddEventHandler('esx_policejob:hasEnteredEntityZone', function(entity) - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() if PlayerData.job ~= nil and PlayerData.job.name == 'police' and not IsPedInAnyVehicle(playerPed, false) then CurrentAction = 'remove_entity' @@ -1362,7 +1361,7 @@ AddEventHandler('esx_policejob:hasEnteredEntityZone', function(entity) if GetEntityModel(entity) == GetHashKey('p_ld_stinger_s') then - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) if IsPedInAnyVehicle(playerPed, false) then @@ -1389,67 +1388,93 @@ end) RegisterNetEvent('esx_policejob:handcuff') AddEventHandler('esx_policejob:handcuff', function() + IsHandcuffed = not IsHandcuffed + local playerPed = PlayerPedId() - IsHandcuffed = not IsHandcuffed; - local playerPed = GetPlayerPed(-1) + Citizen.CreateThread(function() + if IsHandcuffed then - Citizen.CreateThread(function() + RequestAnimDict('mp_arresting') + while not HasAnimDictLoaded('mp_arresting') do + Citizen.Wait(100) + end - if IsHandcuffed then + TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) - RequestAnimDict('mp_arresting') + SetEnableHandcuffs(playerPed, true) + DisablePlayerFiring(playerPed, true) + SetCurrentPedWeapon(playerPed, GetHashKey('WEAPON_UNARMED'), true) -- unarm player + SetPedCanPlayGestureAnims(playerPed, false) + FreezeEntityPosition(playerPed, true) - while not HasAnimDictLoaded('mp_arresting') do - Wait(100) - end + if Config.EnableHandcuffTimer then + if HandcuffTimer then + ESX.ClearTimeout(HandcuffTimer) + end - TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) - SetEnableHandcuffs(playerPed, true) - SetPedCanPlayGestureAnims(playerPed, false) - FreezeEntityPosition(playerPed, true) + StartHandcuffTimer() + end - else + else - ClearPedSecondaryTask(playerPed) - SetEnableHandcuffs(playerPed, false) - SetPedCanPlayGestureAnims(playerPed, true) - FreezeEntityPosition(playerPed, false) + if Config.EnableHandcuffTimer and HandcuffTimer then + ESX.ClearTimeout(HandcuffTimer) + end + ClearPedSecondaryTask(playerPed) + SetEnableHandcuffs(playerPed, false) + DisablePlayerFiring(playerPed, false) + SetPedCanPlayGestureAnims(playerPed, true) + FreezeEntityPosition(playerPed, false) + end + end) - end +end) - end) +AddEventHandler('esx_policejob:unrestrain', function() + if IsHandcuffed then + local playerPed = PlayerPedId() + IsHandcuffed = false + + ClearPedSecondaryTask(playerPed) + SetEnableHandcuffs(playerPed, false) + DisablePlayerFiring(playerPed, false) + SetPedCanPlayGestureAnims(playerPed, true) + FreezeEntityPosition(playerPed, false) + end end) RegisterNetEvent('esx_policejob:drag') AddEventHandler('esx_policejob:drag', function(cop) - IsDragged = not IsDragged - CopPed = tonumber(cop) + IsDragged = not IsDragged + CopPed = tonumber(cop) end) Citizen.CreateThread(function() - while true do - Wait(0) - if IsHandcuffed then - if IsDragged then - local ped = GetPlayerPed(GetPlayerFromServerId(CopPed)) - local myped = GetPlayerPed(-1) - AttachEntityToEntity(myped, ped, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) - else - DetachEntity(GetPlayerPed(-1), true, false) - end - end - end + while true do + Citizen.Wait(1) + if IsHandcuffed then + if IsDragged then + local ped = GetPlayerPed(GetPlayerFromServerId(CopPed)) + local myped = PlayerPedId() + AttachEntityToEntity(myped, ped, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) + else + DetachEntity(PlayerPedId(), true, false) + end + else + Citizen.Wait(500) + end + end end) RegisterNetEvent('esx_policejob:putInVehicle') AddEventHandler('esx_policejob:putInVehicle', function() - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) + local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) if DoesEntityExist(vehicle) then @@ -1457,14 +1482,14 @@ AddEventHandler('esx_policejob:putInVehicle', function() local freeSeat = nil for i=maxSeats - 1, 0, -1 do - if IsVehicleSeatFree(vehicle, i) then + if IsVehicleSeatFree(vehicle, i) then freeSeat = i break end end if freeSeat ~= nil then - TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) + TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) end end @@ -1477,18 +1502,21 @@ RegisterNetEvent('esx_policejob:OutVehicle') AddEventHandler('esx_policejob:OutVehicle', function(t) local ped = GetPlayerPed(t) ClearPedTasksImmediately(ped) - plyPos = GetEntityCoords(GetPlayerPed(-1), true) + plyPos = GetEntityCoords(PlayerPedId(), true) local xnew = plyPos.x+2 local ynew = plyPos.y+2 - SetEntityCoords(GetPlayerPed(-1), xnew, ynew, plyPos.z) + SetEntityCoords(PlayerPedId(), xnew, ynew, plyPos.z) end) -- Handcuff Citizen.CreateThread(function() while true do - Citizen.Wait(10) + Citizen.Wait(1) if IsHandcuffed then + DisplayRadar(false) + DisableControlAction(2, 1, true) -- Disable pan + DisableControlAction(2, 2, true) -- Disable tilt DisableControlAction(2, 24, true) -- Attack DisableControlAction(2, 257, true) -- Attack 2 DisableControlAction(2, 25, true) -- Aim @@ -1502,8 +1530,21 @@ Citizen.CreateThread(function() DisableControlAction(2, Keys['F1'], true) -- Disable phone DisableControlAction(2, Keys['F2'], true) -- Inventory DisableControlAction(2, Keys['F3'], true) -- Animations + DisableControlAction(2, Keys['V'], true) -- Disable changing view + DisableControlAction(2, Keys['P'], true) -- Disable pause screen + DisableControlAction(2, 59, true) -- Disable steering in vehicle + DisableControlAction(2, Keys['LEFTCTRL'], true) -- Disable going stealth + DisableControlAction(0, 47, true) -- Disable weapon + DisableControlAction(0, 264, true) -- Disable melee + DisableControlAction(0, 257, true) -- Disable melee + DisableControlAction(0, 140, true) -- Disable melee + DisableControlAction(0, 141, true) -- Disable melee + DisableControlAction(0, 142, true) -- Disable melee + DisableControlAction(0, 143, true) -- Disable melee + DisableControlAction(0, 75, true) -- Disable exit vehicle + DisableControlAction(27, 75, true) -- Disable exit vehicle else - Citizen.Wait(1000) + Citizen.Wait(500) end end end) @@ -1537,7 +1578,7 @@ Citizen.CreateThread(function() if PlayerData.job ~= nil and PlayerData.job.name == 'police' then - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) for k,v in pairs(Config.PoliceStations) do @@ -1592,7 +1633,7 @@ Citizen.CreateThread(function() if PlayerData.job ~= nil and PlayerData.job.name == 'police' then - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) local isInMarker = false local currentStation = nil @@ -1726,7 +1767,7 @@ Citizen.CreateThread(function() Citizen.Wait(0) - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) local closestDistance = -1 @@ -1780,7 +1821,7 @@ Citizen.CreateThread(function() AddTextComponentString(CurrentActionMsg) DisplayHelpTextFromStringLabel(0, 0, 1, -1) - if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' and (GetGameTimer() - GUI.Time) > 150 then + if IsControlJustReleased(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' then if CurrentAction == 'menu_cloakroom' then OpenCloakroomMenu() @@ -1817,19 +1858,17 @@ Citizen.CreateThread(function() end CurrentAction = nil - GUI.Time = GetGameTimer() end end -- CurrentAction end - if IsControlPressed(0, Keys['F6']) and not isDead and PlayerData.job ~= nil and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') and (GetGameTimer() - GUI.Time) > 150 then + if IsControlJustReleased(0, Keys['F6']) and not isDead and PlayerData.job ~= nil and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') then OpenPoliceActionsMenu() - GUI.Time = GetGameTimer() end - if IsControlPressed(0, Keys['E']) and CurrentTask.Busy then + if IsControlJustReleased(0, Keys['E']) and CurrentTask.Busy then ESX.ShowNotification(_U('impound_canceled')) ESX.ClearTimeout(CurrentTask.Task) - ClearPedTasks(GetPlayerPed(-1)) + ClearPedTasks(PlayerPedId()) CurrentTask.Busy = false end @@ -1871,7 +1910,7 @@ AddEventHandler('esx_policejob:updateBlip', function() for i=1, #players, 1 do if players[i].job.name == 'police' then for id = 0, 32 do - if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= GetPlayerPed(-1) and GetPlayerName(id) == players[i].name then + if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= PlayerPedId() and GetPlayerName(id) == players[i].name then createBlip(id) end end @@ -1884,17 +1923,38 @@ end) AddEventHandler('playerSpawned', function(spawn) isDead = false + TriggerEvent('esx_policejob:unrestrain') + if not hasAlreadyJoined then TriggerServerEvent('esx_policejob:spawned') end hasAlreadyJoined = true - IsHandcuffed = false end) -AddEventHandler('esx:onPlayerDeath', function() +AddEventHandler('esx:onPlayerDeath', function(data) isDead = true end) +AddEventHandler('onResourceStop', function(resource) + if resource == GetCurrentResourceName() then + TriggerEvent('esx_policejob:unrestrain') + end +end) + +-- handcuff timer, unrestrain the player after an certain amount of time +function StartHandcuffTimer() + if Config.EnableHandcuffTimer and HandcuffTimer then + ESX.ClearTimeout(HandcuffTimer) + end + + HandcuffTimer = ESX.SetTimeout(Config.HandcuffTimer, function() + ESX.ShowNotification(_U('unrestrained_timer')) + TriggerEvent('esx_policejob:unrestrain') + end) + + HandcuffTimer = nil +end + -- TODO -- - return to garage if owned -- - message owner that his vehicle has been impounded diff --git a/config.lua b/config.lua index 4c03be7e..7ca7c712 100644 --- a/config.lua +++ b/config.lua @@ -1,14 +1,20 @@ Config = {} + Config.DrawDistance = 100.0 Config.MarkerType = 1 Config.MarkerSize = { x = 1.5, y = 1.5, z = 1.0 } Config.MarkerColor = { r = 50, g = 50, b = 204 } + Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false Config.EnableLicenses = false -- only turn this on if you are using esx_license + +Config.EnableHandcuffTimer = true -- enable handcuff timer? will unrestrain player after the time ends +Config.HandcuffTimer = 10 * 60000 -- 10 mins + Config.MaxInService = -1 Config.Locale = 'fr' diff --git a/locales/br.lua b/locales/br.lua index 056c7915..d86a231f 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -101,6 +101,7 @@ Locales['br'] = { -- Misc ['remove_prop'] = 'Pressione ~INPUT_CONTEXT~ para remover o objeto', ['map_blip'] = 'Departamento de Polícia', + ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'Alerta da Polícia', } diff --git a/locales/de.lua b/locales/de.lua index 5e517869..b3921c43 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -101,6 +101,7 @@ Locales['de'] = { -- Misc ['remove_prop'] = 'Drücke ~INPUT_CONTEXT~ um das Objekt zu entfernen', ['map_blip'] = 'Polizeistation', + ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'Polizei alamieren', } diff --git a/locales/en.lua b/locales/en.lua index 14a4a825..e534eb74 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -109,6 +109,7 @@ Locales['en'] = { -- Misc ['remove_prop'] = 'press ~INPUT_CONTEXT~ to delete the object', ['map_blip'] = 'police Station', + ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'alert police', } diff --git a/locales/es.lua b/locales/es.lua index 103e70cb..8b3a1ac6 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -107,6 +107,7 @@ Locales['es'] = { -- Misc ['remove_prop'] = 'Presionar ~INPUT_CONTEXT~ para eliminar el objeto', ['map_blip'] = 'Comisaría de policía', + ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'Alerta policia', } diff --git a/locales/fi.lua b/locales/fi.lua index 86f909c2..3a0148ad 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -107,6 +107,7 @@ Locales['fi'] = { -- Misc ['remove_prop'] = 'Paina ~INPUT_CONTEXT~ poistaaksesi objektin', ['map_blip'] = 'Poliisilaitos', + ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'hälyytys Poliisi', } \ No newline at end of file diff --git a/locales/fr.lua b/locales/fr.lua index 3115ab39..b90ccdc8 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -107,6 +107,7 @@ Locales['fr'] = { -- Misc ['remove_prop'] = 'appuyez sur ~INPUT_CONTEXT~ pour enlever l\'objet', ['map_blip'] = 'Commissariat', + ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'alerte police', } diff --git a/locales/pl.lua b/locales/pl.lua index aca981cd..9fd78b1f 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -109,6 +109,7 @@ Locales['pl'] = { -- Misc ['remove_prop'] = 'Naciśnij ~INPUT_CONTEXT~ aby usunąć ten obiekt', ['map_blip'] = 'Komisariat Policji', + ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'Ostrzeż policję', } diff --git a/locales/sv.lua b/locales/sv.lua index 45955cb5..87c37bc0 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -107,6 +107,7 @@ Locales['sv'] = { -- Misc ['remove_prop'] = 'tryck ~INPUT_CONTEXT~ för att ta bort obejektet', ['map_blip'] = 'Polisstation', + ['unrestrained_timer'] = 'dina handklovar har försvunnit', -- Notifications ['alert_police'] = 'Meddela polisen', } From 2084a420b24f941519b246c5559b3275443ef5fe Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 13 Jul 2018 00:12:23 +0200 Subject: [PATCH 138/253] Final commit v1.2.0 --- __resource.lua | 9 ++++++--- locales/fr.lua | 10 +++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/__resource.lua b/__resource.lua index 9af78312..9a8c8fec 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,9 +2,10 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' -version '1.1.0' +version '1.2.0' server_scripts { + '@mysql-async/lib/MySQL.lua', '@es_extended/locale.lua', 'locales/br.lua', 'locales/de.lua', @@ -14,7 +15,6 @@ server_scripts { 'locales/fi.lua', 'locales/es.lua', 'locales/sv.lua', - '@mysql-async/lib/MySQL.lua', 'config.lua', 'server/main.lua' } @@ -33,4 +33,7 @@ client_scripts { 'client/main.lua' } -dependency 'es_extended' \ No newline at end of file +dependencies { + 'es_extended', + 'esx_billing' +} \ No newline at end of file diff --git a/locales/fr.lua b/locales/fr.lua index 6db48cd3..c9dc8841 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -3,11 +3,11 @@ Locales['fr'] = { ['cloakroom'] = 'vestiaire', ['citizen_wear'] = 'tenue Civil', ['police_wear'] = 'tenue Policier', - ['sheriff_wear'] = 'Tenue sheriff', - ['lieutenant_wear'] = 'Tenue Swatt', - ['gilet_wear'] = 'Gilet orange', - ['bullet_wear'] = 'Gilet pare-balles', - ['no_outfit'] = 'Il n\'y a pas d\'uniforme à votre taille...', + ['sheriff_wear'] = 'tenue sheriff', + ['lieutenant_wear'] = 'tenue Swatt', + ['gilet_wear'] = 'gilet orange', + ['bullet_wear'] = 'gilet pare-balles', + ['no_outfit'] = 'il n\'y a pas d\'uniforme à votre taille...', ['open_cloackroom'] = 'appuyez sur ~INPUT_CONTEXT~ pour vous changer', -- Armory ['remove_object'] = 'prendre Objet', From aebc05feebf47c0e7e464c028fc4761003ac96e6 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 13 Jul 2018 12:20:55 +0200 Subject: [PATCH 139/253] Made event allowed to be called from server-side, so jail scripts can unrestrain --- client/main.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/main.lua b/client/main.lua index 9c7b5134..6c9896e2 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1430,6 +1430,7 @@ AddEventHandler('esx_policejob:handcuff', function() end) +RegisterNetEvent('esx_policejob:unrestrain') AddEventHandler('esx_policejob:unrestrain', function() if IsHandcuffed then local playerPed = PlayerPedId() @@ -1440,6 +1441,11 @@ AddEventHandler('esx_policejob:unrestrain', function() DisablePlayerFiring(playerPed, false) SetPedCanPlayGestureAnims(playerPed, true) FreezeEntityPosition(playerPed, false) + + -- end timer + if Config.EnableHandcuffTimer and HandcuffTimer then + ESX.ClearTimeout(HandcuffTimer) + end end end) From e7b75d8d510be9dc841bf17bf899e37610fcddfc Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 13 Jul 2018 12:42:19 +0200 Subject: [PATCH 140/253] Fixed radar disabled after unrestrain --- client/main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 6c9896e2..e30ee503 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1406,6 +1406,7 @@ AddEventHandler('esx_policejob:handcuff', function() SetCurrentPedWeapon(playerPed, GetHashKey('WEAPON_UNARMED'), true) -- unarm player SetPedCanPlayGestureAnims(playerPed, false) FreezeEntityPosition(playerPed, true) + DisplayRadar(false) if Config.EnableHandcuffTimer then if HandcuffTimer then @@ -1425,6 +1426,7 @@ AddEventHandler('esx_policejob:handcuff', function() DisablePlayerFiring(playerPed, false) SetPedCanPlayGestureAnims(playerPed, true) FreezeEntityPosition(playerPed, false) + DisplayRadar(true) end end) @@ -1441,6 +1443,7 @@ AddEventHandler('esx_policejob:unrestrain', function() DisablePlayerFiring(playerPed, false) SetPedCanPlayGestureAnims(playerPed, true) FreezeEntityPosition(playerPed, false) + DisplayRadar(true) -- end timer if Config.EnableHandcuffTimer and HandcuffTimer then @@ -1520,7 +1523,6 @@ Citizen.CreateThread(function() while true do Citizen.Wait(1) if IsHandcuffed then - DisplayRadar(false) DisableControlAction(2, 1, true) -- Disable pan DisableControlAction(2, 2, true) -- Disable tilt DisableControlAction(2, 24, true) -- Attack From 0d874e78e7bde33dbf7238fcfbf8de633a12431c Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 14 Jul 2018 13:18:56 +0200 Subject: [PATCH 141/253] Implemented managing unpaid bills, closes #121 --- client/main.lua | 248 ++++++++++++++++++++++-------------------------- locales/br.lua | 12 ++- locales/de.lua | 10 ++ locales/en.lua | 12 ++- locales/es.lua | 14 ++- locales/fi.lua | 14 ++- locales/fr.lua | 14 ++- locales/pl.lua | 12 ++- locales/sv.lua | 11 ++- server/main.lua | 2 +- 10 files changed, 203 insertions(+), 146 deletions(-) diff --git a/client/main.lua b/client/main.lua index e30ee503..6efd096b 100644 --- a/client/main.lua +++ b/client/main.lua @@ -446,7 +446,8 @@ function OpenPoliceActionsMenu() {label = _U('drag'), value = 'drag'}, {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, - {label = _U('fine'), value = 'fine'} + {label = _U('fine'), value = 'fine'}, + {label = _U('unpaid_bills'), value = 'unpaid_bills'} } if Config.EnableLicenses then @@ -480,6 +481,8 @@ function OpenPoliceActionsMenu() OpenFineMenu(closestPlayer) elseif action == 'license' then ShowPlayerLicense(closestPlayer) + elseif action == 'unpaid_bills' then + OpenUnpaidBillsMenu(closestPlayer) end else @@ -620,141 +623,94 @@ end function OpenIdentityCardMenu(player) - if Config.EnableESXIdentity then + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - - local jobLabel = nil - local sexLabel = nil - local sex = nil - local dobLabel = nil - local heightLabel = nil - local idLabel = nil - - if data.job.grade_label ~= nil and data.job.grade_label ~= '' then - jobLabel = 'Job: ' .. data.job.label .. ' - ' .. data.job.grade_label - else - jobLabel = 'Job: ' .. data.job.label - end - - if data.sex ~= nil then - if (data.sex == 'm') or (data.sex == 'M') then - sex = 'Male' - else - sex = 'Female' - end - sexLabel = 'Sex: ' .. sex - else - sexLabel = 'Sex: Unknown' - end - - if data.dob ~= nil then - dobLabel = 'DOB: ' .. data.dob - else - dobLabel = 'DOB: Unknown' - end - - if data.height ~= nil then - heightLabel = 'Height: ' .. data.height - else - heightLabel = 'Height: Unknown' - end - - if data.name ~= nil then - idLabel = 'ID: ' .. data.name - else - idLabel = 'ID: Unknown' - end - - local elements = { - {label = _U('name', data.firstname .. ' ' .. data.lastname), value = nil}, - {label = sexLabel, value = nil}, - {label = dobLabel, value = nil}, - {label = heightLabel, value = nil}, - {label = jobLabel, value = nil}, - {label = idLabel, value = nil}, - } - - if data.drunk ~= nil then - table.insert(elements, {label = _U('bac', data.drunk), value = nil}) - end - - if data.licenses ~= nil then - - table.insert(elements, {label = '--- Licenses ---', value = nil}) - - for i=1, #data.licenses, 1 do - table.insert(elements, {label = data.licenses[i].label, value = nil}) - end - - end - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { - title = _U('citizen_interaction'), - align = 'top-left', - elements = elements, - }, - function(data, menu) - - end, - function(data, menu) - menu.close() - end - ) - - end, GetPlayerServerId(player)) - - else - - ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - - local jobLabel = nil - - if data.job.grade_label ~= nil and data.job.grade_label ~= '' then - jobLabel = 'Job: ' .. data.job.label .. ' - ' .. data.job.grade_label - else - jobLabel = 'Job: ' .. data.job.label - end - - local elements = { - {label = _U('name') .. data.name, value = nil}, - {label = jobLabel, value = nil}, - } - - if data.drunk ~= nil then - table.insert(elements, {label = _U('bac') .. data.drunk .. '%', value = nil}) - end - - if data.licenses ~= nil then - - table.insert(elements, {label = '--- Licenses ---', value = nil}) - - for i=1, #data.licenses, 1 do - table.insert(elements, {label = data.licenses[i].label, value = nil}) - end - - end - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { - title = _U('citizen_interaction'), - align = 'top-left', - elements = elements, - }, - function(data, menu) - - end, - function(data, menu) - menu.close() - end - ) - - end, GetPlayerServerId(player)) - - end + local elements = {} + local nameLabel = _U('name', data.name) + local jobLabel = nil + local sexLabel = nil + local dobLabel = nil + local heightLabel = nil + local idLabel = nil + + if data.job.grade_label ~= nil and data.job.grade_label ~= '' then + jobLabel = _U('job', data.job.label .. ' - ' .. data.job.grade_label) + else + jobLabel = _U('job', data.job.label) + end + + if Config.EnableESXIdentity then + + nameLabel = _U('name', data.firstname .. ' ' .. data.lastname) + + if data.sex ~= nil then + if string.lower(data.sex) == 'm' then + sexLabel = _U('sex', _U('male')) + else + sexLabel = _U('sex', _U('female')) + end + else + sexLabel = _U('sex', _U('unknown')) + end + + if data.dob ~= nil then + dobLabel = _U('dob', data.dob) + else + dobLabel = _U('dob', _U('unknown')) + end + + if data.height ~= nil then + heightLabel = _U('height', data.height) + else + heightLabel = _U('height', _U('unknown')) + end + + if data.name ~= nil then + idLabel = _U('id', data.name) + else + idLabel = _U('id', _U('unknown')) + end + + end + + local elements = { + {label = nameLabel, value = nil}, + {label = jobLabel, value = nil}, + } + + if Config.EnableESXIdentity then + table.insert(elements, {label = sexLabel, value = nil}) + table.insert(elements, {label = dobLabel, value = nil}) + table.insert(elements, {label = heightLabel, value = nil}) + table.insert(elements, {label = idLabel, value = nil}) + end + + if data.drunk ~= nil then + table.insert(elements, {label = _U('bac', data.drunk), value = nil}) + end + + if data.licenses ~= nil then + + table.insert(elements, {label = _U('license_label'), value = nil}) + + for i=1, #data.licenses, 1 do + table.insert(elements, {label = data.licenses[i].label, value = nil}) + end + + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', + { + title = _U('citizen_interaction'), + align = 'top-left', + elements = elements, + }, function(data, menu) + + end, function(data, menu) + menu.close() + end) + + end, GetPlayerServerId(player)) end @@ -978,6 +934,28 @@ function ShowPlayerLicense(player) end, GetPlayerServerId(player)) end +function OpenUnpaidBillsMenu(player) + + local elements = {} + + ESX.TriggerServerCallback('esx_billing:getTargetBills', function(bills) + for i=1, #bills, 1 do + table.insert(elements, {label = bills[i].label .. ' - $' .. bills[i].amount .. '', value = bills[i].id}) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'billing', + { + title = _U('unpaid_bills'), + align = 'top-left', + elements = elements + }, function(data, menu) + + end, function(data, menu) + menu.close() + end) + end, GetPlayerServerId(player)) +end + function OpenVehicleInfosMenu(vehicleData) diff --git a/locales/br.lua b/locales/br.lua index d86a231f..d3be0ecc 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -35,6 +35,7 @@ Locales['br'] = { ['put_in_vehicle'] = 'Colocar no veículo', ['out_the_vehicle'] = 'take out of vehicle', ['fine'] = 'Multa', + ['unpaid_bills'] = 'manage unpaid bills', ['license_check'] = 'manage license', ['license_revoke'] = 'revoke license', ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', @@ -63,11 +64,20 @@ Locales['br'] = { ['box'] = 'Caixa', ['cash'] = 'Caixa de dinheiro', -- ID Card Menu - ['name'] = 'Nome: %s', + ['name'] = 'name: %s', + ['job'] = 'job: %s', + ['sex'] = 'sex: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'height: %s', + ['id'] = 'ID: %s', ['bac'] = 'BAC: %s', + ['unknown'] = 'unknown', + ['male'] = 'male', + ['female'] = 'female', -- Body Search Menu ['guns_label'] = '--- Armas ---', ['inventory_label'] = '--- Inventário ---', + ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confiscar %s', ['confiscate_inv'] = 'Confiscar %sx %s', ['confiscate_dirty'] = 'Confiscar dinheiro sujo: $%s', diff --git a/locales/de.lua b/locales/de.lua index b3921c43..85f8650f 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -35,6 +35,7 @@ Locales['de'] = { ['put_in_vehicle'] = 'In Fahrzeug setzen', ['out_the_vehicle'] = 'take out of vehicle', ['fine'] = 'Strafe', + ['unpaid_bills'] = 'manage unpaid bills', ['license_check'] = 'manage license', ['license_revoke'] = 'revoke license', ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', @@ -64,10 +65,19 @@ Locales['de'] = { ['cash'] = 'Box mit Geld', -- ID Card Menu ['name'] = 'name: %s', + ['job'] = 'job: %s', + ['sex'] = 'sex: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'height: %s', + ['id'] = 'ID: %s', ['bac'] = 'BAC: %s', + ['unknown'] = 'unknown', + ['male'] = 'male', + ['female'] = 'female', -- Body Search Menu ['guns_label'] = '--- Waffen ---', ['inventory_label'] = '--- Inventar ---', + ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'konfeszieren %s', ['confiscate_inv'] = 'konfeziere %sx %s', ['confiscate_dirty'] = 'schwarzgeld konfesziert: $%s', diff --git a/locales/en.lua b/locales/en.lua index e534eb74..0c28b1cc 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -35,6 +35,7 @@ Locales['en'] = { ['put_in_vehicle'] = 'put in Vehicle', ['out_the_vehicle'] = 'drag out from vehicle', ['fine'] = 'fine', + ['unpaid_bills'] = 'manage unpaid bills', ['license_check'] = 'manage license', ['license_revoke'] = 'revoke license', ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', @@ -61,13 +62,22 @@ Locales['en'] = { ['barrier'] = 'barrier', ['spikestrips'] = 'spikestrips', ['box'] = 'box', - ['cash'] = 'Box of cash', + ['cash'] = 'box of cash', -- ID Card Menu ['name'] = 'name: %s', + ['job'] = 'job: %s', + ['sex'] = 'sex: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'height: %s', + ['id'] = 'ID: %s', ['bac'] = 'BAC: %s', + ['unknown'] = 'unknown', + ['male'] = 'male', + ['female'] = 'female', -- Body Search Menu ['guns_label'] = '--- Guns ---', ['inventory_label'] = '--- Inventory ---', + ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confiscate %s', ['confiscate_inv'] = 'confiscate %sx %s', ['confiscate_dirty'] = 'confiscate dirty money: $%s', diff --git a/locales/es.lua b/locales/es.lua index 8b3a1ac6..6fa71cfc 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -35,6 +35,7 @@ Locales['es'] = { ['put_in_vehicle'] = 'Meter en el vehículo', ['out_the_vehicle'] = 'Sacar del vehículo', ['fine'] = 'Multa', + ['unpaid_bills'] = 'manage unpaid bills', ['license_check'] = 'manage license', ['license_revoke'] = 'revoke license', ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', @@ -63,11 +64,20 @@ Locales['es'] = { ['box'] = 'Caja', ['cash'] = 'Dinero', -- ID Card Menu - ['name'] = 'nombre: %s', - ['bac'] = 'alcoolemia: %s', + ['name'] = 'name: %s', + ['job'] = 'job: %s', + ['sex'] = 'sex: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'height: %s', + ['id'] = 'ID: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'unknown', + ['male'] = 'male', + ['female'] = 'female', -- Body Search Menu ['guns_label'] = '--- Armas ---', ['inventory_label'] = '--- Inventario ---', + ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confiscar %s', ['confiscate_inv'] = 'confiscar %sx %s', ['confiscate_dirty'] = 'confiscar dinero negro: €%s', diff --git a/locales/fi.lua b/locales/fi.lua index 3a0148ad..d4b1703d 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -35,6 +35,7 @@ Locales['fi'] = { ['put_in_vehicle'] = 'laita ajoneuvoon', ['out_the_vehicle'] = 'ota ulos ajoneuvosta', ['fine'] = 'sakko', + ['unpaid_bills'] = 'manage unpaid bills', ['license_check'] = 'hallitse lisenssejä', ['license_revoke'] = 'kumoa lisenssi', ['license_revoked'] = 'sinun ~b~%s~s~ ~y~kumottiin~s~!', @@ -63,11 +64,20 @@ Locales['fi'] = { ['box'] = 'laatikko', ['cash'] = 'rahalaatikko', -- ID Card Menu - ['name'] = 'nimi: %s', - ['bac'] = 'alkometri: %s', + ['name'] = 'name: %s', + ['job'] = 'job: %s', + ['sex'] = 'sex: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'height: %s', + ['id'] = 'ID: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'unknown', + ['male'] = 'male', + ['female'] = 'female', -- Body Search Menu ['guns_label'] = '--- Aseet ---', ['inventory_label'] = '--- Reppu ---', + ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'takavarikoi %s', ['confiscate_inv'] = 'takavarikoi %sx %s', ['confiscate_dirty'] = 'takavarikoi likainen raha: €%s', diff --git a/locales/fr.lua b/locales/fr.lua index c9dc8841..9ca05320 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -35,6 +35,7 @@ Locales['fr'] = { ['put_in_vehicle'] = 'mettre dans véhicule', ['out_the_vehicle'] = 'sortir du véhicule', ['fine'] = 'Amende', + ['unpaid_bills'] = 'manage unpaid bills', ['license_check'] = 'gérer les licences', ['license_revoke'] = 'révoquer la licence', ['license_revoked'] = 'votre ~b~%s~s~ a été ~y~révoqué~s~!', @@ -63,11 +64,20 @@ Locales['fr'] = { ['box'] = 'caisse', ['cash'] = 'caisse', -- ID Card Menu - ['name'] = 'nom: %s', - ['bac'] = 'alcoolémie: %s', + ['name'] = 'name: %s', + ['job'] = 'job: %s', + ['sex'] = 'sex: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'height: %s', + ['id'] = 'ID: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'unknown', + ['male'] = 'male', + ['female'] = 'female', -- Body Search Menu ['guns_label'] = '--- Armes ---', ['inventory_label'] = '--- Inventaire ---', + ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confisquer %s', ['confiscate_inv'] = 'confisquer %sx %s', ['confiscate_dirty'] = 'confisquer argent sale: €%s', diff --git a/locales/pl.lua b/locales/pl.lua index 9fd78b1f..7b79c473 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -35,6 +35,7 @@ Locales['pl'] = { ['put_in_vehicle'] = 'Wsadź do pojazdu', ['out_the_vehicle'] = 'Wyciągnij z pojazdu', ['fine'] = 'Mandaty', + ['unpaid_bills'] = 'manage unpaid bills', ['license_check'] = 'Zarządzaj licencjami', ['license_revoke'] = 'Uniewaźnij licencje', ['license_revoked'] = 'Twoja licencja ~b~%s~s~ została ~y~unieważniona~s~!', @@ -63,11 +64,20 @@ Locales['pl'] = { ['box'] = 'Pudła', ['cash'] = 'Paleta z pieniędzmi', -- ID Card Menu - ['name'] = 'nazwa: %s', + ['name'] = 'name: %s', + ['job'] = 'job: %s', + ['sex'] = 'sex: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'height: %s', + ['id'] = 'ID: %s', ['bac'] = 'BAC: %s', + ['unknown'] = 'unknown', + ['male'] = 'male', + ['female'] = 'female', -- Body Search Menu ['guns_label'] = '--- Bronie ---', ['inventory_label'] = '--- Ekwipunek ---', + ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'skonfiskuj %s', ['confiscate_inv'] = 'skonfiskuj %sx %s', ['confiscate_dirty'] = 'skonfiskuj brudne pieniądze: $%s', diff --git a/locales/sv.lua b/locales/sv.lua index 87c37bc0..7309bd36 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -63,11 +63,20 @@ Locales['sv'] = { ['box'] = 'låda', ['cash'] = 'låda med pengar', -- ID Card Menu - ['name'] ='namn: %s', + ['name'] = 'namn: %s', + ['job'] = 'jobb: %s', + ['sex'] = 'kön: %s', + ['dob'] = 'födelsedatum: %s', + ['height'] = 'längd: %s', + ['id'] = 'ID: %s', ['bac'] = 'alkohol i blodet: %s', + ['unknown'] = 'okänt', + ['male'] = 'man', + ['female'] = 'kvinna', -- Body Search Menu ['guns_label'] = '--- Vapen ---', ['inventory_label'] = '--- Inventory ---', + ['license_label'] = ' --- Licenser ---', ['confiscate'] = 'beslagta %s', ['confiscate_inv'] = 'beslagta %sx %s', ['confiscate_dirty'] = 'beslagta svarta pengar: $%s', diff --git a/server/main.lua b/server/main.lua index e5448896..ff83ab38 100644 --- a/server/main.lua +++ b/server/main.lua @@ -135,7 +135,7 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, ['@identifier'] = identifier }) - local user = result[1] + local user = result[1] local firstname = user['firstname'] local lastname = user['lastname'] local sex = user['sex'] From 3fff063269db8ad28707a13e410f444a281d8a63 Mon Sep 17 00:00:00 2001 From: AdrineX Date: Sat, 14 Jul 2018 16:40:47 +0300 Subject: [PATCH 142/253] fix finnish translates --- locales/fi.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/locales/fi.lua b/locales/fi.lua index d4b1703d..73d6135f 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -6,7 +6,7 @@ Locales['fi'] = { ['sheriff_wear'] = 'sheriffiasu', ['lieutenant_wear'] = 'swattiasu', ['gilet_wear'] = 'huomioliivi', - ['bullet_wear'] = 'Luotiliivi', + ['bullet_wear'] = 'luotiliivi', ['no_outfit'] = 'täällä ei ole sinulle sopivaa asua', ['open_cloackroom'] = 'paina ~INPUT_CONTEXT~ vaihtaaksesi ~y~vaatteita~s~.', -- Armory @@ -28,14 +28,14 @@ Locales['fi'] = { ['vehicle_interaction'] = 'ajoneuvon vuorovaikutus', ['object_spawner'] = 'objekti spawneri', - ['id_card'] = 'Henkilöllisyystodistus', + ['id_card'] = 'henkilöllisyystodistus', ['search'] = 'tutki', - ['handcuff'] = 'Raudat On/Off', + ['handcuff'] = 'raudat On/Off', ['drag'] = 'raahaa', ['put_in_vehicle'] = 'laita ajoneuvoon', ['out_the_vehicle'] = 'ota ulos ajoneuvosta', ['fine'] = 'sakko', - ['unpaid_bills'] = 'manage unpaid bills', + ['unpaid_bills'] = 'hallinoi maksamattomia laskuja', ['license_check'] = 'hallitse lisenssejä', ['license_revoke'] = 'kumoa lisenssi', ['license_revoked'] = 'sinun ~b~%s~s~ ~y~kumottiin~s~!', @@ -64,20 +64,20 @@ Locales['fi'] = { ['box'] = 'laatikko', ['cash'] = 'rahalaatikko', -- ID Card Menu - ['name'] = 'name: %s', - ['job'] = 'job: %s', - ['sex'] = 'sex: %s', - ['dob'] = 'DOB: %s', - ['height'] = 'height: %s', + ['name'] = 'nimi: %s', + ['job'] = 'työ: %s', + ['sex'] = 'sukupuoli: %s', + ['dob'] = 'syntymäaika: %s', + ['height'] = 'pituus: %s', ['id'] = 'ID: %s', - ['bac'] = 'BAC: %s', - ['unknown'] = 'unknown', - ['male'] = 'male', - ['female'] = 'female', + ['bac'] = 'alkometri: %s', + ['unknown'] = 'tuntematon', + ['male'] = 'mies', + ['female'] = 'nainen', -- Body Search Menu ['guns_label'] = '--- Aseet ---', ['inventory_label'] = '--- Reppu ---', - ['license_label'] = ' --- Licenses ---', + ['license_label'] = ' --- Lisenssit ---', ['confiscate'] = 'takavarikoi %s', ['confiscate_inv'] = 'takavarikoi %sx %s', ['confiscate_dirty'] = 'takavarikoi likainen raha: €%s', From eaa07150b8c9f5059839038e0e49d34d1e6e2566 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 14 Jul 2018 18:18:30 +0200 Subject: [PATCH 143/253] Fixed drunk status, closes #123 --- client/main.lua | 4 ++-- server/main.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index 6efd096b..b7d633e7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -742,7 +742,7 @@ function OpenBodySearchMenu(player) label = _U('confiscate', ESX.GetWeaponLabel(data.weapons[i].name)), value = data.weapons[i].name, itemType = 'item_weapon', - amount = data.ammo, + amount = data.ammo }) end @@ -754,7 +754,7 @@ function OpenBodySearchMenu(player) label = _U('confiscate_inv', data.inventory[i].count, data.inventory[i].label), value = data.inventory[i].name, itemType = 'item_standard', - amount = data.inventory[i].count, + amount = data.inventory[i].count }) end end diff --git a/server/main.lua b/server/main.lua index ff83ab38..4cc26c31 100644 --- a/server/main.lua +++ b/server/main.lua @@ -189,7 +189,7 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, TriggerEvent('esx_status:getStatus', target, 'drunk', function(status) if status ~= nil then - data.drunk = status.getPercent() + data.drunk = math.floor(status.percent) end end) From ad19d8ddbb95e91d6ce391f263f74ee4079a2475 Mon Sep 17 00:00:00 2001 From: Alex Garcio <855331+RedAlex@users.noreply.github.com> Date: Sat, 14 Jul 2018 18:07:22 -0400 Subject: [PATCH 144/253] Prevent teleport of handcuffed player. Set IsDragged = false after player is put in vehicule to prevent teleport of player on exit if put in a vehicule of another cops. --- client/main.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index b7d633e7..713300e7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1477,6 +1477,7 @@ AddEventHandler('esx_policejob:putInVehicle', function() if freeSeat ~= nil then TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) + IsDragged = false end end @@ -1949,4 +1950,4 @@ function ImpoundVehicle(vehicle) ESX.Game.DeleteVehicle(vehicle) ESX.ShowNotification(_U('impound_successful')) CurrentTask.Busy = false -end \ No newline at end of file +end From 0d7971fefbf76a733bf738902a2ac5e5465fb435 Mon Sep 17 00:00:00 2001 From: Alex Garcio <855331+RedAlex@users.noreply.github.com> Date: Sat, 14 Jul 2018 18:10:50 -0400 Subject: [PATCH 145/253] Fix space --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 713300e7..c4f2fa0f 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1477,7 +1477,7 @@ AddEventHandler('esx_policejob:putInVehicle', function() if freeSeat ~= nil then TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) - IsDragged = false + IsDragged = false end end From c341cf32d2459816baadd8e613a568b181637ecf Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 15 Jul 2018 00:42:30 +0200 Subject: [PATCH 146/253] Fixed confiscating weapons, and locales for ammo count --- client/main.lua | 115 ++++++++++++++++++++++++------------------------ locales/br.lua | 1 + locales/de.lua | 1 + locales/en.lua | 1 + locales/es.lua | 1 + locales/fi.lua | 1 + locales/fr.lua | 1 + locales/pl.lua | 1 + locales/sv.lua | 41 ++++++++--------- server/main.lua | 4 +- 10 files changed, 87 insertions(+), 80 deletions(-) diff --git a/client/main.lua b/client/main.lua index b7d633e7..dcb0e7cb 100644 --- a/client/main.lua +++ b/client/main.lua @@ -716,78 +716,77 @@ end function OpenBodySearchMenu(player) - ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - local elements = {} + local elements = {} - local blackMoney = 0 + local blackMoney = 0 - for i=1, #data.accounts, 1 do - if data.accounts[i].name == 'black_money' then - blackMoney = data.accounts[i].money - end - end + for i=1, #data.accounts, 1 do + if data.accounts[i].money > 0 then + if data.accounts[i].name == 'black_money' then + blackMoney = data.accounts[i].money - table.insert(elements, { - label = _U('confiscate_dirty', blackMoney), - value = 'black_money', - itemType = 'item_account', - amount = blackMoney - }) + table.insert(elements, { + label = _U('confiscate_dirty', ESX.Round(blackMoney)), + value = 'black_money', + itemType = 'item_account', + amount = blackMoney + }) - table.insert(elements, {label = _U('guns_label'), value = nil}) + break + end + end - for i=1, #data.weapons, 1 do - table.insert(elements, { - label = _U('confiscate', ESX.GetWeaponLabel(data.weapons[i].name)), - value = data.weapons[i].name, - itemType = 'item_weapon', - amount = data.ammo - }) - end + end - table.insert(elements, {label = _U('inventory_label'), value = nil}) + table.insert(elements, {label = _U('guns_label'), value = nil}) - for i=1, #data.inventory, 1 do - if data.inventory[i].count > 0 then - table.insert(elements, { - label = _U('confiscate_inv', data.inventory[i].count, data.inventory[i].label), - value = data.inventory[i].name, - itemType = 'item_standard', - amount = data.inventory[i].count - }) - end - end + for i=1, #data.weapons, 1 do + table.insert(elements, { + label = _U('confiscate_weapon', ESX.GetWeaponLabel(data.weapons[i].name), data.weapons[i].ammo), + value = data.weapons[i].name, + itemType = 'item_weapon', + amount = data.weapons[i].ammo + }) + end + + table.insert(elements, {label = _U('inventory_label'), value = nil}) + + for i=1, #data.inventory, 1 do + if data.inventory[i].count > 0 then + table.insert(elements, { + label = _U('confiscate_inv', data.inventory[i].count, data.inventory[i].label), + value = data.inventory[i].name, + itemType = 'item_standard', + amount = data.inventory[i].count + }) + end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'body_search', - { - title = _U('search'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'body_search', + { + title = _U('search'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - local itemType = data.current.itemType - local itemName = data.current.value - local amount = data.current.amount + local itemType = data.current.itemType + local itemName = data.current.value + local amount = data.current.amount - if data.current.value ~= nil then + if data.current.value ~= nil then + TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), itemType, itemName, amount) + OpenBodySearchMenu(player) + end - TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), itemType, itemName, amount) + end, function(data, menu) + menu.close() + end) - OpenBodySearchMenu(player) - - end - - end, - function(data, menu) - menu.close() - end - ) - - end, GetPlayerServerId(player)) + end, GetPlayerServerId(player)) end diff --git a/locales/br.lua b/locales/br.lua index d3be0ecc..638339e6 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -79,6 +79,7 @@ Locales['br'] = { ['inventory_label'] = '--- Inventário ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confiscar %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'Confiscar %sx %s', ['confiscate_dirty'] = 'Confiscar dinheiro sujo: $%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/de.lua b/locales/de.lua index 85f8650f..0448926e 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -79,6 +79,7 @@ Locales['de'] = { ['inventory_label'] = '--- Inventar ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'konfeszieren %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'konfeziere %sx %s', ['confiscate_dirty'] = 'schwarzgeld konfesziert: $%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/en.lua b/locales/en.lua index 0c28b1cc..f0cf16ac 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -79,6 +79,7 @@ Locales['en'] = { ['inventory_label'] = '--- Inventory ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confiscate %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'confiscate %sx %s', ['confiscate_dirty'] = 'confiscate dirty money: $%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/es.lua b/locales/es.lua index 6fa71cfc..b6d4cf3d 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -79,6 +79,7 @@ Locales['es'] = { ['inventory_label'] = '--- Inventario ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confiscar %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'confiscar %sx %s', ['confiscate_dirty'] = 'confiscar dinero negro: €%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/fi.lua b/locales/fi.lua index 73d6135f..7bc7d28a 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -79,6 +79,7 @@ Locales['fi'] = { ['inventory_label'] = '--- Reppu ---', ['license_label'] = ' --- Lisenssit ---', ['confiscate'] = 'takavarikoi %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'takavarikoi %sx %s', ['confiscate_dirty'] = 'takavarikoi likainen raha: €%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/fr.lua b/locales/fr.lua index 9ca05320..663b286c 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -79,6 +79,7 @@ Locales['fr'] = { ['inventory_label'] = '--- Inventaire ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confisquer %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'confisquer %sx %s', ['confiscate_dirty'] = 'confisquer argent sale: €%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/pl.lua b/locales/pl.lua index 7b79c473..a0149ebc 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -79,6 +79,7 @@ Locales['pl'] = { ['inventory_label'] = '--- Ekwipunek ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'skonfiskuj %s', + ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'skonfiskuj %sx %s', ['confiscate_dirty'] = 'skonfiskuj brudne pieniądze: $%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', diff --git a/locales/sv.lua b/locales/sv.lua index 7309bd36..02ef8dfb 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -10,12 +10,12 @@ Locales['sv'] = { ['no_outfit'] = 'det finns ingen uniform som passar dig!', ['open_cloackroom'] = 'tryck ~INPUT_CONTEXT~ för att välja ~y~kläder~s~.', -- Armory - ['remove_object'] = 'Ta ut objekt', - ['deposit_object'] = 'Lägg in objekt', - ['get_weapon'] = 'Ta ut vapen', - ['put_weapon'] = 'Lägg in vapen', - ['buy_weapons'] = 'Köp in vapen', - ['armory'] = 'Vapenförråd', + ['remove_object'] = 'ta ut objekt', + ['deposit_object'] = 'lägg in objekt', + ['get_weapon'] = 'ta ut vapen', + ['put_weapon'] = 'lägg in vapen', + ['buy_weapons'] = 'köp in vapen', + ['armory'] = 'vapenförråd', ['open_armory'] = 'tryck ~INPUT_CONTEXT~ för att komma åt förrådet', -- Vehicles ['vehicle_menu'] = 'Bilar', @@ -57,9 +57,9 @@ Locales['sv'] = { ['search_database_found'] = 'detta fordon är ~y~registrerat~s~ till ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'trafiksåtgärder', - ['cone'] = 'Kon', - ['barrier'] = 'Barriär', - ['spikestrips'] = 'Spikmatta', + ['cone'] = 'kon', + ['barrier'] = 'barriär', + ['spikestrips'] = 'spikmatta', ['box'] = 'låda', ['cash'] = 'låda med pengar', -- ID Card Menu @@ -78,6 +78,7 @@ Locales['sv'] = { ['inventory_label'] = '--- Inventory ---', ['license_label'] = ' --- Licenser ---', ['confiscate'] = 'beslagta %s', + ['confiscate_weapon'] = 'beslagta %s med %s skott', ['confiscate_inv'] = 'beslagta %sx %s', ['confiscate_dirty'] = 'beslagta svarta pengar: $%s', ['you_confiscated'] = 'du beslagtog ~y~%sx~s~ ~b~%s~s~ från ~b~%s~s~', @@ -96,18 +97,18 @@ Locales['sv'] = { ['owner_unknown'] = 'ägare: Okänt', ['owner'] = 'ägare: %s', -- Weapons Menus - ['get_weapon_menu'] = 'Vapenförråd - Ta vapen', - ['put_weapon_menu'] = 'Vapenförråd - Lägg in vapen', - ['buy_weapon_menu'] = 'Vapenförråd - Köp in vapen', - ['not_enough_money'] = 'Du har inte tillräckligt mycket pengar', + ['get_weapon_menu'] = 'vapenförråd - Ta vapen', + ['put_weapon_menu'] = 'vapenförråd - Lägg in vapen', + ['buy_weapon_menu'] = 'vapenförråd - Köp in vapen', + ['not_enough_money'] = 'du har inte tillräckligt mycket pengar', -- Boss Menu - ['take_company_money'] = 'Ta ut företagspengar', - ['deposit_money'] = 'Lägg in pengar till företaget', - ['amount_of_withdrawal'] = 'Belopp att ta ut', - ['invalid_amount'] = 'Otillgängligt belopp', - ['amount_of_deposit'] = 'Belopp att lägga in', - ['open_bossmenu'] = 'Tryck ~INPUT_CONTEXT~ för att öppna menyn', - ['quantity_invalid'] = 'Otillgängligt antal', + ['take_company_money'] = 'ta ut företagspengar', + ['deposit_money'] = 'lägg in pengar till företaget', + ['amount_of_withdrawal'] = 'belopp att ta ut', + ['invalid_amount'] = 'otillgängligt belopp', + ['amount_of_deposit'] = 'belopp att lägga in', + ['open_bossmenu'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn', + ['quantity_invalid'] = 'otillgängligt antal', ['have_withdraw'] = 'Du har tagit ut x', ['added'] = 'Du la in x', ['quantity'] = 'Antal', diff --git a/server/main.lua b/server/main.lua index 4cc26c31..2235983a 100644 --- a/server/main.lua +++ b/server/main.lua @@ -30,7 +30,7 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, -- can the player carry the said amount of x item? if sourceItem.limit ~= -1 and (sourceItem.count + amount) > sourceItem.limit then - TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) else targetXPlayer.removeInventoryItem(itemName, amount) sourceXPlayer.addInventoryItem (itemName, amount) @@ -38,7 +38,7 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, TriggerClientEvent('esx:showNotification', target, _U('got_confiscated', amount, sourceItem.label, sourceXPlayer.name)) end else - TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) end elseif itemType == 'item_account' then From 424d8872dfb1e51dc37567e27d52ecf123abde13 Mon Sep 17 00:00:00 2001 From: MajorMarcin Date: Mon, 16 Jul 2018 12:41:00 +0200 Subject: [PATCH 147/253] Polish translation updated --- locales/pl.lua | 195 +++++++++++++++++++++++++------------------------ 1 file changed, 98 insertions(+), 97 deletions(-) diff --git a/locales/pl.lua b/locales/pl.lua index a0149ebc..f81a98d2 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -1,126 +1,127 @@ Locales['pl'] = { -- Cloakroom - ['cloakroom'] = 'Szatnia', - ['citizen_wear'] = 'Ubranie Cywilne', - ['police_wear'] = 'Mundur', - ['sheriff_wear'] = 'Mundur Szeryfa', - ['lieutenant_wear'] = 'Mundur Porucznika', - ['gilet_wear'] = 'Kamizelka odblaskowa', - ['bullet_wear'] = 'Kamizelka kuloodporna', - ['no_outfit'] = 'Brak ubrania', - ['open_cloackroom'] = 'Naciśnij ~INPUT_CONTEXT~ aby zmienić ~y~ubranie~s~.', + ['cloakroom'] = 'szatnia', + ['citizen_wear'] = 'ubranie Cywilne', + ['police_wear'] = 'mundur', + ['sheriff_wear'] = 'mundur Szeryfa', + ['lieutenant_wear'] = 'mundur Porucznika', + ['commandant_wear'] = 'mundur Komendanta', + ['gilet_wear'] = 'kamizelka odblaskowa', + ['bullet_wear'] = 'kamizelka kuloodporna', + ['no_outfit'] = 'brak ubrania', + ['open_cloackroom'] = 'naciśnij ~INPUT_CONTEXT~ aby zmienić ~y~ubranie~s~.', -- Armory - ['remove_object'] = 'Weź przedmiot', - ['deposit_object'] = 'Zdeponuj przedmiot', - ['get_weapon'] = 'Weź broń', - ['put_weapon'] = 'Odłóż broń', - ['buy_weapons'] = 'Kup Broń', - ['armory'] = 'Zbrojownia', - ['open_armory'] = 'Naciśnij ~INPUT_CONTEXT~ żeby uzyskać dostęp do zbrojowni', + ['remove_object'] = 'weź przedmiot', + ['deposit_object'] = 'zdeponuj przedmiot', + ['get_weapon'] = 'weź broń', + ['put_weapon'] = 'odłóż broń', + ['buy_weapons'] = 'kup Broń', + ['armory'] = 'zbrojownia', + ['open_armory'] = 'naciśnij ~INPUT_CONTEXT~ żeby uzyskać dostęp do zbrojowni', -- Vehicles - ['vehicle_menu'] = 'Pojazdy', - ['vehicle_out'] = 'Masz już pojazd poza garażem', - ['vehicle_spawner'] = 'Naciśnij ~INPUT_CONTEXT~ żeby wziąć pojazd', - ['store_vehicle'] = 'Naciśnij ~INPUT_CONTEXT~ żeby przechować pojazd', + ['vehicle_menu'] = 'pojazdy', + ['vehicle_out'] = 'masz już pojazd poza garażem', + ['vehicle_spawner'] = 'naciśnij ~INPUT_CONTEXT~ żeby wziąć pojazd', + ['store_vehicle'] = 'naciśnij ~INPUT_CONTEXT~ żeby przechować pojazd', ['service_max'] = 'maksymalna ilość policjantów na służbie: %s/%s', -- Action Menu - ['citizen_interaction'] = 'Interakcja z cywilami', - ['vehicle_interaction'] = 'Interakcja z pojazdami', - ['object_spawner'] = 'Przedmioty do postawienia', + ['citizen_interaction'] = 'interakcja z cywilami', + ['vehicle_interaction'] = 'interakcja z pojazdami', + ['object_spawner'] = 'przedmioty do postawienia', - ['id_card'] = 'Dowód osobisty', - ['search'] = 'Przeszukaj', - ['handcuff'] = 'Zakuj/Rozkuj Kajdanki ', - ['drag'] = 'Przemieść podejrzanego', - ['put_in_vehicle'] = 'Wsadź do pojazdu', - ['out_the_vehicle'] = 'Wyciągnij z pojazdu', - ['fine'] = 'Mandaty', + ['id_card'] = 'dowód osobisty', + ['search'] = 'przeszukaj', + ['handcuff'] = 'zakuj/Rozkuj Kajdanki ', + ['drag'] = 'przemieść podejrzanego', + ['put_in_vehicle'] = 'wsadź do pojazdu', + ['out_the_vehicle'] = 'wyciągnij z pojazdu', + ['fine'] = 'mandaty', ['unpaid_bills'] = 'manage unpaid bills', - ['license_check'] = 'Zarządzaj licencjami', - ['license_revoke'] = 'Uniewaźnij licencje', - ['license_revoked'] = 'Twoja licencja ~b~%s~s~ została ~y~unieważniona~s~!', - ['licence_you_revoked'] = 'Unieważniłeś ~b~%s~s~ które należały do ~y~%s~s~', - ['no_players_nearby'] = 'Brak graczy w pobliżu', + ['license_check'] = 'zarządzaj licencjami', + ['license_revoke'] = 'uniewaźnij licencje', + ['license_revoked'] = 'twoja licencja ~b~%s~s~ została ~y~unieważniona~s~!', + ['licence_you_revoked'] = 'unieważniłeś ~b~%s~s~ które należały do ~y~%s~s~', + ['no_players_nearby'] = 'brak graczy w pobliżu', -- Vehicle interaction - ['vehicle_info'] = 'Informacje o pojeździe', - ['pick_lock'] = 'Odblokuj pojazd', - ['vehicle_unlocked'] = 'Pojazd ~g~Odblokowany~s~', - ['no_vehicles_nearby'] = 'Brak pojazdu w pobliżu', - ['impound'] = 'Zajmij pojazd', - ['impound_prompt'] = 'Naciśnij ~INPUT_CONTEXT~ żeby unieważnić ~y~zajęcie~s~', - ['impound_canceled'] = 'Unieważniłeś/aś zajęcie', - ['impound_canceled_moved'] = 'Zajęcie zostało anulowane, ponieważ pojazd przemieścił się', - ['impound_successful'] = 'Zająłeś/aś pojazd', - ['search_database'] = 'Informacje o pojeździe', - ['search_database_title'] = 'Informacjeo pojeździe - przeszukaj używając numeru rejestracyjnego', - ['search_database_error_invalid'] = 'To ~r~nie~s~ jest ~y~poprawny~s~ rnumer rejestracyjny', - ['search_database_error_not_found'] = 'Ten ~y~numer rejestracyjny~s~ ~r~nie jest~s~ zarejestrowany do tego pojazdu!', - ['search_database_found'] = 'Pojazd jest ~y~zarejestrowany~s~ do ~b~%s~s~', + ['vehicle_info'] = 'informacje o pojeździe', + ['pick_lock'] = 'odblokuj pojazd', + ['vehicle_unlocked'] = 'pojazd ~g~Odblokowany~s~', + ['no_vehicles_nearby'] = 'brak pojazdu w pobliżu', + ['impound'] = 'zajmij pojazd', + ['impound_prompt'] = 'naciśnij ~INPUT_CONTEXT~ żeby unieważnić ~y~zajęcie~s~', + ['impound_canceled'] = 'unieważniłeś/aś zajęcie', + ['impound_canceled_moved'] = 'zajęcie zostało anulowane, ponieważ pojazd przemieścił się', + ['impound_successful'] = 'zająłeś/aś pojazd', + ['search_database'] = 'informacje o pojeździe', + ['search_database_title'] = 'informacjeo pojeździe - przeszukaj używając numeru rejestracyjnego', + ['search_database_error_invalid'] = 'to ~r~nie~s~ jest ~y~poprawny~s~ rnumer rejestracyjny', + ['search_database_error_not_found'] = 'ten ~y~numer rejestracyjny~s~ ~r~nie jest~s~ zarejestrowany do tego pojazdu!', + ['search_database_found'] = 'pojazd jest ~y~zarejestrowany~s~ do ~b~%s~s~', -- Traffic interaction - ['traffic_interaction'] = 'Interakcje dla ruchu drogowego', - ['cone'] = 'Pachołek', - ['barrier'] = 'Barierka', - ['spikestrips'] = 'Kolczatka', - ['box'] = 'Pudła', - ['cash'] = 'Paleta z pieniędzmi', + ['traffic_interaction'] = 'interakcje dla ruchu drogowego', + ['cone'] = 'pachołek', + ['barrier'] = 'barierka', + ['spikestrips'] = 'kolczatka', + ['box'] = 'pudła', + ['cash'] = 'paleta z pieniędzmi', -- ID Card Menu ['name'] = 'name: %s', - ['job'] = 'job: %s', - ['sex'] = 'sex: %s', - ['dob'] = 'DOB: %s', - ['height'] = 'height: %s', - ['id'] = 'ID: %s', - ['bac'] = 'BAC: %s', - ['unknown'] = 'unknown', - ['male'] = 'male', - ['female'] = 'female', + ['job'] = 'praca: %s', + ['sex'] = 'płeć: %s', + ['dob'] = 'data urodzenia: %s', + ['height'] = 'wzrost: %s', + ['id'] = 'iD: %s', + ['bac'] = 'bAC: %s', + ['unknown'] = 'nieznany', + ['male'] = 'mężczyzna', + ['female'] = 'kobieta', -- Body Search Menu ['guns_label'] = '--- Bronie ---', ['inventory_label'] = '--- Ekwipunek ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'skonfiskuj %s', - ['confiscate_weapon'] = 'confiscate %s with %s bullets', - ['confiscate_inv'] = 'skonfiskuj %sx %s', + ['confiscate_weapon'] = 'skonfiskuj %s z %s bullets', + ['confiscate_inv'] = 'skonfiskuj %s x %s', ['confiscate_dirty'] = 'skonfiskuj brudne pieniądze: $%s', - ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', - ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', - ['you_confiscated_account'] = 'you confiscated ~g~$%s~s~ (%s) from ~b~%s~s~', - ['got_confiscated_account'] = '~g~$%s~s~ (%s) was confiscated by ~y~%s~s~', - ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', - ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', - ['traffic_offense'] = 'Wykroczenia drogowe', - ['minor_offense'] = 'Niewielkie wykroczenia', - ['average_offense'] = 'Średnie wykroczenia', - ['major_offense'] = 'Duże wykroczenia', + ['you_confiscated'] = 'skonfiskowałeś ~y~%sx~s~ ~b~%s~s~ od ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ zostały skonfiskowane przez ~y~%s~s~', + ['you_confiscated_account'] = 'skonfiskowałeś ~g~%s$~s~ (%s) od ~b~%s~s~', + ['got_confiscated_account'] = '~g~%s$~s~ (%s) zostały skonfiskowane przez ~y~%s~s~', + ['you_confiscated_weapon'] = 'skonfiskowałeś ~b~%s~s~ od ~b~%s~s~ z ~o~%s~s~ pociskami', + ['got_confiscated_weapon'] = 'twój ~b~%s~s~ z ~o~%s~s~ kulami został skonfiskowany przez ~y~%s~s~', + ['traffic_offense'] = 'wykroczenia drogowe', + ['minor_offense'] = 'niewielkie wykroczenia', + ['average_offense'] = 'średnie wykroczenia', + ['major_offense'] = 'duże wykroczenia', ['fine_total'] = 'mandat: %s', -- Vehicle Info Menu ['plate'] = 'tablica rejestracyjna: %s', ['owner_unknown'] = 'właściciel: Nieznany', ['owner'] = 'właściciel: %s', -- Weapons Menus - ['get_weapon_menu'] = 'Zbrojownia - Weź broń', - ['put_weapon_menu'] = 'Zbrojownia - Odłóż broń', - ['buy_weapon_menu'] = 'Zbrojownia - Kup broń', - ['not_enough_money'] = 'Nie masz wystarczającej ilości pieniędzy', + ['get_weapon_menu'] = 'zbrojownia - Weź broń', + ['put_weapon_menu'] = 'zbrojownia - Odłóż broń', + ['buy_weapon_menu'] = 'zbrojownia - Kup broń', + ['not_enough_money'] = 'nie masz wystarczającej ilości pieniędzy', -- Boss Menu - ['take_company_money'] = 'Wypłać firmowe pieniądze', - ['deposit_money'] = 'Zdeponuj pieniądze', - ['amount_of_withdrawal'] = 'Wartość wypłaty', - ['invalid_amount'] = 'Nieprawidłowa wartość', - ['amount_of_deposit'] = 'Wartość depozytu', - ['open_bossmenu'] = 'Naciśnij ~INPUT_CONTEXT~ aby otworzyć menu', - ['quantity_invalid'] = 'Nieprawidłowa ilość', - ['have_withdrawn'] = 'Wypłaciłeś x', - ['not_enough_in_society'] = 'Niewystarczająca ilość przedmiotu w społeczeństwie!', + ['take_company_money'] = 'wypłać firmowe pieniądze', + ['deposit_money'] = 'zdeponuj pieniądze', + ['amount_of_withdrawal'] = 'wartość wypłaty', + ['invalid_amount'] = 'nieprawidłowa wartość', + ['amount_of_deposit'] = 'wartość depozytu', + ['open_bossmenu'] = 'naciśnij ~INPUT_CONTEXT~ aby otworzyć menu', + ['quantity_invalid'] = 'nieprawidłowa ilość', + ['have_withdrawn'] = 'wypłaciłeś x', + ['not_enough_in_society'] = 'niewystarczająca ilość przedmiotu w społeczeństwie!', ['player_cannot_hold'] = '~r~Nie masz~w~ wystarczająco ~y~wolnego miejsca~w~ w ekwipunku!', - ['added'] = 'Dodałeś x', - ['quantity'] = 'Ilość', - ['inventory'] = 'Ekwipunek', - ['police_stock'] = 'Zapasy policji', + ['added'] = 'dodałeś x', + ['quantity'] = 'ilość', + ['inventory'] = 'ekwipunek', + ['police_stock'] = 'zapasy policji', -- Misc - ['remove_prop'] = 'Naciśnij ~INPUT_CONTEXT~ aby usunąć ten obiekt', - ['map_blip'] = 'Komisariat Policji', - ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', + ['remove_prop'] = 'naciśnij ~INPUT_CONTEXT~ aby usunąć ten obiekt', + ['map_blip'] = 'komisariat Policji', + ['unrestrained_timer'] = 'czujesz, że twoje kajdanki powoli tracą przyczepność i znikają.', -- Notifications - ['alert_police'] = 'Ostrzeż policję', + ['alert_police'] = 'ostrzeż policję', } From 63440a6ef6f5be35d532d1e79e332911c7b064ef Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 16 Jul 2018 13:57:39 +0200 Subject: [PATCH 148/253] Fixed #126, improved draging, improved out of vehicle - Stability fixes in general - You can no use the 'out vehicle' action if the target isn't in an vehicle - You can no longer drag players whilst inside an vehicle - Minor improvements - Added colorful text to bills - Fixed service string - Possible fix for #127 --- client/main.lua | 135 ++++++++++++++++++++++++++++-------------------- 1 file changed, 79 insertions(+), 56 deletions(-) diff --git a/client/main.lua b/client/main.lua index 07004ddc..dbd40b3d 100644 --- a/client/main.lua +++ b/client/main.lua @@ -20,9 +20,9 @@ local CurrentAction = nil local CurrentActionMsg = '' local CurrentActionData = {} local IsHandcuffed = false -local HandcuffTimer = nil -local IsDragged = false -local CopPed = 0 +local HandcuffTimer = {} +local DragStatus = {} +DragStatus.IsDragged = false local hasAlreadyJoined = false local blipsCops = {} local isDead = false @@ -396,7 +396,7 @@ function OpenVehicleSpawnerMenu(station, partNum) end) else - ESX.ShowNotification(_U('service_max', inServiceCount, maxInService) .. inServiceCount .. '/' .. maxInService) + ESX.ShowNotification(_U('service_max', inServiceCount, maxInService)) end end, 'police') @@ -720,22 +720,18 @@ function OpenBodySearchMenu(player) local elements = {} - local blackMoney = 0 - for i=1, #data.accounts, 1 do - if data.accounts[i].money > 0 then - if data.accounts[i].name == 'black_money' then - blackMoney = data.accounts[i].money - table.insert(elements, { - label = _U('confiscate_dirty', ESX.Round(blackMoney)), - value = 'black_money', - itemType = 'item_account', - amount = blackMoney - }) + if data.accounts[i].name == 'black_money' and data.accounts[i].money > 0 then - break - end + table.insert(elements, { + label = _U('confiscate_dirty', ESX.Round(data.accounts[i].money)), + value = 'black_money', + itemType = 'item_account', + amount = data.accounts[i].money + }) + + break end end @@ -798,10 +794,10 @@ function OpenFineMenu(player) title = _U('fine'), align = 'top-left', elements = { - {label = _U('traffic_offense'), value = 0}, - {label = _U('minor_offense'), value = 1}, - {label = _U('average_offense'), value = 2}, - {label = _U('major_offense'), value = 3} + {label = _U('traffic_offense'), value = 0}, + {label = _U('minor_offense'), value = 1}, + {label = _U('average_offense'), value = 2}, + {label = _U('major_offense'), value = 3} }, }, function(data, menu) @@ -824,7 +820,7 @@ function OpenFineCategoryMenu(player, category) for i=1, #fines, 1 do table.insert(elements, { - label = fines[i].label .. ' $' .. fines[i].amount, + label = fines[i].label .. ' $' .. fines[i].amount .. '', value = fines[i].id, amount = fines[i].amount, fineLabel = fines[i].label @@ -866,11 +862,10 @@ function OpenFineCategoryMenu(player, category) end function LookupVehicle() - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'lookup_vehicle', + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'lookup_vehicle', { title = _U('search_database_title'), - }, function (data, menu) + }, function(data, menu) local length = string.len(data.value) if data.value == nil or length < 8 or length > 13 then ESX.ShowNotification(_U('search_database_error_invalid')) @@ -884,10 +879,9 @@ function LookupVehicle() end, data.value) menu.close() end - end, function (data, menu) + end, function(data, menu) menu.close() - end - ) + end) end function ShowPlayerLicense(player) @@ -955,7 +949,6 @@ function OpenUnpaidBillsMenu(player) end, GetPlayerServerId(player)) end - function OpenVehicleInfosMenu(vehicleData) ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(infos) @@ -1386,8 +1379,9 @@ AddEventHandler('esx_policejob:handcuff', function() DisplayRadar(false) if Config.EnableHandcuffTimer then - if HandcuffTimer then - ESX.ClearTimeout(HandcuffTimer) + + if HandcuffTimer.Active then + ESX.ClearTimeout(HandcuffTimer.Task) end StartHandcuffTimer() @@ -1395,9 +1389,10 @@ AddEventHandler('esx_policejob:handcuff', function() else - if Config.EnableHandcuffTimer and HandcuffTimer then - ESX.ClearTimeout(HandcuffTimer) + if Config.EnableHandcuffTimer and HandcuffTimer.Active then + ESX.ClearTimeout(HandcuffTimer.Task) end + ClearPedSecondaryTask(playerPed) SetEnableHandcuffs(playerPed, false) DisablePlayerFiring(playerPed, false) @@ -1423,28 +1418,45 @@ AddEventHandler('esx_policejob:unrestrain', function() DisplayRadar(true) -- end timer - if Config.EnableHandcuffTimer and HandcuffTimer then - ESX.ClearTimeout(HandcuffTimer) + if Config.EnableHandcuffTimer and HandcuffTimer.Active then + ESX.ClearTimeout(HandcuffTimer.Task) end end end) RegisterNetEvent('esx_policejob:drag') -AddEventHandler('esx_policejob:drag', function(cop) - IsDragged = not IsDragged - CopPed = tonumber(cop) +AddEventHandler('esx_policejob:drag', function(copID) + if not IsHandcuffed then + return + end + + DragStatus.IsDragged = not DragStatus.IsDragged + DragStatus.CopId = tonumber(copID) end) Citizen.CreateThread(function() + local playerPed + local targetPed + while true do Citizen.Wait(1) + if IsHandcuffed then - if IsDragged then - local ped = GetPlayerPed(GetPlayerFromServerId(CopPed)) - local myped = PlayerPedId() - AttachEntityToEntity(myped, ped, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) + playerPed = PlayerPedId() + + if DragStatus.IsDragged then + targetPed = GetPlayerPed(GetPlayerFromServerId(DragStatus.CopId)) + + -- undrag if target is in an vehicle + if not IsPedSittingInAnyVehicle(targetPed) then + AttachEntityToEntity(playerPed, targetPed, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) + else + DragStatus.IsDragged = false + DetachEntity(playerPed, true, false) + end + else - DetachEntity(PlayerPedId(), true, false) + DetachEntity(playerPed, true, false) end else Citizen.Wait(500) @@ -1486,14 +1498,20 @@ AddEventHandler('esx_policejob:putInVehicle', function() end) RegisterNetEvent('esx_policejob:OutVehicle') -AddEventHandler('esx_policejob:OutVehicle', function(t) - local ped = GetPlayerPed(t) - ClearPedTasksImmediately(ped) - plyPos = GetEntityCoords(PlayerPedId(), true) - local xnew = plyPos.x+2 - local ynew = plyPos.y+2 +AddEventHandler('esx_policejob:OutVehicle', function(targetID) + local playerPed = PlayerPedId() + local targetPed = GetPlayerPed(targetID) - SetEntityCoords(PlayerPedId(), xnew, ynew, plyPos.z) + if not IsPedSittingInAnyVehicle(playerPed) then + return + end + + ClearPedTasksImmediately(targetPed) + targetPos = GetEntityCoords(playerPed, true) + + local newX = plyPos.x+2 + local newY = plyPos.y+2 + SetEntityCoords(playerPed, newX, newY, targetPos.z) end) -- Handcuff @@ -1924,21 +1942,26 @@ end) AddEventHandler('onResourceStop', function(resource) if resource == GetCurrentResourceName() then TriggerEvent('esx_policejob:unrestrain') + + if Config.EnableHandcuffTimer and HandcuffTimer.Active then + ESX.ClearTimeout(HandcuffTimer.Task) + end end end) -- handcuff timer, unrestrain the player after an certain amount of time function StartHandcuffTimer() - if Config.EnableHandcuffTimer and HandcuffTimer then - ESX.ClearTimeout(HandcuffTimer) + if Config.EnableHandcuffTimer and HandcuffTimer.Active then + ESX.ClearTimeout(HandcuffTimer.Task) end - HandcuffTimer = ESX.SetTimeout(Config.HandcuffTimer, function() + HandcuffTimer.Active = true + + HandcuffTimer.Task = ESX.SetTimeout(Config.HandcuffTimer, function() ESX.ShowNotification(_U('unrestrained_timer')) TriggerEvent('esx_policejob:unrestrain') + HandcuffTimer.Active = false end) - - HandcuffTimer = nil end -- TODO @@ -1949,4 +1972,4 @@ function ImpoundVehicle(vehicle) ESX.Game.DeleteVehicle(vehicle) ESX.ShowNotification(_U('impound_successful')) CurrentTask.Busy = false -end +end \ No newline at end of file From a162cb9b2b75aace17b40c4f2f5f897e5897b388 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 16 Jul 2018 14:55:04 +0200 Subject: [PATCH 149/253] Fixed undrag when put in vehicle --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index dbd40b3d..3861cbe9 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1488,7 +1488,7 @@ AddEventHandler('esx_policejob:putInVehicle', function() if freeSeat ~= nil then TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) - IsDragged = false + DragStatus.IsDragged = false end end From 91a5e9bca4eaab37c13548ec3ea75359ec17faa9 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 17 Jul 2018 13:25:31 +0200 Subject: [PATCH 150/253] Possible fix for drag out vehicle, Possible fix #131, locale improvements, see desc - Moved phone string to locale - The police society can no longer wash money --- client/main.lua | 17 +++++++---------- locales/br.lua | 9 ++++++++- locales/de.lua | 7 +++++++ locales/en.lua | 9 ++++----- locales/es.lua | 29 +++++++++++++++-------------- locales/fi.lua | 5 +++-- locales/fr.lua | 11 ++++++----- locales/pl.lua | 7 +++---- locales/sv.lua | 5 +++-- server/main.lua | 36 +++++++++++++++++++++--------------- 10 files changed, 77 insertions(+), 58 deletions(-) diff --git a/client/main.lua b/client/main.lua index 3861cbe9..b2f40ed8 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1125,6 +1125,7 @@ function OpenGetStocksMenu() 'default', GetCurrentResourceName(), 'stocks_menu', { title = _U('police_stock'), + align = 'top-left', elements = elements }, function(data, menu) @@ -1186,6 +1187,7 @@ function OpenPutStocksMenu() 'default', GetCurrentResourceName(), 'stocks_menu', { title = _U('inventory'), + align = 'top-left', elements = elements }, function(data, menu) @@ -1239,7 +1241,7 @@ RegisterNetEvent('esx_phone:loaded') AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) local specialContact = { - name = 'Police', + name = _U('phone_police'), number = 'police', base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDFGQTJDRkI0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDFGQTJDRkM0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0MUZBMkNGOTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0MUZBMkNGQTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoW66EYAAAjGSURBVHjapJcLcFTVGcd/u3cfSXaTLEk2j80TCI8ECI9ABCyoiBqhBVQqVG2ppVKBQqUVgUl5OU7HKqNOHUHU0oHamZZWoGkVS6cWAR2JPJuAQBPy2ISEvLN57+v2u2E33e4k6Ngz85+9d++95/zP9/h/39GpqsqiRYsIGz8QZAq28/8PRfC+4HT4fMXFxeiH+GC54NeCbYLLATLpYe/ECx4VnBTsF0wWhM6lXY8VbBE0Ch4IzLcpfDFD2P1TgrdC7nMCZLRxQ9AkiAkQCn77DcH3BC2COoFRkCSIG2JzLwqiQi0RSmCD4JXbmNKh0+kc/X19tLtc9Ll9sk9ZS1yoU71YIk3xsbEx8QaDEc2ttxmaJSKC1ggSKBK8MKwTFQVXRzs3WzpJGjmZgvxcMpMtWIwqsjztvSrlzjYul56jp+46qSmJmMwR+P3+4aZ8TtCprRkk0DvUW7JjmV6lsqoKW/pU1q9YQOE4Nxkx4ladE7zd8ivuVmJQfXZKW5dx5EwPRw4fxNx2g5SUVLw+33AkzoRaQDP9SkFu6OKqz0uF8yaz7vsOL6ycQVLkcSg/BlWNsjuFoKE1knqDSl5aNnmPLmThrE0UvXqQqvJPyMrMGorEHwQfEha57/3P7mXS684GFjy8kreLppPUuBXfyd/ibeoS2kb0mWPANhJdYjb61AxUvx5PdT3+4y+Tb3mTd19ZSebE+VTXVGNQlHAC7w4VhH8TbA36vKq6ilnzlvPSunHw6Trc7XpZ14AyfgYeyz18crGN1Alz6e3qwNNQSv4dZox1h/BW9+O7eIaEsVv41Y4XeHJDG83Nl4mLTwzGhJYtx0PzNTjOB9KMTlc7Nkcem39YAGU7cbeBKVLMPGMVf296nMd2VbBq1wmizHoqqm/wrS1/Zf0+N19YN2PIu1fcIda4Vk66Zx/rVi+jo9eIX9wZGGcFXUMR6BHUa76/2ezioYcXMtpyAl91DSaTfDxlJbtLprHm2ecpObqPuTPzSNV9yKz4a4zJSuLo71/j8Q17ON69EmXiPIlNMe6FoyzOqWPW/MU03Lw5EFcyKghTrNDh7+/vw545mcJcWbTiGKpRdGPMXbx90sGmDaux6sXk+kimjU+BjnMkx3kYP34cXrFuZ+3nrHi6iDMt92JITcPjk3R3naRwZhpuNSqoD93DKaFVU7j2dhcF8+YzNlpErbIBTVh8toVccbaysPB+4pMcuPw25kwSsau7BIlmHpy3guaOPtISYyi/UkaJM5Lpc5agq5Xkcl6gIHkmqaMn0dtylcjIyPThCNyhaXyfR2W0I1our0v6qBii07ih5rDtGSOxNVdk1y4R2SR8jR/g7hQD9l1jUeY/WLJB5m39AlZN4GZyIQ1fFJNsEgt0duBIc5GRkcZF53mNwIzhXPDgQPoZIkiMkbTxtstDMVnmFA4cOsbz2/aKjSQjev4Mp9ZAg+hIpFhB3EH5Yal16+X+Kq3dGfxkzRY+KauBjBzREvGN0kNCTARu94AejBLMHorAQ7cEQMGs2cXvkWshYLDi6e9l728O8P1XW6hKeB2yv42q18tjj+iFTGoSi+X9jJM9RTxS9E+OHT0krhNiZqlbqraoT7RAU5bBGrEknEBhgJks7KXbLS8qERI0ErVqF/Y4K6NHZfLZB+/wzJvncacvFd91oXO3o/O40MfZKJOKu/rne+mRQByXM4lYreb1tUnkizVVA/0SpfpbWaCNBeEE5gb/UH19NLqEgDF+oNDQWcn41Cj0EXFEWqzkOIyYekslFkThsvMxpIyE2hIc6lXGZ6cPyK7Nnk5OipixRdxgUESAYmhq68VsGgy5CYKCUAJTg0+izApXne3CJFmUTwg4L3FProFxU+6krqmXu3MskkhSD2av41jLdzlnfFrSdCZxyqfMnppN6ZUa7pwt0h3fiK9DCt4IO9e7YqisvI7VYgmNv7mhBKKD/9psNi5dOMv5ZjukjsLdr0ffWsyTi6eSlfcA+dmiVyOXs+/sHNZu3M6PdxzgVO9GmDSHsSNqmTz/R6y6Xxqma4fwaS5Mn85n1ZE0Vl3CHBER3lUNEhiURpPJRFdTOcVnpUJnPIhR7cZXfoH5UYc5+E4RzRH3sfSnl9m2dSMjE+Tz9msse+o5dr7UwcQ5T3HwlWUkNuzG3dKFSTbsNs7m/Y8vExOlC29UWkMJlAxKoRQMR3IC7x85zOn6fHS50+U/2Untx2R1voinu5no+DQmz7yPXmMKZnsu0wrm0Oe3YhOVHdm8A09dBQYhTv4T7C+xUPrZh8Qn2MMr4qcDSRfoirWgKAvtgOpv1JI8Zi77X15G7L+fxeOUOiUFxZiULD5fSlNzNM62W+k1yq5gjajGX/ZHvOIyxd+Fkj+P092rWP/si0Qr7VisMaEWuCiYonXFwbAUTWWPYLV245NITnGkUXnpI9butLJn2y6iba+hlp7C09qBcvoN7FYL9mhxo1/y/LoEXK8Pv6qIC8WbBY/xr9YlPLf9dZT+OqKTUwfmDBm/GOw7ws4FWpuUP2gJEZvKqmocuXPZuWYJMzKuSsH+SNwh3bo0p6hao6HeEqwYEZ2M6aKWd3PwTCy7du/D0F1DsmzE6/WGLr5LsDF4LggnYBacCOboQLHQ3FFfR58SR+HCR1iQH8ukhA5s5o5AYZMwUqOp74nl8xvRHDlRTsnxYpJsUjtsceHt2C8Fm0MPJrphTkZvBc4It9RKLOFx91Pf0Igu0k7W2MmkOewS2QYJUJVWVz9VNbXUVVwkyuAmKTFJayrDo/4Jwe/CT0aGYTrWVYEeUfsgXssMRcpyenraQJa0VX9O3ZU+Ma1fax4xGxUsUVFkOUbcama1hf+7+LmA9juHWshwmwOE1iMmCFYEzg1jtIm1BaxW6wCGGoFdewPfvyE4ertTiv4rHC73B855dwp2a23bbd4tC1hvhOCbX7b4VyUQKhxrtSOaYKngasizvwi0RmOS4O1QZf2yYfiaR+73AvhTQEVf+rpn9/8IMAChKDrDzfsdIQAAAABJRU5ErkJggg==' } @@ -1498,20 +1500,15 @@ AddEventHandler('esx_policejob:putInVehicle', function() end) RegisterNetEvent('esx_policejob:OutVehicle') -AddEventHandler('esx_policejob:OutVehicle', function(targetID) +AddEventHandler('esx_policejob:OutVehicle', function() local playerPed = PlayerPedId() - local targetPed = GetPlayerPed(targetID) if not IsPedSittingInAnyVehicle(playerPed) then return end - ClearPedTasksImmediately(targetPed) - targetPos = GetEntityCoords(playerPed, true) - - local newX = plyPos.x+2 - local newY = plyPos.y+2 - SetEntityCoords(playerPed, newX, newY, targetPos.z) + local vehicle = GetVehiclePedIsIn(playerPed, false) + TaskLeaveVehicle(playerPed, vehicle, 16) end) -- Handcuff @@ -1856,7 +1853,7 @@ Citizen.CreateThread(function() CurrentAction = 'menu_boss_actions' CurrentActionMsg = _U('open_bossmenu') CurrentActionData = {} - end) + end, { wash = false }) -- disable washing money elseif CurrentAction == 'remove_entity' then DeleteEntity(CurrentActionData.entity) end diff --git a/locales/br.lua b/locales/br.lua index 638339e6..c746398e 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -4,7 +4,7 @@ Locales['br'] = { ['citizen_wear'] = 'Roupa casual', ['police_wear'] = 'Uniforme da Polícia', ['sheriff_wear'] = 'sheriff Outfit', - ['lieutenant_wear'] = 'Swatt outfit ', + ['lieutenant_wear'] = 'Swatt outfit', ['gilet_wear'] = 'orange reflective jacket', ['bullet_wear'] = 'bulletproof vest', ['no_outfit'] = 'there\'s no uniform that fits you!', @@ -109,10 +109,17 @@ Locales['br'] = { ['invalid_amount'] = 'Quantidade inválida', ['amount_of_deposit'] = 'Quantidade de depósito', ['open_bossmenu'] = 'Pressione ~INPUT_CONTEXT~ para abrir o menu', + ['quantity_invalid'] = 'invalid quantity', + ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'quantity', + ['inventory'] = 'inventory', + ['police_stock'] = 'police Stock', -- Misc ['remove_prop'] = 'Pressione ~INPUT_CONTEXT~ para remover o objeto', ['map_blip'] = 'Departamento de Polícia', ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'Alerta da Polícia', + ['phone_police'] = 'police', } diff --git a/locales/de.lua b/locales/de.lua index 0448926e..a48a8233 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -109,10 +109,17 @@ Locales['de'] = { ['invalid_amount'] = 'ungültiger Betrag', ['amount_of_deposit'] = 'Betrag zum einzahlen', ['open_bossmenu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', + ['quantity_invalid'] = 'invalid quantity', + ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'quantity', + ['inventory'] = 'inventory', + ['police_stock'] = 'police Stock', -- Misc ['remove_prop'] = 'Drücke ~INPUT_CONTEXT~ um das Objekt zu entfernen', ['map_blip'] = 'Polizeistation', ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'Polizei alamieren', + ['phone_police'] = 'police', } diff --git a/locales/en.lua b/locales/en.lua index f0cf16ac..ad6d5b40 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -110,17 +110,16 @@ Locales['en'] = { ['amount_of_deposit'] = 'amount of deposit', ['open_bossmenu'] = 'press ~INPUT_CONTEXT~ to open the menu', ['quantity_invalid'] = 'invalid quantity', - ['have_withdrawn'] = 'you have withdrawn x', - ['not_enough_in_society'] = 'there\'s not enough of ~r~that item~s~ in the society!', - ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', - ['added'] = 'you added x', + ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', ['quantity'] = 'quantity', ['inventory'] = 'inventory', - ['police_stock'] = 'Police Stock', + ['police_stock'] = 'police Stock', -- Misc ['remove_prop'] = 'press ~INPUT_CONTEXT~ to delete the object', ['map_blip'] = 'police Station', ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'alert police', + ['phone_police'] = 'police', } diff --git a/locales/es.lua b/locales/es.lua index b6d4cf3d..6d3e3df4 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -103,22 +103,23 @@ Locales['es'] = { ['buy_weapon_menu'] = 'Arsenal - Comprar armas', ['not_enough_money'] = 'No tienes suficiente dinero', -- Boss Menu - ['take_company_money'] = 'Retirar dinero de la empresa', - ['deposit_money'] = 'Depositar dinero en la empresa', - ['amount_of_withdrawal'] = 'Cantidad a retirar', - ['invalid_amount'] = 'Cantidad inválida', - ['amount_of_deposit'] = 'Cantidad a depositar', - ['open_bossmenu'] = 'Presionar ~INPUT_CONTEXT~ para abrir el menú', - ['quantity_invalid'] = 'Cantidad invalida', - ['have_withdrawn'] = 'Has retirado x', - ['added'] = 'Has metido x', - ['quantity'] = 'Cantidad', + ['take_company_money'] = 'retirar dinero de la empresa', + ['deposit_money'] = 'depositar dinero en la empresa', + ['amount_of_withdrawal'] = 'cantidad a retirar', + ['invalid_amount'] = 'cantidad inválida', + ['amount_of_deposit'] = 'cantidad a depositar', + ['open_bossmenu'] = 'presionar ~INPUT_CONTEXT~ para abrir el menú', + ['quantity_invalid'] = 'cantidad invalida', + ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'cantidad', ['inventory'] = 'inventario', - ['police_stock'] = 'Almacen Policial', + ['police_stock'] = 'almacen Policial', -- Misc - ['remove_prop'] = 'Presionar ~INPUT_CONTEXT~ para eliminar el objeto', - ['map_blip'] = 'Comisaría de policía', + ['remove_prop'] = 'presionar ~INPUT_CONTEXT~ para eliminar el objeto', + ['map_blip'] = 'comisaría de policía', ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications - ['alert_police'] = 'Alerta policia', + ['alert_police'] = 'alerta policia', + ['phone_police'] = 'policia', } diff --git a/locales/fi.lua b/locales/fi.lua index 7bc7d28a..976ae3e8 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -110,8 +110,8 @@ Locales['fi'] = { ['amount_of_deposit'] = 'talletuksen määrä', ['open_bossmenu'] = 'paina ~INPUT_CONTEXT~ avataksesi valikon', ['quantity_invalid'] = 'invalid quantity', - ['have_withdrawn'] = 'sinä nostit x', - ['added'] = 'sinä lisäsit varastoon x', + ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', ['quantity'] = 'määrä', ['inventory'] = 'varasto', ['police_stock'] = 'Poliisin Varasto', @@ -121,4 +121,5 @@ Locales['fi'] = { ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'hälyytys Poliisi', + ['phone_police'] = 'poliisi', } \ No newline at end of file diff --git a/locales/fr.lua b/locales/fr.lua index 663b286c..2ba1d387 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -109,16 +109,17 @@ Locales['fr'] = { ['invalid_amount'] = 'montant invalide', ['amount_of_deposit'] = 'montant du dépôt', ['open_bossmenu'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir le menu', - ['quantity_invalid'] = 'Quantité invalide', - ['have_withdrawn'] = 'Vous avez retiré x', - ['added'] = 'Vous avez ajouté x', - ['quantity'] = 'Quantité', + ['quantity_invalid'] = 'quantité invalide', + ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'quantité', ['inventory'] = 'inventaire', - ['police_stock'] = 'Police Stock', + ['police_stock'] = 'police Stock', -- Misc ['remove_prop'] = 'appuyez sur ~INPUT_CONTEXT~ pour enlever l\'objet', ['map_blip'] = 'Commissariat', ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications ['alert_police'] = 'alerte police', + ['phone_police'] = 'police', } diff --git a/locales/pl.lua b/locales/pl.lua index f81a98d2..2a8fb1b4 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -111,10 +111,8 @@ Locales['pl'] = { ['amount_of_deposit'] = 'wartość depozytu', ['open_bossmenu'] = 'naciśnij ~INPUT_CONTEXT~ aby otworzyć menu', ['quantity_invalid'] = 'nieprawidłowa ilość', - ['have_withdrawn'] = 'wypłaciłeś x', - ['not_enough_in_society'] = 'niewystarczająca ilość przedmiotu w społeczeństwie!', - ['player_cannot_hold'] = '~r~Nie masz~w~ wystarczająco ~y~wolnego miejsca~w~ w ekwipunku!', - ['added'] = 'dodałeś x', + ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', ['quantity'] = 'ilość', ['inventory'] = 'ekwipunek', ['police_stock'] = 'zapasy policji', @@ -124,4 +122,5 @@ Locales['pl'] = { ['unrestrained_timer'] = 'czujesz, że twoje kajdanki powoli tracą przyczepność i znikają.', -- Notifications ['alert_police'] = 'ostrzeż policję', + ['phone_police'] = 'police', } diff --git a/locales/sv.lua b/locales/sv.lua index 02ef8dfb..dc0a6fb4 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -109,8 +109,8 @@ Locales['sv'] = { ['amount_of_deposit'] = 'belopp att lägga in', ['open_bossmenu'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn', ['quantity_invalid'] = 'otillgängligt antal', - ['have_withdraw'] = 'Du har tagit ut x', - ['added'] = 'Du la in x', + ['have_withdrawn'] = 'du har tagit ut ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'du har lagrat ~y~x%s~s~ ~b~%s~s~', ['quantity'] = 'Antal', ['inventory'] = 'Förråd', ['police_stock'] = 'Polisförråd', @@ -120,4 +120,5 @@ Locales['sv'] = { ['unrestrained_timer'] = 'dina handklovar har försvunnit', -- Notifications ['alert_police'] = 'Meddela polisen', + ['phone_police'] = 'polisen', } diff --git a/server/main.lua b/server/main.lua index 2235983a..176f1a16 100644 --- a/server/main.lua +++ b/server/main.lua @@ -81,23 +81,29 @@ end) RegisterServerEvent('esx_policejob:getStockItem') AddEventHandler('esx_policejob:getStockItem', function(itemName, count) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local sourceItem = xPlayer.getInventoryItem(itemName) - local xPlayer = ESX.GetPlayerFromId(source) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) + local item = inventory.getItem(itemName) - local item = inventory.getItem(itemName) - - if item.count >= count then - inventory.removeItem(itemName, count) - xPlayer.addInventoryItem(itemName, count) - else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) - end - - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) - - end) + -- is there enough in the society? + if count > 0 and item.count >= count then + + -- can the player carry the said amount of x item? + if sourceItem.limit ~= -1 and (sourceItem.count + count) > sourceItem.limit then + TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) + else + inventory.removeItem(itemName, count) + xPlayer.addInventoryItem(itemName, count) + TriggerClientEvent('esx:showNotification', _source, _U('have_withdrawn', count, item.label)) + end + else + TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) + end + end) end) @@ -117,7 +123,7 @@ AddEventHandler('esx_policejob:putStockItems', function(itemName, count) TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) end - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('added') .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited', count, item.label)) end) From 206509a46c6847441df636d26aaea07a84df329b Mon Sep 17 00:00:00 2001 From: AdrineX Date: Tue, 17 Jul 2018 14:40:13 +0300 Subject: [PATCH 151/253] fix finnish lang... --- locales/fi.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/locales/fi.lua b/locales/fi.lua index 976ae3e8..2bd5a078 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -57,7 +57,7 @@ Locales['fi'] = { ['search_database_error_not_found'] = 'tämä ~y~rekisterinumero~s~ ~r~ei~s~ ole rekistöröity ajoneuvoon!', ['search_database_found'] = 'ajoneuvo on ~y~rekistöröity~s~ henkilölle ~b~%s~s~', -- Traffic interaction - ['traffic_interaction'] = 'Liikenne vuorovaikutus', + ['traffic_interaction'] = 'liikenteen vuorovaikutus', ['cone'] = 'kartio', ['barrier'] = 'este', ['spikestrips'] = 'piikkimatto', @@ -81,13 +81,13 @@ Locales['fi'] = { ['confiscate'] = 'takavarikoi %s', ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'takavarikoi %sx %s', - ['confiscate_dirty'] = 'takavarikoi likainen raha: €%s', - ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', - ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', - ['you_confiscated_account'] = 'you confiscated ~g~$%s~s~ (%s) from ~b~%s~s~', - ['got_confiscated_account'] = '~g~$%s~s~ (%s) was confiscated by ~y~%s~s~', - ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', - ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', + ['confiscate_dirty'] = 'takavarikoi likainen raha: $%s', + ['you_confiscated'] = 'sinä takavarioit ~y~%sx~s~ ~b~%s~s~ pelaajalta ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ takavarikoitiin sinulta pelaajan ~y~%s~s~ toimesta', + ['you_confiscated_account'] = 'sinä takavarikoit ~g~$%s~s~ (%s) pelaajalta ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) takavarikoitiin sinulta pelaajan ~y~%s~s~ toimesta', + ['you_confiscated_weapon'] = 'sinä takavarikoit ~b~%s~s~ pelaajalta ~b~%s~s~ jossa oli ~o~%s~s~ panosta', + ['got_confiscated_weapon'] = 'sinun ~b~%s~s~ jossa oli ~o~%s~s~ panosta takavarikoitiin sinulta~y~%s~s~', ['traffic_offense'] = 'liikenne rikokset', ['minor_offense'] = 'lievät rikokset', ['average_offense'] = 'keskisuuret rikokset', @@ -110,15 +110,15 @@ Locales['fi'] = { ['amount_of_deposit'] = 'talletuksen määrä', ['open_bossmenu'] = 'paina ~INPUT_CONTEXT~ avataksesi valikon', ['quantity_invalid'] = 'invalid quantity', - ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', - ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', + ['have_withdrawn'] = 'sinä otit varastosta ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'sinä talletit varastoon ~y~%sx~s~ ~b~%s~s~', ['quantity'] = 'määrä', ['inventory'] = 'varasto', - ['police_stock'] = 'Poliisin Varasto', + ['police_stock'] = 'poliisin Varasto', -- Misc - ['remove_prop'] = 'Paina ~INPUT_CONTEXT~ poistaaksesi objektin', - ['map_blip'] = 'Poliisilaitos', - ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', + ['remove_prop'] = 'paina ~INPUT_CONTEXT~ poistaaksesi objektin', + ['map_blip'] = 'poliisilaitos', + ['unrestrained_timer'] = 'tunnet kuinka hitaasti käsiraudat alkavat löystyä ja irtoavat', -- Notifications ['alert_police'] = 'hälyytys Poliisi', ['phone_police'] = 'poliisi', From 6144990abf22dccf34ac5c5b06490958a229dede Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 17 Jul 2018 21:18:56 +0200 Subject: [PATCH 152/253] You can no longer put people in vehicle if they're not handcuffed --- client/main.lua | 42 ++++++++++++++++++++++-------------------- locales/sv.lua | 1 + 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/client/main.lua b/client/main.lua index b2f40ed8..14eff184 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1468,35 +1468,37 @@ end) RegisterNetEvent('esx_policejob:putInVehicle') AddEventHandler('esx_policejob:putInVehicle', function() + local playerPed = PlayerPedId() + local coords = GetEntityCoords(playerPed) - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) + if not IsHandcuffed then + return + end - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then + if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) + local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) - if DoesEntityExist(vehicle) then + if DoesEntityExist(vehicle) then - local maxSeats = GetVehicleMaxNumberOfPassengers(vehicle) - local freeSeat = nil + local maxSeats = GetVehicleMaxNumberOfPassengers(vehicle) + local freeSeat = nil - for i=maxSeats - 1, 0, -1 do - if IsVehicleSeatFree(vehicle, i) then - freeSeat = i - break - end - end + for i=maxSeats - 1, 0, -1 do + if IsVehicleSeatFree(vehicle, i) then + freeSeat = i + break + end + end - if freeSeat ~= nil then - TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) - DragStatus.IsDragged = false - end + if freeSeat ~= nil then + TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) + DragStatus.IsDragged = false + end - end - - end + end + end end) RegisterNetEvent('esx_policejob:OutVehicle') diff --git a/locales/sv.lua b/locales/sv.lua index dc0a6fb4..e348945d 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -35,6 +35,7 @@ Locales['sv'] = { ['put_in_vehicle'] = 'sätt in i fordon', ['out_the_vehicle'] = 'dra ut ur fordon', ['fine'] = 'Ge böter', + ['unpaid_bills'] = 'se obetalda räkningar', ['license_check'] = 'se licenser', ['license_revoke'] = 'återkalla licenser', ['license_revoked'] = 'Ditt ~b~%s~s~ har blivit ~y~återkallat~s~!', From 14507e97b21eb5bc867f54c6d5b29b4a30dd381e Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 17 Jul 2018 21:46:28 +0200 Subject: [PATCH 153/253] Fixed exploit taking more than you can carry, closes #134 --- client/main.lua | 10 ++++++---- server/main.lua | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/client/main.lua b/client/main.lua index 14eff184..ec67b6c7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1146,9 +1146,10 @@ function OpenGetStocksMenu() else menu2.close() menu.close() - OpenGetStocksMenu() - TriggerServerEvent('esx_policejob:getStockItem', itemName, count) + + Citizen.Wait(300) + OpenGetStocksMenu() end end, @@ -1208,9 +1209,10 @@ function OpenPutStocksMenu() else menu2.close() menu.close() - OpenPutStocksMenu() - TriggerServerEvent('esx_policejob:putStockItems', itemName, count) + + Citizen.Wait(300) + OpenPutStocksMenu() end end, diff --git a/server/main.lua b/server/main.lua index 176f1a16..afa96d65 100644 --- a/server/main.lua +++ b/server/main.lua @@ -87,10 +87,10 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count) TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) - local item = inventory.getItem(itemName) + local inventoryItem = inventory.getItem(itemName) -- is there enough in the society? - if count > 0 and item.count >= count then + if count > 0 and inventoryItem.count >= count then -- can the player carry the said amount of x item? if sourceItem.limit ~= -1 and (sourceItem.count + count) > sourceItem.limit then @@ -98,7 +98,7 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count) else inventory.removeItem(itemName, count) xPlayer.addInventoryItem(itemName, count) - TriggerClientEvent('esx:showNotification', _source, _U('have_withdrawn', count, item.label)) + TriggerClientEvent('esx:showNotification', _source, _U('have_withdrawn', count, inventoryItem.label)) end else TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) @@ -109,23 +109,23 @@ end) RegisterServerEvent('esx_policejob:putStockItems') AddEventHandler('esx_policejob:putStockItems', function(itemName, count) + local xPlayer = ESX.GetPlayerFromId(source) + local sourceItem = xPlayer.getInventoryItem(itemName) - local xPlayer = ESX.GetPlayerFromId(source) + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) + local inventoryItem = inventory.getItem(itemName) - local item = inventory.getItem(itemName) + -- does the player have enough of the item? + if sourceItem.count >= count and count > 0 then + xPlayer.removeInventoryItem(itemName, count) + inventory.addItem(itemName, count) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited', count, inventoryItem.label)) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) + end - if item.count >= 0 then - xPlayer.removeInventoryItem(itemName, count) - inventory.addItem(itemName, count) - else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) - end - - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited', count, item.label)) - - end) + end) end) From da7e487ad67b108f5e8e450c46f4aac9b8b8d325 Mon Sep 17 00:00:00 2001 From: MajorMarcin Date: Wed, 18 Jul 2018 16:32:31 +0200 Subject: [PATCH 154/253] Polish translation update --- locales/pl.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locales/pl.lua b/locales/pl.lua index 2a8fb1b4..9ac8a9f6 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -36,7 +36,7 @@ Locales['pl'] = { ['put_in_vehicle'] = 'wsadź do pojazdu', ['out_the_vehicle'] = 'wyciągnij z pojazdu', ['fine'] = 'mandaty', - ['unpaid_bills'] = 'manage unpaid bills', + ['unpaid_bills'] = 'zarządzaj niezapłaconymi rachunkami', ['license_check'] = 'zarządzaj licencjami', ['license_revoke'] = 'uniewaźnij licencje', ['license_revoked'] = 'twoja licencja ~b~%s~s~ została ~y~unieważniona~s~!', @@ -111,8 +111,8 @@ Locales['pl'] = { ['amount_of_deposit'] = 'wartość depozytu', ['open_bossmenu'] = 'naciśnij ~INPUT_CONTEXT~ aby otworzyć menu', ['quantity_invalid'] = 'nieprawidłowa ilość', - ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', - ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', + ['have_withdrawn'] = 'wyjmujesz z depozytu ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'zdeponowałeś ~y~%sx~s~ ~b~%s~s~', ['quantity'] = 'ilość', ['inventory'] = 'ekwipunek', ['police_stock'] = 'zapasy policji', From d31a5976df5de98845c3942cde280ddb83eed213 Mon Sep 17 00:00:00 2001 From: MajorMarcin Date: Wed, 18 Jul 2018 22:19:46 +0200 Subject: [PATCH 155/253] corrected translation --- locales/pl.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/pl.lua b/locales/pl.lua index 9ac8a9f6..9d240afb 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -38,7 +38,7 @@ Locales['pl'] = { ['fine'] = 'mandaty', ['unpaid_bills'] = 'zarządzaj niezapłaconymi rachunkami', ['license_check'] = 'zarządzaj licencjami', - ['license_revoke'] = 'uniewaźnij licencje', + ['license_revoke'] = 'unieważnij licencje', ['license_revoked'] = 'twoja licencja ~b~%s~s~ została ~y~unieważniona~s~!', ['licence_you_revoked'] = 'unieważniłeś ~b~%s~s~ które należały do ~y~%s~s~', ['no_players_nearby'] = 'brak graczy w pobliżu', From d8100fe0d03d3ffd6b536dd8f991385cb93dfee0 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 22 Jul 2018 14:45:11 +0200 Subject: [PATCH 156/253] Greatly improved esx_service (see desc), closes #138 Not being in service means that you can no longer open the F6 menu, or open the armory. You will no longer be able to take out vehicles or receive dispatch calls. Greatly improved support for esx_service and esx_phone when restarting the scripts mentioned above mid-game. All ranks now have proper clothing in, but will still need a redo at some point. Many ranks simply doesn't match USA standard (that's what we'll aim at) Don't forget to update esx_service and esx_phone to support the new things! --- client/main.lua | 532 ++++++++++++++++++++++++++---------------------- config.lua | 56 ++++- locales/en.lua | 27 ++- server/main.lua | 6 + 4 files changed, 360 insertions(+), 261 deletions(-) diff --git a/client/main.lua b/client/main.lua index ec67b6c7..dcdbd6ab 100644 --- a/client/main.lua +++ b/client/main.lua @@ -27,6 +27,7 @@ local hasAlreadyJoined = false local blipsCops = {} local isDead = false local CurrentTask = {} +local playerInService = false ESX = nil @@ -61,134 +62,191 @@ function cleanPlayer(playerPed) end function setUniform(job, playerPed) - TriggerEvent('skinchanger:getSkin', function(skin) - if skin.sex == 0 then - if Config.Uniforms[job].male ~= nil then - TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].male) - else - ESX.ShowNotification(_U('no_outfit')) - end - if job == 'bullet_wear' then - SetPedArmour(playerPed, 100) - end - else - if Config.Uniforms[job].female ~= nil then - TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].female) - else - ESX.ShowNotification(_U('no_outfit')) - end - if job == 'bullet_wear' then - SetPedArmour(playerPed, 100) - end - end + TriggerEvent('skinchanger:getSkin', function(skin) - end) + if skin.sex == 0 then + + if Config.Uniforms[job].male ~= nil then + TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].male) + else + ESX.ShowNotification(_U('no_outfit')) + end + + if job == 'bullet_wear' then + SetPedArmour(playerPed, 100) + end + + else + + if Config.Uniforms[job].female ~= nil then + TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].female) + else + ESX.ShowNotification(_U('no_outfit')) + end + + if job == 'bullet_wear' then + SetPedArmour(playerPed, 100) + end + + end + + end) end function OpenCloakroomMenu() - local playerPed = PlayerPedId() + local playerPed = PlayerPedId() - local elements = { - { label = _U('citizen_wear'), value = 'citizen_wear' }, - { label = _U('bullet_wear'), value = 'bullet_wear' }, - { label = _U('gilet_wear'), value = 'gilet_wear' } - } + local elements = { + { label = _U('citizen_wear'), value = 'citizen_wear' }, + { label = _U('bullet_wear'), value = 'bullet_wear' }, + { label = _U('gilet_wear'), value = 'gilet_wear' } + } - if PlayerData.job.grade_name == 'recruit' then - table.insert(elements, {label = _U('police_wear'), value = 'cadet_wear'}) - end + if PlayerData.job.grade_name == 'recruit' then + table.insert(elements, {label = _U('police_wear'), value = 'recruit_wear'}) + elseif PlayerData.job.grade_name == 'officer' then + table.insert(elements, {label = _U('police_wear'), value = 'officer_wear'}) + elseif PlayerData.job.grade_name == 'sergeant' then + table.insert(elements, {label = _U('police_wear'), value = 'sergeant_wear'}) + elseif PlayerData.job.grade_name == 'intendent' then + table.insert(elements, {label = _U('police_wear'), value = 'intendent_wear'}) + elseif PlayerData.job.grade_name == 'lieutenant' then + table.insert(elements, {label = _U('police_wear'), value = 'lieutenant_wear'}) + elseif PlayerData.job.grade_name == 'chef' then + table.insert(elements, {label = _U('police_wear'), value = 'chef_wear'}) + elseif PlayerData.job.grade_name == 'boss' then + table.insert(elements, {label = _U('police_wear'), value = 'boss_wear'}) + end - if PlayerData.job.grade_name == 'officer' then - table.insert(elements, {label = _U('police_wear'), value = 'police_wear'}) - end + if Config.EnableNonFreemodePeds then + table.insert(elements, {label = _U('sheriff_wear'), value = 'freemode_ped', maleModel = 's_m_y_sheriff_01', femaleModel = 's_f_y_sheriff_01'}) + table.insert(elements, {label = _U('lieutenant_wear'), value = 'freemode_ped', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'}) + table.insert(elements, {label = _U('commandant_wear'), value = 'freemode_ped', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'}) + end - if PlayerData.job.grade_name == 'sergeant' then - table.insert(elements, {label = _U('police_wear'), value = 'sergeant_wear'}) - end + ESX.UI.Menu.CloseAll() - if PlayerData.job.grade_name == 'lieutenant' then - table.insert(elements, {label = _U('police_wear'), value = 'lieutenant_wear'}) - end + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'cloakroom', + { + title = _U('cloakroom'), + align = 'top-left', + elements = elements + }, function(data, menu) - if PlayerData.job.grade_name == 'boss' then - table.insert(elements, {label = _U('police_wear'), value = 'commandant_wear'}) - end + cleanPlayer(playerPed) - if Config.EnableNonFreemodePeds then - table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear_freemode', maleModel = 's_m_y_sheriff_01', femaleModel = 's_f_y_sheriff_01'}) - table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear_freemode', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'}) - table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear_freemode', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'}) - end + if data.current.value == 'citizen_wear' then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:loadSkin', skin) + end) - ESX.UI.Menu.CloseAll() + if Config.MaxInService ~= -1 then - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'cloakroom', - { - title = _U('cloakroom'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.TriggerServerCallback('esx_service:isInService', function(isInService) + if isInService then - cleanPlayer(playerPed) + local notification = { + title = _U('service_anonunce'), + subject = '', + msg = _U('service_out_announce', GetPlayerName(PlayerId())), + iconType = 1 + } - if data.current.value == 'citizen_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) - TriggerEvent('skinchanger:loadSkin', skin) - end) - end + TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') - if - data.current.value == 'cadet_wear' or - data.current.value == 'police_wear' or - data.current.value == 'sergeant_wear' or - data.current.value == 'lieutenant_wear' or - data.current.value == 'commandant_wear' or - data.current.value == 'bullet_wear' or - data.current.value == 'gilet_wear' - then - setUniform(data.current.value, playerPed) - end + TriggerServerEvent('esx_service:disableService', 'police') + ESX.ShowNotification(_U('service_out')) + playerInService = false + end + end, 'police') + end - if - data.current.value == 'sheriff_wear_freemode' or - data.current.value == 'lieutenant_wear_freemode' or - data.current.value == 'commandant_wear_freemode' - then - local model = nil - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) - if skin.sex == 0 then - model = GetHashKey(data.current.maleModel) - else - model = GetHashKey(data.current.femaleModel) - end - end) - - RequestModel(model) - while not HasModelLoaded(model) do - RequestModel(model) - Citizen.Wait(1) - end - - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) - end + menu.close() + end - CurrentAction = 'menu_cloakroom' - CurrentActionMsg = _U('open_cloackroom') - CurrentActionData = {} + if Config.MaxInService ~= -1 and data.current.value ~= 'citizen_wear' then + local serviceOk = 'waiting' - end, - function(data, menu) - menu.close() - CurrentAction = 'menu_cloakroom' - CurrentActionMsg = _U('open_cloackroom') - CurrentActionData = {} - end - ) + ESX.TriggerServerCallback('esx_service:isInService', function(isInService) + if not isInService then + + ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) + if not canTakeService then + ESX.ShowNotification(_U('service_max', inServiceCount, maxInService)) + else + + local notification = { + title = _U('service_anonunce'), + subject = '', + msg = _U('service_in_announce', GetPlayerName(PlayerId())), + iconType = 1 + } + + TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') + ESX.ShowNotification(_U('service_in')) + serviceOk = true + playerInService = true + end + end, 'police') + + else + serviceOk = true + end + end, 'police') + + while type(serviceOk) == 'string' do + Citizen.Wait(5) + end + + -- if we couldn't enter service don't let the player get changed + if not serviceOk then + return + end + end + + if + data.current.value == 'recruit_wear' or + data.current.value == 'officer_wear' or + data.current.value == 'sergeant_wear' or + data.current.value == 'intendent_wear' or + data.current.value == 'lieutenant_wear' or + data.current.value == 'chef_wear' or + data.current.value == 'boss_wear' or + data.current.value == 'bullet_wear' or + data.current.value == 'gilet_wear' + then + setUniform(data.current.value, playerPed) + end + + if data.current.value == 'freemode_ped' then + local model = nil + + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + if skin.sex == 0 then + model = GetHashKey(data.current.maleModel) + else + model = GetHashKey(data.current.femaleModel) + end + end) + + ESX.Streaming.RequestModel(model) + SetPlayerModel(PlayerId(), model) + SetModelAsNoLongerNeeded(model) + end + + CurrentAction = 'menu_cloakroom' + CurrentActionMsg = _U('open_cloackroom') + CurrentActionData = {} + + end, function(data, menu) + menu.close() + + CurrentAction = 'menu_cloakroom' + CurrentActionMsg = _U('open_cloackroom') + CurrentActionData = {} + end) end function OpenArmoryMenu(station) @@ -287,140 +345,110 @@ end function OpenVehicleSpawnerMenu(station, partNum) - local vehicles = Config.PoliceStations[station].Vehicles + local vehicles = Config.PoliceStations[station].Vehicles + 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(garageVehicles) - ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(garageVehicles) + for i=1, #garageVehicles, 1 do + table.insert(elements, {label = GetDisplayNameFromVehicleModel(garageVehicles[i].model) .. ' [' .. garageVehicles[i].plate .. ']', value = garageVehicles[i]}) + end - for i=1, #garageVehicles, 1 do - table.insert(elements, {label = GetDisplayNameFromVehicleModel(garageVehicles[i].model) .. ' [' .. garageVehicles[i].plate .. ']', value = garageVehicles[i]}) - end + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('vehicle_menu'), + align = 'top-left', + elements = elements + }, function(data, menu) + menu.close() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('vehicle_menu'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + local vehicleProps = data.current.value - menu.close() + ESX.Game.SpawnVehicle(vehicleProps.model, vehicles[partNum].SpawnPoint, vehicles[partNum].Heading, function(vehicle) + ESX.Game.SetVehicleProperties(vehicle, vehicleProps) + local playerPed = PlayerPedId() + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + end) - local vehicleProps = data.current.value + TriggerServerEvent('esx_society:removeVehicleFromGarage', 'police', vehicleProps) + end, function(data, menu) + menu.close() - ESX.Game.SpawnVehicle(vehicleProps.model, vehicles[partNum].SpawnPoint, 270.0, function(vehicle) - ESX.Game.SetVehicleProperties(vehicle, vehicleProps) - local playerPed = PlayerPedId() - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) + CurrentAction = 'menu_vehicle_spawner' + CurrentActionMsg = _U('vehicle_spawner') + CurrentActionData = {station = station, partNum = partNum} + end) - TriggerServerEvent('esx_society:removeVehicleFromGarage', 'police', vehicleProps) + end, 'police') - end, - function(data, menu) + else - menu.close() + local elements = {} - CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = _U('vehicle_spawner') - CurrentActionData = {station = station, partNum = partNum} + local sharedVehicles = Config.AuthorizedVehicles.Shared + for i=1, #sharedVehicles, 1 do + table.insert(elements, { label = sharedVehicles[i].label, model = sharedVehicles[i].model}) + end - end - ) + local authorizedVehicles = Config.AuthorizedVehicles[PlayerData.job.grade_name] + for i=1, #authorizedVehicles, 1 do + table.insert(elements, { label = authorizedVehicles[i].label, model = authorizedVehicles[i].model}) + end - end, 'police') + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', + { + title = _U('vehicle_menu'), + align = 'top-left', + elements = elements + }, function(data, menu) + menu.close() - else + local model = data.current.model + local vehicle = GetClosestVehicle(vehicles[partNum].SpawnPoint.x, vehicles[partNum].SpawnPoint.y, vehicles[partNum].SpawnPoint.z, 3.0, 0, 71) - local elements = {} + if not DoesEntityExist(vehicle) then + + local playerPed = PlayerPedId() + + if Config.MaxInService == -1 then + + ESX.Game.SpawnVehicle(model, vehicles[partNum].SpawnPoint, vehicles[partNum].Heading, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + SetVehicleMaxMods(vehicle) + end) + else + + ESX.TriggerServerCallback('esx_service:isInService', function(isInService) + if isInService then + + ESX.Game.SpawnVehicle(model, vehicles[partNum].SpawnPoint, vehicles[partNum].Heading, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + SetVehicleMaxMods(vehicle) + end) + else + ESX.ShowNotification(_U('service_not')) + end + end, 'police') + end + + else + ESX.ShowNotification(_U('vehicle_out')) + end + + end, function(data, menu) + menu.close() + + CurrentAction = 'menu_vehicle_spawner' + CurrentActionMsg = _U('vehicle_spawner') + CurrentActionData = {station = station, partNum = partNum} + + end) - local sharedVehicles = Config.AuthorizedVehicles.Shared - for i=1, #sharedVehicles, 1 do - table.insert(elements, { label = sharedVehicles[i].label, model = sharedVehicles[i].model}) end - - local authorizedVehicles = Config.AuthorizedVehicles[PlayerData.job.grade_name] - for i=1, #authorizedVehicles, 1 do - table.insert(elements, { label = authorizedVehicles[i].label, model = authorizedVehicles[i].model}) - end - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('vehicle_menu'), - align = 'top-left', - elements = elements, - }, - function(data, menu) - - menu.close() - - local model = data.current.model - - local vehicle = GetClosestVehicle(vehicles[partNum].SpawnPoint.x, vehicles[partNum].SpawnPoint.y, vehicles[partNum].SpawnPoint.z, 3.0, 0, 71) - - if not DoesEntityExist(vehicle) then - - local playerPed = PlayerPedId() - - if Config.MaxInService == -1 then - - ESX.Game.SpawnVehicle(model, { - x = vehicles[partNum].SpawnPoint.x, - y = vehicles[partNum].SpawnPoint.y, - z = vehicles[partNum].SpawnPoint.z - }, vehicles[partNum].Heading, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - SetVehicleMaxMods(vehicle) - end) - - else - - ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) - - if canTakeService then - - ESX.Game.SpawnVehicle(model, { - x = vehicles[partNum].SpawnPoint.x, - y = vehicles[partNum].SpawnPoint.y, - z = vehicles[partNum].SpawnPoint.z - }, vehicles[partNum].Heading, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - SetVehicleMaxMods(vehicle) - end) - - else - ESX.ShowNotification(_U('service_max', inServiceCount, maxInService)) - end - - end, 'police') - - end - - else - ESX.ShowNotification(_U('vehicle_out')) - end - - end, - function(data, menu) - - menu.close() - - CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = _U('vehicle_spawner') - CurrentActionData = {station = station, partNum = partNum} - - end - ) - - end - end function OpenPoliceActionsMenu() @@ -1241,17 +1269,27 @@ end) RegisterNetEvent('esx_phone:loaded') AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts) + local specialContact = { + name = _U('phone_police'), + number = 'police', + base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDFGQTJDRkI0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDFGQTJDRkM0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0MUZBMkNGOTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0MUZBMkNGQTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoW66EYAAAjGSURBVHjapJcLcFTVGcd/u3cfSXaTLEk2j80TCI8ECI9ABCyoiBqhBVQqVG2ppVKBQqUVgUl5OU7HKqNOHUHU0oHamZZWoGkVS6cWAR2JPJuAQBPy2ISEvLN57+v2u2E33e4k6Ngz85+9d++95/zP9/h/39GpqsqiRYsIGz8QZAq28/8PRfC+4HT4fMXFxeiH+GC54NeCbYLLATLpYe/ECx4VnBTsF0wWhM6lXY8VbBE0Ch4IzLcpfDFD2P1TgrdC7nMCZLRxQ9AkiAkQCn77DcH3BC2COoFRkCSIG2JzLwqiQi0RSmCD4JXbmNKh0+kc/X19tLtc9Ll9sk9ZS1yoU71YIk3xsbEx8QaDEc2ttxmaJSKC1ggSKBK8MKwTFQVXRzs3WzpJGjmZgvxcMpMtWIwqsjztvSrlzjYul56jp+46qSmJmMwR+P3+4aZ8TtCprRkk0DvUW7JjmV6lsqoKW/pU1q9YQOE4Nxkx4ladE7zd8ivuVmJQfXZKW5dx5EwPRw4fxNx2g5SUVLw+33AkzoRaQDP9SkFu6OKqz0uF8yaz7vsOL6ycQVLkcSg/BlWNsjuFoKE1knqDSl5aNnmPLmThrE0UvXqQqvJPyMrMGorEHwQfEha57/3P7mXS684GFjy8kreLppPUuBXfyd/ibeoS2kb0mWPANhJdYjb61AxUvx5PdT3+4y+Tb3mTd19ZSebE+VTXVGNQlHAC7w4VhH8TbA36vKq6ilnzlvPSunHw6Trc7XpZ14AyfgYeyz18crGN1Alz6e3qwNNQSv4dZox1h/BW9+O7eIaEsVv41Y4XeHJDG83Nl4mLTwzGhJYtx0PzNTjOB9KMTlc7Nkcem39YAGU7cbeBKVLMPGMVf296nMd2VbBq1wmizHoqqm/wrS1/Zf0+N19YN2PIu1fcIda4Vk66Zx/rVi+jo9eIX9wZGGcFXUMR6BHUa76/2ezioYcXMtpyAl91DSaTfDxlJbtLprHm2ecpObqPuTPzSNV9yKz4a4zJSuLo71/j8Q17ON69EmXiPIlNMe6FoyzOqWPW/MU03Lw5EFcyKghTrNDh7+/vw545mcJcWbTiGKpRdGPMXbx90sGmDaux6sXk+kimjU+BjnMkx3kYP34cXrFuZ+3nrHi6iDMt92JITcPjk3R3naRwZhpuNSqoD93DKaFVU7j2dhcF8+YzNlpErbIBTVh8toVccbaysPB+4pMcuPw25kwSsau7BIlmHpy3guaOPtISYyi/UkaJM5Lpc5agq5Xkcl6gIHkmqaMn0dtylcjIyPThCNyhaXyfR2W0I1our0v6qBii07ih5rDtGSOxNVdk1y4R2SR8jR/g7hQD9l1jUeY/WLJB5m39AlZN4GZyIQ1fFJNsEgt0duBIc5GRkcZF53mNwIzhXPDgQPoZIkiMkbTxtstDMVnmFA4cOsbz2/aKjSQjev4Mp9ZAg+hIpFhB3EH5Yal16+X+Kq3dGfxkzRY+KauBjBzREvGN0kNCTARu94AejBLMHorAQ7cEQMGs2cXvkWshYLDi6e9l728O8P1XW6hKeB2yv42q18tjj+iFTGoSi+X9jJM9RTxS9E+OHT0krhNiZqlbqraoT7RAU5bBGrEknEBhgJks7KXbLS8qERI0ErVqF/Y4K6NHZfLZB+/wzJvncacvFd91oXO3o/O40MfZKJOKu/rne+mRQByXM4lYreb1tUnkizVVA/0SpfpbWaCNBeEE5gb/UH19NLqEgDF+oNDQWcn41Cj0EXFEWqzkOIyYekslFkThsvMxpIyE2hIc6lXGZ6cPyK7Nnk5OipixRdxgUESAYmhq68VsGgy5CYKCUAJTg0+izApXne3CJFmUTwg4L3FProFxU+6krqmXu3MskkhSD2av41jLdzlnfFrSdCZxyqfMnppN6ZUa7pwt0h3fiK9DCt4IO9e7YqisvI7VYgmNv7mhBKKD/9psNi5dOMv5ZjukjsLdr0ffWsyTi6eSlfcA+dmiVyOXs+/sHNZu3M6PdxzgVO9GmDSHsSNqmTz/R6y6Xxqma4fwaS5Mn85n1ZE0Vl3CHBER3lUNEhiURpPJRFdTOcVnpUJnPIhR7cZXfoH5UYc5+E4RzRH3sfSnl9m2dSMjE+Tz9msse+o5dr7UwcQ5T3HwlWUkNuzG3dKFSTbsNs7m/Y8vExOlC29UWkMJlAxKoRQMR3IC7x85zOn6fHS50+U/2Untx2R1voinu5no+DQmz7yPXmMKZnsu0wrm0Oe3YhOVHdm8A09dBQYhTv4T7C+xUPrZh8Qn2MMr4qcDSRfoirWgKAvtgOpv1JI8Zi77X15G7L+fxeOUOiUFxZiULD5fSlNzNM62W+k1yq5gjajGX/ZHvOIyxd+Fkj+P092rWP/si0Qr7VisMaEWuCiYonXFwbAUTWWPYLV245NITnGkUXnpI9butLJn2y6iba+hlp7C09qBcvoN7FYL9mhxo1/y/LoEXK8Pv6qIC8WbBY/xr9YlPLf9dZT+OqKTUwfmDBm/GOw7ws4FWpuUP2gJEZvKqmocuXPZuWYJMzKuSsH+SNwh3bo0p6hao6HeEqwYEZ2M6aKWd3PwTCy7du/D0F1DsmzE6/WGLr5LsDF4LggnYBacCOboQLHQ3FFfR58SR+HCR1iQH8ukhA5s5o5AYZMwUqOp74nl8xvRHDlRTsnxYpJsUjtsceHt2C8Fm0MPJrphTkZvBc4It9RKLOFx91Pf0Igu0k7W2MmkOewS2QYJUJVWVz9VNbXUVVwkyuAmKTFJayrDo/4Jwe/CT0aGYTrWVYEeUfsgXssMRcpyenraQJa0VX9O3ZU+Ma1fax4xGxUsUVFkOUbcama1hf+7+LmA9juHWshwmwOE1iMmCFYEzg1jtIm1BaxW6wCGGoFdewPfvyE4ertTiv4rHC73B855dwp2a23bbd4tC1hvhOCbX7b4VyUQKhxrtSOaYKngasizvwi0RmOS4O1QZf2yYfiaR+73AvhTQEVf+rpn9/8IMAChKDrDzfsdIQAAAABJRU5ErkJggg==' + } - local specialContact = { - name = _U('phone_police'), - number = 'police', - base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDFGQTJDRkI0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDFGQTJDRkM0QUJCMTFFN0JBNkQ5OENBMUI4QUEzM0YiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0MUZBMkNGOTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0MUZBMkNGQTRBQkIxMUU3QkE2RDk4Q0ExQjhBQTMzRiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoW66EYAAAjGSURBVHjapJcLcFTVGcd/u3cfSXaTLEk2j80TCI8ECI9ABCyoiBqhBVQqVG2ppVKBQqUVgUl5OU7HKqNOHUHU0oHamZZWoGkVS6cWAR2JPJuAQBPy2ISEvLN57+v2u2E33e4k6Ngz85+9d++95/zP9/h/39GpqsqiRYsIGz8QZAq28/8PRfC+4HT4fMXFxeiH+GC54NeCbYLLATLpYe/ECx4VnBTsF0wWhM6lXY8VbBE0Ch4IzLcpfDFD2P1TgrdC7nMCZLRxQ9AkiAkQCn77DcH3BC2COoFRkCSIG2JzLwqiQi0RSmCD4JXbmNKh0+kc/X19tLtc9Ll9sk9ZS1yoU71YIk3xsbEx8QaDEc2ttxmaJSKC1ggSKBK8MKwTFQVXRzs3WzpJGjmZgvxcMpMtWIwqsjztvSrlzjYul56jp+46qSmJmMwR+P3+4aZ8TtCprRkk0DvUW7JjmV6lsqoKW/pU1q9YQOE4Nxkx4ladE7zd8ivuVmJQfXZKW5dx5EwPRw4fxNx2g5SUVLw+33AkzoRaQDP9SkFu6OKqz0uF8yaz7vsOL6ycQVLkcSg/BlWNsjuFoKE1knqDSl5aNnmPLmThrE0UvXqQqvJPyMrMGorEHwQfEha57/3P7mXS684GFjy8kreLppPUuBXfyd/ibeoS2kb0mWPANhJdYjb61AxUvx5PdT3+4y+Tb3mTd19ZSebE+VTXVGNQlHAC7w4VhH8TbA36vKq6ilnzlvPSunHw6Trc7XpZ14AyfgYeyz18crGN1Alz6e3qwNNQSv4dZox1h/BW9+O7eIaEsVv41Y4XeHJDG83Nl4mLTwzGhJYtx0PzNTjOB9KMTlc7Nkcem39YAGU7cbeBKVLMPGMVf296nMd2VbBq1wmizHoqqm/wrS1/Zf0+N19YN2PIu1fcIda4Vk66Zx/rVi+jo9eIX9wZGGcFXUMR6BHUa76/2ezioYcXMtpyAl91DSaTfDxlJbtLprHm2ecpObqPuTPzSNV9yKz4a4zJSuLo71/j8Q17ON69EmXiPIlNMe6FoyzOqWPW/MU03Lw5EFcyKghTrNDh7+/vw545mcJcWbTiGKpRdGPMXbx90sGmDaux6sXk+kimjU+BjnMkx3kYP34cXrFuZ+3nrHi6iDMt92JITcPjk3R3naRwZhpuNSqoD93DKaFVU7j2dhcF8+YzNlpErbIBTVh8toVccbaysPB+4pMcuPw25kwSsau7BIlmHpy3guaOPtISYyi/UkaJM5Lpc5agq5Xkcl6gIHkmqaMn0dtylcjIyPThCNyhaXyfR2W0I1our0v6qBii07ih5rDtGSOxNVdk1y4R2SR8jR/g7hQD9l1jUeY/WLJB5m39AlZN4GZyIQ1fFJNsEgt0duBIc5GRkcZF53mNwIzhXPDgQPoZIkiMkbTxtstDMVnmFA4cOsbz2/aKjSQjev4Mp9ZAg+hIpFhB3EH5Yal16+X+Kq3dGfxkzRY+KauBjBzREvGN0kNCTARu94AejBLMHorAQ7cEQMGs2cXvkWshYLDi6e9l728O8P1XW6hKeB2yv42q18tjj+iFTGoSi+X9jJM9RTxS9E+OHT0krhNiZqlbqraoT7RAU5bBGrEknEBhgJks7KXbLS8qERI0ErVqF/Y4K6NHZfLZB+/wzJvncacvFd91oXO3o/O40MfZKJOKu/rne+mRQByXM4lYreb1tUnkizVVA/0SpfpbWaCNBeEE5gb/UH19NLqEgDF+oNDQWcn41Cj0EXFEWqzkOIyYekslFkThsvMxpIyE2hIc6lXGZ6cPyK7Nnk5OipixRdxgUESAYmhq68VsGgy5CYKCUAJTg0+izApXne3CJFmUTwg4L3FProFxU+6krqmXu3MskkhSD2av41jLdzlnfFrSdCZxyqfMnppN6ZUa7pwt0h3fiK9DCt4IO9e7YqisvI7VYgmNv7mhBKKD/9psNi5dOMv5ZjukjsLdr0ffWsyTi6eSlfcA+dmiVyOXs+/sHNZu3M6PdxzgVO9GmDSHsSNqmTz/R6y6Xxqma4fwaS5Mn85n1ZE0Vl3CHBER3lUNEhiURpPJRFdTOcVnpUJnPIhR7cZXfoH5UYc5+E4RzRH3sfSnl9m2dSMjE+Tz9msse+o5dr7UwcQ5T3HwlWUkNuzG3dKFSTbsNs7m/Y8vExOlC29UWkMJlAxKoRQMR3IC7x85zOn6fHS50+U/2Untx2R1voinu5no+DQmz7yPXmMKZnsu0wrm0Oe3YhOVHdm8A09dBQYhTv4T7C+xUPrZh8Qn2MMr4qcDSRfoirWgKAvtgOpv1JI8Zi77X15G7L+fxeOUOiUFxZiULD5fSlNzNM62W+k1yq5gjajGX/ZHvOIyxd+Fkj+P092rWP/si0Qr7VisMaEWuCiYonXFwbAUTWWPYLV245NITnGkUXnpI9butLJn2y6iba+hlp7C09qBcvoN7FYL9mhxo1/y/LoEXK8Pv6qIC8WbBY/xr9YlPLf9dZT+OqKTUwfmDBm/GOw7ws4FWpuUP2gJEZvKqmocuXPZuWYJMzKuSsH+SNwh3bo0p6hao6HeEqwYEZ2M6aKWd3PwTCy7du/D0F1DsmzE6/WGLr5LsDF4LggnYBacCOboQLHQ3FFfR58SR+HCR1iQH8ukhA5s5o5AYZMwUqOp74nl8xvRHDlRTsnxYpJsUjtsceHt2C8Fm0MPJrphTkZvBc4It9RKLOFx91Pf0Igu0k7W2MmkOewS2QYJUJVWVz9VNbXUVVwkyuAmKTFJayrDo/4Jwe/CT0aGYTrWVYEeUfsgXssMRcpyenraQJa0VX9O3ZU+Ma1fax4xGxUsUVFkOUbcama1hf+7+LmA9juHWshwmwOE1iMmCFYEzg1jtIm1BaxW6wCGGoFdewPfvyE4ertTiv4rHC73B855dwp2a23bbd4tC1hvhOCbX7b4VyUQKhxrtSOaYKngasizvwi0RmOS4O1QZf2yYfiaR+73AvhTQEVf+rpn9/8IMAChKDrDzfsdIQAAAABJRU5ErkJggg==' - } - - TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) - + TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon) end) +-- don't show dispatches if the player isn't in service +AddEventHandler('esx_phone:cancelMessage', function(dispatchNumber) + + if type(PlayerData.job.name) == 'string' and PlayerData.job.name == 'police' and PlayerData.job.name == dispatchNumber then + -- if esx_service is enabled + if Config.MaxInService ~= -1 and not playerInService then + CancelEvent() + end + end +end) + + AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNum) if part == 'Cloakroom' then @@ -1278,11 +1316,7 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu if not IsAnyVehicleNearPoint(helicopters[partNum].SpawnPoint.x, helicopters[partNum].SpawnPoint.y, helicopters[partNum].SpawnPoint.z, 3.0) then - ESX.Game.SpawnVehicle('polmav', { - x = helicopters[partNum].SpawnPoint.x, - y = helicopters[partNum].SpawnPoint.y, - z = helicopters[partNum].SpawnPoint.z - }, helicopters[partNum].Heading, function(vehicle) + ESX.Game.SpawnVehicle('polmav', helicopters[partNum].SpawnPoint, helicopters[partNum].Heading, function(vehicle) SetVehicleModKit(vehicle, 0) SetVehicleLivery(vehicle, 0) end) @@ -1831,23 +1865,19 @@ Citizen.CreateThread(function() if CurrentAction == 'menu_cloakroom' then OpenCloakroomMenu() elseif CurrentAction == 'menu_armory' then - OpenArmoryMenu(CurrentActionData.station) + if Config.MaxInService == -1 then + OpenArmoryMenu(CurrentActionData.station) + elseif playerInService then + OpenArmoryMenu(CurrentActionData.station) + else + ESX.ShowNotification(_U('service_not')) + end elseif CurrentAction == 'menu_vehicle_spawner' then OpenVehicleSpawnerMenu(CurrentActionData.station, CurrentActionData.partNum) elseif CurrentAction == 'delete_vehicle' then if Config.EnableSocietyOwnedVehicles then local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) TriggerServerEvent('esx_society:putVehicleInGarage', 'police', vehicleProps) - else - if GetEntityModel(vehicle) == GetHashKey('police') or - GetEntityModel(vehicle) == GetHashKey('police2') or - GetEntityModel(vehicle) == GetHashKey('police3') or - GetEntityModel(vehicle) == GetHashKey('police4') or - GetEntityModel(vehicle) == GetHashKey('policeb') or - GetEntityModel(vehicle) == GetHashKey('policet') - then - TriggerServerEvent('esx_service:disableService', 'police') - end end ESX.Game.DeleteVehicle(CurrentActionData.vehicle) elseif CurrentAction == 'menu_boss_actions' then @@ -1867,7 +1897,13 @@ Citizen.CreateThread(function() end -- CurrentAction end if IsControlJustReleased(0, Keys['F6']) and not isDead and PlayerData.job ~= nil and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') then - OpenPoliceActionsMenu() + if Config.MaxInService == -1 then + OpenPoliceActionsMenu() + elseif playerInService then + OpenPoliceActionsMenu() + else + ESX.ShowNotification(_U('service_not')) + end end if IsControlJustReleased(0, Keys['E']) and CurrentTask.Busy then @@ -1943,6 +1979,8 @@ end) AddEventHandler('onResourceStop', function(resource) if resource == GetCurrentResourceName() then TriggerEvent('esx_policejob:unrestrain') + TriggerEvent('esx_phone:removeSpecialContact', 'police') + TriggerServerEvent('esx_service:disableService', 'police') if Config.EnableHandcuffTimer and HandcuffTimer.Active then ESX.ClearTimeout(HandcuffTimer.Task) diff --git a/config.lua b/config.lua index 7ca7c712..515dcc9a 100644 --- a/config.lua +++ b/config.lua @@ -136,7 +136,7 @@ Config.AuthorizedVehicles = { -- CHECK SKINCHANGER CLIENT MAIN.LUA for matching elements Config.Uniforms = { - cadet_wear = { + recruit_wear = { male = { ['tshirt_1'] = 59, ['tshirt_2'] = 1, ['torso_1'] = 55, ['torso_2'] = 0, @@ -160,7 +160,7 @@ Config.Uniforms = { ['ears_1'] = 2, ['ears_2'] = 0 } }, - police_wear = { + officer_wear = { male = { ['tshirt_1'] = 58, ['tshirt_2'] = 0, ['torso_1'] = 55, ['torso_2'] = 0, @@ -208,7 +208,7 @@ Config.Uniforms = { ['ears_1'] = 2, ['ears_2'] = 0 } }, - lieutenant_wear = { + intendent_wear = { male = { ['tshirt_1'] = 58, ['tshirt_2'] = 0, ['torso_1'] = 55, ['torso_2'] = 0, @@ -232,7 +232,55 @@ Config.Uniforms = { ['ears_1'] = 2, ['ears_2'] = 0 } }, - commandant_wear = { + lieutenant_wear = { -- currently the same as intendent_wear + male = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 8, ['decals_2'] = 2, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 7, ['decals_2'] = 2, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + chef_wear = { + male = { + ['tshirt_1'] = 58, ['tshirt_2'] = 0, + ['torso_1'] = 55, ['torso_2'] = 0, + ['decals_1'] = 8, ['decals_2'] = 3, + ['arms'] = 41, + ['pants_1'] = 25, ['pants_2'] = 0, + ['shoes_1'] = 25, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + }, + female = { + ['tshirt_1'] = 35, ['tshirt_2'] = 0, + ['torso_1'] = 48, ['torso_2'] = 0, + ['decals_1'] = 7, ['decals_2'] = 3, + ['arms'] = 44, + ['pants_1'] = 34, ['pants_2'] = 0, + ['shoes_1'] = 27, ['shoes_2'] = 0, + ['helmet_1'] = -1, ['helmet_2'] = 0, + ['chain_1'] = 0, ['chain_2'] = 0, + ['ears_1'] = 2, ['ears_2'] = 0 + } + }, + boss_wear = { -- currently the same as chef_wear male = { ['tshirt_1'] = 58, ['tshirt_2'] = 0, ['torso_1'] = 55, ['torso_2'] = 0, diff --git a/locales/en.lua b/locales/en.lua index ad6d5b40..c376dd94 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -4,16 +4,16 @@ Locales['en'] = { ['citizen_wear'] = 'civilian Outfit', ['police_wear'] = 'police Outfit', ['sheriff_wear'] = 'sheriff Outfit', - ['lieutenant_wear'] = 'Swatt outfit ', + ['lieutenant_wear'] = 'swat outfit', ['gilet_wear'] = 'orange reflective jacket', ['bullet_wear'] = 'bulletproof vest', ['no_outfit'] = 'there\'s no uniform that fits you!', ['open_cloackroom'] = 'press ~INPUT_CONTEXT~ to change ~y~clothes~s~.', -- Armory - ['remove_object'] = 'take object', + ['remove_object'] = 'withdraw object', ['deposit_object'] = 'deposit object', - ['get_weapon'] = 'take weapon', - ['put_weapon'] = 'put weapon', + ['get_weapon'] = 'withdraw weapon', + ['put_weapon'] = 'deposit weapon', ['buy_weapons'] = 'buy weapons', ['armory'] = 'armory', ['open_armory'] = 'press ~INPUT_CONTEXT~ to access the armory', @@ -22,16 +22,23 @@ Locales['en'] = { ['vehicle_out'] = 'there is already a car out of the garage', ['vehicle_spawner'] = 'press ~INPUT_CONTEXT~ to take out a vehicle', ['store_vehicle'] = 'press ~INPUT_CONTEXT~ to store the vehicle', - ['service_max'] = 'max officers in service: %s/%s', + -- Service + ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', + ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', + ['service_anonunce'] = 'service information', + ['service_in'] = 'you\'ve entered service, welcome!', + ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', + ['service_out'] = 'you have left service.', + ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', -- Action Menu ['citizen_interaction'] = 'citizen Interaction', ['vehicle_interaction'] = 'vehicle Interaction', ['object_spawner'] = 'object Spawner', - ['id_card'] = 'iD Card', + ['id_card'] = 'ID Card', ['search'] = 'search', ['handcuff'] = 'cuff / Uncuff', - ['drag'] = 'drag', + ['drag'] = 'escort', ['put_in_vehicle'] = 'put in Vehicle', ['out_the_vehicle'] = 'drag out from vehicle', ['fine'] = 'fine', @@ -98,8 +105,8 @@ Locales['en'] = { ['owner_unknown'] = 'owner: Unknown', ['owner'] = 'owner: %s', -- Weapons Menus - ['get_weapon_menu'] = 'armory - Take Weapon', - ['put_weapon_menu'] = 'armory - Put Weapon', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Deposit Weapon', ['buy_weapon_menu'] = 'armory - Buy Guns', ['not_enough_money'] = 'you do not have enough money', -- Boss Menu @@ -120,6 +127,6 @@ Locales['en'] = { ['map_blip'] = 'police Station', ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', -- Notifications - ['alert_police'] = 'alert police', + ['alert_police'] = 'police alert', ['phone_police'] = 'police', } diff --git a/server/main.lua b/server/main.lua index afa96d65..59dfb92a 100644 --- a/server/main.lua +++ b/server/main.lua @@ -521,6 +521,12 @@ AddEventHandler('onResourceStart', function(resource) end end) +AddEventHandler('onResourceStop', function(resource) + if resource == GetCurrentResourceName() then + TriggerEvent('esx_phone:removeNumber', 'police') + end +end) + RegisterServerEvent('esx_policejob:message') AddEventHandler('esx_policejob:message', function(target, msg) TriggerClientEvent('esx:showNotification', target, msg) From 7ad20daf52f4049875dc6d740620dbc59e2a4e3f Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 22 Jul 2018 15:08:40 +0200 Subject: [PATCH 157/253] Some fixed to blip system closes #77 --- client/main.lua | 26 ++++++++++++++++++-------- config.lua | 2 ++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/client/main.lua b/client/main.lua index dcdbd6ab..f9128e53 100644 --- a/client/main.lua +++ b/client/main.lua @@ -157,6 +157,7 @@ function OpenCloakroomMenu() TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') TriggerServerEvent('esx_service:disableService', 'police') + TriggerEvent('esx_policejob:updateBlip') ESX.ShowNotification(_U('service_out')) playerInService = false end @@ -185,6 +186,7 @@ function OpenCloakroomMenu() } TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') + TriggerEvent('esx_policejob:updateBlip') ESX.ShowNotification(_U('service_in')) serviceOk = true playerInService = true @@ -1918,14 +1920,14 @@ end) -- Create blip for colleagues function createBlip(id) - ped = GetPlayerPed(id) - blip = GetBlipFromEntity(ped) - + local ped = GetPlayerPed(id) + local blip = GetBlipFromEntity(ped) + if not DoesBlipExist(blip) then -- Add blip and create head display on player blip = AddBlipForEntity(ped) SetBlipSprite(blip, 1) ShowHeadingIndicatorOnBlip(blip, true) -- Player Blip indicator - SetBlipRotation(blip, math.ceil(GetEntityHeading(veh))) -- update rotation + SetBlipRotation(blip, math.ceil(GetEntityHeading(ped))) -- update rotation SetBlipNameToPlayerName(blip, id) -- update blip name SetBlipScale(blip, 0.85) -- set scale SetBlipAsShortRange(blip, true) @@ -1944,16 +1946,24 @@ AddEventHandler('esx_policejob:updateBlip', function() -- Clean the blip table blipsCops = {} + + -- Enable blip? + if Config.MaxInService ~= -1 and not playerInService then + return + end + + if not Config.EnableJobBlip the + return + end -- Is the player a cop? In that case show all the blips for other cops if PlayerData.job ~= nil and PlayerData.job.name == 'police' then ESX.TriggerServerCallback('esx_society:getOnlinePlayers', function(players) for i=1, #players, 1 do if players[i].job.name == 'police' then - for id = 0, 32 do - if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= PlayerPedId() and GetPlayerName(id) == players[i].name then - createBlip(id) - end + local id = GetPlayerFromServerId(players[i].source) + if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= PlayerPedId() then + createBlip(id) end end end diff --git a/config.lua b/config.lua index 515dcc9a..f5801de9 100644 --- a/config.lua +++ b/config.lua @@ -15,6 +15,8 @@ Config.EnableLicenses = false -- only turn this on if you are using Config.EnableHandcuffTimer = true -- enable handcuff timer? will unrestrain player after the time ends Config.HandcuffTimer = 10 * 60000 -- 10 mins +Config.EnableJobBlip = true -- enable blips for colleagues + Config.MaxInService = -1 Config.Locale = 'fr' From 5676500f09b9e6226e6a293d6a33cefd5ba18406 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 22 Jul 2018 15:14:46 +0200 Subject: [PATCH 158/253] Added missing locales --- locales/br.lua | 9 ++++++++- locales/de.lua | 9 ++++++++- locales/es.lua | 9 ++++++++- locales/fi.lua | 9 ++++++++- locales/fr.lua | 9 ++++++++- locales/pl.lua | 9 ++++++++- locales/sv.lua | 31 +++++++++++++++++++------------ 7 files changed, 67 insertions(+), 18 deletions(-) diff --git a/locales/br.lua b/locales/br.lua index c746398e..0523c396 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -22,7 +22,14 @@ Locales['br'] = { ['vehicle_out'] = 'Já existe um carro fora da garagem', ['vehicle_spawner'] = 'Pressione ~INPUT_CONTEXT~ para escolher um veículo', ['store_vehicle'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', - ['service_max'] = 'maximo de oficiais em serviço: %s/%s', + -- Service + ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', + ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', + ['service_anonunce'] = 'service information', + ['service_in'] = 'you\'ve entered service, welcome!', + ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', + ['service_out'] = 'you have left service.', + ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', -- Action Menu ['citizen_interaction'] = 'Interagir com o cidadão', ['vehicle_interaction'] = 'Interagir com o veículo', diff --git a/locales/de.lua b/locales/de.lua index a48a8233..de79ebd8 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -22,7 +22,14 @@ Locales['de'] = { ['vehicle_out'] = 'es ist bereits ein Fahrzeug draussen', ['vehicle_spawner'] = 'Drücke ~INPUT_CONTEXT~ um ein Fahrzeug zu holen', ['store_vehicle'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', - ['service_max'] = 'max Polizisten im Dienst: %s/%s', + -- Service + ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', + ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', + ['service_anonunce'] = 'service information', + ['service_in'] = 'you\'ve entered service, welcome!', + ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', + ['service_out'] = 'you have left service.', + ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', -- Action Menu ['citizen_interaction'] = 'Zivilistenaktionen', ['vehicle_interaction'] = 'Fahrzeuginteraktionen', diff --git a/locales/es.lua b/locales/es.lua index 6d3e3df4..d44c2295 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -22,7 +22,14 @@ Locales['es'] = { ['vehicle_out'] = 'Ya tienes un vehículo fuera', ['vehicle_spawner'] = 'Presionar ~INPUT_CONTEXT~ para sacar un vehículo', ['store_vehicle'] = 'Presionar ~INPUT_CONTEXT~ para guardar un vehículo', - ['service_max'] = 'Servicio completado: %s/%s', + -- Service + ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', + ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', + ['service_anonunce'] = 'service information', + ['service_in'] = 'you\'ve entered service, welcome!', + ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', + ['service_out'] = 'you have left service.', + ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', -- Action Menu ['citizen_interaction'] = 'Interacción ciudadana', ['vehicle_interaction'] = 'Interacción vehículo', diff --git a/locales/fi.lua b/locales/fi.lua index 2bd5a078..95fcce8f 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -22,7 +22,14 @@ Locales['fi'] = { ['vehicle_out'] = 'ajoneuvo on jo ulkona tallista', ['vehicle_spawner'] = 'paina ~INPUT_CONTEXT~ ottaaksesi auton ulos', ['store_vehicle'] = 'paina ~INPUT_CONTEXT~ laittaaksesi auto talliin', - ['service_max'] = 'maksimi määrä poliiseja: %s/%s', + -- Service + ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', + ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', + ['service_anonunce'] = 'service information', + ['service_in'] = 'you\'ve entered service, welcome!', + ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', + ['service_out'] = 'you have left service.', + ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', -- Action Menu ['citizen_interaction'] = 'siviilin vuorovaikutus', ['vehicle_interaction'] = 'ajoneuvon vuorovaikutus', diff --git a/locales/fr.lua b/locales/fr.lua index 2ba1d387..9dbb382c 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -22,7 +22,14 @@ Locales['fr'] = { ['vehicle_out'] = 'il y a déja un véhicule de sorti', ['vehicle_spawner'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir un véhicule', ['store_vehicle'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', - ['service_max'] = 'service complet: %s/%s', + -- Service + ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', + ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', + ['service_anonunce'] = 'service information', + ['service_in'] = 'you\'ve entered service, welcome!', + ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', + ['service_out'] = 'you have left service.', + ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', -- Action Menu ['citizen_interaction'] = 'interaction citoyen', ['vehicle_interaction'] = 'interaction véhicule', diff --git a/locales/pl.lua b/locales/pl.lua index 9d240afb..d7d2e2a6 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -23,7 +23,14 @@ Locales['pl'] = { ['vehicle_out'] = 'masz już pojazd poza garażem', ['vehicle_spawner'] = 'naciśnij ~INPUT_CONTEXT~ żeby wziąć pojazd', ['store_vehicle'] = 'naciśnij ~INPUT_CONTEXT~ żeby przechować pojazd', - ['service_max'] = 'maksymalna ilość policjantów na służbie: %s/%s', + -- Service + ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', + ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', + ['service_anonunce'] = 'service information', + ['service_in'] = 'you\'ve entered service, welcome!', + ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', + ['service_out'] = 'you have left service.', + ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', -- Action Menu ['citizen_interaction'] = 'interakcja z cywilami', ['vehicle_interaction'] = 'interakcja z pojazdami', diff --git a/locales/sv.lua b/locales/sv.lua index e348945d..a5c8133c 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -18,14 +18,21 @@ Locales['sv'] = { ['armory'] = 'vapenförråd', ['open_armory'] = 'tryck ~INPUT_CONTEXT~ för att komma åt förrådet', -- Vehicles - ['vehicle_menu'] = 'Bilar', - ['vehicle_out'] = 'Det finns redan en bil ute!', - ['vehicle_spawner'] = 'Tryck ~INPUT_CONTEXT~ för att ta ut en bil', - ['store_vehicle'] = 'Tryck ~INPUT_CONTEXT~ för att parkera bilen', - ['service_max'] = 'max antal poliser i tjänst: %s/%s', + ['vehicle_menu'] = 'bilar', + ['vehicle_out'] = 'det finns redan en bil ute!', + ['vehicle_spawner'] = 'tryck ~INPUT_CONTEXT~ för att ta ut en bil', + ['store_vehicle'] = 'tryck ~INPUT_CONTEXT~ för att parkera bilen', + -- Service + ['service_max'] = 'du kan inte gå tjänst, poliser i tjänst: %s/%s', + ['service_not'] = 'du är inte i tjänst! Byt om för att gå in i tjänst.', + ['service_anonunce'] = 'tjänsteinformation', + ['service_in'] = 'du deltog i tjänst, välkommen!', + ['service_in_announce'] = 'operatör ~y~%s~s~ har deltagit tjänst!', + ['service_out'] = 'du har lämnat tjänst.', + ['service_out_announce'] = 'operatör ~y~%s~s~ har lämnat deras tjänst.', -- Action Menu - ['citizen_interaction'] = 'Handlingar mot civila', - ['vehicle_interaction'] = 'Handlingar på bilar', + ['citizen_interaction'] = 'handlingar mot civila', + ['vehicle_interaction'] = 'handlingar på bilar', ['object_spawner'] = 'ta fram ett objekt', ['id_card'] = 'ID-Kort', @@ -112,14 +119,14 @@ Locales['sv'] = { ['quantity_invalid'] = 'otillgängligt antal', ['have_withdrawn'] = 'du har tagit ut ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'du har lagrat ~y~x%s~s~ ~b~%s~s~', - ['quantity'] = 'Antal', - ['inventory'] = 'Förråd', - ['police_stock'] = 'Polisförråd', + ['quantity'] = 'antal', + ['inventory'] = 'förråd', + ['police_stock'] = 'polisförråd', -- Misc ['remove_prop'] = 'tryck ~INPUT_CONTEXT~ för att ta bort obejektet', - ['map_blip'] = 'Polisstation', + ['map_blip'] = 'polisstation', ['unrestrained_timer'] = 'dina handklovar har försvunnit', -- Notifications - ['alert_police'] = 'Meddela polisen', + ['alert_police'] = 'meddela polisen', ['phone_police'] = 'polisen', } From 662a535244f394c14e836510d9b1f1ba709b6666 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 22 Jul 2018 18:17:21 +0200 Subject: [PATCH 159/253] Fixed typo --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index f9128e53..9ab6a986 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1952,7 +1952,7 @@ AddEventHandler('esx_policejob:updateBlip', function() return end - if not Config.EnableJobBlip the + if not Config.EnableJobBlip then return end From 2d634487a70bc874ba04223570b61bc2e18e2f8f Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 23 Jul 2018 12:06:25 +0200 Subject: [PATCH 160/253] Fixed issue with blips noted in #125 --- client/main.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index 9ab6a986..6298ec26 100644 --- a/client/main.lua +++ b/client/main.lua @@ -147,6 +147,8 @@ function OpenCloakroomMenu() ESX.TriggerServerCallback('esx_service:isInService', function(isInService) if isInService then + playerInService = false + local notification = { title = _U('service_anonunce'), subject = '', @@ -159,7 +161,6 @@ function OpenCloakroomMenu() TriggerServerEvent('esx_service:disableService', 'police') TriggerEvent('esx_policejob:updateBlip') ESX.ShowNotification(_U('service_out')) - playerInService = false end end, 'police') end @@ -178,6 +179,9 @@ function OpenCloakroomMenu() ESX.ShowNotification(_U('service_max', inServiceCount, maxInService)) else + serviceOk = true + playerInService = true + local notification = { title = _U('service_anonunce'), subject = '', @@ -188,8 +192,6 @@ function OpenCloakroomMenu() TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') TriggerEvent('esx_policejob:updateBlip') ESX.ShowNotification(_U('service_in')) - serviceOk = true - playerInService = true end end, 'police') From 9dde2092b40e460c39c2de938ff90d4929220598 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 23 Jul 2018 12:09:06 +0200 Subject: [PATCH 161/253] added requirement info --- config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.lua b/config.lua index f5801de9..f0c4f361 100644 --- a/config.lua +++ b/config.lua @@ -15,7 +15,7 @@ Config.EnableLicenses = false -- only turn this on if you are using Config.EnableHandcuffTimer = true -- enable handcuff timer? will unrestrain player after the time ends Config.HandcuffTimer = 10 * 60000 -- 10 mins -Config.EnableJobBlip = true -- enable blips for colleagues +Config.EnableJobBlip = true -- enable blips for colleagues, requires esx_society Config.MaxInService = -1 Config.Locale = 'fr' From b3a8b6ddb51a1c835534be7781fbadcd18c7ec1c Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 23 Jul 2018 20:31:39 +0200 Subject: [PATCH 162/253] Fixed restarting resource without esx_service enabled --- client/main.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 6298ec26..9e7ebbce 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1992,7 +1992,10 @@ AddEventHandler('onResourceStop', function(resource) if resource == GetCurrentResourceName() then TriggerEvent('esx_policejob:unrestrain') TriggerEvent('esx_phone:removeSpecialContact', 'police') - TriggerServerEvent('esx_service:disableService', 'police') + + if Config.MaxInService ~= -1 then + TriggerServerEvent('esx_service:disableService', 'police') + end if Config.EnableHandcuffTimer and HandcuffTimer.Active then ESX.ClearTimeout(HandcuffTimer.Task) From ed8e3f0505cad401ef2ab0bf0542827c952fcd26 Mon Sep 17 00:00:00 2001 From: MajorMarcin Date: Tue, 24 Jul 2018 12:12:34 +0200 Subject: [PATCH 163/253] fix pl --- locales/pl.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/locales/pl.lua b/locales/pl.lua index d7d2e2a6..4d4fd756 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -24,13 +24,13 @@ Locales['pl'] = { ['vehicle_spawner'] = 'naciśnij ~INPUT_CONTEXT~ żeby wziąć pojazd', ['store_vehicle'] = 'naciśnij ~INPUT_CONTEXT~ żeby przechować pojazd', -- Service - ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', - ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', - ['service_anonunce'] = 'service information', - ['service_in'] = 'you\'ve entered service, welcome!', - ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', - ['service_out'] = 'you have left service.', - ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', + ['service_max'] = 'nie możesz wejść do służby, maksymalna liczba oficerów w służbie: %s/%s', + ['service_not'] = 'nie rozpoczynasz służby! Najpierw musisz się przebrać.', + ['service_anonunce'] = 'informacje o służbie', + ['service_in'] = 'rozpoczynasz służbe, Witaj!', + ['service_in_announce'] = 'operator ~y~%s~s~ rozpoczyna służbę!', + ['service_out'] = 'opuszczasz służbę.', + ['service_out_announce'] = 'operator ~y~%s~s~ opuszcza służbe.', -- Action Menu ['citizen_interaction'] = 'interakcja z cywilami', ['vehicle_interaction'] = 'interakcja z pojazdami', @@ -47,7 +47,7 @@ Locales['pl'] = { ['license_check'] = 'zarządzaj licencjami', ['license_revoke'] = 'unieważnij licencje', ['license_revoked'] = 'twoja licencja ~b~%s~s~ została ~y~unieważniona~s~!', - ['licence_you_revoked'] = 'unieważniłeś ~b~%s~s~ które należały do ~y~%s~s~', + ['licence_you_revoked'] = 'unieważniasz ~b~%s~s~ które należały do ~y~%s~s~', ['no_players_nearby'] = 'brak graczy w pobliżu', -- Vehicle interaction ['vehicle_info'] = 'informacje o pojeździe', @@ -56,9 +56,9 @@ Locales['pl'] = { ['no_vehicles_nearby'] = 'brak pojazdu w pobliżu', ['impound'] = 'zajmij pojazd', ['impound_prompt'] = 'naciśnij ~INPUT_CONTEXT~ żeby unieważnić ~y~zajęcie~s~', - ['impound_canceled'] = 'unieważniłeś/aś zajęcie', + ['impound_canceled'] = 'unieważniasz zajęcie', ['impound_canceled_moved'] = 'zajęcie zostało anulowane, ponieważ pojazd przemieścił się', - ['impound_successful'] = 'zająłeś/aś pojazd', + ['impound_successful'] = 'zajmujesz pojazd', ['search_database'] = 'informacje o pojeździe', ['search_database_title'] = 'informacjeo pojeździe - przeszukaj używając numeru rejestracyjnego', ['search_database_error_invalid'] = 'to ~r~nie~s~ jest ~y~poprawny~s~ rnumer rejestracyjny', @@ -87,7 +87,7 @@ Locales['pl'] = { ['inventory_label'] = '--- Ekwipunek ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'skonfiskuj %s', - ['confiscate_weapon'] = 'skonfiskuj %s z %s bullets', + ['confiscate_weapon'] = 'skonfiskuj %s z %s kulami', ['confiscate_inv'] = 'skonfiskuj %s x %s', ['confiscate_dirty'] = 'skonfiskuj brudne pieniądze: $%s', ['you_confiscated'] = 'skonfiskowałeś ~y~%sx~s~ ~b~%s~s~ od ~b~%s~s~', @@ -119,7 +119,7 @@ Locales['pl'] = { ['open_bossmenu'] = 'naciśnij ~INPUT_CONTEXT~ aby otworzyć menu', ['quantity_invalid'] = 'nieprawidłowa ilość', ['have_withdrawn'] = 'wyjmujesz z depozytu ~y~%sx~s~ ~b~%s~s~', - ['have_deposited'] = 'zdeponowałeś ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'zeponujesz ~y~%sx~s~ ~b~%s~s~', ['quantity'] = 'ilość', ['inventory'] = 'ekwipunek', ['police_stock'] = 'zapasy policji', From d7158bf4e3a814c8902d132945278dfd4410a74d Mon Sep 17 00:00:00 2001 From: MajorMarcin Date: Tue, 24 Jul 2018 12:14:19 +0200 Subject: [PATCH 164/253] fix pl --- locales/pl.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/pl.lua b/locales/pl.lua index 4d4fd756..63cd16a8 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -119,7 +119,7 @@ Locales['pl'] = { ['open_bossmenu'] = 'naciśnij ~INPUT_CONTEXT~ aby otworzyć menu', ['quantity_invalid'] = 'nieprawidłowa ilość', ['have_withdrawn'] = 'wyjmujesz z depozytu ~y~%sx~s~ ~b~%s~s~', - ['have_deposited'] = 'zeponujesz ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'zdeponowano ~y~%sx~s~ ~b~%s~s~', ['quantity'] = 'ilość', ['inventory'] = 'ekwipunek', ['police_stock'] = 'zapasy policji', From 5926584595a935014c6f4e4637e72e85a9dc78bc Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 25 Jul 2018 12:11:04 +0200 Subject: [PATCH 165/253] Closes #130, updated to support new vehicle db system --- client/main.lua | 58 ++++++++++---------- config.lua | 12 ++++- locales/br.lua | 3 +- locales/de.lua | 3 +- locales/en.lua | 3 +- locales/es.lua | 3 +- locales/fi.lua | 1 + locales/fr.lua | 1 + locales/pl.lua | 1 + locales/sv.lua | 1 + server/main.lua | 140 ++++++++++++------------------------------------ 11 files changed, 83 insertions(+), 143 deletions(-) diff --git a/client/main.lua b/client/main.lua index 9e7ebbce..5d7652db 100644 --- a/client/main.lua +++ b/client/main.lua @@ -466,7 +466,7 @@ function OpenPoliceActionsMenu() elements = { {label = _U('citizen_interaction'), value = 'citizen_interaction'}, {label = _U('vehicle_interaction'), value = 'vehicle_interaction'}, - {label = _U('object_spawner'), value = 'object_spawner'}, + {label = _U('object_spawner'), value = 'object_spawner'} } }, function(data, menu) @@ -500,6 +500,7 @@ function OpenPoliceActionsMenu() if action == 'identity_card' then OpenIdentityCardMenu(closestPlayer) elseif action == 'body_search' then + TriggerServerEvent('esx_policejob:message', GetPlayerServerId(closestPlayer), _U('being_searched')) OpenBodySearchMenu(closestPlayer) elseif action == 'handcuff' then TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(closestPlayer)) @@ -524,7 +525,7 @@ function OpenPoliceActionsMenu() menu2.close() end) elseif data.current.value == 'vehicle_interaction' then - local elements = {} + local elements = {} local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) local vehicle = ESX.Game.GetVehicleInDirection() @@ -535,7 +536,7 @@ function OpenPoliceActionsMenu() table.insert(elements, {label = _U('impound'), value = 'impound'}) end - --table.insert(elements, {label = _U('search_database'), value = 'search_database'}) + table.insert(elements, {label = _U('search_database'), value = 'search_database'}) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'vehicle_interaction', @@ -544,9 +545,9 @@ function OpenPoliceActionsMenu() align = 'top-left', elements = elements }, function(data2, menu2) - coords = GetEntityCoords(playerPed) - vehicle = ESX.Game.GetVehicleInDirection() - action = data2.current.value + coords = GetEntityCoords(playerPed) + vehicle = ESX.Game.GetVehicleInDirection() + action = data2.current.value if action == 'search_database' then LookupVehicle() @@ -899,7 +900,7 @@ function LookupVehicle() title = _U('search_database_title'), }, function(data, menu) local length = string.len(data.value) - if data.value == nil or length < 8 or length > 13 then + if data.value == nil or length < 2 or length > 13 then ESX.ShowNotification(_U('search_database_error_invalid')) else ESX.TriggerServerCallback('esx_policejob:getVehicleFromPlate', function(owner, found) @@ -983,32 +984,28 @@ end function OpenVehicleInfosMenu(vehicleData) - ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(infos) + ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(retrivedInfo) - local elements = {} + local elements = {} - table.insert(elements, {label = _U('plate', infos.plate), value = nil}) + table.insert(elements, {label = _U('plate', retrivedInfo.plate), value = nil}) - if infos.owner == nil then - table.insert(elements, {label = _U('owner_unknown'), value = nil}) - else - table.insert(elements, {label = _U('owner', infos.owner), value = nil}) - end + if retrivedInfo.owner == nil then + table.insert(elements, {label = _U('owner_unknown'), value = nil}) + else + table.insert(elements, {label = _U('owner', retrivedInfo.owner), value = nil}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_infos', - { - title = _U('vehicle_info'), - align = 'top-left', - elements = elements, - }, - nil, - function(data, menu) - menu.close() - end - ) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_infos', + { + title = _U('vehicle_info'), + align = 'top-left', + elements = elements + }, nil, function(data, menu) + menu.close() + end) - end, vehicleData.plate) + end, vehicleData.plate) end @@ -1029,7 +1026,7 @@ function OpenGetWeaponMenu() { title = _U('get_weapon_menu'), align = 'top-left', - elements = elements, + elements = elements }, function(data, menu) @@ -1060,7 +1057,6 @@ function OpenPutWeaponMenu() local weaponHash = GetHashKey(weaponList[i].name) if HasPedGotWeapon(playerPed, weaponHash, false) and weaponList[i].name ~= 'WEAPON_UNARMED' then - --local ammo = GetAmmoInPedWeapon(playerPed, weaponHash) table.insert(elements, {label = weaponList[i].label, value = weaponList[i].name}) end @@ -1071,7 +1067,7 @@ function OpenPutWeaponMenu() { title = _U('put_weapon_menu'), align = 'top-left', - elements = elements, + elements = elements }, function(data, menu) diff --git a/config.lua b/config.lua index f0c4f361..c78100c3 100644 --- a/config.lua +++ b/config.lua @@ -31,7 +31,7 @@ Config.PoliceStations = { Scale = 1.2, Colour = 29, }, - -- https://wiki.fivem.net/wiki/Weapons + -- https://wiki.rage.mp/index.php?title=Weapons AuthorizedWeapons = { { name = 'WEAPON_NIGHTSTICK', price = 200 }, { name = 'WEAPON_COMBATPISTOL', price = 300 }, @@ -83,7 +83,7 @@ Config.PoliceStations = { } --- https://wiki.fivem.net/wiki/Vehicles +-- https://wiki.rage.mp/index.php?title=Vehicles Config.AuthorizedVehicles = { Shared = { { @@ -118,6 +118,10 @@ Config.AuthorizedVehicles = { } }, + intendent = { + + }, + lieutenant = { { model = 'riot', @@ -129,6 +133,10 @@ Config.AuthorizedVehicles = { } }, + chef = { + + }, + boss = { } diff --git a/locales/br.lua b/locales/br.lua index 0523c396..fb3ea1a1 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -47,7 +47,8 @@ Locales['br'] = { ['license_revoke'] = 'revoke license', ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', - ['no_players_nearby'] = 'Nenhum jogador nas proximidades', + ['no_players_nearby'] = 'nenhum jogador nas proximidades', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', -- Vehicle interaction ['vehicle_info'] = 'Informações', ['pick_lock'] = 'Trancar veículo', diff --git a/locales/de.lua b/locales/de.lua index de79ebd8..310179f2 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -47,7 +47,8 @@ Locales['de'] = { ['license_revoke'] = 'revoke license', ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', - ['no_players_nearby'] = 'Keine Spieler in der Nähe', + ['no_players_nearby'] = 'keine Spieler in der Nähe', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', -- Vehicle interaction ['vehicle_info'] = 'Fahrzeug Info', ['pick_lock'] = 'Fahrzeug öffnen', diff --git a/locales/en.lua b/locales/en.lua index c376dd94..2c9003f9 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -47,7 +47,8 @@ Locales['en'] = { ['license_revoke'] = 'revoke license', ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', - ['no_players_nearby'] = 'no players nearby', + ['no_players_nearby'] = 'there is no player(s) nearby!', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', -- Vehicle interaction ['vehicle_info'] = 'vehicle Info', ['pick_lock'] = 'lockpick Vehicle', diff --git a/locales/es.lua b/locales/es.lua index d44c2295..5cbbfac9 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -47,7 +47,8 @@ Locales['es'] = { ['license_revoke'] = 'revoke license', ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', - ['no_players_nearby'] = 'No hay jugadores cerca', + ['no_players_nearby'] = 'no hay jugadores cerca', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', -- Vehicle interaction ['vehicle_info'] = 'Información del vehículo', ['pick_lock'] = 'Forzar coche', diff --git a/locales/fi.lua b/locales/fi.lua index 95fcce8f..b5b08d83 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -48,6 +48,7 @@ Locales['fi'] = { ['license_revoked'] = 'sinun ~b~%s~s~ ~y~kumottiin~s~!', ['licence_you_revoked'] = 'sinä kumosit ~b~%s~s~ mikä kuului henkilölle ~y~%s~s~', ['no_players_nearby'] = 'ei pelaajia lähettyvillä', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', -- Vehicle interaction ['vehicle_info'] = 'ajoneuvon tiedot', ['pick_lock'] = 'tiirikoi ovet', diff --git a/locales/fr.lua b/locales/fr.lua index 9dbb382c..7ddf43d2 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -48,6 +48,7 @@ Locales['fr'] = { ['license_revoked'] = 'votre ~b~%s~s~ a été ~y~révoqué~s~!', ['licence_you_revoked'] = 'vous avez révoqué un ~b~%s~s~ qui appartenait à ~y~%s~s~', ['no_players_nearby'] = 'aucun joueur à proximité', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', -- Vehicle interaction ['vehicle_info'] = 'infos véhicule', ['pick_lock'] = 'crocheter véhicule', diff --git a/locales/pl.lua b/locales/pl.lua index d7d2e2a6..0b98fc61 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -49,6 +49,7 @@ Locales['pl'] = { ['license_revoked'] = 'twoja licencja ~b~%s~s~ została ~y~unieważniona~s~!', ['licence_you_revoked'] = 'unieważniłeś ~b~%s~s~ które należały do ~y~%s~s~', ['no_players_nearby'] = 'brak graczy w pobliżu', + ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', -- Vehicle interaction ['vehicle_info'] = 'informacje o pojeździe', ['pick_lock'] = 'odblokuj pojazd', diff --git a/locales/sv.lua b/locales/sv.lua index a5c8133c..0b13d8a3 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -48,6 +48,7 @@ Locales['sv'] = { ['license_revoked'] = 'Ditt ~b~%s~s~ har blivit ~y~återkallat~s~!', ['licence_you_revoked'] = 'du återkallade ett ~b~%s~s~ som tillhörde ~y~%s~s~', ['no_players_nearby'] = 'det finns ingen i närheten', + ['being_searched'] = 'du blir ~y~visiterad~s~ av ~b~Polisen~s~', -- Vehicle interaction ['vehicle_info'] = 'fordon', ['pick_lock'] = 'bryt upp fordon', diff --git a/server/main.lua b/server/main.lua index 59dfb92a..080333da 100644 --- a/server/main.lua +++ b/server/main.lua @@ -226,114 +226,32 @@ end) ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, plate) - if Config.EnableESXIdentity then + MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE @plate = plate', { + ['@plate'] = plate + }, function(result) - MySQL.Async.fetchAll( - 'SELECT * FROM owned_vehicles', - {}, - function(result) + local retrivedInfo = { + plate = plate + } - local foundIdentifier = nil + if result[1] then - for i=1, #result, 1 do + MySQL.Async.fetchAll('SELECT * FROM users WHERE identifier = @identifier', { + ['@identifier'] = result[1].owner + }, function(result2) - local vehicleData = json.decode(result[i].vehicle) - - if vehicleData.plate == plate then - foundIdentifier = result[i].owner - break - end - - end - - if foundIdentifier ~= nil then - - MySQL.Async.fetchAll( - 'SELECT * FROM users WHERE identifier = @identifier', - { - ['@identifier'] = foundIdentifier - }, - function(result) - - local ownerName = result[1].firstname .. " " .. result[1].lastname - - local infos = { - plate = plate, - owner = ownerName - } - - cb(infos) - - end - ) - - else - - local infos = { - plate = plate - } - - cb(infos) - - end - - end - ) - - else - - MySQL.Async.fetchAll( - 'SELECT * FROM owned_vehicles', - {}, - function(result) - - local foundIdentifier = nil - - for i=1, #result, 1 do - - local vehicleData = json.decode(result[i].vehicle) - - if vehicleData.plate == plate then - foundIdentifier = result[i].owner - break - end - - end - - if foundIdentifier ~= nil then - - MySQL.Async.fetchAll( - 'SELECT * FROM users WHERE identifier = @identifier', - { - ['@identifier'] = foundIdentifier - }, - function(result) - - local infos = { - plate = plate, - owner = result[1].name - } - - cb(infos) - - end - ) - - else - - local infos = { - plate = plate - } - - cb(infos) - - end - - end - ) - - end + if Config.EnableESXIdentity then + retrivedInfo.owner = result2[1].firstname .. ' ' .. result2[1].lastname + else + retrivedInfo.owner = result2[1].name + end + cb(retrivedInfo) + end) + else + cb(retrivedInfo) + end + end) end) ESX.RegisterServerCallback('esx_policejob:getVehicleFromPlate', function(source, cb, plate) @@ -344,10 +262,20 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleFromPlate', function(source, }, function(result) if result[1] ~= nil then - local playerName = ESX.GetPlayerFromIdentifier(result[1].owner).name - cb(playerName, true) + + MySQL.Async.fetchAll('SELECT * FROM users WHERE identifier = @identifier', { + ['@identifier'] = result[1].owner + }, function(result2) + + if Config.EnableESXIdentity then + cb(result2[1].firstname .. ' ' .. result2[1].lastname, true) + else + cb(result2[1].name, true) + end + + end) else - cb('unknown', false) + cb(_U('unknown'), false) end end ) From 42c0b81ceccc554ba47d3fb33e0a14b1c52f9df5 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 28 Jul 2018 15:42:04 +0200 Subject: [PATCH 166/253] Minor improvmenets to freemode peds, #154 --- client/main.lua | 62 +++++++++++++++++++++++++++++-------------------- config.lua | 6 ++--- locales/br.lua | 2 -- locales/de.lua | 2 -- locales/en.lua | 2 -- locales/es.lua | 2 -- locales/fi.lua | 2 -- locales/fr.lua | 2 -- locales/pl.lua | 3 --- locales/sv.lua | 2 -- 10 files changed, 40 insertions(+), 45 deletions(-) diff --git a/client/main.lua b/client/main.lua index 5d7652db..0e2f99c5 100644 --- a/client/main.lua +++ b/client/main.lua @@ -97,6 +97,7 @@ end function OpenCloakroomMenu() local playerPed = PlayerPedId() + local grade = PlayerData.job.grade_name local elements = { { label = _U('citizen_wear'), value = 'citizen_wear' }, @@ -104,26 +105,26 @@ function OpenCloakroomMenu() { label = _U('gilet_wear'), value = 'gilet_wear' } } - if PlayerData.job.grade_name == 'recruit' then + if grade == 'recruit' then table.insert(elements, {label = _U('police_wear'), value = 'recruit_wear'}) - elseif PlayerData.job.grade_name == 'officer' then + elseif grade == 'officer' then table.insert(elements, {label = _U('police_wear'), value = 'officer_wear'}) - elseif PlayerData.job.grade_name == 'sergeant' then + elseif grade == 'sergeant' then table.insert(elements, {label = _U('police_wear'), value = 'sergeant_wear'}) - elseif PlayerData.job.grade_name == 'intendent' then + elseif grade == 'intendent' then table.insert(elements, {label = _U('police_wear'), value = 'intendent_wear'}) - elseif PlayerData.job.grade_name == 'lieutenant' then + elseif grade == 'lieutenant' then table.insert(elements, {label = _U('police_wear'), value = 'lieutenant_wear'}) - elseif PlayerData.job.grade_name == 'chef' then + elseif grade == 'chef' then table.insert(elements, {label = _U('police_wear'), value = 'chef_wear'}) - elseif PlayerData.job.grade_name == 'boss' then + elseif grade == 'boss' then table.insert(elements, {label = _U('police_wear'), value = 'boss_wear'}) end - if Config.EnableNonFreemodePeds then - table.insert(elements, {label = _U('sheriff_wear'), value = 'freemode_ped', maleModel = 's_m_y_sheriff_01', femaleModel = 's_f_y_sheriff_01'}) - table.insert(elements, {label = _U('lieutenant_wear'), value = 'freemode_ped', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'}) - table.insert(elements, {label = _U('commandant_wear'), value = 'freemode_ped', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'}) + if Config.EnableFreemodePeds then + table.insert(elements, {label = 'Sheriff wear', value = 'freemode_ped', maleModel = 's_m_y_sheriff_01', femaleModel = 's_f_y_sheriff_01'}) + table.insert(elements, {label = 'Police wear', value = 'freemode_ped', maleModel = 's_m_y_cop_01', femaleModel = 's_f_y_cop_01'}) + table.insert(elements, {label = 'Swat wear', value = 'freemode_ped', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'}) end ESX.UI.Menu.CloseAll() @@ -138,9 +139,21 @@ function OpenCloakroomMenu() cleanPlayer(playerPed) if data.current.value == 'citizen_wear' then - ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) - TriggerEvent('skinchanger:loadSkin', skin) - end) + + if Config.EnableFreemodePeds then + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) + local isMale = skin.sex == 0 + + TriggerEvent('skinchanger:loadDefaultModel', isMale, function() + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:loadSkin', skin) + end) + end) + + end) + end + + if Config.MaxInService ~= -1 then @@ -165,7 +178,6 @@ function OpenCloakroomMenu() end, 'police') end - menu.close() end if Config.MaxInService ~= -1 and data.current.value ~= 'citizen_wear' then @@ -225,24 +237,24 @@ function OpenCloakroomMenu() end if data.current.value == 'freemode_ped' then - local model = nil + local modelHash = '' ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) if skin.sex == 0 then - model = GetHashKey(data.current.maleModel) + modelHash = GetHashKey(data.current.maleModel) else - model = GetHashKey(data.current.femaleModel) + modelHash = GetHashKey(data.current.femaleModel) end + + ESX.Streaming.RequestModel(modelHash, function() + SetPlayerModel(PlayerId(), modelHash) + SetModelAsNoLongerNeeded(modelHash) + end) end) - - ESX.Streaming.RequestModel(model) - SetPlayerModel(PlayerId(), model) - SetModelAsNoLongerNeeded(model) + end - CurrentAction = 'menu_cloakroom' - CurrentActionMsg = _U('open_cloackroom') - CurrentActionData = {} + end, function(data, menu) menu.close() diff --git a/config.lua b/config.lua index c78100c3..999840b5 100644 --- a/config.lua +++ b/config.lua @@ -7,10 +7,10 @@ Config.MarkerColor = { r = 50, g = 50, b = 204 } Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false -Config.EnableESXIdentity = false -- only turn this on if you are using esx_identity -Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds +Config.EnableESXIdentity = false -- enable if you're using esx_identity +Config.EnableFreemodePeds = true -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false -Config.EnableLicenses = false -- only turn this on if you are using esx_license +Config.EnableLicenses = false -- enable if you're using esx_license Config.EnableHandcuffTimer = true -- enable handcuff timer? will unrestrain player after the time ends Config.HandcuffTimer = 10 * 60000 -- 10 mins diff --git a/locales/br.lua b/locales/br.lua index fb3ea1a1..fe29aeb0 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -3,8 +3,6 @@ Locales['br'] = { ['cloakroom'] = 'Vestiário', ['citizen_wear'] = 'Roupa casual', ['police_wear'] = 'Uniforme da Polícia', - ['sheriff_wear'] = 'sheriff Outfit', - ['lieutenant_wear'] = 'Swatt outfit', ['gilet_wear'] = 'orange reflective jacket', ['bullet_wear'] = 'bulletproof vest', ['no_outfit'] = 'there\'s no uniform that fits you!', diff --git a/locales/de.lua b/locales/de.lua index 310179f2..7aac4c49 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -3,8 +3,6 @@ Locales['de'] = { ['cloakroom'] = 'Garderobe', ['citizen_wear'] = 'Zivilkleidung', ['police_wear'] = 'Arbeitskleidung', - ['sheriff_wear'] = 'sheriff Outfit', - ['lieutenant_wear'] = 'Swatt outfit ', ['gilet_wear'] = 'orange reflective jacket', ['bullet_wear'] = 'bulletproof vest', ['no_outfit'] = 'there\'s no uniform that fits you!', diff --git a/locales/en.lua b/locales/en.lua index 2c9003f9..33011c7f 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -3,8 +3,6 @@ Locales['en'] = { ['cloakroom'] = 'locker room', ['citizen_wear'] = 'civilian Outfit', ['police_wear'] = 'police Outfit', - ['sheriff_wear'] = 'sheriff Outfit', - ['lieutenant_wear'] = 'swat outfit', ['gilet_wear'] = 'orange reflective jacket', ['bullet_wear'] = 'bulletproof vest', ['no_outfit'] = 'there\'s no uniform that fits you!', diff --git a/locales/es.lua b/locales/es.lua index 5cbbfac9..fefabc68 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -3,8 +3,6 @@ Locales['es'] = { ['cloakroom'] = 'Taquilla', ['citizen_wear'] = 'Ropa civil', ['police_wear'] = 'Ropa CNP', - ['sheriff_wear'] = 'Ropa Oficial', - ['lieutenant_wear'] = 'Ropa Teniente', ['gilet_wear'] = 'orange reflective jacket', ['bullet_wear'] = 'bulletproof vest', ['no_outfit'] = 'there\'s no uniform that fits you!', diff --git a/locales/fi.lua b/locales/fi.lua index b5b08d83..46d30bb1 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -3,8 +3,6 @@ Locales['fi'] = { ['cloakroom'] = 'vaatelokero', ['citizen_wear'] = 'siviiliasu', ['police_wear'] = 'poliisiasu', - ['sheriff_wear'] = 'sheriffiasu', - ['lieutenant_wear'] = 'swattiasu', ['gilet_wear'] = 'huomioliivi', ['bullet_wear'] = 'luotiliivi', ['no_outfit'] = 'täällä ei ole sinulle sopivaa asua', diff --git a/locales/fr.lua b/locales/fr.lua index 7ddf43d2..d0aca5d9 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -3,8 +3,6 @@ Locales['fr'] = { ['cloakroom'] = 'vestiaire', ['citizen_wear'] = 'tenue Civil', ['police_wear'] = 'tenue Policier', - ['sheriff_wear'] = 'tenue sheriff', - ['lieutenant_wear'] = 'tenue Swatt', ['gilet_wear'] = 'gilet orange', ['bullet_wear'] = 'gilet pare-balles', ['no_outfit'] = 'il n\'y a pas d\'uniforme à votre taille...', diff --git a/locales/pl.lua b/locales/pl.lua index 0b98fc61..90f06ee5 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -3,9 +3,6 @@ Locales['pl'] = { ['cloakroom'] = 'szatnia', ['citizen_wear'] = 'ubranie Cywilne', ['police_wear'] = 'mundur', - ['sheriff_wear'] = 'mundur Szeryfa', - ['lieutenant_wear'] = 'mundur Porucznika', - ['commandant_wear'] = 'mundur Komendanta', ['gilet_wear'] = 'kamizelka odblaskowa', ['bullet_wear'] = 'kamizelka kuloodporna', ['no_outfit'] = 'brak ubrania', diff --git a/locales/sv.lua b/locales/sv.lua index 0b13d8a3..a4d69734 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -3,8 +3,6 @@ Locales['sv'] = { ['cloakroom'] = 'omklädningsrum', ['citizen_wear'] = 'civila kläder', ['police_wear'] = 'polisuniform', - ['sheriff_wear'] = 'inspektöruniform', - ['lieutenant_wear'] = 'insatsstyrka', ['gilet_wear'] = 'reflektiv väst', ['bullet_wear'] = 'skottsäker väst', ['no_outfit'] = 'det finns ingen uniform som passar dig!', From 09974157752f3087b4231021660ac57c4099e8fb Mon Sep 17 00:00:00 2001 From: Viktor <35453587+LifeGoal@users.noreply.github.com> Date: Tue, 7 Aug 2018 22:35:56 +0200 Subject: [PATCH 167/253] Added police barrier --- client/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index 0e2f99c5..a1dd6871 100644 --- a/client/main.lua +++ b/client/main.lua @@ -631,7 +631,7 @@ function OpenPoliceActionsMenu() align = 'top-left', elements = { {label = _U('cone'), value = 'prop_roadcone02a'}, - {label = _U('barrier'), value = 'prop_barrier_work06a'}, + {label = _U('barrier'), value = 'prop_barrier_work05'}, {label = _U('spikestrips'), value = 'p_ld_stinger_s'}, {label = _U('box'), value = 'prop_boxpile_07d'}, {label = _U('cash'), value = 'hei_prop_cash_crate_half_full'} @@ -1808,7 +1808,7 @@ Citizen.CreateThread(function() local trackedEntities = { 'prop_roadcone02a', - 'prop_barrier_work06a', + 'prop_barrier_work05', 'p_ld_stinger_s', 'prop_boxpile_07d', 'hei_prop_cash_crate_half_full' @@ -2034,4 +2034,4 @@ function ImpoundVehicle(vehicle) ESX.Game.DeleteVehicle(vehicle) ESX.ShowNotification(_U('impound_successful')) CurrentTask.Busy = false -end \ No newline at end of file +end From 9cc82ebc1d6c9a92b62dfcc21c140e84a2ba32dc Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Fri, 10 Aug 2018 00:55:06 -0400 Subject: [PATCH 168/253] Repo Update --- .editorconfig | 2 +- LICENSE.txt => LICENSE | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename LICENSE.txt => LICENSE (100%) diff --git a/.editorconfig b/.editorconfig index 6866fb40..9b425256 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,7 +3,7 @@ root = true [*] indent_size = 4 indent_style = tab -end_of_line = lf +end_of_line = crlf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE similarity index 100% rename from LICENSE.txt rename to LICENSE From ae8cdf1371b8cbf8c2c9ea6acb74aa0a4674f83b Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 10 Aug 2018 21:49:21 +0200 Subject: [PATCH 169/253] Fixed citizen clothing, closes #166, closes #164 --- client/main.lua | 10 ++++++---- config.lua | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/main.lua b/client/main.lua index 0e2f99c5..732d9d8c 100644 --- a/client/main.lua +++ b/client/main.lua @@ -121,7 +121,7 @@ function OpenCloakroomMenu() table.insert(elements, {label = _U('police_wear'), value = 'boss_wear'}) end - if Config.EnableFreemodePeds then + if Config.EnableNonFreemodePeds then table.insert(elements, {label = 'Sheriff wear', value = 'freemode_ped', maleModel = 's_m_y_sheriff_01', femaleModel = 's_f_y_sheriff_01'}) table.insert(elements, {label = 'Police wear', value = 'freemode_ped', maleModel = 's_m_y_cop_01', femaleModel = 's_f_y_cop_01'}) table.insert(elements, {label = 'Swat wear', value = 'freemode_ped', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'}) @@ -140,7 +140,7 @@ function OpenCloakroomMenu() if data.current.value == 'citizen_wear' then - if Config.EnableFreemodePeds then + if Config.EnableNonFreemodePeds then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) local isMale = skin.sex == 0 @@ -151,10 +151,12 @@ function OpenCloakroomMenu() end) end) + else + ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) + TriggerEvent('skinchanger:loadSkin', skin) + end) end - - if Config.MaxInService ~= -1 then ESX.TriggerServerCallback('esx_service:isInService', function(isInService) diff --git a/config.lua b/config.lua index 999840b5..d15a3d32 100644 --- a/config.lua +++ b/config.lua @@ -8,7 +8,7 @@ Config.MarkerColor = { r = 50, g = 50, b = 204 } Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false Config.EnableESXIdentity = false -- enable if you're using esx_identity -Config.EnableFreemodePeds = true -- turn this on if you want custom peds +Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false Config.EnableLicenses = false -- enable if you're using esx_license From 2438844f4a53e475bd25ee3f064e5dd7a75b6a46 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 11 Aug 2018 23:54:55 +0200 Subject: [PATCH 170/253] Corrected Swedish currency --- locales/sv.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locales/sv.lua b/locales/sv.lua index a4d69734..d553918c 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -87,11 +87,11 @@ Locales['sv'] = { ['confiscate'] = 'beslagta %s', ['confiscate_weapon'] = 'beslagta %s med %s skott', ['confiscate_inv'] = 'beslagta %sx %s', - ['confiscate_dirty'] = 'beslagta svarta pengar: $%s', + ['confiscate_dirty'] = 'beslagta svarta pengar: %s SEK', ['you_confiscated'] = 'du beslagtog ~y~%sx~s~ ~b~%s~s~ från ~b~%s~s~', ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ beslagtogs av ~y~%s~s~', - ['you_confiscated_account'] = 'du beslagtog ~g~$%s~s~ (%s) från ~b~%s~s~', - ['got_confiscated_account'] = '~g~$%s~s~ (%s) beslagtogs av ~y~%s~s~', + ['you_confiscated_account'] = 'du beslagtog ~g~%s SEK~s~ (%s) från ~b~%s~s~', + ['got_confiscated_account'] = '~g~%s SEK~s~ (%s) beslagtogs av ~y~%s~s~', ['you_confiscated_weapon'] = 'du beslagtog ~b~%s~s~ från ~b~%s~s~ med ~o~%s~s~ skott', ['got_confiscated_weapon'] = 'din ~b~%s~s~ med ~o~%s~s~ skott beslagtogs av ~y~%s~s~', ['traffic_offense'] = 'brott mot trafikregler', From ae13da8170eea830d0d53f9e332f1cbeb07862cf Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 23 Aug 2018 20:00:33 +0200 Subject: [PATCH 171/253] Added mission row garage at the back, improved PlayerData fetching --- client/main.lua | 5 ++++- config.lua | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index c82cec2d..d92b097c 100644 --- a/client/main.lua +++ b/client/main.lua @@ -37,7 +37,10 @@ Citizen.CreateThread(function() Citizen.Wait(0) end - Citizen.Wait(5000) + while ESX.GetPlayerData().job == nil do + Citizen.Wait(10) + end + PlayerData = ESX.GetPlayerData() end) diff --git a/config.lua b/config.lua index d15a3d32..65bd9f69 100644 --- a/config.lua +++ b/config.lua @@ -31,6 +31,7 @@ Config.PoliceStations = { Scale = 1.2, Colour = 29, }, + -- https://wiki.rage.mp/index.php?title=Weapons AuthorizedWeapons = { { name = 'WEAPON_NIGHTSTICK', price = 200 }, @@ -58,7 +59,13 @@ Config.PoliceStations = { { Spawner = { x = 454.69, y = -1017.4, z = 27.430 }, SpawnPoint = { x = 438.42, y = -1018.3, z = 27.757 }, - Heading = 90.0, + Heading = 90.0 + }, + + { + Spawner = { x = 473.38, y = -1018.43, z = 27.00 }, + SpawnPoint = { x = 475.98, y = -1021.65, z = 28.06 }, + Heading = 276.11 } }, @@ -66,13 +73,14 @@ Config.PoliceStations = { { Spawner = { x = 466.477, y = -982.819, z = 42.691 }, SpawnPoint = { x = 450.04, y = -981.14, z = 42.691 }, - Heading = 0.0, + Heading = 0.0 } }, VehicleDeleters = { { x = 462.74, y = -1014.4, z = 27.065 }, { x = 462.40, y = -1019.7, z = 27.104 }, + { x = 469.12, y = -1024.52, z = 27.20 } }, BossActions = { From 40b6998dd3e2c634b158dc5860e760b1c4de98af Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 25 Aug 2018 14:09:32 +0200 Subject: [PATCH 172/253] Check for if player is cop when handcuffing and dragging out from vehicle Tab indent aswell --- server/main.lua | 350 +++++++++++++++++++++++------------------------- 1 file changed, 167 insertions(+), 183 deletions(-) diff --git a/server/main.lua b/server/main.lua index 080333da..dd5d9cfb 100644 --- a/server/main.lua +++ b/server/main.lua @@ -3,7 +3,7 @@ ESX = nil TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) if Config.MaxInService ~= -1 then - TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) + TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) end TriggerEvent('esx_phone:registerNumber', 'police', _U('alert_police'), true, true) @@ -11,8 +11,8 @@ TriggerEvent('esx_society:registerSociety', 'police', 'Police', 'society_police' RegisterServerEvent('esx_policejob:giveWeapon') AddEventHandler('esx_policejob:giveWeapon', function(weapon, ammo) - local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.addWeapon(weapon, ammo) + local xPlayer = ESX.GetPlayerFromId(source) + xPlayer.addWeapon(weapon, ammo) end) RegisterServerEvent('esx_policejob:confiscatePlayerItem') @@ -60,23 +60,34 @@ end) RegisterServerEvent('esx_policejob:handcuff') AddEventHandler('esx_policejob:handcuff', function(target) - TriggerClientEvent('esx_policejob:handcuff', target) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'police' then + TriggerClientEvent('esx_policejob:handcuff', target) + else + print(('esx_policejob: %s attempted to handcuff a player (not cop)!'):format(xPlayer.identifier)) + end end) RegisterServerEvent('esx_policejob:drag') AddEventHandler('esx_policejob:drag', function(target) - local _source = source - TriggerClientEvent('esx_policejob:drag', target, _source) + TriggerClientEvent('esx_policejob:drag', target, source) end) RegisterServerEvent('esx_policejob:putInVehicle') AddEventHandler('esx_policejob:putInVehicle', function(target) - TriggerClientEvent('esx_policejob:putInVehicle', target) + TriggerClientEvent('esx_policejob:putInVehicle', target) end) RegisterServerEvent('esx_policejob:OutVehicle') AddEventHandler('esx_policejob:OutVehicle', function(target) - TriggerClientEvent('esx_policejob:OutVehicle', target) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'police' then + TriggerClientEvent('esx_policejob:OutVehicle', target) + else + print(('esx_policejob: %s attempted to drag out from vehicle (not cop)!'):format(xPlayer.identifier)) + end end) RegisterServerEvent('esx_policejob:getStockItem') @@ -131,97 +142,84 @@ end) ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, cb, target) - if Config.EnableESXIdentity then + if Config.EnableESXIdentity then - local xPlayer = ESX.GetPlayerFromId(target) + local xPlayer = ESX.GetPlayerFromId(target) - local identifier = GetPlayerIdentifiers(target)[1] + local identifier = GetPlayerIdentifiers(target)[1] - local result = MySQL.Sync.fetchAll("SELECT * FROM users WHERE identifier = @identifier", { - ['@identifier'] = identifier - }) + local result = MySQL.Sync.fetchAll("SELECT * FROM users WHERE identifier = @identifier", { + ['@identifier'] = identifier + }) - local user = result[1] - local firstname = user['firstname'] - local lastname = user['lastname'] - local sex = user['sex'] - local dob = user['dateofbirth'] - local height = user['height'] .. " Inches" + local firstname = result[1].firstname + local lastname = result[1].lastname + local sex = result[1].sex + local dob = result[1].dateofbirth + local height = result[1].height - local data = { - name = GetPlayerName(target), - job = xPlayer.job, - inventory = xPlayer.inventory, - accounts = xPlayer.accounts, - weapons = xPlayer.loadout, - firstname = firstname, - lastname = lastname, - sex = sex, - dob = dob, - height = height - } + local data = { + name = GetPlayerName(target), + job = xPlayer.job, + inventory = xPlayer.inventory, + accounts = xPlayer.accounts, + weapons = xPlayer.loadout, + firstname = firstname, + lastname = lastname, + sex = sex, + dob = dob, + height = height + } - TriggerEvent('esx_status:getStatus', target, 'drunk', function(status) + TriggerEvent('esx_status:getStatus', target, 'drunk', function(status) + if status ~= nil then + data.drunk = math.floor(status.percent) + end + end) - if status ~= nil then - data.drunk = math.floor(status.percent) - end + if Config.EnableLicenses then + TriggerEvent('esx_license:getLicenses', target, function(licenses) + data.licenses = licenses + cb(data) + end) + else + cb(data) + end - end) + else - if Config.EnableLicenses then + local xPlayer = ESX.GetPlayerFromId(target) - TriggerEvent('esx_license:getLicenses', target, function(licenses) - data.licenses = licenses - cb(data) - end) + local data = { + name = GetPlayerName(target), + job = xPlayer.job, + inventory = xPlayer.inventory, + accounts = xPlayer.accounts, + weapons = xPlayer.loadout + } - else - cb(data) - end + TriggerEvent('esx_status:getStatus', target, 'drunk', function(status) + if status ~= nil then + data.drunk = math.floor(status.percent) + end + end) - else + TriggerEvent('esx_license:getLicenses', target, function(licenses) + data.licenses = licenses + end) - local xPlayer = ESX.GetPlayerFromId(target) + cb(data) - local data = { - name = GetPlayerName(target), - job = xPlayer.job, - inventory = xPlayer.inventory, - accounts = xPlayer.accounts, - weapons = xPlayer.loadout - } - - TriggerEvent('esx_status:getStatus', target, 'drunk', function(status) - - if status ~= nil then - data.drunk = math.floor(status.percent) - end - - end) - - TriggerEvent('esx_license:getLicenses', target, function(licenses) - data.licenses = licenses - end) - - cb(data) - - end + end end) ESX.RegisterServerCallback('esx_policejob:getFineList', function(source, cb, category) - - MySQL.Async.fetchAll( - 'SELECT * FROM fine_types WHERE category = @category', - { - ['@category'] = category - }, - function(fines) - cb(fines) - end - ) - + MySQL.Async.fetchAll('SELECT * FROM fine_types WHERE category = @category', { + ['@category'] = category + }, function(fines) + cb(fines) + end) end) ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, plate) @@ -255,159 +253,145 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, end) ESX.RegisterServerCallback('esx_policejob:getVehicleFromPlate', function(source, cb, plate) - MySQL.Async.fetchAll( - 'SELECT * FROM owned_vehicles WHERE plate = @plate', - { - ['@plate'] = plate - }, - function(result) - if result[1] ~= nil then + MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE plate = @plate', { + ['@plate'] = plate + }, function(result) + if result[1] ~= nil then - MySQL.Async.fetchAll('SELECT * FROM users WHERE identifier = @identifier', { - ['@identifier'] = result[1].owner - }, function(result2) - - if Config.EnableESXIdentity then - cb(result2[1].firstname .. ' ' .. result2[1].lastname, true) - else - cb(result2[1].name, true) - end + MySQL.Async.fetchAll('SELECT * FROM users WHERE identifier = @identifier', { + ['@identifier'] = result[1].owner + }, function(result2) - end) - else - cb(_U('unknown'), false) - end + if Config.EnableESXIdentity then + cb(result2[1].firstname .. ' ' .. result2[1].lastname, true) + else + cb(result2[1].name, true) + end + + end) + else + cb(_U('unknown'), false) end - ) + end) end) ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb) - TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) - local weapons = store.get('weapons') + local weapons = store.get('weapons') - if weapons == nil then - weapons = {} - end + if weapons == nil then + weapons = {} + end - cb(weapons) + cb(weapons) - end) + end) end) ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, weaponName, removeWeapon) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - if removeWeapon then - xPlayer.removeWeapon(weaponName) - end + if removeWeapon then + xPlayer.removeWeapon(weaponName) + end - TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) - local weapons = store.get('weapons') + local weapons = store.get('weapons') - if weapons == nil then - weapons = {} - end + if weapons == nil then + weapons = {} + end - local foundWeapon = false + local foundWeapon = false - for i=1, #weapons, 1 do - if weapons[i].name == weaponName then - weapons[i].count = weapons[i].count + 1 - foundWeapon = true - end - end + for i=1, #weapons, 1 do + if weapons[i].name == weaponName then + weapons[i].count = weapons[i].count + 1 + foundWeapon = true + break + end + end - if not foundWeapon then - table.insert(weapons, { - name = weaponName, - count = 1 - }) - end + if not foundWeapon then + table.insert(weapons, { + name = weaponName, + count = 1 + }) + end - store.set('weapons', weapons) - - cb() - - end) + store.set('weapons', weapons) + cb() + end) end) ESX.RegisterServerCallback('esx_policejob:removeArmoryWeapon', function(source, cb, weaponName) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.addWeapon(weaponName, 1000) + xPlayer.addWeapon(weaponName, 500) - TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) + TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) - local weapons = store.get('weapons') + local weapons = store.get('weapons') - if weapons == nil then - weapons = {} - end + if weapons == nil then + weapons = {} + end - local foundWeapon = false + local foundWeapon = false - for i=1, #weapons, 1 do - if weapons[i].name == weaponName then - weapons[i].count = (weapons[i].count > 0 and weapons[i].count - 1 or 0) - foundWeapon = true - end - end + for i=1, #weapons, 1 do + if weapons[i].name == weaponName then + weapons[i].count = (weapons[i].count > 0 and weapons[i].count - 1 or 0) + foundWeapon = true + break + end + end - if not foundWeapon then - table.insert(weapons, { - name = weaponName, - count = 0 - }) - end + if not foundWeapon then + table.insert(weapons, { + name = weaponName, + count = 0 + }) + end - store.set('weapons', weapons) - - cb() - - end) + store.set('weapons', weapons) + cb() + end) end) ESX.RegisterServerCallback('esx_policejob:buy', function(source, cb, amount) - TriggerEvent('esx_addonaccount:getSharedAccount', 'society_police', function(account) - - if account.money >= amount then - account.removeMoney(amount) - cb(true) - else - cb(false) - end - - end) + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_police', function(account) + if account.money >= amount then + account.removeMoney(amount) + cb(true) + else + cb(false) + end + end) end) ESX.RegisterServerCallback('esx_policejob:getStockItems', function(source, cb) - - TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) - cb(inventory.items) - end) - + TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) + cb(inventory.items) + end) end) ESX.RegisterServerCallback('esx_policejob:getPlayerInventory', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + local items = xPlayer.inventory - local xPlayer = ESX.GetPlayerFromId(source) - local items = xPlayer.inventory - - cb({ - items = items - }) - + cb( { items = items } ) end) AddEventHandler('playerDropped', function() From 2b31d526bdf726f5f35e2623985e111768f3fa84 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 15 Sep 2018 11:15:50 +0200 Subject: [PATCH 173/253] Fixed #189, performance improvements, 4 tab indent update --- client/main.lua | 1088 +++++++++++++++++++++-------------------------- 1 file changed, 494 insertions(+), 594 deletions(-) diff --git a/client/main.lua b/client/main.lua index d92b097c..42673ca3 100644 --- a/client/main.lua +++ b/client/main.lua @@ -50,7 +50,7 @@ function SetVehicleMaxMods(vehicle) modBrakes = 2, modTransmission = 2, modSuspension = 3, - modTurbo = true, + modTurbo = true } ESX.Game.SetVehicleProperties(vehicle, props) @@ -150,6 +150,7 @@ function OpenCloakroomMenu() TriggerEvent('skinchanger:loadDefaultModel', isMale, function() ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin) TriggerEvent('skinchanger:loadSkin', skin) + TriggerEvent('esx:restoreLoadout') end) end) @@ -254,6 +255,8 @@ function OpenCloakroomMenu() ESX.Streaming.RequestModel(modelHash, function() SetPlayerModel(PlayerId(), modelHash) SetModelAsNoLongerNeeded(modelHash) + + TriggerEvent('esx:restoreLoadout') end) end) @@ -272,95 +275,76 @@ end function OpenArmoryMenu(station) - if Config.EnableArmoryManagement then + if Config.EnableArmoryManagement then - local elements = { - {label = _U('get_weapon'), value = 'get_weapon'}, - {label = _U('put_weapon'), value = 'put_weapon'}, - {label = _U('remove_object'), value = 'get_stock'}, - {label = _U('deposit_object'), value = 'put_stock'} - } + local elements = { + {label = _U('get_weapon'), value = 'get_weapon'}, + {label = _U('put_weapon'), value = 'put_weapon'}, + {label = _U('remove_object'), value = 'get_stock'}, + {label = _U('deposit_object'), value = 'put_stock'} + } - if PlayerData.job.grade_name == 'boss' then - table.insert(elements, {label = _U('buy_weapons'), value = 'buy_weapons'}) - end + if PlayerData.job.grade_name == 'boss' then + table.insert(elements, {label = _U('buy_weapons'), value = 'buy_weapons'}) + end - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'armory', - { - title = _U('armory'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory', + { + title = _U('armory'), + align = 'top-left', + elements = elements + }, function(data, menu) - if data.current.value == 'get_weapon' then - OpenGetWeaponMenu() - end + if data.current.value == 'get_weapon' then + OpenGetWeaponMenu() + elseif data.current.value == 'put_weapon' then + OpenPutWeaponMenu() + elseif data.current.value == 'buy_weapons' then + OpenBuyWeaponsMenu(station) + elseif data.current.value == 'put_stock' then + OpenPutStocksMenu() + elseif data.current.value == 'get_stock' then + OpenGetStocksMenu() + end - if data.current.value == 'put_weapon' then - OpenPutWeaponMenu() - end + end, function(data, menu) + menu.close() - if data.current.value == 'buy_weapons' then - OpenBuyWeaponsMenu(station) - end + CurrentAction = 'menu_armory' + CurrentActionMsg = _U('open_armory') + CurrentActionData = {station = station} + end) - if data.current.value == 'put_stock' then - OpenPutStocksMenu() - end + else - if data.current.value == 'get_stock' then - OpenGetStocksMenu() - end + local elements = {} - end, - function(data, menu) + for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do + local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] + table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name), value = weapon.name}) + end - menu.close() + ESX.UI.Menu.CloseAll() - CurrentAction = 'menu_armory' - CurrentActionMsg = _U('open_armory') - CurrentActionData = {station = station} - end - ) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory', + { + title = _U('armory'), + align = 'top-left', + elements = elements + }, function(data, menu) + local weapon = data.current.value + TriggerServerEvent('esx_policejob:giveWeapon', weapon, 1000) + end, function(data, menu) + menu.close() - else + CurrentAction = 'menu_armory' + CurrentActionMsg = _U('open_armory') + CurrentActionData = {station = station} + end) - local elements = {} - - for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do - local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] - table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name), value = weapon.name}) - end - - ESX.UI.Menu.CloseAll() - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'armory', - { - title = _U('armory'), - align = 'top-left', - elements = elements, - }, - function(data, menu) - local weapon = data.current.value - TriggerServerEvent('esx_policejob:giveWeapon', weapon, 1000) - end, - function(data, menu) - - menu.close() - - CurrentAction = 'menu_armory' - CurrentActionMsg = _U('open_armory') - CurrentActionData = {station = station} - - end - ) - - end + end end @@ -466,7 +450,6 @@ function OpenVehicleSpawnerMenu(station, partNum) CurrentAction = 'menu_vehicle_spawner' CurrentActionMsg = _U('vehicle_spawner') CurrentActionData = {station = station, partNum = partNum} - end) end @@ -589,10 +572,8 @@ function OpenPoliceActionsMenu() if CurrentTask.Busy then return end - - SetTextComponentFormat('STRING') - AddTextComponentString(_U('impound_prompt')) - DisplayHelpTextFromStringLabel(0, 0, 1, -1) + + ESX.ShowHelpNotification(_U('impound_prompt')) TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) @@ -838,76 +819,66 @@ end function OpenFineMenu(player) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'fine', - { - title = _U('fine'), - align = 'top-left', - elements = { - {label = _U('traffic_offense'), value = 0}, - {label = _U('minor_offense'), value = 1}, - {label = _U('average_offense'), value = 2}, - {label = _U('major_offense'), value = 3} - }, - }, - function(data, menu) - - OpenFineCategoryMenu(player, data.current.value) - - end, - function(data, menu) - menu.close() - end - ) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'fine', + { + title = _U('fine'), + align = 'top-left', + elements = { + {label = _U('traffic_offense'), value = 0}, + {label = _U('minor_offense'), value = 1}, + {label = _U('average_offense'), value = 2}, + {label = _U('major_offense'), value = 3} + } + }, function(data, menu) + OpenFineCategoryMenu(player, data.current.value) + end, function(data, menu) + menu.close() + end) end function OpenFineCategoryMenu(player, category) - ESX.TriggerServerCallback('esx_policejob:getFineList', function(fines) + ESX.TriggerServerCallback('esx_policejob:getFineList', function(fines) - local elements = {} + local elements = {} - for i=1, #fines, 1 do - table.insert(elements, { - label = fines[i].label .. ' $' .. fines[i].amount .. '', - value = fines[i].id, - amount = fines[i].amount, - fineLabel = fines[i].label - }) - end + for i=1, #fines, 1 do + table.insert(elements, { + label = fines[i].label .. ' $' .. fines[i].amount .. '', + value = fines[i].id, + amount = fines[i].amount, + fineLabel = fines[i].label + }) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'fine_category', - { - title = _U('fine'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'fine_category', + { + title = _U('fine'), + align = 'top-left', + elements = elements, + }, function(data, menu) - local label = data.current.fineLabel - local amount = data.current.amount + local label = data.current.fineLabel + local amount = data.current.amount - menu.close() + menu.close() - if Config.EnablePlayerManagement then - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', _U('fine_total', label), amount) - else - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', _U('fine_total', label), amount) - end + if Config.EnablePlayerManagement then + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', _U('fine_total', label), amount) + else + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', _U('fine_total', label), amount) + end - ESX.SetTimeout(300, function() - OpenFineCategoryMenu(player, category) - end) + ESX.SetTimeout(300, function() + OpenFineCategoryMenu(player, category) + end) - end, - function(data, menu) - menu.close() - end - ) + end, function(data, menu) + menu.close() + end) - end, category) + end, category) end @@ -1028,251 +999,212 @@ end function OpenGetWeaponMenu() - ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) + ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) + local elements = {} - local elements = {} + for i=1, #weapons, 1 do + if weapons[i].count > 0 then + table.insert(elements, {label = 'x' .. weapons[i].count .. ' ' .. ESX.GetWeaponLabel(weapons[i].name), value = weapons[i].name}) + end + end - for i=1, #weapons, 1 do - if weapons[i].count > 0 then - table.insert(elements, {label = 'x' .. weapons[i].count .. ' ' .. ESX.GetWeaponLabel(weapons[i].name), value = weapons[i].name}) - end - end + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_get_weapon', + { + title = _U('get_weapon_menu'), + align = 'top-left', + elements = elements + }, function(data, menu) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'armory_get_weapon', - { - title = _U('get_weapon_menu'), - align = 'top-left', - elements = elements - }, - function(data, menu) + menu.close() - menu.close() + ESX.TriggerServerCallback('esx_policejob:removeArmoryWeapon', function() + OpenGetWeaponMenu() + end, data.current.value) - ESX.TriggerServerCallback('esx_policejob:removeArmoryWeapon', function() - OpenGetWeaponMenu() - end, data.current.value) - - end, - function(data, menu) - menu.close() - end - ) - - end) + end, function(data, menu) + menu.close() + end) + end) end function OpenPutWeaponMenu() + local elements = {} + local playerPed = PlayerPedId() + local weaponList = ESX.GetWeaponList() - local elements = {} - local playerPed = PlayerPedId() - local weaponList = ESX.GetWeaponList() + for i=1, #weaponList, 1 do + local weaponHash = GetHashKey(weaponList[i].name) - for i=1, #weaponList, 1 do + if HasPedGotWeapon(playerPed, weaponHash, false) and weaponList[i].name ~= 'WEAPON_UNARMED' then + table.insert(elements, {label = weaponList[i].label, value = weaponList[i].name}) + end + end - local weaponHash = GetHashKey(weaponList[i].name) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_put_weapon', + { + title = _U('put_weapon_menu'), + align = 'top-left', + elements = elements + }, function(data, menu) - if HasPedGotWeapon(playerPed, weaponHash, false) and weaponList[i].name ~= 'WEAPON_UNARMED' then - table.insert(elements, {label = weaponList[i].label, value = weaponList[i].name}) - end + menu.close() - end - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'armory_put_weapon', - { - title = _U('put_weapon_menu'), - align = 'top-left', - elements = elements - }, - function(data, menu) - - menu.close() - - ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() - OpenPutWeaponMenu() - end, data.current.value, true) - - end, - function(data, menu) - menu.close() - end - ) + ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() + OpenPutWeaponMenu() + end, data.current.value, true) + end, function(data, menu) + menu.close() + end) end function OpenBuyWeaponsMenu(station) - ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) + ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) - local elements = {} + local elements = {} - for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do + for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do + local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] + local count = 0 - local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] - local count = 0 + for i=1, #weapons, 1 do + if weapons[i].name == weapon.name then + count = weapons[i].count + break + end + end - for i=1, #weapons, 1 do - if weapons[i].name == weapon.name then - count = weapons[i].count - break - end - end + table.insert(elements, { + label = 'x' .. count .. ' ' .. ESX.GetWeaponLabel(weapon.name) .. ' $' .. weapon.price, + value = weapon.name, + price = weapon.price + }) + end - table.insert(elements, {label = 'x' .. count .. ' ' .. ESX.GetWeaponLabel(weapon.name) .. ' $' .. weapon.price, value = weapon.name, price = weapon.price}) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_buy_weapons', + { + title = _U('buy_weapon_menu'), + align = 'top-left', + elements = elements, + }, function(data, menu) - end + ESX.TriggerServerCallback('esx_policejob:buy', function(hasEnoughMoney) + if hasEnoughMoney then + ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() + OpenBuyWeaponsMenu(station) + end, data.current.value, false) + else + ESX.ShowNotification(_U('not_enough_money')) + end + end, data.current.price) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'armory_buy_weapons', - { - title = _U('buy_weapon_menu'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + end, function(data, menu) + menu.close() + end) - ESX.TriggerServerCallback('esx_policejob:buy', function(hasEnoughMoney) - - if hasEnoughMoney then - ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() - OpenBuyWeaponsMenu(station) - end, data.current.value, false) - else - ESX.ShowNotification(_U('not_enough_money')) - end - - end, data.current.price) - - end, - function(data, menu) - menu.close() - end - ) - - end) + end) end function OpenGetStocksMenu() - ESX.TriggerServerCallback('esx_policejob:getStockItems', function(items) + ESX.TriggerServerCallback('esx_policejob:getStockItems', function(items) - local elements = {} + local elements = {} - for i=1, #items, 1 do - table.insert(elements, {label = 'x' .. items[i].count .. ' ' .. items[i].label, value = items[i].name}) - end + for i=1, #items, 1 do + table.insert(elements, {label = 'x' .. items[i].count .. ' ' .. items[i].label, value = items[i].name}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'stocks_menu', - { - title = _U('police_stock'), - align = 'top-left', - elements = elements - }, - function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', + { + title = _U('police_stock'), + align = 'top-left', + elements = elements + }, function(data, menu) - local itemName = data.current.value + local itemName = data.current.value - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', - { - title = _U('quantity') - }, - function(data2, menu2) + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { + title = _U('quantity') + }, function(data2, menu2) - local count = tonumber(data2.value) + local count = tonumber(data2.value) - if count == nil then - ESX.ShowNotification(_U('quantity_invalid')) - else - menu2.close() - menu.close() - TriggerServerEvent('esx_policejob:getStockItem', itemName, count) + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() + TriggerServerEvent('esx_policejob:getStockItem', itemName, count) - Citizen.Wait(300) - OpenGetStocksMenu() - end + Citizen.Wait(300) + OpenGetStocksMenu() + end - end, - function(data2, menu2) - menu2.close() - end - ) + end, function(data2, menu2) + menu2.close() + end) - end, - function(data, menu) - menu.close() - end - ) + end, function(data, menu) + menu.close() + end) - end) + end) end function OpenPutStocksMenu() - ESX.TriggerServerCallback('esx_policejob:getPlayerInventory', function(inventory) + ESX.TriggerServerCallback('esx_policejob:getPlayerInventory', function(inventory) - local elements = {} + local elements = {} - for i=1, #inventory.items, 1 do + for i=1, #inventory.items, 1 do + local item = inventory.items[i] - local item = inventory.items[i] + if item.count > 0 then + table.insert(elements, {label = item.label .. ' x' .. item.count, type = 'item_standard', value = item.name}) + end + end - if item.count > 0 then - table.insert(elements, {label = item.label .. ' x' .. item.count, type = 'item_standard', value = item.name}) - end + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', + { + title = _U('inventory'), + align = 'top-left', + elements = elements + }, function(data, menu) - end + local itemName = data.current.value - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'stocks_menu', - { - title = _U('inventory'), - align = 'top-left', - elements = elements - }, - function(data, menu) + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { + title = _U('quantity') + }, function(data2, menu2) - local itemName = data.current.value + local count = tonumber(data2.value) - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', - { - title = _U('quantity') - }, - function(data2, menu2) + if count == nil then + ESX.ShowNotification(_U('quantity_invalid')) + else + menu2.close() + menu.close() + TriggerServerEvent('esx_policejob:putStockItems', itemName, count) - local count = tonumber(data2.value) + Citizen.Wait(300) + OpenPutStocksMenu() + end - if count == nil then - ESX.ShowNotification(_U('quantity_invalid')) - else - menu2.close() - menu.close() - TriggerServerEvent('esx_policejob:putStockItems', itemName, count) + end, function(data2, menu2) + menu2.close() + end) - Citizen.Wait(300) - OpenPutStocksMenu() - end - - end, - function(data2, menu2) - menu2.close() - end - ) - - end, - function(data, menu) - menu.close() - end - ) - - end) + end, function(data, menu) + menu.close() + end) + end) end @@ -1297,7 +1229,6 @@ end) -- don't show dispatches if the player isn't in service AddEventHandler('esx_phone:cancelMessage', function(dispatchNumber) - if type(PlayerData.job.name) == 'string' and PlayerData.job.name == 'police' and PlayerData.job.name == dispatchNumber then -- if esx_service is enabled if Config.MaxInService ~= -1 and not playerInService then @@ -1309,106 +1240,93 @@ end) AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNum) - if part == 'Cloakroom' then - CurrentAction = 'menu_cloakroom' - CurrentActionMsg = _U('open_cloackroom') - CurrentActionData = {} - end + if part == 'Cloakroom' then + CurrentAction = 'menu_cloakroom' + CurrentActionMsg = _U('open_cloackroom') + CurrentActionData = {} - if part == 'Armory' then - CurrentAction = 'menu_armory' - CurrentActionMsg = _U('open_armory') - CurrentActionData = {station = station} - end + elseif part == 'Armory' then - if part == 'VehicleSpawner' then - CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = _U('vehicle_spawner') - CurrentActionData = {station = station, partNum = partNum} - end + CurrentAction = 'menu_armory' + CurrentActionMsg = _U('open_armory') + CurrentActionData = {station = station} - if part == 'HelicopterSpawner' then + elseif part == 'VehicleSpawner' then - local helicopters = Config.PoliceStations[station].Helicopters + CurrentAction = 'menu_vehicle_spawner' + CurrentActionMsg = _U('vehicle_spawner') + CurrentActionData = {station = station, partNum = partNum} - if not IsAnyVehicleNearPoint(helicopters[partNum].SpawnPoint.x, helicopters[partNum].SpawnPoint.y, helicopters[partNum].SpawnPoint.z, 3.0) then + elseif part == 'HelicopterSpawner' then - ESX.Game.SpawnVehicle('polmav', helicopters[partNum].SpawnPoint, helicopters[partNum].Heading, function(vehicle) - SetVehicleModKit(vehicle, 0) - SetVehicleLivery(vehicle, 0) - end) + local helicopters = Config.PoliceStations[station].Helicopters - end + if not IsAnyVehicleNearPoint(helicopters[partNum].SpawnPoint.x, helicopters[partNum].SpawnPoint.y, helicopters[partNum].SpawnPoint.z, 3.0) then + ESX.Game.SpawnVehicle('polmav', helicopters[partNum].SpawnPoint, helicopters[partNum].Heading, function(vehicle) + SetVehicleModKit(vehicle, 0) + SetVehicleLivery(vehicle, 0) + end) + end - end + elseif part == 'VehicleDeleter' then - if part == 'VehicleDeleter' then + local playerPed = PlayerPedId() + local coords = GetEntityCoords(playerPed) - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) + if IsPedInAnyVehicle(playerPed, false) then - if IsPedInAnyVehicle(playerPed, false) then + local vehicle = GetVehiclePedIsIn(playerPed, false) - local vehicle = GetVehiclePedIsIn(playerPed, false) + if DoesEntityExist(vehicle) then + CurrentAction = 'delete_vehicle' + CurrentActionMsg = _U('store_vehicle') + CurrentActionData = {vehicle = vehicle} + end - if DoesEntityExist(vehicle) then - CurrentAction = 'delete_vehicle' - CurrentActionMsg = _U('store_vehicle') - CurrentActionData = {vehicle = vehicle} - end + end - end + elseif part == 'BossActions' then - end + CurrentAction = 'menu_boss_actions' + CurrentActionMsg = _U('open_bossmenu') + CurrentActionData = {} - if part == 'BossActions' then - CurrentAction = 'menu_boss_actions' - CurrentActionMsg = _U('open_bossmenu') - CurrentActionData = {} - end + end end) AddEventHandler('esx_policejob:hasExitedMarker', function(station, part, partNum) - ESX.UI.Menu.CloseAll() - CurrentAction = nil + ESX.UI.Menu.CloseAll() + CurrentAction = nil end) AddEventHandler('esx_policejob:hasEnteredEntityZone', function(entity) + local playerPed = PlayerPedId() - local playerPed = PlayerPedId() + if PlayerData.job ~= nil and PlayerData.job.name == 'police' and IsPedOnFoot(playerPed) then + CurrentAction = 'remove_entity' + CurrentActionMsg = _U('remove_prop') + CurrentActionData = {entity = entity} + end - if PlayerData.job ~= nil and PlayerData.job.name == 'police' and not IsPedInAnyVehicle(playerPed, false) then - CurrentAction = 'remove_entity' - CurrentActionMsg = _U('remove_prop') - CurrentActionData = {entity = entity} - end + if GetEntityModel(entity) == GetHashKey('p_ld_stinger_s') then + local playerPed = PlayerPedId() + local coords = GetEntityCoords(playerPed) - if GetEntityModel(entity) == GetHashKey('p_ld_stinger_s') then - - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - - if IsPedInAnyVehicle(playerPed, false) then - - local vehicle = GetVehiclePedIsIn(playerPed) - - for i=0, 7, 1 do - SetVehicleTyreBurst(vehicle, i, true, 1000) - end - - end - - end + if IsPedInAnyVehicle(playerPed, false) then + local vehicle = GetVehiclePedIsIn(playerPed) + for i=0, 7, 1 do + SetVehicleTyreBurst(vehicle, i, true, 1000) + end + end + end end) AddEventHandler('esx_policejob:hasExitedEntityZone', function(entity) - - if CurrentAction == 'remove_entity' then - CurrentAction = nil - end - + if CurrentAction == 'remove_entity' then + CurrentAction = nil + end end) RegisterNetEvent('esx_policejob:handcuff') @@ -1608,274 +1526,256 @@ end) -- Create blips Citizen.CreateThread(function() - for k,v in pairs(Config.PoliceStations) do + for k,v in pairs(Config.PoliceStations) do + local blip = AddBlipForCoord(v.Blip.Pos.x, v.Blip.Pos.y, v.Blip.Pos.z) - local blip = AddBlipForCoord(v.Blip.Pos.x, v.Blip.Pos.y, v.Blip.Pos.z) + SetBlipSprite (blip, v.Blip.Sprite) + SetBlipDisplay(blip, v.Blip.Display) + SetBlipScale (blip, v.Blip.Scale) + SetBlipColour (blip, v.Blip.Colour) + SetBlipAsShortRange(blip, true) - SetBlipSprite (blip, v.Blip.Sprite) - SetBlipDisplay(blip, v.Blip.Display) - SetBlipScale (blip, v.Blip.Scale) - SetBlipColour (blip, v.Blip.Colour) - SetBlipAsShortRange(blip, true) - - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('map_blip')) - EndTextCommandSetBlipName(blip) - - end + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(_U('map_blip')) + EndTextCommandSetBlipName(blip) + end end) -- Display markers Citizen.CreateThread(function() - while true do + while true do - Wait(0) + Citizen.Wait(1) - if PlayerData.job ~= nil and PlayerData.job.name == 'police' then + if PlayerData.job ~= nil and PlayerData.job.name == 'police' then - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) + local playerPed = PlayerPedId() + local coords = GetEntityCoords(playerPed) - for k,v in pairs(Config.PoliceStations) do + for k,v in pairs(Config.PoliceStations) do - for i=1, #v.Cloakrooms, 1 do - if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end + for i=1, #v.Cloakrooms, 1 do + if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end - for i=1, #v.Armories, 1 do - if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end + for i=1, #v.Armories, 1 do + if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end - for i=1, #v.Vehicles, 1 do - if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end + for i=1, #v.Vehicles, 1 do + if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end - for i=1, #v.VehicleDeleters, 1 do - if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end + for i=1, #v.VehicleDeleters, 1 do + if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end - if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'police' and PlayerData.job.grade_name == 'boss' then + if Config.EnablePlayerManagement and PlayerData.job.grade_name == 'boss' then + for i=1, #v.BossActions, 1 do + if not v.BossActions[i].disabled and GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end + end - for i=1, #v.BossActions, 1 do - if not v.BossActions[i].disabled and GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end + end - end + else + Citizen.Wait(500) + end - end - - end - - end + end end) -- Enter / Exit marker events Citizen.CreateThread(function() - while true do + while true do - Wait(0) + Citizen.Wait(10) - if PlayerData.job ~= nil and PlayerData.job.name == 'police' then + if PlayerData.job ~= nil and PlayerData.job.name == 'police' then - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - local isInMarker = false - local currentStation = nil - local currentPart = nil - local currentPartNum = nil + local playerPed = PlayerPedId() + local coords = GetEntityCoords(playerPed) + local isInMarker = false + local currentStation = nil + local currentPart = nil + local currentPartNum = nil - for k,v in pairs(Config.PoliceStations) do + for k,v in pairs(Config.PoliceStations) do - for i=1, #v.Cloakrooms, 1 do - if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'Cloakroom' - currentPartNum = i - end - end + for i=1, #v.Cloakrooms, 1 do + if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'Cloakroom' + currentPartNum = i + end + end - for i=1, #v.Armories, 1 do - if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'Armory' - currentPartNum = i - end - end + for i=1, #v.Armories, 1 do + if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'Armory' + currentPartNum = i + end + end - for i=1, #v.Vehicles, 1 do + for i=1, #v.Vehicles, 1 do + if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'VehicleSpawner' + currentPartNum = i + end - if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'VehicleSpawner' - currentPartNum = i - end + if GetDistanceBetweenCoords(coords, v.Vehicles[i].SpawnPoint.x, v.Vehicles[i].SpawnPoint.y, v.Vehicles[i].SpawnPoint.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'VehicleSpawnPoint' + currentPartNum = i + end + end - if GetDistanceBetweenCoords(coords, v.Vehicles[i].SpawnPoint.x, v.Vehicles[i].SpawnPoint.y, v.Vehicles[i].SpawnPoint.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'VehicleSpawnPoint' - currentPartNum = i - end + for i=1, #v.Helicopters, 1 do + if GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner.x, v.Helicopters[i].Spawner.y, v.Helicopters[i].Spawner.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'HelicopterSpawner' + currentPartNum = i + end - end + if GetDistanceBetweenCoords(coords, v.Helicopters[i].SpawnPoint.x, v.Helicopters[i].SpawnPoint.y, v.Helicopters[i].SpawnPoint.z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'HelicopterSpawnPoint' + currentPartNum = i + end + end - for i=1, #v.Helicopters, 1 do + for i=1, #v.VehicleDeleters, 1 do + if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'VehicleDeleter' + currentPartNum = i + end + end - if GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner.x, v.Helicopters[i].Spawner.y, v.Helicopters[i].Spawner.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'HelicopterSpawner' - currentPartNum = i - end + if Config.EnablePlayerManagement and PlayerData.job.grade_name == 'boss' then + for i=1, #v.BossActions, 1 do + if GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.MarkerSize.x then + isInMarker = true + currentStation = k + currentPart = 'BossActions' + currentPartNum = i + end + end + end - if GetDistanceBetweenCoords(coords, v.Helicopters[i].SpawnPoint.x, v.Helicopters[i].SpawnPoint.y, v.Helicopters[i].SpawnPoint.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'HelicopterSpawnPoint' - currentPartNum = i - end + end - end + local hasExited = false - for i=1, #v.VehicleDeleters, 1 do - if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'VehicleDeleter' - currentPartNum = i - end - end + if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum)) then - if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.name == 'police' and PlayerData.job.grade_name == 'boss' then + if + (LastStation ~= nil and LastPart ~= nil and LastPartNum ~= nil) and + (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) + then + TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) + hasExited = true + end - for i=1, #v.BossActions, 1 do - if GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'BossActions' - currentPartNum = i - end - end + HasAlreadyEnteredMarker = true + LastStation = currentStation + LastPart = currentPart + LastPartNum = currentPartNum - end + TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) + end - end + if not hasExited and not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) + end - local hasExited = false + else + Citizen.Wait(500) + end - if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) ) then - - if - (LastStation ~= nil and LastPart ~= nil and LastPartNum ~= nil) and - (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) - then - TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) - hasExited = true - end - - HasAlreadyEnteredMarker = true - LastStation = currentStation - LastPart = currentPart - LastPartNum = currentPartNum - - TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) - end - - if not hasExited and not isInMarker and HasAlreadyEnteredMarker then - - HasAlreadyEnteredMarker = false - - TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) - end - - end - - end + end end) -- Enter / Exit entity zone events Citizen.CreateThread(function() - local trackedEntities = { - 'prop_roadcone02a', - 'prop_barrier_work05', - 'p_ld_stinger_s', - 'prop_boxpile_07d', - 'hei_prop_cash_crate_half_full' - } + local trackedEntities = { + 'prop_roadcone02a', + 'prop_barrier_work05', + 'p_ld_stinger_s', + 'prop_boxpile_07d', + 'hei_prop_cash_crate_half_full' + } - while true do + while true do - Citizen.Wait(0) + Citizen.Wait(500) - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) + local playerPed = PlayerPedId() + local coords = GetEntityCoords(playerPed) - local closestDistance = -1 - local closestEntity = nil + local closestDistance = -1 + local closestEntity = nil - for i=1, #trackedEntities, 1 do + for i=1, #trackedEntities, 1 do + local object = GetClosestObjectOfType(coords.x, coords.y, coords.z, 3.0, GetHashKey(trackedEntities[i]), false, false, false) - local object = GetClosestObjectOfType(coords.x, coords.y, coords.z, 3.0, GetHashKey(trackedEntities[i]), false, false, false) + if DoesEntityExist(object) then + local objCoords = GetEntityCoords(object) + local distance = GetDistanceBetweenCoords(coords.x, coords.y, coords.z, objCoords.x, objCoords.y, objCoords.z, true) - if DoesEntityExist(object) then + if closestDistance == -1 or closestDistance > distance then + closestDistance = distance + closestEntity = object + end + end + end - local objCoords = GetEntityCoords(object) - local distance = GetDistanceBetweenCoords(coords.x, coords.y, coords.z, objCoords.x, objCoords.y, objCoords.z, true) + if closestDistance ~= -1 and closestDistance <= 3.0 then + if LastEntity ~= closestEntity then + TriggerEvent('esx_policejob:hasEnteredEntityZone', closestEntity) + LastEntity = closestEntity + end + else + if LastEntity ~= nil then + TriggerEvent('esx_policejob:hasExitedEntityZone', LastEntity) + LastEntity = nil + end + end - if closestDistance == -1 or closestDistance > distance then - closestDistance = distance - closestEntity = object - end - - end - - end - - if closestDistance ~= -1 and closestDistance <= 3.0 then - - if LastEntity ~= closestEntity then - TriggerEvent('esx_policejob:hasEnteredEntityZone', closestEntity) - LastEntity = closestEntity - end - - else - - if LastEntity ~= nil then - TriggerEvent('esx_policejob:hasExitedEntityZone', LastEntity) - LastEntity = nil - end - - end - - end + end end) -- Key Controls Citizen.CreateThread(function() while true do - Citizen.Wait(0) + Citizen.Wait(10) if CurrentAction ~= nil then - SetTextComponentFormat('STRING') - AddTextComponentString(CurrentActionMsg) - DisplayHelpTextFromStringLabel(0, 0, 1, -1) + ESX.ShowHelpNotification(CurrentActionMsg) if IsControlJustReleased(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' then From 8eeb444df70c124f34aded7b2e9bcedbec5a49c0 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 15 Sep 2018 21:37:30 +0200 Subject: [PATCH 174/253] Fixed handcuff animation not being enforced --- client/main.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 42673ca3..07604f28 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1488,6 +1488,8 @@ end) Citizen.CreateThread(function() while true do Citizen.Wait(1) + local playerPed = PlayerPedId() + if IsHandcuffed then DisableControlAction(2, 1, true) -- Disable pan DisableControlAction(2, 2, true) -- Disable tilt @@ -1496,7 +1498,6 @@ Citizen.CreateThread(function() DisableControlAction(2, 25, true) -- Aim DisableControlAction(2, 263, true) -- Melee Attack 1 DisableControlAction(2, Keys['R'], true) -- Reload - DisableControlAction(2, Keys['TOP'], true) -- Open phone (not needed?) DisableControlAction(2, Keys['SPACE'], true) -- Jump DisableControlAction(2, Keys['Q'], true) -- Cover DisableControlAction(2, Keys['TAB'], true) -- Select Weapon @@ -1505,6 +1506,7 @@ Citizen.CreateThread(function() DisableControlAction(2, Keys['F2'], true) -- Inventory DisableControlAction(2, Keys['F3'], true) -- Animations DisableControlAction(2, Keys['V'], true) -- Disable changing view + DisableControlAction(2, Keys['X'], true) -- Disable clearing animation DisableControlAction(2, Keys['P'], true) -- Disable pause screen DisableControlAction(2, 59, true) -- Disable steering in vehicle DisableControlAction(2, Keys['LEFTCTRL'], true) -- Disable going stealth @@ -1517,6 +1519,11 @@ Citizen.CreateThread(function() DisableControlAction(0, 143, true) -- Disable melee DisableControlAction(0, 75, true) -- Disable exit vehicle DisableControlAction(27, 75, true) -- Disable exit vehicle + if not (IsEntityPlayingAnim(playerPed, 'mp_arresting', 'idle', 3) == 1) then + ESX.Streaming.RequestAnimDict('mp_arresting', function() + TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) + end) + end else Citizen.Wait(500) end From de674ab53a53d2cbec2035dad1cb2c5585a9b9dc Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 29 Sep 2018 14:07:28 +0200 Subject: [PATCH 175/253] Fixed moving when restrained causes weird animation --- client/main.lua | 66 ++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/client/main.lua b/client/main.lua index 07604f28..56be6d33 100644 --- a/client/main.lua +++ b/client/main.lua @@ -65,11 +65,8 @@ function cleanPlayer(playerPed) end function setUniform(job, playerPed) - TriggerEvent('skinchanger:getSkin', function(skin) - if skin.sex == 0 then - if Config.Uniforms[job].male ~= nil then TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].male) else @@ -79,9 +76,7 @@ function setUniform(job, playerPed) if job == 'bullet_wear' then SetPedArmour(playerPed, 100) end - else - if Config.Uniforms[job].female ~= nil then TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].female) else @@ -91,9 +86,7 @@ function setUniform(job, playerPed) if job == 'bullet_wear' then SetPedArmour(playerPed, 100) end - end - end) end @@ -335,7 +328,7 @@ function OpenArmoryMenu(station) elements = elements }, function(data, menu) local weapon = data.current.value - TriggerServerEvent('esx_policejob:giveWeapon', weapon, 1000) + TriggerServerEvent('esx_policejob:giveWeapon', weapon, 1000) end, function(data, menu) menu.close() @@ -1447,11 +1440,9 @@ AddEventHandler('esx_policejob:putInVehicle', function() end if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) if DoesEntityExist(vehicle) then - local maxSeats = GetVehicleMaxNumberOfPassengers(vehicle) local freeSeat = nil @@ -1466,9 +1457,7 @@ AddEventHandler('esx_policejob:putInVehicle', function() TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) DragStatus.IsDragged = false end - end - end end) @@ -1491,25 +1480,39 @@ Citizen.CreateThread(function() local playerPed = PlayerPedId() if IsHandcuffed then - DisableControlAction(2, 1, true) -- Disable pan - DisableControlAction(2, 2, true) -- Disable tilt - DisableControlAction(2, 24, true) -- Attack - DisableControlAction(2, 257, true) -- Attack 2 - DisableControlAction(2, 25, true) -- Aim - DisableControlAction(2, 263, true) -- Melee Attack 1 - DisableControlAction(2, Keys['R'], true) -- Reload - DisableControlAction(2, Keys['SPACE'], true) -- Jump - DisableControlAction(2, Keys['Q'], true) -- Cover - DisableControlAction(2, Keys['TAB'], true) -- Select Weapon - DisableControlAction(2, Keys['F'], true) -- Also 'enter'? - DisableControlAction(2, Keys['F1'], true) -- Disable phone - DisableControlAction(2, Keys['F2'], true) -- Inventory - DisableControlAction(2, Keys['F3'], true) -- Animations - DisableControlAction(2, Keys['V'], true) -- Disable changing view - DisableControlAction(2, Keys['X'], true) -- Disable clearing animation + DisableControlAction(0, 1, true) -- Disable pan + DisableControlAction(0, 2, true) -- Disable tilt + DisableControlAction(0, 24, true) -- Attack + DisableControlAction(0, 257, true) -- Attack 2 + DisableControlAction(0, 25, true) -- Aim + DisableControlAction(0, 263, true) -- Melee Attack 1 + DisableControlAction(0, Keys['W'], true) -- W + DisableControlAction(0, Keys['A'], true) -- A + DisableControlAction(0, 31, true) -- S (fault in Keys table!) + DisableControlAction(0, 30, true) -- D (fault in Keys table!) + + DisableControlAction(0, Keys['R'], true) -- Reload + DisableControlAction(0, Keys['SPACE'], true) -- Jump + DisableControlAction(0, Keys['Q'], true) -- Cover + DisableControlAction(0, Keys['TAB'], true) -- Select Weapon + DisableControlAction(0, Keys['F'], true) -- Also 'enter'? + + DisableControlAction(0, Keys['F1'], true) -- Disable phone + DisableControlAction(0, Keys['F2'], true) -- Inventory + DisableControlAction(0, Keys['F3'], true) -- Animations + DisableControlAction(0, Keys['F6'], true) -- Job + + DisableControlAction(0, Keys['V'], true) -- Disable changing view + DisableControlAction(0, Keys['C'], true) -- Disable looking behind + DisableControlAction(0, Keys['X'], true) -- Disable clearing animation DisableControlAction(2, Keys['P'], true) -- Disable pause screen - DisableControlAction(2, 59, true) -- Disable steering in vehicle + + DisableControlAction(0, 59, true) -- Disable steering in vehicle + DisableControlAction(0, 71, true) -- Disable driving forward in vehicle + DisableControlAction(0, 72, true) -- Disable reversing in vehicle + DisableControlAction(2, Keys['LEFTCTRL'], true) -- Disable going stealth + DisableControlAction(0, 47, true) -- Disable weapon DisableControlAction(0, 264, true) -- Disable melee DisableControlAction(0, 257, true) -- Disable melee @@ -1519,7 +1522,7 @@ Citizen.CreateThread(function() DisableControlAction(0, 143, true) -- Disable melee DisableControlAction(0, 75, true) -- Disable exit vehicle DisableControlAction(27, 75, true) -- Disable exit vehicle - if not (IsEntityPlayingAnim(playerPed, 'mp_arresting', 'idle', 3) == 1) then + if IsEntityPlayingAnim(playerPed, 'mp_arresting', 'idle', 3) ~= 1 then ESX.Streaming.RequestAnimDict('mp_arresting', function() TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) end) @@ -1727,7 +1730,6 @@ end) -- Enter / Exit entity zone events Citizen.CreateThread(function() - local trackedEntities = { 'prop_roadcone02a', 'prop_barrier_work05', @@ -1737,7 +1739,6 @@ Citizen.CreateThread(function() } while true do - Citizen.Wait(500) local playerPed = PlayerPedId() @@ -1771,7 +1772,6 @@ Citizen.CreateThread(function() LastEntity = nil end end - end end) From 6a38360ee496d769750c510f6a06d9cb43c9aaef Mon Sep 17 00:00:00 2001 From: SleepyMode Date: Wed, 17 Oct 2018 18:58:44 +0300 Subject: [PATCH 176/253] Fix English localization of the SQL file --- localization/en_esx_policejob.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localization/en_esx_policejob.sql b/localization/en_esx_policejob.sql index ad1f7601..479c7bd4 100644 --- a/localization/en_esx_policejob.sql +++ b/localization/en_esx_policejob.sql @@ -18,7 +18,7 @@ INSERT INTO `jobs` (name, label) VALUES INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES ('police',0,'recruit','Recruit',20,'{}','{}'), - ('police',1,'officer','Officier',40,'{}','{}'), + ('police',1,'officer','Officer',40,'{}','{}'), ('police',2,'sergeant','Sergeant',60,'{}','{}'), ('police',3,'lieutenant','Lieutenant',85,'{}','{}'), ('police',4,'boss','Chief',100,'{}','{}') @@ -41,7 +41,7 @@ INSERT INTO `fine_types` (label, amount, category) VALUES ('Illegal U-Turn', 250, 0), ('Illegally Driving Off-road', 170, 0), ('Refusing a Lawful Command', 30, 0), - ('Illegally Stoped of a Vehicle', 150, 0), + ('Illegally Stopping a Vehicle', 150, 0), ('Illegal Parking', 70, 0), ('Failing to Yield to the right', 70, 0), ('Failure to comply with Vehicle Information', 90, 0), From 70a882165ee84d8f7b9290464e26c8de74851c78 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 20 Oct 2018 20:06:47 +0200 Subject: [PATCH 177/253] Implemented multiple vehicle spawn point system, closess #109 --- client/main.lua | 103 +++++++++++++++++++++++------------------------- config.lua | 16 +++++--- locales/br.lua | 2 +- locales/de.lua | 2 +- locales/en.lua | 2 +- locales/es.lua | 2 +- locales/fi.lua | 2 +- locales/fr.lua | 2 +- locales/pl.lua | 2 +- locales/sv.lua | 2 +- 10 files changed, 68 insertions(+), 67 deletions(-) diff --git a/client/main.lua b/client/main.lua index 56be6d33..c168ba6e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -343,7 +343,6 @@ end function OpenVehicleSpawnerMenu(station, partNum) - local vehicles = Config.PoliceStations[station].Vehicles ESX.UI.Menu.CloseAll() if Config.EnableSocietyOwnedVehicles then @@ -353,7 +352,10 @@ function OpenVehicleSpawnerMenu(station, partNum) ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(garageVehicles) for i=1, #garageVehicles, 1 do - table.insert(elements, {label = GetDisplayNameFromVehicleModel(garageVehicles[i].model) .. ' [' .. garageVehicles[i].plate .. ']', value = garageVehicles[i]}) + table.insert(elements, { + label = GetDisplayNameFromVehicleModel(garageVehicles[i].model) .. ' [' .. garageVehicles[i].plate .. ']', + value = garageVehicles[i] + }) end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', @@ -365,14 +367,16 @@ function OpenVehicleSpawnerMenu(station, partNum) menu.close() local vehicleProps = data.current.value + local foundSpawnPoint, spawnPoint = GetAvailableVehicleSpawnPoint(station, partNum) - ESX.Game.SpawnVehicle(vehicleProps.model, vehicles[partNum].SpawnPoint, vehicles[partNum].Heading, function(vehicle) - ESX.Game.SetVehicleProperties(vehicle, vehicleProps) - local playerPed = PlayerPedId() - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - end) + if foundSpawnPoint then + ESX.Game.SpawnVehicle(vehicleProps.model, spawnPoint, spawnPoint.heading, function(vehicle) + ESX.Game.SetVehicleProperties(vehicle, vehicleProps) + TaskWarpPedIntoVehicle(PlayerPedId(), vehicle, -1) + end) - TriggerServerEvent('esx_society:removeVehicleFromGarage', 'police', vehicleProps) + TriggerServerEvent('esx_society:removeVehicleFromGarage', 'police', vehicleProps) + end end, function(data, menu) menu.close() @@ -405,36 +409,29 @@ function OpenVehicleSpawnerMenu(station, partNum) }, function(data, menu) menu.close() - local model = data.current.model - local vehicle = GetClosestVehicle(vehicles[partNum].SpawnPoint.x, vehicles[partNum].SpawnPoint.y, vehicles[partNum].SpawnPoint.z, 3.0, 0, 71) - - if not DoesEntityExist(vehicle) then - - local playerPed = PlayerPedId() + local foundSpawnPoint, spawnPoint = GetAvailableVehicleSpawnPoint(station, partNum) + if foundSpawnPoint then if Config.MaxInService == -1 then - - ESX.Game.SpawnVehicle(model, vehicles[partNum].SpawnPoint, vehicles[partNum].Heading, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + ESX.Game.SpawnVehicle(data.current.model, spawnPoint, spawnPoint.heading, function(vehicle) + TaskWarpPedIntoVehicle(PlayerPedId(), vehicle, -1) SetVehicleMaxMods(vehicle) end) else ESX.TriggerServerCallback('esx_service:isInService', function(isInService) - if isInService then - ESX.Game.SpawnVehicle(model, vehicles[partNum].SpawnPoint, vehicles[partNum].Heading, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + if isInService then + ESX.Game.SpawnVehicle(data.current.model, spawnPoint, spawnPoint.heading, function(vehicle) + TaskWarpPedIntoVehicle(PlayerPedId(), vehicle, -1) SetVehicleMaxMods(vehicle) end) else ESX.ShowNotification(_U('service_not')) end + end, 'police') end - - else - ESX.ShowNotification(_U('vehicle_out')) end end, function(data, menu) @@ -448,11 +445,29 @@ function OpenVehicleSpawnerMenu(station, partNum) end end +function GetAvailableVehicleSpawnPoint(station, partNum) + local spawnPoints = Config.PoliceStations[station].Vehicles[partNum].SpawnPoints + local found, foundSpawnPoint = false, nil + + for i=1, #spawnPoints, 1 do + if ESX.Game.IsSpawnPointClear(spawnPoints[i], spawnPoints[i].radius) then + found, foundSpawnPoint = true, spawnPoints[i] + break + end + end + + if found then + return true, foundSpawnPoint + else + ESX.ShowNotification(_U('vehicle_blocked')) + return false + end +end + function OpenPoliceActionsMenu() ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'police_actions', + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'police_actions', { title = 'Police', align = 'top-left', @@ -599,8 +614,7 @@ function OpenPoliceActionsMenu() end, function(data2, menu2) menu2.close() - end - ) + end) elseif data.current.value == 'object_spawner' then ESX.UI.Menu.Open( @@ -776,10 +790,10 @@ function OpenBodySearchMenu(player) for i=1, #data.inventory, 1 do if data.inventory[i].count > 0 then table.insert(elements, { - label = _U('confiscate_inv', data.inventory[i].count, data.inventory[i].label), - value = data.inventory[i].name, - itemType = 'item_standard', - amount = data.inventory[i].count + label = _U('confiscate_inv', data.inventory[i].count, data.inventory[i].label), + value = data.inventory[i].name, + itemType = 'item_standard', + amount = data.inventory[i].count }) end end @@ -916,14 +930,12 @@ function ShowPlayerLicense(player) targetName = data.name end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'manage_license', + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'manage_license', { title = _U('license_revoke'), align = 'top-left', elements = elements, - }, - function(data, menu) + }, function(data, menu) ESX.ShowNotification(_U('licence_you_revoked', data.current.label, targetName)) TriggerServerEvent('esx_policejob:message', GetPlayerServerId(player), _U('license_revoked', data.current.label)) @@ -932,17 +944,14 @@ function ShowPlayerLicense(player) ESX.SetTimeout(300, function() ShowPlayerLicense(player) end) - end, - function(data, menu) + end, function(data, menu) menu.close() - end - ) + end) end, GetPlayerServerId(player)) end function OpenUnpaidBillsMenu(player) - local elements = {} ESX.TriggerServerCallback('esx_billing:getTargetBills', function(bills) @@ -1649,13 +1658,6 @@ Citizen.CreateThread(function() currentPart = 'VehicleSpawner' currentPartNum = i end - - if GetDistanceBetweenCoords(coords, v.Vehicles[i].SpawnPoint.x, v.Vehicles[i].SpawnPoint.y, v.Vehicles[i].SpawnPoint.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'VehicleSpawnPoint' - currentPartNum = i - end end for i=1, #v.Helicopters, 1 do @@ -1665,13 +1667,6 @@ Citizen.CreateThread(function() currentPart = 'HelicopterSpawner' currentPartNum = i end - - if GetDistanceBetweenCoords(coords, v.Helicopters[i].SpawnPoint.x, v.Helicopters[i].SpawnPoint.y, v.Helicopters[i].SpawnPoint.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'HelicopterSpawnPoint' - currentPartNum = i - end end for i=1, #v.VehicleDeleters, 1 do diff --git a/config.lua b/config.lua index 65bd9f69..3a6c0340 100644 --- a/config.lua +++ b/config.lua @@ -57,15 +57,21 @@ Config.PoliceStations = { Vehicles = { { - Spawner = { x = 454.69, y = -1017.4, z = 27.430 }, - SpawnPoint = { x = 438.42, y = -1018.3, z = 27.757 }, - Heading = 90.0 + Spawner = { x = 454.69, y = -1017.40, z = 27.43 }, + SpawnPoints = { + { x = 438.42, y = -1018.30, z = 27.75, heading = 90.0, radius = 6.0 }, + { x = 441.08, y = -1024.23, z = 28.30, heading = 90.0, radius = 6.0 }, + { x = 453.53, y = -1022.20, z = 28.02, heading = 90.0, radius = 6.0 }, + { x = 450.97, y = -1016.55, z = 28.10, heading = 90.0, radius = 6.0 } + } }, { Spawner = { x = 473.38, y = -1018.43, z = 27.00 }, - SpawnPoint = { x = 475.98, y = -1021.65, z = 28.06 }, - Heading = 276.11 + SpawnPoints = { + { x = 475.98, y = -1021.65, z = 28.06, heading = 276.11, radius = 6.0 }, + { x = 484.10, y = -1023.19, z = 27.57, heading = 302.54, radius = 6.0 } + } } }, diff --git a/locales/br.lua b/locales/br.lua index fe29aeb0..ad5bd3b6 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -17,7 +17,7 @@ Locales['br'] = { ['open_armory'] = 'Pressione ~INPUT_CONTEXT~ para acessar o arsenal', -- Vehicles ['vehicle_menu'] = 'Veículo', - ['vehicle_out'] = 'Já existe um carro fora da garagem', + ['vehicle_blocked'] = 'Já existe um carro fora da garagem', ['vehicle_spawner'] = 'Pressione ~INPUT_CONTEXT~ para escolher um veículo', ['store_vehicle'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', -- Service diff --git a/locales/de.lua b/locales/de.lua index 7aac4c49..ff73fbef 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -17,7 +17,7 @@ Locales['de'] = { ['open_armory'] = 'Drücke ~INPUT_CONTEXT~ um die Waffenkammer zu öffnen', -- Vehicles ['vehicle_menu'] = 'Fahrzeug', - ['vehicle_out'] = 'es ist bereits ein Fahrzeug draussen', + ['vehicle_blocked'] = 'es ist bereits ein Fahrzeug draussen', ['vehicle_spawner'] = 'Drücke ~INPUT_CONTEXT~ um ein Fahrzeug zu holen', ['store_vehicle'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', -- Service diff --git a/locales/en.lua b/locales/en.lua index 33011c7f..e125d5dc 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -17,7 +17,7 @@ Locales['en'] = { ['open_armory'] = 'press ~INPUT_CONTEXT~ to access the armory', -- Vehicles ['vehicle_menu'] = 'vehicle', - ['vehicle_out'] = 'there is already a car out of the garage', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', ['vehicle_spawner'] = 'press ~INPUT_CONTEXT~ to take out a vehicle', ['store_vehicle'] = 'press ~INPUT_CONTEXT~ to store the vehicle', -- Service diff --git a/locales/es.lua b/locales/es.lua index fefabc68..edae9fec 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -17,7 +17,7 @@ Locales['es'] = { ['open_armory'] = 'Presionarr ~INPUT_CONTEXT~ para acceder a la armeria', -- Vehicles ['vehicle_menu'] = 'Vehículo', - ['vehicle_out'] = 'Ya tienes un vehículo fuera', + ['vehicle_blocked'] = 'Ya tienes un vehículo fuera', ['vehicle_spawner'] = 'Presionar ~INPUT_CONTEXT~ para sacar un vehículo', ['store_vehicle'] = 'Presionar ~INPUT_CONTEXT~ para guardar un vehículo', -- Service diff --git a/locales/fi.lua b/locales/fi.lua index 46d30bb1..f7575835 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -17,7 +17,7 @@ Locales['fi'] = { ['open_armory'] = 'paina ~INPUT_CONTEXT~ avataksesi asevarasto', -- Vehicles ['vehicle_menu'] = 'ajoneuvo', - ['vehicle_out'] = 'ajoneuvo on jo ulkona tallista', + ['vehicle_blocked'] = 'ajoneuvo on jo ulkona tallista', ['vehicle_spawner'] = 'paina ~INPUT_CONTEXT~ ottaaksesi auton ulos', ['store_vehicle'] = 'paina ~INPUT_CONTEXT~ laittaaksesi auto talliin', -- Service diff --git a/locales/fr.lua b/locales/fr.lua index d0aca5d9..47ff1b5e 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -17,7 +17,7 @@ Locales['fr'] = { ['open_armory'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie', -- Vehicles ['vehicle_menu'] = 'véhicule', - ['vehicle_out'] = 'il y a déja un véhicule de sorti', + ['vehicle_blocked'] = 'il y a déja un véhicule de sorti', ['vehicle_spawner'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir un véhicule', ['store_vehicle'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', -- Service diff --git a/locales/pl.lua b/locales/pl.lua index 5c71a150..3f3b2a69 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -17,7 +17,7 @@ Locales['pl'] = { ['open_armory'] = 'naciśnij ~INPUT_CONTEXT~ żeby uzyskać dostęp do zbrojowni', -- Vehicles ['vehicle_menu'] = 'pojazdy', - ['vehicle_out'] = 'masz już pojazd poza garażem', + ['vehicle_blocked'] = 'masz już pojazd poza garażem', ['vehicle_spawner'] = 'naciśnij ~INPUT_CONTEXT~ żeby wziąć pojazd', ['store_vehicle'] = 'naciśnij ~INPUT_CONTEXT~ żeby przechować pojazd', -- Service diff --git a/locales/sv.lua b/locales/sv.lua index d553918c..f57c25d2 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -17,7 +17,7 @@ Locales['sv'] = { ['open_armory'] = 'tryck ~INPUT_CONTEXT~ för att komma åt förrådet', -- Vehicles ['vehicle_menu'] = 'bilar', - ['vehicle_out'] = 'det finns redan en bil ute!', + ['vehicle_blocked'] = 'alla tillgänliga spawn points är blockerade!', ['vehicle_spawner'] = 'tryck ~INPUT_CONTEXT~ för att ta ut en bil', ['store_vehicle'] = 'tryck ~INPUT_CONTEXT~ för att parkera bilen', -- Service From d987bfa877f7147655e3c113de8ac1e7353e495e Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 20 Oct 2018 20:09:11 +0200 Subject: [PATCH 178/253] Final commit v1.3.0 --- __resource.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__resource.lua b/__resource.lua index 9a8c8fec..dca1b4b1 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Police Job' -version '1.2.0' +version '1.3.0' server_scripts { '@mysql-async/lib/MySQL.lua', From e67aeee96102e6704823d1cf6008851b886ed8f7 Mon Sep 17 00:00:00 2001 From: celestian Date: Sun, 28 Oct 2018 17:24:46 +0100 Subject: [PATCH 179/253] USE essentialmode db in esx_policejob.sql Resolves #196 --- esx_policejob.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esx_policejob.sql b/esx_policejob.sql index dc820f41..ca16562e 100644 --- a/esx_policejob.sql +++ b/esx_policejob.sql @@ -1,3 +1,5 @@ +USE `essentialmode`; + INSERT INTO `addon_account` (name, label, shared) VALUES ('society_police', 'Police', 1) ; From b944ad9659dd30800b719bb8a65d4a2a29cc05bf Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 20 Nov 2018 21:15:06 +0100 Subject: [PATCH 180/253] Secured events from non-cops --- client/main.lua | 29 ++++++++++++++++++++++------- server/main.lua | 30 +++++++++++++++++++++++++----- 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/client/main.lua b/client/main.lua index c168ba6e..17df1788 100644 --- a/client/main.lua +++ b/client/main.lua @@ -956,7 +956,10 @@ function OpenUnpaidBillsMenu(player) ESX.TriggerServerCallback('esx_billing:getTargetBills', function(bills) for i=1, #bills, 1 do - table.insert(elements, {label = bills[i].label .. ' - $' .. bills[i].amount .. '', value = bills[i].id}) + table.insert(elements, { + label = bills[i].label .. ' - $' .. bills[i].amount .. '', + value = bills[i].id + }) end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'billing', @@ -1006,7 +1009,10 @@ function OpenGetWeaponMenu() for i=1, #weapons, 1 do if weapons[i].count > 0 then - table.insert(elements, {label = 'x' .. weapons[i].count .. ' ' .. ESX.GetWeaponLabel(weapons[i].name), value = weapons[i].name}) + table.insert(elements, { + label = 'x' .. weapons[i].count .. ' ' .. ESX.GetWeaponLabel(weapons[i].name), + value = weapons[i].name + }) end end @@ -1039,7 +1045,10 @@ function OpenPutWeaponMenu() local weaponHash = GetHashKey(weaponList[i].name) if HasPedGotWeapon(playerPed, weaponHash, false) and weaponList[i].name ~= 'WEAPON_UNARMED' then - table.insert(elements, {label = weaponList[i].label, value = weaponList[i].name}) + table.insert(elements, { + label = weaponList[i].label, + value = weaponList[i].name + }) end end @@ -1079,7 +1088,7 @@ function OpenBuyWeaponsMenu(station) end table.insert(elements, { - label = 'x' .. count .. ' ' .. ESX.GetWeaponLabel(weapon.name) .. ' $' .. weapon.price, + label = 'x' .. count .. ' ' .. ESX.GetWeaponLabel(weapon.name) .. ' $' .. ESX.Math.GroupDigits(weapon.price), value = weapon.name, price = weapon.price }) @@ -1114,11 +1123,13 @@ function OpenGetStocksMenu() ESX.TriggerServerCallback('esx_policejob:getStockItems', function(items) - local elements = {} for i=1, #items, 1 do - table.insert(elements, {label = 'x' .. items[i].count .. ' ' .. items[i].label, value = items[i].name}) + table.insert(elements, { + label = 'x' .. items[i].count .. ' ' .. items[i].label, + value = items[i].name + }) end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', @@ -1169,7 +1180,11 @@ function OpenPutStocksMenu() local item = inventory.items[i] if item.count > 0 then - table.insert(elements, {label = item.label .. ' x' .. item.count, type = 'item_standard', value = item.name}) + table.insert(elements, { + label = item.label .. ' x' .. item.count, + type = 'item_standard', + value = item.name + }) end end diff --git a/server/main.lua b/server/main.lua index dd5d9cfb..06470c76 100644 --- a/server/main.lua +++ b/server/main.lua @@ -12,7 +12,12 @@ TriggerEvent('esx_society:registerSociety', 'police', 'Police', 'society_police' RegisterServerEvent('esx_policejob:giveWeapon') AddEventHandler('esx_policejob:giveWeapon', function(weapon, ammo) local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.addWeapon(weapon, ammo) + + if xPlayer.job.name == 'police' then + xPlayer.addWeapon(weapon, ammo) + else + print(('esx_policejob: %s attempted to give weapon!'):format(xPlayer.identifier)) + end end) RegisterServerEvent('esx_policejob:confiscatePlayerItem') @@ -21,6 +26,11 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, local sourceXPlayer = ESX.GetPlayerFromId(_source) local targetXPlayer = ESX.GetPlayerFromId(target) + if sourceXPlayer.job.name ~= 'police' then + print(('esx_policejob: %s attempted to confiscate!'):format(xPlayer.identifier)) + return + end + if itemType == 'item_standard' then local targetItem = targetXPlayer.getInventoryItem(itemName) local sourceItem = sourceXPlayer.getInventoryItem(itemName) @@ -71,12 +81,24 @@ end) RegisterServerEvent('esx_policejob:drag') AddEventHandler('esx_policejob:drag', function(target) - TriggerClientEvent('esx_policejob:drag', target, source) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'police' then + TriggerClientEvent('esx_policejob:drag', target, source) + else + print(('esx_policejob: %s attempted to drag (not cop)!'):format(xPlayer.identifier)) + end end) RegisterServerEvent('esx_policejob:putInVehicle') AddEventHandler('esx_policejob:putInVehicle', function(target) - TriggerClientEvent('esx_policejob:putInVehicle', target) + local xPlayer = ESX.GetPlayerFromId(source) + + if xPlayer.job.name == 'police' then + TriggerClientEvent('esx_policejob:putInVehicle', target) + else + print(('esx_policejob: %s attempted to put in vehicle (not cop)!'):format(xPlayer.identifier)) + end end) RegisterServerEvent('esx_policejob:OutVehicle') @@ -278,7 +300,6 @@ end) ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb) TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) - local weapons = store.get('weapons') if weapons == nil then @@ -286,7 +307,6 @@ ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb end cb(weapons) - end) end) From 048f291d81f2b0ff9d2d7a6927952ab74d16d144 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 28 Nov 2018 21:45:41 +0100 Subject: [PATCH 181/253] mysql-async request optimizations --- client/main.lua | 6 +++++- server/main.lua | 12 +++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/client/main.lua b/client/main.lua index 17df1788..00967c77 100644 --- a/client/main.lua +++ b/client/main.lua @@ -316,7 +316,11 @@ function OpenArmoryMenu(station) for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] - table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name), value = weapon.name}) + + table.insert(elements, { + label = ESX.GetWeaponLabel(weapon.name), + value = weapon.name + }) end ESX.UI.Menu.CloseAll() diff --git a/server/main.lua b/server/main.lua index 06470c76..8943d098 100644 --- a/server/main.lua +++ b/server/main.lua @@ -168,10 +168,8 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, local xPlayer = ESX.GetPlayerFromId(target) - local identifier = GetPlayerIdentifiers(target)[1] - - local result = MySQL.Sync.fetchAll("SELECT * FROM users WHERE identifier = @identifier", { - ['@identifier'] = identifier + local result = MySQL.Sync.fetchAll('SELECT firstname, lastname, sex, dateofbirth, height FROM users WHERE identifier = @identifier', { + ['@identifier'] = xPlayer.identifier }) local firstname = result[1].firstname @@ -256,7 +254,7 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, if result[1] then - MySQL.Async.fetchAll('SELECT * FROM users WHERE identifier = @identifier', { + MySQL.Async.fetchAll('SELECT name, firstname, lastname FROM users WHERE identifier = @identifier', { ['@identifier'] = result[1].owner }, function(result2) @@ -275,12 +273,12 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, end) ESX.RegisterServerCallback('esx_policejob:getVehicleFromPlate', function(source, cb, plate) - MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE plate = @plate', { + MySQL.Async.fetchAll('SELECT owner FROM owned_vehicles WHERE plate = @plate', { ['@plate'] = plate }, function(result) if result[1] ~= nil then - MySQL.Async.fetchAll('SELECT * FROM users WHERE identifier = @identifier', { + MySQL.Async.fetchAll('SELECT name, firstname, lastname FROM users WHERE identifier = @identifier', { ['@identifier'] = result[1].owner }, function(result2) From d062d101d6588d894f19a52d1618239fc73721c6 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 22 Dec 2018 12:29:02 +0100 Subject: [PATCH 182/253] Undrag if cop dies --- client/main.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index 00967c77..2f49bdc6 100644 --- a/client/main.lua +++ b/client/main.lua @@ -767,7 +767,7 @@ function OpenBodySearchMenu(player) if data.accounts[i].name == 'black_money' and data.accounts[i].money > 0 then table.insert(elements, { - label = _U('confiscate_dirty', ESX.Round(data.accounts[i].money)), + label = _U('confiscate_dirty', ESX.Math.Round(data.accounts[i].money)), value = 'black_money', itemType = 'item_account', amount = data.accounts[i].money @@ -802,7 +802,6 @@ function OpenBodySearchMenu(player) end end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'body_search', { title = _U('search'), @@ -1258,7 +1257,6 @@ AddEventHandler('esx_phone:cancelMessage', function(dispatchNumber) end end) - AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNum) if part == 'Cloakroom' then @@ -1449,6 +1447,11 @@ Citizen.CreateThread(function() DetachEntity(playerPed, true, false) end + if IsPedDeadOrDying(targetPed, true) then + DragStatus.IsDragged = false + DetachEntity(playerPed, true, false) + end + else DetachEntity(playerPed, true, false) end From fe00e790468e7fe820329f1da437d7cde03281f6 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 22 Dec 2018 12:32:14 +0100 Subject: [PATCH 183/253] Proper vector3 parsing --- client/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/main.lua b/client/main.lua index 2f49bdc6..b33f7359 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1553,9 +1553,10 @@ Citizen.CreateThread(function() DisableControlAction(0, 143, true) -- Disable melee DisableControlAction(0, 75, true) -- Disable exit vehicle DisableControlAction(27, 75, true) -- Disable exit vehicle + if IsEntityPlayingAnim(playerPed, 'mp_arresting', 'idle', 3) ~= 1 then ESX.Streaming.RequestAnimDict('mp_arresting', function() - TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) + TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0.0, false, false, false) end) end else @@ -1765,11 +1766,11 @@ Citizen.CreateThread(function() local closestEntity = nil for i=1, #trackedEntities, 1 do - local object = GetClosestObjectOfType(coords.x, coords.y, coords.z, 3.0, GetHashKey(trackedEntities[i]), false, false, false) + local object = GetClosestObjectOfType(coords, 3.0, GetHashKey(trackedEntities[i]), false, false, false) if DoesEntityExist(object) then local objCoords = GetEntityCoords(object) - local distance = GetDistanceBetweenCoords(coords.x, coords.y, coords.z, objCoords.x, objCoords.y, objCoords.z, true) + local distance = GetDistanceBetweenCoords(coords, objCoords, true) if closestDistance == -1 or closestDistance > distance then closestDistance = distance From 1dece11ccdf8072dedc9f95a42e259b8cc0ae640 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 30 Dec 2018 20:58:06 +0100 Subject: [PATCH 184/253] Check IsControlJustReleased() every frame --- client/main.lua | 4 ++-- config.lua | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/main.lua b/client/main.lua index b33f7359..6aeac42a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1643,7 +1643,7 @@ Citizen.CreateThread(function() while true do - Citizen.Wait(10) + Citizen.Wait(100) if PlayerData.job ~= nil and PlayerData.job.name == 'police' then @@ -1797,7 +1797,7 @@ end) Citizen.CreateThread(function() while true do - Citizen.Wait(10) + Citizen.Wait(0) if CurrentAction ~= nil then ESX.ShowHelpNotification(CurrentActionMsg) diff --git a/config.lua b/config.lua index 3a6c0340..69e0f3c1 100644 --- a/config.lua +++ b/config.lua @@ -5,20 +5,20 @@ Config.MarkerType = 1 Config.MarkerSize = { x = 1.5, y = 1.5, z = 1.0 } Config.MarkerColor = { r = 50, g = 50, b = 204 } -Config.EnablePlayerManagement = false -Config.EnableArmoryManagement = false -Config.EnableESXIdentity = false -- enable if you're using esx_identity +Config.EnablePlayerManagement = true +Config.EnableArmoryManagement = true +Config.EnableESXIdentity = true -- enable if you're using esx_identity Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false -Config.EnableLicenses = false -- enable if you're using esx_license +Config.EnableLicenses = true -- enable if you're using esx_license Config.EnableHandcuffTimer = true -- enable handcuff timer? will unrestrain player after the time ends Config.HandcuffTimer = 10 * 60000 -- 10 mins Config.EnableJobBlip = true -- enable blips for colleagues, requires esx_society -Config.MaxInService = -1 -Config.Locale = 'fr' +Config.MaxInService = 5 +Config.Locale = 'sv' Config.PoliceStations = { @@ -29,7 +29,7 @@ Config.PoliceStations = { Sprite = 60, Display = 4, Scale = 1.2, - Colour = 29, + Colour = 29 }, -- https://wiki.rage.mp/index.php?title=Weapons @@ -44,7 +44,7 @@ Config.PoliceStations = { { name = 'WEAPON_FIREEXTINGUISHER', price = 120 }, { name = 'WEAPON_FLAREGUN', price = 60 }, { name = 'WEAPON_STICKYBOMB', price = 250 }, - { name = 'GADGET_PARACHUTE', price = 300 }, + { name = 'GADGET_PARACHUTE', price = 300 } }, Cloakrooms = { From 77ff73d6991aa303da98e38d72cb6cd38a060612 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 1 Jan 2019 15:50:19 +0100 Subject: [PATCH 185/253] Re wrote police armory. Components supported too! --- client/main.lua | 458 +++++++++++++++++++++++------------------------- config.lua | 61 +++++-- locales/br.lua | 20 +-- locales/de.lua | 20 +-- locales/en.lua | 26 +-- locales/es.lua | 20 +-- locales/fi.lua | 20 +-- locales/fr.lua | 20 +-- locales/pl.lua | 20 +-- locales/sv.lua | 24 +-- server/main.lua | 57 ++++-- 11 files changed, 392 insertions(+), 354 deletions(-) diff --git a/client/main.lua b/client/main.lua index 6aeac42a..c636ed4a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -10,24 +10,21 @@ local Keys = { ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 } -local PlayerData = {} +local PlayerData = {} local HasAlreadyEnteredMarker = false -local LastStation = nil -local LastPart = nil -local LastPartNum = nil -local LastEntity = nil -local CurrentAction = nil -local CurrentActionMsg = '' -local CurrentActionData = {} -local IsHandcuffed = false -local HandcuffTimer = {} -local DragStatus = {} -DragStatus.IsDragged = false -local hasAlreadyJoined = false -local blipsCops = {} -local isDead = false -local CurrentTask = {} -local playerInService = false +local LastStation, LastPart, LastPartNum, LastEntity +local CurrentAction = nil +local CurrentActionMsg = '' +local CurrentActionData = {} +local IsHandcuffed = false +local HandcuffTimer = {} +local DragStatus = {} +DragStatus.IsDragged = false +local hasAlreadyJoined = false +local blipsCops = {} +local isDead = false +local CurrentTask = {} +local playerInService = false ESX = nil @@ -255,8 +252,6 @@ function OpenCloakroomMenu() end - - end, function(data, menu) menu.close() @@ -267,82 +262,45 @@ function OpenCloakroomMenu() end function OpenArmoryMenu(station) + local elements = { + {label = _U('buy_weapons'), value = 'buy_weapons'} + } if Config.EnableArmoryManagement then - - local elements = { - {label = _U('get_weapon'), value = 'get_weapon'}, - {label = _U('put_weapon'), value = 'put_weapon'}, - {label = _U('remove_object'), value = 'get_stock'}, - {label = _U('deposit_object'), value = 'put_stock'} - } - - if PlayerData.job.grade_name == 'boss' then - table.insert(elements, {label = _U('buy_weapons'), value = 'buy_weapons'}) - end - - ESX.UI.Menu.CloseAll() - - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory', - { - title = _U('armory'), - align = 'top-left', - elements = elements - }, function(data, menu) - - if data.current.value == 'get_weapon' then - OpenGetWeaponMenu() - elseif data.current.value == 'put_weapon' then - OpenPutWeaponMenu() - elseif data.current.value == 'buy_weapons' then - OpenBuyWeaponsMenu(station) - elseif data.current.value == 'put_stock' then - OpenPutStocksMenu() - elseif data.current.value == 'get_stock' then - OpenGetStocksMenu() - end - - end, function(data, menu) - menu.close() - - CurrentAction = 'menu_armory' - CurrentActionMsg = _U('open_armory') - CurrentActionData = {station = station} - end) - - else - - local elements = {} - - for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do - local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] - - table.insert(elements, { - label = ESX.GetWeaponLabel(weapon.name), - value = weapon.name - }) - end - - ESX.UI.Menu.CloseAll() - - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory', - { - title = _U('armory'), - align = 'top-left', - elements = elements - }, function(data, menu) - local weapon = data.current.value - TriggerServerEvent('esx_policejob:giveWeapon', weapon, 1000) - end, function(data, menu) - menu.close() - - CurrentAction = 'menu_armory' - CurrentActionMsg = _U('open_armory') - CurrentActionData = {station = station} - end) - + table.insert(elements, {label = _U('get_weapon'), value = 'get_weapon'}) + table.insert(elements, {label = _U('put_weapon'), value = 'put_weapon'}) + table.insert(elements, {label = _U('remove_object'), value = 'get_stock'}) + table.insert(elements, {label = _U('deposit_object'), value = 'put_stock'}) end + ESX.UI.Menu.CloseAll() + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory', + { + title = _U('armory'), + align = 'top-left', + elements = elements + }, function(data, menu) + + if data.current.value == 'get_weapon' then + OpenGetWeaponMenu() + elseif data.current.value == 'put_weapon' then + OpenPutWeaponMenu() + elseif data.current.value == 'buy_weapons' then + OpenBuyWeaponsMenu() + elseif data.current.value == 'put_stock' then + OpenPutStocksMenu() + elseif data.current.value == 'get_stock' then + OpenGetStocksMenu() + end + + end, function(data, menu) + menu.close() + + CurrentAction = 'menu_armory' + CurrentActionMsg = _U('open_armory') + CurrentActionData = {station = station} + end) end function OpenVehicleSpawnerMenu(station, partNum) @@ -1073,55 +1031,132 @@ function OpenPutWeaponMenu() end) end -function OpenBuyWeaponsMenu(station) +function OpenBuyWeaponsMenu() - ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) + local elements = {} + local playerPed = PlayerPedId() - local elements = {} + for k,v in ipairs(Config.AuthorizedWeapons[PlayerData.job.grade_name]) do + local weaponNum, weapon = ESX.GetWeapon(v.weapon) + local components, label = {} - for i=1, #Config.PoliceStations[station].AuthorizedWeapons, 1 do - local weapon = Config.PoliceStations[station].AuthorizedWeapons[i] - local count = 0 + local hasWeapon = HasPedGotWeapon(playerPed, GetHashKey(v.weapon), false) - for i=1, #weapons, 1 do - if weapons[i].name == weapon.name then - count = weapons[i].count - break + if v.components then + for i=1, #v.components do + if v.components[i] then + + local component = weapon.components[i] + local hasComponent = HasPedGotWeaponComponent(playerPed, GetHashKey(v.weapon), component.hash) + + if hasComponent then + label = ('%s: %s'):format(component.label, _U('armory_owned')) + else + if v.components[i] > 0 then + label = ('%s: %s'):format(component.label, _U('armory_item', ESX.Math.GroupDigits(v.components[i]))) + else + label = ('%s: %s'):format(component.label, _U('armory_free')) + end + end + + table.insert(components, { + label = label, + componentLabel = component.label, + hash = component.hash, + name = component.name, + price = v.components[i], + hasComponent = hasComponent, + componentNum = i + }) end end - - table.insert(elements, { - label = 'x' .. count .. ' ' .. ESX.GetWeaponLabel(weapon.name) .. ' $' .. ESX.Math.GroupDigits(weapon.price), - value = weapon.name, - price = weapon.price - }) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_buy_weapons', - { - title = _U('buy_weapon_menu'), - align = 'top-left', - elements = elements, - }, function(data, menu) + if hasWeapon and v.components then + label = ('%s: >'):format(weapon.label) + elseif hasWeapon and not v.components then + label = ('%s: %s'):format(weapon.label, _U('armory_owned')) + else + if v.price > 0 then + label = ('%s: %s'):format(weapon.label, _U('armory_item', ESX.Math.GroupDigits(v.price))) + else + label = ('%s: %s'):format(weapon.label, _U('armory_free')) + end + end - ESX.TriggerServerCallback('esx_policejob:buy', function(hasEnoughMoney) - if hasEnoughMoney then - ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() - OpenBuyWeaponsMenu(station) - end, data.current.value, false) + table.insert(elements, { + label = label, + weaponLabel = weapon.label, + name = weapon.name, + components = components, + price = v.price, + hasWeapon = hasWeapon + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_buy_weapons', { + title = _U('armory_weapontitle'), + align = 'top-left', + elements = elements + }, function(data, menu) + + if data.current.hasWeapon then + if #data.current.components > 0 then + OpenWeaponComponentShop(data.current.components, data.current.name, menu) + end + else + ESX.TriggerServerCallback('esx_policejob:buyWeapon', function(bought) + if bought then + if data.current.price > 0 then + ESX.ShowNotification(_U('armory_bought', data.current.weaponLabel, ESX.Math.GroupDigits(data.current.price))) + end + + menu.close() + + OpenBuyWeaponsMenu() else - ESX.ShowNotification(_U('not_enough_money')) + ESX.ShowNotification(_U('armory_money')) end - end, data.current.price) - - end, function(data, menu) - menu.close() - end) + end, data.current.name, 1) + end + end, function(data, menu) + menu.close() end) end +function OpenWeaponComponentShop(components, weaponName, parentShop) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_buy_weapons_components', { + title = _U('armory_componenttitle'), + align = 'top-left', + elements = components + }, function(data, menu) + + if data.current.hasComponent then + ESX.ShowNotification(_U('armory_hascomponent')) + else + ESX.TriggerServerCallback('esx_policejob:buyWeapon', function(bought) + if bought then + if data.current.price > 0 then + ESX.ShowNotification(_U('armory_bought', data.current.componentLabel, ESX.Math.GroupDigits(data.current.price))) + end + + menu.close() + parentShop.close() + + OpenBuyWeaponsMenu() + else + ESX.ShowNotification(_U('armory_money')) + end + end, weaponName, 2, data.current.componentNum) + end + + end, function(data, menu) + menu.close() + end) +end + function OpenGetStocksMenu() ESX.TriggerServerCallback('esx_policejob:getStockItems', function(items) @@ -1588,155 +1623,110 @@ end) Citizen.CreateThread(function() while true do - Citizen.Wait(1) + Citizen.Wait(0) if PlayerData.job ~= nil and PlayerData.job.name == 'police' then local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) + local isInMarker, hasExited = false, false + local currentStation, currentPart, currentPartNum for k,v in pairs(Config.PoliceStations) do for i=1, #v.Cloakrooms, 1 do - if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + local distance = GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) + + if distance < Config.DrawDistance then + DrawMarker(20, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z + 1, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + end + + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Cloakroom', i end end for i=1, #v.Armories, 1 do - if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + local distance = GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) + + if distance < Config.DrawDistance then + DrawMarker(21, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + end + + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Armory', i end end for i=1, #v.Vehicles, 1 do - if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + local distance = GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) + + if distance < Config.DrawDistance then + DrawMarker(36, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) end - end - for i=1, #v.VehicleDeleters, 1 do - if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end - - if Config.EnablePlayerManagement and PlayerData.job.grade_name == 'boss' then - for i=1, #v.BossActions, 1 do - if not v.BossActions[i].disabled and GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end - end - - end - - else - Citizen.Wait(500) - end - - end -end) - --- Enter / Exit marker events -Citizen.CreateThread(function() - - while true do - - Citizen.Wait(100) - - if PlayerData.job ~= nil and PlayerData.job.name == 'police' then - - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - local isInMarker = false - local currentStation = nil - local currentPart = nil - local currentPartNum = nil - - for k,v in pairs(Config.PoliceStations) do - - for i=1, #v.Cloakrooms, 1 do - if GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'Cloakroom' - currentPartNum = i - end - end - - for i=1, #v.Armories, 1 do - if GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'Armory' - currentPartNum = i - end - end - - for i=1, #v.Vehicles, 1 do - if GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'VehicleSpawner' - currentPartNum = i + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'VehicleSpawner', i end end for i=1, #v.Helicopters, 1 do - if GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner.x, v.Helicopters[i].Spawner.y, v.Helicopters[i].Spawner.z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'HelicopterSpawner' - currentPartNum = i + local distance = GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner.x, v.Helicopters[i].Spawner.y, v.Helicopters[i].Spawner.z, true) + + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'HelicopterSpawner', i end end for i=1, #v.VehicleDeleters, 1 do - if GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'VehicleDeleter' - currentPartNum = i + local distance = GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + end + + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'VehicleDeleter', i end end if Config.EnablePlayerManagement and PlayerData.job.grade_name == 'boss' then for i=1, #v.BossActions, 1 do - if GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) < Config.MarkerSize.x then - isInMarker = true - currentStation = k - currentPart = 'BossActions' - currentPartNum = i + local distance = GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) + + if distance < Config.DrawDistance then + DrawMarker(22, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + end + + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'BossActions', i end end end - end - - local hasExited = false - - if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum)) then - - if - (LastStation ~= nil and LastPart ~= nil and LastPartNum ~= nil) and - (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) - then + if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum)) then + + if + (LastStation ~= nil and LastPart ~= nil and LastPartNum ~= nil) and + (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) + then + TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) + hasExited = true + end + + HasAlreadyEnteredMarker = true + LastStation = currentStation + LastPart = currentPart + LastPartNum = currentPartNum + + TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) + end + + if not hasExited and not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) - hasExited = true end - HasAlreadyEnteredMarker = true - LastStation = currentStation - LastPart = currentPart - LastPartNum = currentPartNum - - TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) - end - - if not hasExited and not isInMarker and HasAlreadyEnteredMarker then - HasAlreadyEnteredMarker = false - TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) end else diff --git a/config.lua b/config.lua index 69e0f3c1..bb7a6843 100644 --- a/config.lua +++ b/config.lua @@ -2,7 +2,7 @@ Config = {} Config.DrawDistance = 100.0 Config.MarkerType = 1 -Config.MarkerSize = { x = 1.5, y = 1.5, z = 1.0 } +Config.MarkerSize = { x = 1.5, y = 1.5, z = 0.5 } Config.MarkerColor = { r = 50, g = 50, b = 204 } Config.EnablePlayerManagement = true @@ -17,8 +17,8 @@ Config.HandcuffTimer = 10 * 60000 -- 10 mins Config.EnableJobBlip = true -- enable blips for colleagues, requires esx_society -Config.MaxInService = 5 -Config.Locale = 'sv' +Config.MaxInService = -1 +Config.Locale = 'en' Config.PoliceStations = { @@ -32,23 +32,8 @@ Config.PoliceStations = { Colour = 29 }, - -- https://wiki.rage.mp/index.php?title=Weapons - AuthorizedWeapons = { - { name = 'WEAPON_NIGHTSTICK', price = 200 }, - { name = 'WEAPON_COMBATPISTOL', price = 300 }, - { name = 'WEAPON_ASSAULTSMG', price = 1250 }, - { name = 'WEAPON_ASSAULTRIFLE', price = 1500 }, - { name = 'WEAPON_PUMPSHOTGUN', price = 600 }, - { name = 'WEAPON_STUNGUN', price = 500 }, - { name = 'WEAPON_FLASHLIGHT', price = 80 }, - { name = 'WEAPON_FIREEXTINGUISHER', price = 120 }, - { name = 'WEAPON_FLAREGUN', price = 60 }, - { name = 'WEAPON_STICKYBOMB', price = 250 }, - { name = 'GADGET_PARACHUTE', price = 300 } - }, - Cloakrooms = { - { x = 452.600, y = -993.306, z = 29.750 }, + { x = 452.6, y = -992.8, z = 29.7 }, }, Armories = { @@ -97,6 +82,44 @@ Config.PoliceStations = { } +Config.AuthorizedWeapons = { + recruit = { + { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, + { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, + { weapon = 'WEAPON_STUNGUN', price = 500 }, + { weapon = 'WEAPON_FLASHLIGHT', price = 80 } + }, + + officer = { + { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, + { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, + { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, + { weapon = 'WEAPON_STUNGUN', price = 500 }, + { weapon = 'WEAPON_FLASHLIGHT', price = 80 } + }, + + sergeant = { + + }, + + intendent = { + + }, + + lieutenant = { + + }, + + chef = { + + }, + + boss = { + + } +} + + -- https://wiki.rage.mp/index.php?title=Vehicles Config.AuthorizedVehicles = { Shared = { diff --git a/locales/br.lua b/locales/br.lua index ad5bd3b6..fb819143 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -15,6 +15,16 @@ Locales['br'] = { ['buy_weapons'] = 'Comprar armas', ['armory'] = 'Arsenal', ['open_armory'] = 'Pressione ~INPUT_CONTEXT~ para acessar o arsenal', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles ['vehicle_menu'] = 'Veículo', ['vehicle_blocked'] = 'Já existe um carro fora da garagem', @@ -103,17 +113,7 @@ Locales['br'] = { ['plate'] = 'placa: %s', ['owner_unknown'] = 'proprietário: Desconhecido', ['owner'] = 'proprietário: %s', - -- Weapons Menus - ['get_weapon_menu'] = 'Arsenal - Pegar arma', - ['put_weapon_menu'] = 'Arsenal - Entregar arma', - ['buy_weapon_menu'] = 'Arsenal - Comprar armas', - ['not_enough_money'] = 'Você não tem dinheiro suficiente', -- Boss Menu - ['take_company_money'] = 'Retirar o dinheiro da empresa', - ['deposit_money'] = 'Depositar dinheiro', - ['amount_of_withdrawal'] = 'Quantidade de retirada', - ['invalid_amount'] = 'Quantidade inválida', - ['amount_of_deposit'] = 'Quantidade de depósito', ['open_bossmenu'] = 'Pressione ~INPUT_CONTEXT~ para abrir o menu', ['quantity_invalid'] = 'invalid quantity', ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', diff --git a/locales/de.lua b/locales/de.lua index ff73fbef..8e6c64ec 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -15,6 +15,16 @@ Locales['de'] = { ['buy_weapons'] = 'Waffen kaufen', ['armory'] = 'Waffenkammer', ['open_armory'] = 'Drücke ~INPUT_CONTEXT~ um die Waffenkammer zu öffnen', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles ['vehicle_menu'] = 'Fahrzeug', ['vehicle_blocked'] = 'es ist bereits ein Fahrzeug draussen', @@ -103,17 +113,7 @@ Locales['de'] = { ['plate'] = 'plate: %s', ['owner_unknown'] = 'besitzer: Unbekannt', ['owner'] = 'besitzer: %s', - -- Weapons Menus - ['get_weapon_menu'] = 'Waffenkammer - Waffen nehmen', - ['put_weapon_menu'] = 'Waffenkammer - Waffen bringen', - ['buy_weapon_menu'] = 'Waffenkammer - Waffen kaufen', - ['not_enough_money'] = 'Du hast nicht genug Geld', -- Boss Menu - ['take_company_money'] = 'Firmengeld abheben', - ['deposit_money'] = 'Geld einzahlen', - ['amount_of_withdrawal'] = 'Betrag zum abheben', - ['invalid_amount'] = 'ungültiger Betrag', - ['amount_of_deposit'] = 'Betrag zum einzahlen', ['open_bossmenu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', ['quantity_invalid'] = 'invalid quantity', ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', diff --git a/locales/en.lua b/locales/en.lua index e125d5dc..e98e712c 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -10,11 +10,21 @@ Locales['en'] = { -- Armory ['remove_object'] = 'withdraw object', ['deposit_object'] = 'deposit object', - ['get_weapon'] = 'withdraw weapon', - ['put_weapon'] = 'deposit weapon', + ['get_weapon'] = 'withdraw weapon from armory', + ['put_weapon'] = 'store weapon in armory', ['buy_weapons'] = 'buy weapons', ['armory'] = 'armory', - ['open_armory'] = 'press ~INPUT_CONTEXT~ to access the armory', + ['open_armory'] = 'press ~INPUT_CONTEXT~ to access the ~y~Armory~s~.', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles ['vehicle_menu'] = 'vehicle', ['vehicle_blocked'] = 'all available spawn points are currently blocked!', @@ -103,17 +113,7 @@ Locales['en'] = { ['plate'] = 'plate: %s', ['owner_unknown'] = 'owner: Unknown', ['owner'] = 'owner: %s', - -- Weapons Menus - ['get_weapon_menu'] = 'armory - Withdraw Weapon', - ['put_weapon_menu'] = 'armory - Deposit Weapon', - ['buy_weapon_menu'] = 'armory - Buy Guns', - ['not_enough_money'] = 'you do not have enough money', -- Boss Menu - ['take_company_money'] = 'withdraw Company Money', - ['deposit_money'] = 'deposit Money', - ['amount_of_withdrawal'] = 'amount of Withdrawal', - ['invalid_amount'] = 'amount invalid', - ['amount_of_deposit'] = 'amount of deposit', ['open_bossmenu'] = 'press ~INPUT_CONTEXT~ to open the menu', ['quantity_invalid'] = 'invalid quantity', ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', diff --git a/locales/es.lua b/locales/es.lua index edae9fec..bb3ff8ae 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -15,6 +15,16 @@ Locales['es'] = { ['buy_weapons'] = 'Comprar armas', ['armory'] = 'Arsenal', ['open_armory'] = 'Presionarr ~INPUT_CONTEXT~ para acceder a la armeria', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles ['vehicle_menu'] = 'Vehículo', ['vehicle_blocked'] = 'Ya tienes un vehículo fuera', @@ -103,17 +113,7 @@ Locales['es'] = { ['plate'] = 'n°: %s', ['owner_unknown'] = 'propietario: Desconocido', ['owner'] = 'propietario: %s', - -- Weapons Menus - ['get_weapon_menu'] = 'Arsenal - Coger armas', - ['put_weapon_menu'] = 'Arsenal - Depositar armas', - ['buy_weapon_menu'] = 'Arsenal - Comprar armas', - ['not_enough_money'] = 'No tienes suficiente dinero', -- Boss Menu - ['take_company_money'] = 'retirar dinero de la empresa', - ['deposit_money'] = 'depositar dinero en la empresa', - ['amount_of_withdrawal'] = 'cantidad a retirar', - ['invalid_amount'] = 'cantidad inválida', - ['amount_of_deposit'] = 'cantidad a depositar', ['open_bossmenu'] = 'presionar ~INPUT_CONTEXT~ para abrir el menú', ['quantity_invalid'] = 'cantidad invalida', ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', diff --git a/locales/fi.lua b/locales/fi.lua index f7575835..b58e9fad 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -15,6 +15,16 @@ Locales['fi'] = { ['buy_weapons'] = 'osta aseita', ['armory'] = 'asevarasto', ['open_armory'] = 'paina ~INPUT_CONTEXT~ avataksesi asevarasto', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles ['vehicle_menu'] = 'ajoneuvo', ['vehicle_blocked'] = 'ajoneuvo on jo ulkona tallista', @@ -103,17 +113,7 @@ Locales['fi'] = { ['plate'] = 'kilpi: %s', ['owner_unknown'] = 'omistaja: Tuntematon', ['owner'] = 'omistaja: %s', - -- Weapons Menus - ['get_weapon_menu'] = 'asevarasto - Ota ase', - ['put_weapon_menu'] = 'asevarasto - Laita ase pois', - ['buy_weapon_menu'] = 'asevarasto - Osta aseet', - ['not_enough_money'] = 'sinulla ei ole tarpeeksi rahaa', --Boss Menu - ['take_company_money'] = 'nosta yrityksen varoja', - ['deposit_money'] = 'talleta rahaa', - ['amount_of_withdrawal'] = 'noston määrä', - ['invalid_amount'] = 'virheellinen summa', - ['amount_of_deposit'] = 'talletuksen määrä', ['open_bossmenu'] = 'paina ~INPUT_CONTEXT~ avataksesi valikon', ['quantity_invalid'] = 'invalid quantity', ['have_withdrawn'] = 'sinä otit varastosta ~y~%sx~s~ ~b~%s~s~', diff --git a/locales/fr.lua b/locales/fr.lua index 47ff1b5e..cd427fe4 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -15,6 +15,16 @@ Locales['fr'] = { ['buy_weapons'] = 'acheter Armes', ['armory'] = 'armurerie', ['open_armory'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles ['vehicle_menu'] = 'véhicule', ['vehicle_blocked'] = 'il y a déja un véhicule de sorti', @@ -103,17 +113,7 @@ Locales['fr'] = { ['plate'] = 'n°: %s', ['owner_unknown'] = 'propriétaire: Inconnu', ['owner'] = 'propriétaire: %s', - -- Weapons Menus - ['get_weapon_menu'] = 'armurerie - Prendre Arme', - ['put_weapon_menu'] = 'armurerie - Déposer Arme', - ['buy_weapon_menu'] = 'armurerie - Acheter Armes', - ['not_enough_money'] = 'vous n\'avez pas assez d\'argent', -- Boss Menu - ['take_company_money'] = 'retirer argent société', - ['deposit_money'] = 'déposer argent', - ['amount_of_withdrawal'] = 'montant du retrait', - ['invalid_amount'] = 'montant invalide', - ['amount_of_deposit'] = 'montant du dépôt', ['open_bossmenu'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir le menu', ['quantity_invalid'] = 'quantité invalide', ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', diff --git a/locales/pl.lua b/locales/pl.lua index 3f3b2a69..aa4e32ec 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -15,6 +15,16 @@ Locales['pl'] = { ['buy_weapons'] = 'kup Broń', ['armory'] = 'zbrojownia', ['open_armory'] = 'naciśnij ~INPUT_CONTEXT~ żeby uzyskać dostęp do zbrojowni', + ['armory_owned'] = 'owned', + ['armory_free'] = 'free', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'armory - Buy weapon', + ['armory_componenttitle'] = 'armory - Weapon attatchments', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_money'] = 'you cannot afford that weapon', + ['armory_hascomponent'] = 'you have that attatchment equiped!', + ['get_weapon_menu'] = 'armory - Withdraw Weapon', + ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles ['vehicle_menu'] = 'pojazdy', ['vehicle_blocked'] = 'masz już pojazd poza garażem', @@ -103,17 +113,7 @@ Locales['pl'] = { ['plate'] = 'tablica rejestracyjna: %s', ['owner_unknown'] = 'właściciel: Nieznany', ['owner'] = 'właściciel: %s', - -- Weapons Menus - ['get_weapon_menu'] = 'zbrojownia - Weź broń', - ['put_weapon_menu'] = 'zbrojownia - Odłóż broń', - ['buy_weapon_menu'] = 'zbrojownia - Kup broń', - ['not_enough_money'] = 'nie masz wystarczającej ilości pieniędzy', -- Boss Menu - ['take_company_money'] = 'wypłać firmowe pieniądze', - ['deposit_money'] = 'zdeponuj pieniądze', - ['amount_of_withdrawal'] = 'wartość wypłaty', - ['invalid_amount'] = 'nieprawidłowa wartość', - ['amount_of_deposit'] = 'wartość depozytu', ['open_bossmenu'] = 'naciśnij ~INPUT_CONTEXT~ aby otworzyć menu', ['quantity_invalid'] = 'nieprawidłowa ilość', ['have_withdrawn'] = 'wyjmujesz z depozytu ~y~%sx~s~ ~b~%s~s~', diff --git a/locales/sv.lua b/locales/sv.lua index f57c25d2..1c99ab88 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -12,9 +12,19 @@ Locales['sv'] = { ['deposit_object'] = 'lägg in objekt', ['get_weapon'] = 'ta ut vapen', ['put_weapon'] = 'lägg in vapen', - ['buy_weapons'] = 'köp in vapen', + ['buy_weapons'] = 'köp vapen', ['armory'] = 'vapenförråd', - ['open_armory'] = 'tryck ~INPUT_CONTEXT~ för att komma åt förrådet', + ['open_armory'] = 'tryck ~INPUT_CONTEXT~ för att komma åt ~y~vapenförrådet~s~.', + ['armory_owned'] = 'ägd', + ['armory_free'] = 'gratis', + ['armory_item'] = '%s SEK', + ['armory_weapontitle'] = 'vapenförråd - Köp vapen', + ['armory_componenttitle'] = 'vapenförråd - Vapen tillbehör', + ['armory_bought'] = 'du köpte ~y~%s~s~ för ~r~%s SEK~s~', + ['armory_money'] = 'du har inte råd med det vapnet', + ['armory_hascomponent'] = 'du har redan det tillbehöret!', + ['get_weapon_menu'] = 'vapenförråd - Ta ut vapen', + ['put_weapon_menu'] = 'vapenförråd - Spara vapen', -- Vehicles ['vehicle_menu'] = 'bilar', ['vehicle_blocked'] = 'alla tillgänliga spawn points är blockerade!', @@ -103,17 +113,7 @@ Locales['sv'] = { ['plate'] = 'reg nummer: %s', ['owner_unknown'] = 'ägare: Okänt', ['owner'] = 'ägare: %s', - -- Weapons Menus - ['get_weapon_menu'] = 'vapenförråd - Ta vapen', - ['put_weapon_menu'] = 'vapenförråd - Lägg in vapen', - ['buy_weapon_menu'] = 'vapenförråd - Köp in vapen', - ['not_enough_money'] = 'du har inte tillräckligt mycket pengar', -- Boss Menu - ['take_company_money'] = 'ta ut företagspengar', - ['deposit_money'] = 'lägg in pengar till företaget', - ['amount_of_withdrawal'] = 'belopp att ta ut', - ['invalid_amount'] = 'otillgängligt belopp', - ['amount_of_deposit'] = 'belopp att lägga in', ['open_bossmenu'] = 'tryck ~INPUT_CONTEXT~ för att öppna menyn', ['quantity_invalid'] = 'otillgängligt antal', ['have_withdrawn'] = 'du har tagit ut ~y~x%s~s~ ~b~%s~s~', diff --git a/server/main.lua b/server/main.lua index 8943d098..fc41a027 100644 --- a/server/main.lua +++ b/server/main.lua @@ -9,17 +9,6 @@ end TriggerEvent('esx_phone:registerNumber', 'police', _U('alert_police'), true, true) TriggerEvent('esx_society:registerSociety', 'police', 'Police', 'society_police', 'society_police', 'society_police', {type = 'public'}) -RegisterServerEvent('esx_policejob:giveWeapon') -AddEventHandler('esx_policejob:giveWeapon', function(weapon, ammo) - local xPlayer = ESX.GetPlayerFromId(source) - - if xPlayer.job.name == 'police' then - xPlayer.addWeapon(weapon, ammo) - else - print(('esx_policejob: %s attempted to give weapon!'):format(xPlayer.identifier)) - end -end) - RegisterServerEvent('esx_policejob:confiscatePlayerItem') AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, itemName, amount) local _source = source @@ -385,18 +374,54 @@ ESX.RegisterServerCallback('esx_policejob:removeArmoryWeapon', function(source, end) +ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weaponName, type, componentNum) + local xPlayer = ESX.GetPlayerFromId(source) + local authorizedWeapons, selectedWeapon = Config.AuthorizedWeapons[xPlayer.job.grade_name] -ESX.RegisterServerCallback('esx_policejob:buy', function(source, cb, amount) + for k,v in ipairs(authorizedWeapons) do + if v.weapon == weaponName then + selectedWeapon = v + break + end + end + + if not selectedWeapon then + print(('esx_policejob: %s attempted to buy an invalid weapon.'):format(xPlayer.identifier)) + cb(false) + end + + -- Weapon + if type == 1 then + if xPlayer.getMoney() >= selectedWeapon.price then + xPlayer.removeMoney(selectedWeapon.price) + xPlayer.addWeapon(weaponName, 100) - TriggerEvent('esx_addonaccount:getSharedAccount', 'society_police', function(account) - if account.money >= amount then - account.removeMoney(amount) cb(true) else cb(false) end - end) + -- Weapon Component + elseif type == 2 then + local price = selectedWeapon.components[weaponComponent] + local weaponNum, weapon = ESX.GetWeapon(weaponName) + + local component = weapon.components[componentNum] + + if component then + if xPlayer.getMoney() >= selectedWeapon.price then + xPlayer.removeMoney(selectedWeapon.price) + xPlayer.addWeaponComponent(weaponName, component.name) + + cb(true) + else + cb(false) + end + else + print(('esx_policejob: %s attempted to buy an invalid weapon component.'):format(xPlayer.identifier)) + cb(false) + end + end end) ESX.RegisterServerCallback('esx_policejob:getStockItems', function(source, cb) From 595447f549ca3f05eb261c53daeb21146fd215bc Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 1 Jan 2019 16:21:19 +0100 Subject: [PATCH 186/253] Updated weapon list for all ranks --- config.lua | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/config.lua b/config.lua index bb7a6843..a2ecf627 100644 --- a/config.lua +++ b/config.lua @@ -86,36 +86,61 @@ Config.AuthorizedWeapons = { recruit = { { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, - { weapon = 'WEAPON_STUNGUN', price = 500 }, + { weapon = 'WEAPON_STUNGUN', price = 1500 }, { weapon = 'WEAPON_FLASHLIGHT', price = 80 } }, officer = { { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, - { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, + { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, { weapon = 'WEAPON_STUNGUN', price = 500 }, - { weapon = 'WEAPON_FLASHLIGHT', price = 80 } + { weapon = 'WEAPON_FLASHLIGHT', price = 0 } }, sergeant = { - + { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, + { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, + { weapon = 'WEAPON_PUMPSHOTGUN', components = { 2000, 6000, nil }, price = 70000 }, + { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, + { weapon = 'WEAPON_STUNGUN', price = 500 }, + { weapon = 'WEAPON_FLASHLIGHT', price = 0 } }, intendent = { - + { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, + { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, + { weapon = 'WEAPON_PUMPSHOTGUN', components = { 2000, 6000, nil }, price = 70000 }, + { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, + { weapon = 'WEAPON_STUNGUN', price = 500 }, + { weapon = 'WEAPON_FLASHLIGHT', price = 0 } }, lieutenant = { - + { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, + { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, + { weapon = 'WEAPON_PUMPSHOTGUN', components = { 2000, 6000, nil }, price = 70000 }, + { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, + { weapon = 'WEAPON_STUNGUN', price = 500 }, + { weapon = 'WEAPON_FLASHLIGHT', price = 0 } }, chef = { - + { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, + { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, + { weapon = 'WEAPON_PUMPSHOTGUN', components = { 2000, 6000, nil }, price = 70000 }, + { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, + { weapon = 'WEAPON_STUNGUN', price = 500 }, + { weapon = 'WEAPON_FLASHLIGHT', price = 0 } }, boss = { - + { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, + { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, + { weapon = 'WEAPON_PUMPSHOTGUN', components = { 2000, 6000, nil }, price = 70000 }, + { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, + { weapon = 'WEAPON_STUNGUN', price = 500 }, + { weapon = 'WEAPON_FLASHLIGHT', price = 0 } } } From 179b0b1e59674acc3ec4554dcb9615174cf7173b Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 1 Jan 2019 16:32:08 +0100 Subject: [PATCH 187/253] Corrected default config --- config.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.lua b/config.lua index a2ecf627..4459bcf8 100644 --- a/config.lua +++ b/config.lua @@ -5,20 +5,20 @@ Config.MarkerType = 1 Config.MarkerSize = { x = 1.5, y = 1.5, z = 0.5 } Config.MarkerColor = { r = 50, g = 50, b = 204 } -Config.EnablePlayerManagement = true -Config.EnableArmoryManagement = true -Config.EnableESXIdentity = true -- enable if you're using esx_identity +Config.EnablePlayerManagement = false +Config.EnableArmoryManagement = false +Config.EnableESXIdentity = false -- enable if you're using esx_identity Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableSocietyOwnedVehicles = false -Config.EnableLicenses = true -- enable if you're using esx_license +Config.EnableLicenses = false -- enable if you're using esx_license Config.EnableHandcuffTimer = true -- enable handcuff timer? will unrestrain player after the time ends Config.HandcuffTimer = 10 * 60000 -- 10 mins -Config.EnableJobBlip = true -- enable blips for colleagues, requires esx_society +Config.EnableJobBlip = false -- enable blips for colleagues, requires esx_society Config.MaxInService = -1 -Config.Locale = 'en' +Config.Locale = 'fr' Config.PoliceStations = { From 52cc71a2926787f46cf8eccf76604a2d452d8c62 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 1 Jan 2019 16:38:11 +0100 Subject: [PATCH 188/253] Moved all coords to vector3 types --- client/main.lua | 28 ++++++++++++++-------------- config.lua | 38 +++++++++++++++++++------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/client/main.lua b/client/main.lua index c636ed4a..4e225a98 100644 --- a/client/main.lua +++ b/client/main.lua @@ -412,7 +412,7 @@ function GetAvailableVehicleSpawnPoint(station, partNum) local found, foundSpawnPoint = false, nil for i=1, #spawnPoints, 1 do - if ESX.Game.IsSpawnPointClear(spawnPoints[i], spawnPoints[i].radius) then + if ESX.Game.IsSpawnPointClear(spawnPoints[i].coords, spawnPoints[i].radius) then found, foundSpawnPoint = true, spawnPoints[i] break end @@ -1315,7 +1315,7 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu local helicopters = Config.PoliceStations[station].Helicopters - if not IsAnyVehicleNearPoint(helicopters[partNum].SpawnPoint.x, helicopters[partNum].SpawnPoint.y, helicopters[partNum].SpawnPoint.z, 3.0) then + if not IsAnyVehicleNearPoint(helicopters[partNum].SpawnPoint, 3.0) then ESX.Game.SpawnVehicle('polmav', helicopters[partNum].SpawnPoint, helicopters[partNum].Heading, function(vehicle) SetVehicleModKit(vehicle, 0) SetVehicleLivery(vehicle, 0) @@ -1604,7 +1604,7 @@ end) Citizen.CreateThread(function() for k,v in pairs(Config.PoliceStations) do - local blip = AddBlipForCoord(v.Blip.Pos.x, v.Blip.Pos.y, v.Blip.Pos.z) + local blip = AddBlipForCoord(v.Blip.Pos) SetBlipSprite (blip, v.Blip.Sprite) SetBlipDisplay(blip, v.Blip.Display) @@ -1635,10 +1635,10 @@ Citizen.CreateThread(function() for k,v in pairs(Config.PoliceStations) do for i=1, #v.Cloakrooms, 1 do - local distance = GetDistanceBetweenCoords(coords, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z, true) + local distance = GetDistanceBetweenCoords(coords, v.Cloakrooms[i], true) if distance < Config.DrawDistance then - DrawMarker(20, v.Cloakrooms[i].x, v.Cloakrooms[i].y, v.Cloakrooms[i].z + 1, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(20, v.Cloakrooms[i] + 1, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) end if distance < Config.MarkerSize.x then @@ -1647,10 +1647,10 @@ Citizen.CreateThread(function() end for i=1, #v.Armories, 1 do - local distance = GetDistanceBetweenCoords(coords, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z, true) + local distance = GetDistanceBetweenCoords(coords, v.Armories[i], true) if distance < Config.DrawDistance then - DrawMarker(21, v.Armories[i].x, v.Armories[i].y, v.Armories[i].z + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(21, v.Armories[i] + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) end if distance < Config.MarkerSize.x then @@ -1659,10 +1659,10 @@ Citizen.CreateThread(function() end for i=1, #v.Vehicles, 1 do - local distance = GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z, true) + local distance = GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner, true) if distance < Config.DrawDistance then - DrawMarker(36, v.Vehicles[i].Spawner.x, v.Vehicles[i].Spawner.y, v.Vehicles[i].Spawner.z + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(36, v.Vehicles[i].Spawner + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) end if distance < Config.MarkerSize.x then @@ -1671,7 +1671,7 @@ Citizen.CreateThread(function() end for i=1, #v.Helicopters, 1 do - local distance = GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner.x, v.Helicopters[i].Spawner.y, v.Helicopters[i].Spawner.z, true) + local distance = GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner, true) if distance < Config.MarkerSize.x then isInMarker, currentStation, currentPart, currentPartNum = true, k, 'HelicopterSpawner', i @@ -1679,10 +1679,10 @@ Citizen.CreateThread(function() end for i=1, #v.VehicleDeleters, 1 do - local distance = GetDistanceBetweenCoords(coords, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, true) + local distance = GetDistanceBetweenCoords(coords, v.VehicleDeleters[i], true) if distance < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.VehicleDeleters[i].x, v.VehicleDeleters[i].y, v.VehicleDeleters[i].z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + DrawMarker(Config.MarkerType, v.VehicleDeleters[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) end if distance < Config.MarkerSize.x then @@ -1692,10 +1692,10 @@ Citizen.CreateThread(function() if Config.EnablePlayerManagement and PlayerData.job.grade_name == 'boss' then for i=1, #v.BossActions, 1 do - local distance = GetDistanceBetweenCoords(coords, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z, true) + local distance = GetDistanceBetweenCoords(coords, v.BossActions[i], true) if distance < Config.DrawDistance then - DrawMarker(22, v.BossActions[i].x, v.BossActions[i].y, v.BossActions[i].z + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(22, v.BossActions[i] + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) end if distance < Config.MarkerSize.x then diff --git a/config.lua b/config.lua index 4459bcf8..02cb4de3 100644 --- a/config.lua +++ b/config.lua @@ -25,7 +25,7 @@ Config.PoliceStations = { LSPD = { Blip = { - Pos = { x = 425.130, y = -979.558, z = 30.711 }, + Coords = vector3(425.1, -979.5, 30.7), Sprite = 60, Display = 4, Scale = 1.2, @@ -33,52 +33,52 @@ Config.PoliceStations = { }, Cloakrooms = { - { x = 452.6, y = -992.8, z = 29.7 }, + vector3(452.6, -992.8, 29.7) }, Armories = { - { x = 451.699, y = -980.356, z = 29.689 }, + vector3(451.6, -980.3, 29.6) }, Vehicles = { { - Spawner = { x = 454.69, y = -1017.40, z = 27.43 }, + Spawner = vector3(454.6, -1017.4, 27.4), SpawnPoints = { - { x = 438.42, y = -1018.30, z = 27.75, heading = 90.0, radius = 6.0 }, - { x = 441.08, y = -1024.23, z = 28.30, heading = 90.0, radius = 6.0 }, - { x = 453.53, y = -1022.20, z = 28.02, heading = 90.0, radius = 6.0 }, - { x = 450.97, y = -1016.55, z = 28.10, heading = 90.0, radius = 6.0 } + { coords = vector3(438.4, -1018.3, 27.7), heading = 90.0, radius = 6.0 }, + { coords = vector3(441.0, -1024.2, 28.3), heading = 90.0, radius = 6.0 }, + { coords = vector3(453.5, -1022.2, 28.0), heading = 90.0, radius = 6.0 }, + { coords = vector3(450.9, -1016.5, 28.1), heading = 90.0, radius = 6.0 } } }, { - Spawner = { x = 473.38, y = -1018.43, z = 27.00 }, + Spawner = { x = 473.38, y = -1018.43, z = 27.00 }, SpawnPoints = { - { x = 475.98, y = -1021.65, z = 28.06, heading = 276.11, radius = 6.0 }, - { x = 484.10, y = -1023.19, z = 27.57, heading = 302.54, radius = 6.0 } + { x = 475.9, y = -1021.6, z = 28.0, heading = 276.1, radius = 6.0 }, + { x = 484.1, y = -1023.1, z = 27.5, heading = 302.5, radius = 6.0 } } } }, Helicopters = { { - Spawner = { x = 466.477, y = -982.819, z = 42.691 }, - SpawnPoint = { x = 450.04, y = -981.14, z = 42.691 }, + Spawner = vector3(466.4, -982.8, 42.6), + SpawnPoint = vector3(450.0, -981.1, 42.6), Heading = 0.0 } }, VehicleDeleters = { - { x = 462.74, y = -1014.4, z = 27.065 }, - { x = 462.40, y = -1019.7, z = 27.104 }, - { x = 469.12, y = -1024.52, z = 27.20 } + vector3(462.7, -1014.4, 27.0), + vector3(462.4, -1019.7, 27.1), + vector3(469.1, -1024.5, 27.2) }, BossActions = { - { x = 448.417, y = -973.208, z = 29.689 } - }, + vector3(448.4, -973.2, 29.6) + } - }, + } } From 321bb917c9db9b14efb49b179bddb708759c93e4 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 1 Jan 2019 17:04:13 +0100 Subject: [PATCH 189/253] Moved all coords to vector3 types --- config.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/config.lua b/config.lua index 02cb4de3..023c3339 100644 --- a/config.lua +++ b/config.lua @@ -9,7 +9,6 @@ Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false Config.EnableESXIdentity = false -- enable if you're using esx_identity Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds -Config.EnableSocietyOwnedVehicles = false Config.EnableLicenses = false -- enable if you're using esx_license Config.EnableHandcuffTimer = true -- enable handcuff timer? will unrestrain player after the time ends @@ -37,7 +36,7 @@ Config.PoliceStations = { }, Armories = { - vector3(451.6, -980.3, 29.6) + vector3(451.0, -980.7, 29.6) }, Vehicles = { @@ -52,10 +51,10 @@ Config.PoliceStations = { }, { - Spawner = { x = 473.38, y = -1018.43, z = 27.00 }, + Spawner = vector3(473.3, -1018.4, 27.0), SpawnPoints = { - { x = 475.9, y = -1021.6, z = 28.0, heading = 276.1, radius = 6.0 }, - { x = 484.1, y = -1023.1, z = 27.5, heading = 302.5, radius = 6.0 } + { coords = vector3(475.9, -1021.6, 28.0), heading = 276.1, radius = 6.0 }, + { coords = vector3(484.1, -1023.1, 27.5), heading = 302.5, radius = 6.0 } } } }, From 0084ef5752aa76683c4e7f68696d37dffd9a231a Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 1 Jan 2019 19:09:50 +0100 Subject: [PATCH 190/253] Complete vehicle job system re write --- client/main.lua | 511 ++++++++++++++++++++++++++++++++++-------------- config.lua | 83 +++++--- locales/br.lua | 31 ++- locales/de.lua | 31 ++- locales/en.lua | 27 ++- locales/es.lua | 31 ++- locales/fi.lua | 31 ++- locales/fr.lua | 31 ++- locales/pl.lua | 31 ++- locales/sv.lua | 31 ++- server/main.lua | 94 +++++++++ 11 files changed, 731 insertions(+), 201 deletions(-) diff --git a/client/main.lua b/client/main.lua index 4e225a98..5139e504 100644 --- a/client/main.lua +++ b/client/main.lua @@ -25,6 +25,7 @@ local blipsCops = {} local isDead = false local CurrentTask = {} local playerInService = false +local spawnedVehicles, isInShopMenu = {}, false ESX = nil @@ -41,18 +42,6 @@ Citizen.CreateThread(function() PlayerData = ESX.GetPlayerData() end) -function SetVehicleMaxMods(vehicle) - local props = { - modEngine = 2, - modBrakes = 2, - modTransmission = 2, - modSuspension = 3, - modTurbo = true - } - - ESX.Game.SetVehicleProperties(vehicle, props) -end - function cleanPlayer(playerPed) SetPedArmour(playerPed, 0) ClearPedBloodDamage(playerPed) @@ -303,112 +292,205 @@ function OpenArmoryMenu(station) end) end -function OpenVehicleSpawnerMenu(station, partNum) +function OpenVehicleSpawnerMenu(type, station, part, partNum) + local playerCoords = GetEntityCoords(PlayerPedId()) + PlayerData = ESX.GetPlayerData() + local elements = { + {label = _U('garage_storeditem'), action = 'garage'}, + {label = _U('garage_storeitem'), action = 'store_garage'}, + {label = _U('garage_buyitem'), action = 'buy_vehicle'} + } - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle', { + title = _U('garage_title'), + align = 'top-left', + elements = elements + }, function(data, menu) - if Config.EnableSocietyOwnedVehicles then + if data.current.action == 'buy_vehicle' then + local shopElements, shopCoords = {} - local elements = {} + if type == 'car' then + shopCoords = Config.PoliceStations[station].Vehicles[partNum].InsideShop + local authorizedVehicles = Config.AuthorizedVehicles[PlayerData.job.grade_name] - ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(garageVehicles) + if #Config.AuthorizedVehicles['Shared'] > 0 then + for k,vehicle in ipairs(Config.AuthorizedVehicles['Shared']) do + table.insert(shopElements, { + label = ('%s - %s'):format(vehicle.label, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))), + name = vehicle.label, + model = vehicle.model, + price = vehicle.price, + type = 'car' + }) + end + end - for i=1, #garageVehicles, 1 do - table.insert(elements, { - label = GetDisplayNameFromVehicleModel(garageVehicles[i].model) .. ' [' .. garageVehicles[i].plate .. ']', - value = garageVehicles[i] - }) + if #authorizedVehicles > 0 then + for k,vehicle in ipairs(authorizedVehicles) do + table.insert(shopElements, { + label = ('%s - %s'):format(vehicle.label, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))), + name = vehicle.label, + model = vehicle.model, + price = vehicle.price, + type = 'car' + }) + end + else + if #Config.AuthorizedVehicles['Shared'] == 0 then + return + end + end + elseif type == 'helicopter' then + shopCoords = Config.PoliceStations[station].Helicopters[partNum].InsideShop + local authorizedHelicopters = Config.AuthorizedHelicopters[PlayerData.job.grade_name] + + if #authorizedHelicopters > 0 then + for k,vehicle in ipairs(authorizedHelicopters) do + table.insert(shopElements, { + label = ('%s - %s'):format(vehicle.label, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))), + name = vehicle.label, + model = vehicle.model, + price = vehicle.price, + livery = vehicle.livery or nil, + type = 'helicopter' + }) + end + else + ESX.ShowNotification(_U('helicopter_notauthorized')) + return + end end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('vehicle_menu'), - align = 'top-left', - elements = elements - }, function(data, menu) - menu.close() + OpenShopMenu(shopElements, playerCoords, shopCoords) + elseif data.current.action == 'garage' then + local garage = {} - local vehicleProps = data.current.value - local foundSpawnPoint, spawnPoint = GetAvailableVehicleSpawnPoint(station, partNum) + ESX.TriggerServerCallback('esx_vehicleshop:retrieveJobVehicles', function(jobVehicles) + if #jobVehicles > 0 then + for k,v in ipairs(jobVehicles) do + local props = json.decode(v.vehicle) + local vehicleName = GetLabelText(GetDisplayNameFromVehicleModel(props.model)) + local label = ('%s - %s: '):format(vehicleName, props.plate) - if foundSpawnPoint then - ESX.Game.SpawnVehicle(vehicleProps.model, spawnPoint, spawnPoint.heading, function(vehicle) - ESX.Game.SetVehicleProperties(vehicle, vehicleProps) - TaskWarpPedIntoVehicle(PlayerPedId(), vehicle, -1) - end) - - TriggerServerEvent('esx_society:removeVehicleFromGarage', 'police', vehicleProps) - end - end, function(data, menu) - menu.close() - - CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = _U('vehicle_spawner') - CurrentActionData = {station = station, partNum = partNum} - end) - - end, 'police') - - else - - local elements = {} - - local sharedVehicles = Config.AuthorizedVehicles.Shared - for i=1, #sharedVehicles, 1 do - table.insert(elements, { label = sharedVehicles[i].label, model = sharedVehicles[i].model}) - end - - local authorizedVehicles = Config.AuthorizedVehicles[PlayerData.job.grade_name] - for i=1, #authorizedVehicles, 1 do - table.insert(elements, { label = authorizedVehicles[i].label, model = authorizedVehicles[i].model}) - end - - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', - { - title = _U('vehicle_menu'), - align = 'top-left', - elements = elements - }, function(data, menu) - menu.close() - - local foundSpawnPoint, spawnPoint = GetAvailableVehicleSpawnPoint(station, partNum) - - if foundSpawnPoint then - if Config.MaxInService == -1 then - ESX.Game.SpawnVehicle(data.current.model, spawnPoint, spawnPoint.heading, function(vehicle) - TaskWarpPedIntoVehicle(PlayerPedId(), vehicle, -1) - SetVehicleMaxMods(vehicle) - end) - else - - ESX.TriggerServerCallback('esx_service:isInService', function(isInService) - - if isInService then - ESX.Game.SpawnVehicle(data.current.model, spawnPoint, spawnPoint.heading, function(vehicle) - TaskWarpPedIntoVehicle(PlayerPedId(), vehicle, -1) - SetVehicleMaxMods(vehicle) - end) + if v.stored then + label = label .. ('%s'):format(_U('garage_stored')) else - ESX.ShowNotification(_U('service_not')) + label = label .. ('%s'):format(_U('garage_notstored')) end - end, 'police') + table.insert(garage, { + label = label, + stored = v.stored, + model = props.model, + vehicleProps = props + }) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_garage', { + title = _U('garage_title'), + align = 'top-left', + elements = garage + }, function(data2, menu2) + if data2.current.stored then + local foundSpawn, spawnPoint = GetAvailableVehicleSpawnPoint(station, part, partNum) + + if foundSpawn then + menu2.close() + + ESX.Game.SpawnVehicle(data2.current.model, spawnPoint.coords, spawnPoint.heading, function(vehicle) + ESX.Game.SetVehicleProperties(vehicle, data2.current.vehicleProps) + + TriggerServerEvent('esx_vehicleshop:setJobVehicleState', data2.current.vehicleProps.plate, false) + ESX.ShowNotification(_U('garage_released')) + end) + end + else + ESX.ShowNotification(_U('garage_notavailable')) + end + end, function(data2, menu2) + menu2.close() + end) + + else + ESX.ShowNotification(_U('garage_empty')) + end + end, type) + + elseif data.current.action == 'store_garage' then + StoreNearbyVehicle(playerCoords) + end + + end, function(data, menu) + menu.close() + end) + +end + +function StoreNearbyVehicle(playerCoords) + local vehicles, vehiclePlates = ESX.Game.GetVehiclesInArea(playerCoords, 30.0), {} + + if #vehicles > 0 then + for k,v in ipairs(vehicles) do + + -- Make sure the vehicle we're saving is empty, or else it wont be deleted + if GetVehicleNumberOfPassengers(v) == 0 and IsVehicleSeatFree(v, -1) then + table.insert(vehiclePlates, { + vehicle = v, + plate = ESX.Math.Trim(GetVehicleNumberPlateText(v)) + }) + end + end + else + ESX.ShowNotification(_U('garage_store_nearby')) + return + end + + ESX.TriggerServerCallback('esx_policejob:storeNearbyVehicle', function(storeSuccess, foundNum) + if storeSuccess then + local vehicleId = vehiclePlates[foundNum] + local attempts = 0 + ESX.Game.DeleteVehicle(vehicleId.vehicle) + IsBusy = true + + Citizen.CreateThread(function() + while IsBusy do + Citizen.Wait(0) + drawLoadingText(_U('garage_storing'), 255, 255, 255, 255) + end + end) + + -- Workaround for vehicle not deleting when other players are near it. + while DoesEntityExist(vehicleId.vehicle) do + Citizen.Wait(500) + attempts = attempts + 1 + + -- Give up + if attempts > 30 then + break + end + + vehicles = ESX.Game.GetVehiclesInArea(playerCoords, 30.0) + if #vehicles > 0 then + for k,v in ipairs(vehicles) do + if ESX.Math.Trim(GetVehicleNumberPlateText(v)) == vehicleId.plate then + ESX.Game.DeleteVehicle(v) + break + end + end end end - end, function(data, menu) - menu.close() - - CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = _U('vehicle_spawner') - CurrentActionData = {station = station, partNum = partNum} - end) - - end + IsBusy = false + ESX.ShowNotification(_U('garage_has_stored')) + else + ESX.ShowNotification(_U('garage_has_notstored')) + end + end, vehiclePlates) end -function GetAvailableVehicleSpawnPoint(station, partNum) - local spawnPoints = Config.PoliceStations[station].Vehicles[partNum].SpawnPoints +function GetAvailableVehicleSpawnPoint(station, part, partNum) + local spawnPoints = Config.PoliceStations[station][part][partNum].SpawnPoints local found, foundSpawnPoint = false, nil for i=1, #spawnPoints, 1 do @@ -426,6 +508,153 @@ function GetAvailableVehicleSpawnPoint(station, partNum) end end +function OpenShopMenu(elements, restoreCoords, shopCoords) + local playerPed = PlayerPedId() + isInShopMenu = true + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop', { + title = _U('vehicleshop_title'), + align = 'top-left', + elements = elements + }, function(data, menu) + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop_confirm', + { + title = _U('vehicleshop_confirm', data.current.name, data.current.price), + align = 'top-left', + elements = { + { label = _U('confirm_no'), value = 'no' }, + { label = _U('confirm_yes'), value = 'yes' } + } + }, function(data2, menu2) + + if data2.current.value == 'yes' then + local newPlate = exports['esx_vehicleshop']:GeneratePlate() + local vehicle = GetVehiclePedIsIn(playerPed, false) + local props = ESX.Game.GetVehicleProperties(vehicle) + props.plate = newPlate + + ESX.TriggerServerCallback('esx_policejob:buyJobVehicle', function (bought) + if bought then + ESX.ShowNotification(_U('vehicleshop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price))) + + isInShopMenu = false + ESX.UI.Menu.CloseAll() + + DeleteSpawnedVehicles() + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + + ESX.Game.Teleport(playerPed, restoreCoords) + else + ESX.ShowNotification(_U('vehicleshop_money')) + menu2.close() + end + end, props, data.current.type) + else + menu2.close() + end + + end, function(data2, menu2) + menu2.close() + end) + + end, function(data, menu) + isInShopMenu = false + ESX.UI.Menu.CloseAll() + + DeleteSpawnedVehicles() + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + + ESX.Game.Teleport(playerPed, restoreCoords) + end, function(data, menu) + DeleteSpawnedVehicles() + + WaitForVehicleToLoad(data.current.model) + ESX.Game.SpawnLocalVehicle(data.current.model, shopCoords, 0.0, function(vehicle) + table.insert(spawnedVehicles, vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + FreezeEntityPosition(vehicle, true) + + if data.current.livery then + SetVehicleModKit(vehicle, 0) + SetVehicleLivery(vehicle, data.current.livery) + end + end) + end) + + WaitForVehicleToLoad(elements[1].model) + ESX.Game.SpawnLocalVehicle(elements[1].model, shopCoords, 0.0, function(vehicle) + table.insert(spawnedVehicles, vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + FreezeEntityPosition(vehicle, true) + + if elements[1].livery then + SetVehicleModKit(vehicle, 0) + SetVehicleLivery(vehicle,elements[1].livery) + end + end) +end + +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if isInShopMenu then + DisableControlAction(0, 75, true) -- Disable exit vehicle + DisableControlAction(27, 75, true) -- Disable exit vehicle + else + Citizen.Wait(500) + end + end +end) + +function DeleteSpawnedVehicles() + while #spawnedVehicles > 0 do + local vehicle = spawnedVehicles[1] + ESX.Game.DeleteVehicle(vehicle) + table.remove(spawnedVehicles, 1) + end +end + +function WaitForVehicleToLoad(modelHash) + modelHash = (type(modelHash) == 'number' and modelHash or GetHashKey(modelHash)) + + if not HasModelLoaded(modelHash) then + RequestModel(modelHash) + + while not HasModelLoaded(modelHash) do + Citizen.Wait(0) + + DisableControlAction(0, Keys['TOP'], true) + DisableControlAction(0, Keys['DOWN'], true) + DisableControlAction(0, Keys['LEFT'], true) + DisableControlAction(0, Keys['RIGHT'], true) + DisableControlAction(0, 176, true) -- ENTER key + DisableControlAction(0, Keys['BACKSPACE'], true) + + drawLoadingText(_U('vehicleshop_awaiting_model'), 255, 255, 255, 255) + end + end +end + +function drawLoadingText(text, red, green, blue, alpha) + SetTextFont(4) + SetTextProportional(0) + SetTextScale(0.0, 0.5) + SetTextColour(red, green, blue, alpha) + SetTextDropShadow(0, 0, 0, 0, 255) + SetTextEdge(1, 0, 0, 0, 255) + SetTextDropShadow() + SetTextOutline() + SetTextCentre(true) + + BeginTextCommandDisplayText("STRING") + AddTextComponentSubstringPlayerName(text) + EndTextCommandDisplayText(0.5, 0.5) +end + function OpenPoliceActionsMenu() ESX.UI.Menu.CloseAll() @@ -1308,36 +1537,14 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu elseif part == 'VehicleSpawner' then CurrentAction = 'menu_vehicle_spawner' - CurrentActionMsg = _U('vehicle_spawner') - CurrentActionData = {station = station, partNum = partNum} + CurrentActionMsg = _U('garage_prompt') + CurrentActionData = {station = station, part = part, partNum = partNum} - elseif part == 'HelicopterSpawner' then + elseif part == 'Helicopters' then - local helicopters = Config.PoliceStations[station].Helicopters - - if not IsAnyVehicleNearPoint(helicopters[partNum].SpawnPoint, 3.0) then - ESX.Game.SpawnVehicle('polmav', helicopters[partNum].SpawnPoint, helicopters[partNum].Heading, function(vehicle) - SetVehicleModKit(vehicle, 0) - SetVehicleLivery(vehicle, 0) - end) - end - - elseif part == 'VehicleDeleter' then - - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - - if IsPedInAnyVehicle(playerPed, false) then - - local vehicle = GetVehiclePedIsIn(playerPed, false) - - if DoesEntityExist(vehicle) then - CurrentAction = 'delete_vehicle' - CurrentActionMsg = _U('store_vehicle') - CurrentActionData = {vehicle = vehicle} - end - - end + CurrentAction = 'Helicopters' + CurrentActionMsg = _U('helicopter_prompt') + CurrentActionData = {station = station, part = part, partNum = partNum} elseif part == 'BossActions' then @@ -1350,7 +1557,10 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu end) AddEventHandler('esx_policejob:hasExitedMarker', function(station, part, partNum) - ESX.UI.Menu.CloseAll() + if not isInShopMenu then + ESX.UI.Menu.CloseAll() + end + CurrentAction = nil end) @@ -1604,7 +1814,7 @@ end) Citizen.CreateThread(function() for k,v in pairs(Config.PoliceStations) do - local blip = AddBlipForCoord(v.Blip.Pos) + local blip = AddBlipForCoord(v.Blip.Coords) SetBlipSprite (blip, v.Blip.Sprite) SetBlipDisplay(blip, v.Blip.Display) @@ -1638,7 +1848,7 @@ Citizen.CreateThread(function() local distance = GetDistanceBetweenCoords(coords, v.Cloakrooms[i], true) if distance < Config.DrawDistance then - DrawMarker(20, v.Cloakrooms[i] + 1, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(20, v.Cloakrooms[i], 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) end if distance < Config.MarkerSize.x then @@ -1650,7 +1860,7 @@ Citizen.CreateThread(function() local distance = GetDistanceBetweenCoords(coords, v.Armories[i], true) if distance < Config.DrawDistance then - DrawMarker(21, v.Armories[i] + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(21, v.Armories[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) end if distance < Config.MarkerSize.x then @@ -1662,7 +1872,7 @@ Citizen.CreateThread(function() local distance = GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner, true) if distance < Config.DrawDistance then - DrawMarker(36, v.Vehicles[i].Spawner + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(36, v.Vehicles[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) end if distance < Config.MarkerSize.x then @@ -1673,20 +1883,12 @@ Citizen.CreateThread(function() for i=1, #v.Helicopters, 1 do local distance = GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner, true) - if distance < Config.MarkerSize.x then - isInMarker, currentStation, currentPart, currentPartNum = true, k, 'HelicopterSpawner', i - end - end - - for i=1, #v.VehicleDeleters, 1 do - local distance = GetDistanceBetweenCoords(coords, v.VehicleDeleters[i], true) - if distance < Config.DrawDistance then - DrawMarker(Config.MarkerType, v.VehicleDeleters[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false) + DrawMarker(34, v.Helicopters[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) end if distance < Config.MarkerSize.x then - isInMarker, currentStation, currentPart, currentPartNum = true, k, 'VehicleDeleter', i + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Helicopters', i end end @@ -1805,17 +2007,28 @@ Citizen.CreateThread(function() ESX.ShowNotification(_U('service_not')) end elseif CurrentAction == 'menu_vehicle_spawner' then - OpenVehicleSpawnerMenu(CurrentActionData.station, CurrentActionData.partNum) - elseif CurrentAction == 'delete_vehicle' then - if Config.EnableSocietyOwnedVehicles then - local vehicleProps = ESX.Game.GetVehicleProperties(CurrentActionData.vehicle) - TriggerServerEvent('esx_society:putVehicleInGarage', 'police', vehicleProps) + if Config.MaxInService == -1 then + OpenVehicleSpawnerMenu('car', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) + elseif playerInService then + OpenVehicleSpawnerMenu('car', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) + else + ESX.ShowNotification(_U('service_not')) end + elseif CurrentAction == 'Helicopters' then + if Config.MaxInService == -1 then + OpenVehicleSpawnerMenu('helicopter', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) + elseif playerInService then + OpenVehicleSpawnerMenu('helicopter', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) + else + ESX.ShowNotification(_U('service_not')) + end + elseif CurrentAction == 'delete_vehicle' then ESX.Game.DeleteVehicle(CurrentActionData.vehicle) elseif CurrentAction == 'menu_boss_actions' then ESX.UI.Menu.CloseAll() TriggerEvent('esx_society:openBossMenu', 'police', function(data, menu) menu.close() + CurrentAction = 'menu_boss_actions' CurrentActionMsg = _U('open_bossmenu') CurrentActionData = {} diff --git a/config.lua b/config.lua index 023c3339..57c0d52d 100644 --- a/config.lua +++ b/config.lua @@ -32,16 +32,17 @@ Config.PoliceStations = { }, Cloakrooms = { - vector3(452.6, -992.8, 29.7) + vector3(452.6, -992.8, 30.6) }, Armories = { - vector3(451.0, -980.7, 29.6) + vector3(451.7, -980.1, 30.6) }, Vehicles = { { - Spawner = vector3(454.6, -1017.4, 27.4), + Spawner = vector3(454.6, -1017.4, 28.4), + InsideShop = vector3(228.5, -993.5, -99.5), SpawnPoints = { { coords = vector3(438.4, -1018.3, 27.7), heading = 90.0, radius = 6.0 }, { coords = vector3(441.0, -1024.2, 28.3), heading = 90.0, radius = 6.0 }, @@ -52,6 +53,7 @@ Config.PoliceStations = { { Spawner = vector3(473.3, -1018.4, 27.0), + InsideShop = vector3(228.5, -993.5, -99.0), SpawnPoints = { { coords = vector3(475.9, -1021.6, 28.0), heading = 276.1, radius = 6.0 }, { coords = vector3(484.1, -1023.1, 27.5), heading = 302.5, radius = 6.0 } @@ -61,20 +63,16 @@ Config.PoliceStations = { Helicopters = { { - Spawner = vector3(466.4, -982.8, 42.6), - SpawnPoint = vector3(450.0, -981.1, 42.6), - Heading = 0.0 + Spawner = vector3(461.1, -981.5, 43.6), + InsideShop = vector3(477.0, -1106.4, 43.0), + SpawnPoints = { + { coords = vector3(449.5, -981.2, 43.6), heading = 92.6, radius = 10.0 } + } } }, - VehicleDeleters = { - vector3(462.7, -1014.4, 27.0), - vector3(462.4, -1019.7, 27.1), - vector3(469.1, -1024.5, 27.2) - }, - BossActions = { - vector3(448.4, -973.2, 29.6) + vector3(448.4, -973.2, 30.6) } } @@ -143,17 +141,17 @@ Config.AuthorizedWeapons = { } } - --- https://wiki.rage.mp/index.php?title=Vehicles Config.AuthorizedVehicles = { Shared = { { model = 'police', - label = 'Police Cruiser' + label = 'Police Cruiser', + price = 10000 }, { model = 'pbus', - label = 'Police Prison Bus' + label = 'Police Prison Bus', + price = 5000 } }, @@ -164,18 +162,21 @@ Config.AuthorizedVehicles = { officer = { { model = 'police3', - label = 'Police Interceptor' + label = 'Police Interceptor', + price = 20000 } }, sergeant = { { model = 'policet', - label = 'Police Transporter' + label = 'Police Transporter', + price = 18500 }, { model = 'policeb', - label = 'Police Bike' + label = 'Police Bike', + price = 30500 } }, @@ -186,11 +187,13 @@ Config.AuthorizedVehicles = { lieutenant = { { model = 'riot', - label = 'Police Riot' + label = 'Police Riot', + price = 70000 }, { model = 'fbi2', - label = 'FIB SUV' + label = 'FIB SUV', + price = 60000 } }, @@ -203,6 +206,42 @@ Config.AuthorizedVehicles = { } } +Config.AuthorizedHelicopters = { + recruit = {}, + + officer = {}, + + sergeant = {}, + + intendent = {}, + + lieutenant = { + { + model = 'polmav', + label = 'Police Maverick', + livery = 0, + price = 200000 + } + }, + + chef = { + { + model = 'polmav', + label = 'Police Maverick', + livery = 0, + price = 150000 + } + }, + + boss = { + { + model = 'polmav', + label = 'Police Maverick', + livery = 0, + price = 100000 + } + } +} -- CHECK SKINCHANGER CLIENT MAIN.LUA for matching elements diff --git a/locales/br.lua b/locales/br.lua index fb819143..9f040eab 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -26,10 +26,33 @@ Locales['br'] = { ['get_weapon_menu'] = 'armory - Withdraw Weapon', ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles - ['vehicle_menu'] = 'Veículo', - ['vehicle_blocked'] = 'Já existe um carro fora da garagem', - ['vehicle_spawner'] = 'Pressione ~INPUT_CONTEXT~ para escolher um veículo', - ['store_vehicle'] = 'Pressione ~INPUT_CONTEXT~ para guardar o veículo', + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', -- Service ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', diff --git a/locales/de.lua b/locales/de.lua index 8e6c64ec..2f5a9b07 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -26,10 +26,33 @@ Locales['de'] = { ['get_weapon_menu'] = 'armory - Withdraw Weapon', ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles - ['vehicle_menu'] = 'Fahrzeug', - ['vehicle_blocked'] = 'es ist bereits ein Fahrzeug draussen', - ['vehicle_spawner'] = 'Drücke ~INPUT_CONTEXT~ um ein Fahrzeug zu holen', - ['store_vehicle'] = 'Drücke ~INPUT_CONTEXT~ um das Fahrzeug zu parken', + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', -- Service ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', diff --git a/locales/en.lua b/locales/en.lua index e98e712c..69a6b496 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -28,8 +28,31 @@ Locales['en'] = { -- Vehicles ['vehicle_menu'] = 'vehicle', ['vehicle_blocked'] = 'all available spawn points are currently blocked!', - ['vehicle_spawner'] = 'press ~INPUT_CONTEXT~ to take out a vehicle', - ['store_vehicle'] = 'press ~INPUT_CONTEXT~ to store the vehicle', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', -- Service ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', diff --git a/locales/es.lua b/locales/es.lua index bb3ff8ae..202b444e 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -26,10 +26,33 @@ Locales['es'] = { ['get_weapon_menu'] = 'armory - Withdraw Weapon', ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles - ['vehicle_menu'] = 'Vehículo', - ['vehicle_blocked'] = 'Ya tienes un vehículo fuera', - ['vehicle_spawner'] = 'Presionar ~INPUT_CONTEXT~ para sacar un vehículo', - ['store_vehicle'] = 'Presionar ~INPUT_CONTEXT~ para guardar un vehículo', + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', -- Service ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', diff --git a/locales/fi.lua b/locales/fi.lua index b58e9fad..89fce3ff 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -26,10 +26,33 @@ Locales['fi'] = { ['get_weapon_menu'] = 'armory - Withdraw Weapon', ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles - ['vehicle_menu'] = 'ajoneuvo', - ['vehicle_blocked'] = 'ajoneuvo on jo ulkona tallista', - ['vehicle_spawner'] = 'paina ~INPUT_CONTEXT~ ottaaksesi auton ulos', - ['store_vehicle'] = 'paina ~INPUT_CONTEXT~ laittaaksesi auto talliin', + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', -- Service ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', diff --git a/locales/fr.lua b/locales/fr.lua index cd427fe4..f1459b1d 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -26,10 +26,33 @@ Locales['fr'] = { ['get_weapon_menu'] = 'armory - Withdraw Weapon', ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles - ['vehicle_menu'] = 'véhicule', - ['vehicle_blocked'] = 'il y a déja un véhicule de sorti', - ['vehicle_spawner'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir un véhicule', - ['store_vehicle'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule', + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', -- Service ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', diff --git a/locales/pl.lua b/locales/pl.lua index aa4e32ec..3ce1d255 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -26,10 +26,33 @@ Locales['pl'] = { ['get_weapon_menu'] = 'armory - Withdraw Weapon', ['put_weapon_menu'] = 'armory - Store Weapon', -- Vehicles - ['vehicle_menu'] = 'pojazdy', - ['vehicle_blocked'] = 'masz już pojazd poza garażem', - ['vehicle_spawner'] = 'naciśnij ~INPUT_CONTEXT~ żeby wziąć pojazd', - ['store_vehicle'] = 'naciśnij ~INPUT_CONTEXT~ żeby przechować pojazd', + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', -- Service ['service_max'] = 'nie możesz wejść do służby, maksymalna liczba oficerów w służbie: %s/%s', ['service_not'] = 'nie rozpoczynasz służby! Najpierw musisz się przebrać.', diff --git a/locales/sv.lua b/locales/sv.lua index 1c99ab88..963e91e6 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -26,10 +26,33 @@ Locales['sv'] = { ['get_weapon_menu'] = 'vapenförråd - Ta ut vapen', ['put_weapon_menu'] = 'vapenförråd - Spara vapen', -- Vehicles - ['vehicle_menu'] = 'bilar', - ['vehicle_blocked'] = 'alla tillgänliga spawn points är blockerade!', - ['vehicle_spawner'] = 'tryck ~INPUT_CONTEXT~ för att ta ut en bil', - ['store_vehicle'] = 'tryck ~INPUT_CONTEXT~ för att parkera bilen', + ['vehicle_menu'] = 'vehicle', + ['vehicle_blocked'] = 'all available spawn points are currently blocked!', + ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', + ['garage_title'] = 'vehicle Actions', + ['garage_stored'] = 'stored', + ['garage_notstored'] = 'not in garage', + ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', + ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['garage_has_notstored'] = 'no nearby owned vehicles were found', + ['garage_notavailable'] = 'your vehicle is not stored in the garage.', + ['garage_blocked'] = 'there\'s no available spawn points!', + ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_released'] = 'your vehicle has been released from the garage.', + ['garage_store_nearby'] = 'there is no nearby vehicles.', + ['garage_storeditem'] = 'open garage', + ['garage_storeitem'] = 'store vehicle in garage', + ['garage_buyitem'] = 'vehicle shop', + ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', + ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'vehicle Shop', + ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_money'] = 'you cannot afford that vehicle', + ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['confirm_no'] = 'no', + ['confirm_yes'] = 'yes', -- Service ['service_max'] = 'du kan inte gå tjänst, poliser i tjänst: %s/%s', ['service_not'] = 'du är inte i tjänst! Byt om för att gå in i tjänst.', diff --git a/server/main.lua b/server/main.lua index fc41a027..5e249f67 100644 --- a/server/main.lua +++ b/server/main.lua @@ -424,6 +424,100 @@ ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weapo end end) + +ESX.RegisterServerCallback('esx_policejob: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 + print(('esx_policejob: %s attempted to exploit the shop! (invalid vehicle model)'):format(xPlayer.identifier)) + cb(false) + end + + if xPlayer.getMoney() >= price then + xPlayer.removeMoney(price) + + 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 (rowsChanged) + cb(true) + end) + else + cb(false) + end +end) + +ESX.RegisterServerCallback('esx_policejob: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 + print(('esx_policejob: %s has exploited the garage!'):format(xPlayer.identifier)) + cb(false) + else + cb(true, foundNum) + end + end) + end + +end) + +function getPriceFromHash(hashKey, jobGrade, type) + if type == 'helicopter' then + local vehicles = Config.AuthorizedHelicopters[jobGrade] + + for k,v in ipairs(vehicles) do + if GetHashKey(v.model) == hashKey then + return v.price + end + end + elseif type == 'car' then + local vehicles = Config.AuthorizedVehicles[jobGrade] + local shared = Config.AuthorizedVehicles['Shared'] + + for k,v in ipairs(vehicles) do + if GetHashKey(v.model) == hashKey then + return v.price + end + end + + for k,v in ipairs(shared) do + if GetHashKey(v.model) == hashKey then + return v.price + end + end + end + + return 0 +end + ESX.RegisterServerCallback('esx_policejob:getStockItems', function(source, cb) TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) cb(inventory.items) From 5b3c553e667e1166cf24c7c0023129b049ac48c2 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 2 Jan 2019 20:17:39 +0100 Subject: [PATCH 191/253] Fresh playerdata when opening shop --- client/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/client/main.lua b/client/main.lua index 5139e504..518250d7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1264,6 +1264,7 @@ function OpenBuyWeaponsMenu() local elements = {} local playerPed = PlayerPedId() + PlayerData = ESX.GetPlayerData() for k,v in ipairs(Config.AuthorizedWeapons[PlayerData.job.grade_name]) do local weaponNum, weapon = ESX.GetWeapon(v.weapon) From 76a06abc78dd82f5b9891b4c43480817c49c23cd Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 3 Jan 2019 13:16:13 +0100 Subject: [PATCH 192/253] Fixed #223 --- client/main.lua | 15 +++++++++------ server/main.lua | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/client/main.lua b/client/main.lua index 518250d7..68b1d3ad 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1106,10 +1106,13 @@ function ShowPlayerLicense(player) local elements = {} local targetName ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - if data.licenses ~= nil then + if data.licenses then for i=1, #data.licenses, 1 do - if data.licenses[i].label ~= nil and data.licenses[i].type ~= nil then - table.insert(elements, {label = data.licenses[i].label, value = data.licenses[i].type}) + if data.licenses[i].label and data.licenses[i].type then + table.insert(elements, { + label = data.licenses[i].label, + type = data.licenses[i].type + }) end end end @@ -1129,7 +1132,7 @@ function ShowPlayerLicense(player) ESX.ShowNotification(_U('licence_you_revoked', data.current.label, targetName)) TriggerServerEvent('esx_policejob:message', GetPlayerServerId(player), _U('license_revoked', data.current.label)) - TriggerServerEvent('esx_license:removeLicense', GetPlayerServerId(player), data.current.value) + TriggerServerEvent('esx_license:removeLicense', GetPlayerServerId(player), data.current.type) ESX.SetTimeout(300, function() ShowPlayerLicense(player) @@ -1535,7 +1538,7 @@ AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNu CurrentActionMsg = _U('open_armory') CurrentActionData = {station = station} - elseif part == 'VehicleSpawner' then + elseif part == 'Vehicles' then CurrentAction = 'menu_vehicle_spawner' CurrentActionMsg = _U('garage_prompt') @@ -1877,7 +1880,7 @@ Citizen.CreateThread(function() end if distance < Config.MarkerSize.x then - isInMarker, currentStation, currentPart, currentPartNum = true, k, 'VehicleSpawner', i + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Vehicles', i end end diff --git a/server/main.lua b/server/main.lua index 5e249f67..0836c797 100644 --- a/server/main.lua +++ b/server/main.lua @@ -233,7 +233,7 @@ end) ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, plate) - MySQL.Async.fetchAll('SELECT * FROM owned_vehicles WHERE @plate = plate', { + MySQL.Async.fetchAll('SELECT owner FROM owned_vehicles WHERE plate = @plate', { ['@plate'] = plate }, function(result) From b22d49e0d87fb6d2c13221274efd152253684418 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 4 Jan 2019 13:00:50 +0100 Subject: [PATCH 193/253] Fixed #220 --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 0836c797..5e9417e0 100644 --- a/server/main.lua +++ b/server/main.lua @@ -438,7 +438,7 @@ ESX.RegisterServerCallback('esx_policejob:buyJobVehicle', function(source, cb, v if xPlayer.getMoney() >= price then xPlayer.removeMoney(price) - MySQL.Async.execute('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job, stored) VALUES (@owner, @vehicle, @plate, @type, @job, @stored)', { + 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, From cc371bad9f2eac8d4d7045c734011c4f8d09f660 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 4 Jan 2019 13:26:07 +0100 Subject: [PATCH 194/253] Only surround reserved with backtick --- server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index 5e9417e0..aa457a41 100644 --- a/server/main.lua +++ b/server/main.lua @@ -438,7 +438,7 @@ ESX.RegisterServerCallback('esx_policejob:buyJobVehicle', function(source, cb, v if xPlayer.getMoney() >= price then xPlayer.removeMoney(price) - MySQL.Async.execute('INSERT INTO owned_vehicles (`owner`, `vehicle`, `plate`, `type`, `job`, `stored`) VALUES (@owner, @vehicle, @plate, @type, @job, @stored)', { + 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, @@ -473,7 +473,7 @@ ESX.RegisterServerCallback('esx_policejob:storeNearbyVehicle', function(source, 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', { + 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 From 97a38960204e1685e0a4eff9515bd09da97c9dbf Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 11 Jan 2019 22:53:47 +0100 Subject: [PATCH 195/253] Sleep loop if it's OK --- client/main.lua | 22 +++++++++++++++------- config.lua | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/client/main.lua b/client/main.lua index 68b1d3ad..6ed5f4b7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1713,18 +1713,17 @@ end) RegisterNetEvent('esx_policejob:putInVehicle') AddEventHandler('esx_policejob:putInVehicle', function() local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) + local coords = GetEntityCoords(playerPed) if not IsHandcuffed then return end - if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then - local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71) + if IsAnyVehicleNearPoint(coords, 5.0) then + local vehicle = GetClosestVehicle(coords, 5.0, 0, 71) if DoesEntityExist(vehicle) then - local maxSeats = GetVehicleMaxNumberOfPassengers(vehicle) - local freeSeat = nil + local maxSeats, freeSeat = GetVehicleMaxNumberOfPassengers(vehicle) for i=maxSeats - 1, 0, -1 do if IsVehicleSeatFree(vehicle, i) then @@ -1733,7 +1732,7 @@ AddEventHandler('esx_policejob:putInVehicle', function() end end - if freeSeat ~= nil then + if freeSeat then TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) DragStatus.IsDragged = false end @@ -1843,7 +1842,7 @@ Citizen.CreateThread(function() local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) - local isInMarker, hasExited = false, false + local isInMarker, hasExited, letSleep = false, false, true local currentStation, currentPart, currentPartNum for k,v in pairs(Config.PoliceStations) do @@ -1853,6 +1852,7 @@ Citizen.CreateThread(function() if distance < Config.DrawDistance then DrawMarker(20, v.Cloakrooms[i], 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + letSleep = false end if distance < Config.MarkerSize.x then @@ -1865,6 +1865,7 @@ Citizen.CreateThread(function() if distance < Config.DrawDistance then DrawMarker(21, v.Armories[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + letSleep = false end if distance < Config.MarkerSize.x then @@ -1877,6 +1878,7 @@ Citizen.CreateThread(function() if distance < Config.DrawDistance then DrawMarker(36, v.Vehicles[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + letSleep = false end if distance < Config.MarkerSize.x then @@ -1889,6 +1891,7 @@ Citizen.CreateThread(function() if distance < Config.DrawDistance then DrawMarker(34, v.Helicopters[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + letSleep = false end if distance < Config.MarkerSize.x then @@ -1902,6 +1905,7 @@ Citizen.CreateThread(function() if distance < Config.DrawDistance then DrawMarker(22, v.BossActions[i] + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + letSleep = false end if distance < Config.MarkerSize.x then @@ -1933,6 +1937,10 @@ Citizen.CreateThread(function() TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) end + if letSleep then + Citizen.Wait(500) + end + end else diff --git a/config.lua b/config.lua index 57c0d52d..533a2363 100644 --- a/config.lua +++ b/config.lua @@ -52,7 +52,7 @@ Config.PoliceStations = { }, { - Spawner = vector3(473.3, -1018.4, 27.0), + Spawner = vector3(473.3, -1018.8, 28.0), InsideShop = vector3(228.5, -993.5, -99.0), SpawnPoints = { { coords = vector3(475.9, -1021.6, 28.0), heading = 276.1, radius = 6.0 }, From adea5f713b1888f89e666d42847441de77996eb9 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 18 Jan 2019 10:36:39 +0100 Subject: [PATCH 196/253] Fixed #223 --- client/main.lua | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/client/main.lua b/client/main.lua index 6ed5f4b7..8b798dc2 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1913,34 +1913,34 @@ Citizen.CreateThread(function() end end end + end - if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum)) then + if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum)) then - if - (LastStation ~= nil and LastPart ~= nil and LastPartNum ~= nil) and - (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) - then - TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) - hasExited = true - end - - HasAlreadyEnteredMarker = true - LastStation = currentStation - LastPart = currentPart - LastPartNum = currentPartNum - - TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) - end - - if not hasExited and not isInMarker and HasAlreadyEnteredMarker then - HasAlreadyEnteredMarker = false + if + (LastStation ~= nil and LastPart ~= nil and LastPartNum ~= nil) and + (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) + then TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) + hasExited = true end - if letSleep then - Citizen.Wait(500) - end + HasAlreadyEnteredMarker = true + LastStation = currentStation + LastPart = currentPart + LastPartNum = currentPartNum + TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) + + end + + if not hasExited and not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) + end + + if letSleep then + Citizen.Wait(500) end else From afa462ead3f804e6f78a59632b0f8a4639f488b3 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 21 Feb 2019 12:19:23 +0100 Subject: [PATCH 197/253] Simplified config --- config.lua | 63 +++++++++--------------------------------------------- 1 file changed, 10 insertions(+), 53 deletions(-) diff --git a/config.lua b/config.lua index 533a2363..d7712724 100644 --- a/config.lua +++ b/config.lua @@ -143,16 +143,8 @@ Config.AuthorizedWeapons = { Config.AuthorizedVehicles = { Shared = { - { - model = 'police', - label = 'Police Cruiser', - price = 10000 - }, - { - model = 'pbus', - label = 'Police Prison Bus', - price = 5000 - } + { model = 'police', label = 'Police Cruiser', price = 10000 }, + { model = 'pbus', label = 'Police Prison Bus', price = 5000 } }, recruit = { @@ -160,24 +152,12 @@ Config.AuthorizedVehicles = { }, officer = { - { - model = 'police3', - label = 'Police Interceptor', - price = 20000 - } + { model = 'police3', label = 'Police Interceptor', price = 20000 } }, sergeant = { - { - model = 'policet', - label = 'Police Transporter', - price = 18500 - }, - { - model = 'policeb', - label = 'Police Bike', - price = 30500 - } + { model = 'policet', label = 'Police Transporter', price = 18500 }, + { model = 'policeb', label = 'Police Bike', price = 30500 } }, intendent = { @@ -185,16 +165,8 @@ Config.AuthorizedVehicles = { }, lieutenant = { - { - model = 'riot', - label = 'Police Riot', - price = 70000 - }, - { - model = 'fbi2', - label = 'FIB SUV', - price = 60000 - } + { model = 'riot', label = 'Police Riot', price = 70000 }, + { model = 'fbi2', label = 'FIB SUV', price = 60000 } }, chef = { @@ -216,30 +188,15 @@ Config.AuthorizedHelicopters = { intendent = {}, lieutenant = { - { - model = 'polmav', - label = 'Police Maverick', - livery = 0, - price = 200000 - } + { model = 'polmav', label = 'Police Maverick', livery = 0, price = 200000 } }, chef = { - { - model = 'polmav', - label = 'Police Maverick', - livery = 0, - price = 150000 - } + { model = 'polmav', label = 'Police Maverick', livery = 0, price = 150000 } }, boss = { - { - model = 'polmav', - label = 'Police Maverick', - livery = 0, - price = 100000 - } + { model = 'polmav', label = 'Police Maverick', livery = 0, price = 100000 } } } From fa980cf824c5a3c010cf991722b422dd0c28c48d Mon Sep 17 00:00:00 2001 From: Oldarorn <36448848+Oldarorn@users.noreply.github.com> Date: Thu, 21 Feb 2019 15:52:40 +0100 Subject: [PATCH 198/253] Update fr.lua --- locales/fr.lua | 116 ++++++++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/locales/fr.lua b/locales/fr.lua index f1459b1d..c39d9300 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -18,49 +18,49 @@ Locales['fr'] = { ['armory_owned'] = 'owned', ['armory_free'] = 'free', ['armory_item'] = '$%s', - ['armory_weapontitle'] = 'armory - Buy weapon', - ['armory_componenttitle'] = 'armory - Weapon attatchments', - ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', - ['armory_money'] = 'you cannot afford that weapon', - ['armory_hascomponent'] = 'you have that attatchment equiped!', - ['get_weapon_menu'] = 'armory - Withdraw Weapon', - ['put_weapon_menu'] = 'armory - Store Weapon', + ['armory_weapontitle'] = 'armurerie - Acheter une arme', + ['armory_componenttitle'] = 'armurerie - Accessoires d\'armes', + ['armory_bought'] = 'vous achetez un ~y~%s~s~ pour ~r~$%s~s~', + ['armory_money'] = 'vous ne pouvez pas acheter cette arme', + ['armory_hascomponent'] = 'vous avez cet accessoire équipé!', + ['get_weapon_menu'] = 'armurerie - Retirer arme', + ['put_weapon_menu'] = 'armurerie - Stocker arme', -- Vehicles - ['vehicle_menu'] = 'vehicle', - ['vehicle_blocked'] = 'all available spawn points are currently blocked!', - ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', - ['garage_title'] = 'vehicle Actions', - ['garage_stored'] = 'stored', - ['garage_notstored'] = 'not in garage', - ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', - ['garage_has_stored'] = 'the vehicle has been stored in your garage', - ['garage_has_notstored'] = 'no nearby owned vehicles were found', - ['garage_notavailable'] = 'your vehicle is not stored in the garage.', - ['garage_blocked'] = 'there\'s no available spawn points!', - ['garage_empty'] = 'you dont have any vehicles in your garage.', - ['garage_released'] = 'your vehicle has been released from the garage.', - ['garage_store_nearby'] = 'there is no nearby vehicles.', - ['garage_storeditem'] = 'open garage', - ['garage_storeitem'] = 'store vehicle in garage', - ['garage_buyitem'] = 'vehicle shop', - ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', - ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', + ['vehicle_menu'] = 'véhicule', + ['vehicle_blocked'] = 'tous les points de spawn sont bloqués!', + ['garage_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder aux ~y~Actions Véhicule~s~.', + ['garage_title'] = 'actions Véhicules', + ['garage_stored'] = 'rangé', + ['garage_notstored'] = 'sorti(e)', + ['garage_storing'] = 'tentative de suppression du véhicule, assurez-vous que personne ne soit autour.', + ['garage_has_stored'] = 'le véhicule a bien été rangé dans le garage', + ['garage_has_notstored'] = 'aucun véhicule dans le garage', + ['garage_notavailable'] = 'votre véhicule n\'est pas rangé dans le garage.', + ['garage_blocked'] = 'la sortie du garage est obstruée!', + ['garage_empty'] = 'vous n\'avez aucun véhicule dans le garage.', + ['garage_released'] = 'votre véhicule a été sorti.', + ['garage_store_nearby'] = 'aucun véhicule a proximité.', + ['garage_storeditem'] = 'ouvrir le garage', + ['garage_storeitem'] = 'ranger le véhicule', + ['garage_buyitem'] = 'magasin véhicule', + ['helicopter_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder aux ~y~Actions de l\'hélicoptère~s~.', + ['helicopter_notauthorized'] = 'vous n\'êtes pas autorisé à acheter un hélicoptère.', ['shop_item'] = '$%s', - ['vehicleshop_title'] = 'vehicle Shop', - ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', - ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', - ['vehicleshop_money'] = 'you cannot afford that vehicle', - ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', - ['confirm_no'] = 'no', - ['confirm_yes'] = 'yes', + ['vehicleshop_title'] = 'magasin véhicule', + ['vehicleshop_confirm'] = 'voulez-vous acheter ce véhicule?', + ['vehicleshop_bought'] = 'vous avez acheté ~y~%s~s~ pour ~r~$%s~s~', + ['vehicleshop_money'] = 'vous ne pouvez pas acheter ce véhicule', + ['vehicleshop_awaiting_model'] = 'le véhicule est actuellement en ~g~PRÉPARATION~s~ veuillez patienter', + ['confirm_no'] = 'non', + ['confirm_yes'] = 'oui', -- Service - ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', - ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', - ['service_anonunce'] = 'service information', - ['service_in'] = 'you\'ve entered service, welcome!', - ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', - ['service_out'] = 'you have left service.', - ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', + ['service_max'] = 'vous ne pouvez pas entrer en service, officiers en service: %s/%s', + ['service_not'] = 'vous n\'êtes pas en service! Vous devez d\'abord enfiler votre tenue.', + ['service_anonunce'] = 'prise de service', + ['service_in'] = 'vous êtes en service, bon courage!', + ['service_in_announce'] = 'l\'officier ~y~%s~s~ est entré en service!', + ['service_out'] = 'vous avez terminé votre service.', + ['service_out_announce'] = 'l\'officier ~y~%s~s~ a quitté son service.', -- Action Menu ['citizen_interaction'] = 'interaction citoyen', ['vehicle_interaction'] = 'interaction véhicule', @@ -73,13 +73,13 @@ Locales['fr'] = { ['put_in_vehicle'] = 'mettre dans véhicule', ['out_the_vehicle'] = 'sortir du véhicule', ['fine'] = 'Amende', - ['unpaid_bills'] = 'manage unpaid bills', + ['unpaid_bills'] = 'gérer les amendes impayées', ['license_check'] = 'gérer les licences', ['license_revoke'] = 'révoquer la licence', ['license_revoked'] = 'votre ~b~%s~s~ a été ~y~révoqué~s~!', ['licence_you_revoked'] = 'vous avez révoqué un ~b~%s~s~ qui appartenait à ~y~%s~s~', ['no_players_nearby'] = 'aucun joueur à proximité', - ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', + ['being_searched'] = 'vous êtes ~y~recherché(e)~s~ par la ~b~Police~s~', -- Vehicle interaction ['vehicle_info'] = 'infos véhicule', ['pick_lock'] = 'crocheter véhicule', @@ -103,16 +103,16 @@ Locales['fr'] = { ['box'] = 'caisse', ['cash'] = 'caisse', -- ID Card Menu - ['name'] = 'name: %s', - ['job'] = 'job: %s', - ['sex'] = 'sex: %s', + ['name'] = 'non: %s', + ['job'] = 'métier: %s', + ['sex'] = 'sexe: %s', ['dob'] = 'DOB: %s', - ['height'] = 'height: %s', + ['height'] = 'taille: %s', ['id'] = 'ID: %s', ['bac'] = 'BAC: %s', ['unknown'] = 'unknown', - ['male'] = 'male', - ['female'] = 'female', + ['male'] = 'homme', + ['female'] = 'femme', -- Body Search Menu ['guns_label'] = '--- Armes ---', ['inventory_label'] = '--- Inventaire ---', @@ -121,12 +121,12 @@ Locales['fr'] = { ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'confisquer %sx %s', ['confiscate_dirty'] = 'confisquer argent sale: €%s', - ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', - ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', - ['you_confiscated_account'] = 'you confiscated ~g~€%s~s~ (%s) from ~b~%s~s~', - ['got_confiscated_account'] = '~g~€%s~s~ (%s) was confiscated by ~y~%s~s~', - ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', - ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', + ['you_confiscated'] = 'vous avez confisqué ~y~%sx~s~ ~b~%s~s~ à ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ ont été confisqués par ~y~%s~s~', + ['you_confiscated_account'] = 'vous avez confisqué ~g~$%s~s~ (%s) à ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) ont été confisqués par ~y~%s~s~', + ['you_confiscated_weapon'] = 'vous avez confisqué ~b~%s~s~ à ~b~%s~s~ avec ~o~%s~s~ balles', + ['got_confiscated_weapon'] = 'votre ~b~%s~s~ avec ~o~%s~s~ balles a été confisqué par ~y~%s~s~', ['traffic_offense'] = 'code de la route', ['minor_offense'] = 'délit mineur', ['average_offense'] = 'délit moyen', @@ -139,15 +139,15 @@ Locales['fr'] = { -- Boss Menu ['open_bossmenu'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir le menu', ['quantity_invalid'] = 'quantité invalide', - ['have_withdrawn'] = 'you have withdrawn ~y~%sx~s~ ~b~%s~s~', - ['have_deposited'] = 'you have deposited ~y~%sx~s~ ~b~%s~s~', + ['have_withdrawn'] = 'vous avez retiré ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'vous avez déposé ~y~%sx~s~ ~b~%s~s~', ['quantity'] = 'quantité', ['inventory'] = 'inventaire', - ['police_stock'] = 'police Stock', + ['police_stock'] = 'stock Police', -- Misc ['remove_prop'] = 'appuyez sur ~INPUT_CONTEXT~ pour enlever l\'objet', ['map_blip'] = 'Commissariat', - ['unrestrained_timer'] = 'you feel your handcuffs slowly losing grip and fading away.', + ['unrestrained_timer'] = 'vous sentez que vos entraves se relachent.', -- Notifications ['alert_police'] = 'alerte police', ['phone_police'] = 'police', From 1abbccec4564fd60929b0964aac505efdbdab254 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 28 Feb 2019 11:44:10 +0100 Subject: [PATCH 199/253] Fixed boss menu --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 8b798dc2..6e8a34e3 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1904,7 +1904,7 @@ Citizen.CreateThread(function() local distance = GetDistanceBetweenCoords(coords, v.BossActions[i], true) if distance < Config.DrawDistance then - DrawMarker(22, v.BossActions[i] + 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(22, v.BossActions[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) letSleep = false end From d27f48b5597e304c805c308e1a113045744835de Mon Sep 17 00:00:00 2001 From: Sojobo Date: Sat, 2 Mar 2019 14:22:20 +0000 Subject: [PATCH 200/253] Fix attachment pricing in armory --- server/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/main.lua b/server/main.lua index aa457a41..2b23fe41 100644 --- a/server/main.lua +++ b/server/main.lua @@ -403,14 +403,14 @@ ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weapo -- Weapon Component elseif type == 2 then - local price = selectedWeapon.components[weaponComponent] + local price = selectedWeapon.components[componentNum] local weaponNum, weapon = ESX.GetWeapon(weaponName) local component = weapon.components[componentNum] if component then - if xPlayer.getMoney() >= selectedWeapon.price then - xPlayer.removeMoney(selectedWeapon.price) + if xPlayer.getMoney() >= price then + xPlayer.removeMoney(price) xPlayer.addWeaponComponent(weaponName, component.name) cb(true) From b16e1799eb473393b2efa153eef460f68ddbbe47 Mon Sep 17 00:00:00 2001 From: Oldarorn <36448848+Oldarorn@users.noreply.github.com> Date: Tue, 5 Mar 2019 22:43:38 +0100 Subject: [PATCH 201/253] typo --- locales/fr.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/fr.lua b/locales/fr.lua index c39d9300..79cba6c3 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -103,7 +103,7 @@ Locales['fr'] = { ['box'] = 'caisse', ['cash'] = 'caisse', -- ID Card Menu - ['name'] = 'non: %s', + ['name'] = 'nom: %s', ['job'] = 'métier: %s', ['sex'] = 'sexe: %s', ['dob'] = 'DOB: %s', From 8528fd8037b97a7236cfadd5da51ddb5101dfd0c Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 5 May 2019 09:48:47 +0200 Subject: [PATCH 202/253] Proper cb usage --- client/main.lua | 2 +- server/main.lua | 109 +++++++++++++++++++----------------------------- 2 files changed, 45 insertions(+), 66 deletions(-) diff --git a/client/main.lua b/client/main.lua index 6e8a34e3..ac67c870 100644 --- a/client/main.lua +++ b/client/main.lua @@ -27,7 +27,7 @@ local CurrentTask = {} local playerInService = false local spawnedVehicles, isInShopMenu = {}, false -ESX = nil +ESX = nil Citizen.CreateThread(function() while ESX == nil do diff --git a/server/main.lua b/server/main.lua index 2b23fe41..b4898a9b 100644 --- a/server/main.lua +++ b/server/main.lua @@ -108,7 +108,6 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count) local sourceItem = xPlayer.getInventoryItem(itemName) TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) - local inventoryItem = inventory.getItem(itemName) -- is there enough in the society? @@ -126,7 +125,6 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count) TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) end end) - end) RegisterServerEvent('esx_policejob:putStockItems') @@ -135,7 +133,6 @@ AddEventHandler('esx_policejob:putStockItems', function(itemName, count) local sourceItem = xPlayer.getInventoryItem(itemName) TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) - local inventoryItem = inventory.getItem(itemName) -- does the player have enough of the item? @@ -146,17 +143,12 @@ AddEventHandler('esx_policejob:putStockItems', function(itemName, count) else TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) end - end) - end) ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, cb, target) - if Config.EnableESXIdentity then - local xPlayer = ESX.GetPlayerFromId(target) - local result = MySQL.Sync.fetchAll('SELECT firstname, lastname, sex, dateofbirth, height FROM users WHERE identifier = @identifier', { ['@identifier'] = xPlayer.identifier }) @@ -194,9 +186,7 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, else cb(data) end - else - local xPlayer = ESX.GetPlayerFromId(target) local data = { @@ -208,7 +198,7 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, } TriggerEvent('esx_status:getStatus', target, 'drunk', function(status) - if status ~= nil then + if status then data.drunk = math.floor(status.percent) end end) @@ -218,9 +208,7 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, end) cb(data) - end - end) ESX.RegisterServerCallback('esx_policejob:getFineList', function(source, cb, category) @@ -242,7 +230,6 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, } if result[1] then - MySQL.Async.fetchAll('SELECT name, firstname, lastname FROM users WHERE identifier = @identifier', { ['@identifier'] = result[1].owner }, function(result2) @@ -285,7 +272,6 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleFromPlate', function(source, end) ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb) - TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) local weapons = store.get('weapons') @@ -295,11 +281,9 @@ ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb cb(weapons) end) - end) ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, weaponName, removeWeapon) - local xPlayer = ESX.GetPlayerFromId(source) if removeWeapon then @@ -307,7 +291,6 @@ ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, end TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) - local weapons = store.get('weapons') if weapons == nil then @@ -334,13 +317,10 @@ ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, store.set('weapons', weapons) cb() end) - end) ESX.RegisterServerCallback('esx_policejob:removeArmoryWeapon', function(source, cb, weaponName) - local xPlayer = ESX.GetPlayerFromId(source) - xPlayer.addWeapon(weaponName, 500) TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) @@ -371,7 +351,6 @@ ESX.RegisterServerCallback('esx_policejob:removeArmoryWeapon', function(source, store.set('weapons', weapons) cb() end) - end) ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weaponName, type, componentNum) @@ -388,38 +367,38 @@ ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weapo if not selectedWeapon then print(('esx_policejob: %s attempted to buy an invalid weapon.'):format(xPlayer.identifier)) cb(false) - end - - -- Weapon - if type == 1 then - if xPlayer.getMoney() >= selectedWeapon.price then - xPlayer.removeMoney(selectedWeapon.price) - xPlayer.addWeapon(weaponName, 100) - - cb(true) - else - cb(false) - end - - -- Weapon Component - elseif type == 2 then - local price = selectedWeapon.components[componentNum] - local weaponNum, weapon = ESX.GetWeapon(weaponName) - - local component = weapon.components[componentNum] - - if component then - if xPlayer.getMoney() >= price then - xPlayer.removeMoney(price) - xPlayer.addWeaponComponent(weaponName, component.name) + else + -- Weapon + if type == 1 then + if xPlayer.getMoney() >= selectedWeapon.price then + xPlayer.removeMoney(selectedWeapon.price) + xPlayer.addWeapon(weaponName, 100) cb(true) else cb(false) end - else - print(('esx_policejob: %s attempted to buy an invalid weapon component.'):format(xPlayer.identifier)) - cb(false) + + -- Weapon Component + elseif type == 2 then + local price = selectedWeapon.components[componentNum] + local weaponNum, weapon = ESX.GetWeapon(weaponName) + + local component = weapon.components[componentNum] + + if component then + if xPlayer.getMoney() >= price then + xPlayer.removeMoney(price) + xPlayer.addWeaponComponent(weaponName, component.name) + + cb(true) + else + cb(false) + end + else + print(('esx_policejob: %s attempted to buy an invalid weapon component.'):format(xPlayer.identifier)) + cb(false) + end end end end) @@ -433,23 +412,23 @@ ESX.RegisterServerCallback('esx_policejob:buyJobVehicle', function(source, cb, v if price == 0 then print(('esx_policejob: %s attempted to exploit the shop! (invalid vehicle model)'):format(xPlayer.identifier)) cb(false) - end - - if xPlayer.getMoney() >= price then - xPlayer.removeMoney(price) - - 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 (rowsChanged) - cb(true) - end) else - cb(false) + if xPlayer.getMoney() >= price then + xPlayer.removeMoney(price) + + 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 (rowsChanged) + cb(true) + end) + else + cb(false) + end end end) From 4bbd1d952162c3c2117076f4dcb6fb7e566cd92c Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 20 May 2019 23:05:10 +0200 Subject: [PATCH 203/253] Proper hud natives --- client/main.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index ac67c870..0bdb4283 100644 --- a/client/main.lua +++ b/client/main.lua @@ -641,10 +641,9 @@ end function drawLoadingText(text, red, green, blue, alpha) SetTextFont(4) - SetTextProportional(0) SetTextScale(0.0, 0.5) SetTextColour(red, green, blue, alpha) - SetTextDropShadow(0, 0, 0, 0, 255) + SetTextDropshadow(0, 0, 0, 0, 255) SetTextEdge(1, 0, 0, 0, 255) SetTextDropShadow() SetTextOutline() From 0a347eda2aecf71f3b7f62521ffe4a4d9e5d3262 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 31 May 2019 12:40:18 +0200 Subject: [PATCH 204/253] Unused text native --- client/main.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 0bdb4283..5a245560 100644 --- a/client/main.lua +++ b/client/main.lua @@ -644,7 +644,6 @@ function drawLoadingText(text, red, green, blue, alpha) SetTextScale(0.0, 0.5) SetTextColour(red, green, blue, alpha) SetTextDropshadow(0, 0, 0, 0, 255) - SetTextEdge(1, 0, 0, 0, 255) SetTextDropShadow() SetTextOutline() SetTextCentre(true) From e762d6e0284d133223ab001c16b419a1c3fed651 Mon Sep 17 00:00:00 2001 From: KandaSoranyan <32266067+KandaSoranyan@users.noreply.github.com> Date: Fri, 31 May 2019 13:23:55 +0200 Subject: [PATCH 205/253] missing translation --- locales/fr.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locales/fr.lua b/locales/fr.lua index 79cba6c3..2165e130 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -15,8 +15,8 @@ Locales['fr'] = { ['buy_weapons'] = 'acheter Armes', ['armory'] = 'armurerie', ['open_armory'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder à l\'armurerie', - ['armory_owned'] = 'owned', - ['armory_free'] = 'free', + ['armory_owned'] = 'possédé', + ['armory_free'] = 'gratuit', ['armory_item'] = '$%s', ['armory_weapontitle'] = 'armurerie - Acheter une arme', ['armory_componenttitle'] = 'armurerie - Accessoires d\'armes', @@ -110,7 +110,7 @@ Locales['fr'] = { ['height'] = 'taille: %s', ['id'] = 'ID: %s', ['bac'] = 'BAC: %s', - ['unknown'] = 'unknown', + ['unknown'] = 'inconnu', ['male'] = 'homme', ['female'] = 'femme', -- Body Search Menu @@ -118,7 +118,7 @@ Locales['fr'] = { ['inventory_label'] = '--- Inventaire ---', ['license_label'] = ' --- Licenses ---', ['confiscate'] = 'confisquer %s', - ['confiscate_weapon'] = 'confiscate %s with %s bullets', + ['confiscate_weapon'] = 'confisqué %s avec %s balles', ['confiscate_inv'] = 'confisquer %sx %s', ['confiscate_dirty'] = 'confisquer argent sale: €%s', ['you_confiscated'] = 'vous avez confisqué ~y~%sx~s~ ~b~%s~s~ à ~b~%s~s~', @@ -143,11 +143,11 @@ Locales['fr'] = { ['have_deposited'] = 'vous avez déposé ~y~%sx~s~ ~b~%s~s~', ['quantity'] = 'quantité', ['inventory'] = 'inventaire', - ['police_stock'] = 'stock Police', + ['police_stock'] = 'coffre de la police', -- Misc ['remove_prop'] = 'appuyez sur ~INPUT_CONTEXT~ pour enlever l\'objet', ['map_blip'] = 'Commissariat', - ['unrestrained_timer'] = 'vous sentez que vos entraves se relachent.', + ['unrestrained_timer'] = 'vous sentez que vos menottes deviennent fragiles.', -- Notifications ['alert_police'] = 'alerte police', ['phone_police'] = 'police', From 7cfebdd843c359b1c838b663a4ad825c8e30fdc3 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 31 May 2019 22:40:10 +0200 Subject: [PATCH 206/253] Minor cleanup --- client/main.lua | 576 ++++++++++++++++-------------------------------- server/main.lua | 12 +- 2 files changed, 201 insertions(+), 387 deletions(-) diff --git a/client/main.lua b/client/main.lua index 5a245560..93bb1eff 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,32 +1,7 @@ -local Keys = { - ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, - ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, - ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, - ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, - ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, - ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, - ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, - ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, - ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 -} - -local PlayerData = {} -local HasAlreadyEnteredMarker = false -local LastStation, LastPart, LastPartNum, LastEntity -local CurrentAction = nil -local CurrentActionMsg = '' -local CurrentActionData = {} -local IsHandcuffed = false -local HandcuffTimer = {} -local DragStatus = {} -DragStatus.IsDragged = false -local hasAlreadyJoined = false -local blipsCops = {} -local isDead = false -local CurrentTask = {} -local playerInService = false -local spawnedVehicles, isInShopMenu = {}, false - +local PlayerData, CurrentActionData, handcuffTimer, dragStatus, blipsCops, currentTask, spawnedVehicles = {}, {}, {}, {}, {}, {}, {} +local HasAlreadyEnteredMarker, isDead, IsHandcuffed, hasAlreadyJoined, playerInService, isInShopMenu = false, false, false, false, false, false +local LastStation, LastPart, LastPartNum, LastEntity, CurrentAction, CurrentActionMsg +dragStatus.isDragged = false ESX = nil Citizen.CreateThread(function() @@ -53,7 +28,7 @@ end function setUniform(job, playerPed) TriggerEvent('skinchanger:getSkin', function(skin) if skin.sex == 0 then - if Config.Uniforms[job].male ~= nil then + if Config.Uniforms[job].male then TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].male) else ESX.ShowNotification(_U('no_outfit')) @@ -63,7 +38,7 @@ function setUniform(job, playerPed) SetPedArmour(playerPed, 100) end else - if Config.Uniforms[job].female ~= nil then + if Config.Uniforms[job].female then TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].female) else ESX.ShowNotification(_U('no_outfit')) @@ -77,7 +52,6 @@ function setUniform(job, playerPed) end function OpenCloakroomMenu() - local playerPed = PlayerPedId() local grade = PlayerData.job.grade_name @@ -111,17 +85,14 @@ function OpenCloakroomMenu() ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'cloakroom', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'cloakroom', { title = _U('cloakroom'), align = 'top-left', elements = elements }, function(data, menu) - cleanPlayer(playerPed) if data.current.value == 'citizen_wear' then - if Config.EnableNonFreemodePeds then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) local isMale = skin.sex == 0 @@ -141,10 +112,8 @@ function OpenCloakroomMenu() end if Config.MaxInService ~= -1 then - ESX.TriggerServerCallback('esx_service:isInService', function(isInService) if isInService then - playerInService = false local notification = { @@ -162,7 +131,6 @@ function OpenCloakroomMenu() end end, 'police') end - end if Config.MaxInService ~= -1 and data.current.value ~= 'citizen_wear' then @@ -175,7 +143,6 @@ function OpenCloakroomMenu() if not canTakeService then ESX.ShowNotification(_U('service_max', inServiceCount, maxInService)) else - serviceOk = true playerInService = true @@ -185,7 +152,7 @@ function OpenCloakroomMenu() msg = _U('service_in_announce', GetPlayerName(PlayerId())), iconType = 1 } - + TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') TriggerEvent('esx_policejob:updateBlip') ESX.ShowNotification(_U('service_in')) @@ -238,9 +205,7 @@ function OpenCloakroomMenu() TriggerEvent('esx:restoreLoadout') end) end) - end - end, function(data, menu) menu.close() @@ -264,8 +229,7 @@ function OpenArmoryMenu(station) ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory', { title = _U('armory'), align = 'top-left', elements = elements @@ -306,7 +270,6 @@ function OpenVehicleSpawnerMenu(type, station, part, partNum) align = 'top-left', elements = elements }, function(data, menu) - if data.current.action == 'buy_vehicle' then local shopElements, shopCoords = {} @@ -411,20 +374,16 @@ function OpenVehicleSpawnerMenu(type, station, part, partNum) end, function(data2, menu2) menu2.close() end) - else ESX.ShowNotification(_U('garage_empty')) end end, type) - elseif data.current.action == 'store_garage' then StoreNearbyVehicle(playerCoords) end - end, function(data, menu) menu.close() end) - end function StoreNearbyVehicle(playerCoords) @@ -517,17 +476,13 @@ function OpenShopMenu(elements, restoreCoords, shopCoords) align = 'top-left', elements = elements }, function(data, menu) - - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop_confirm', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop_confirm', { title = _U('vehicleshop_confirm', data.current.name, data.current.price), align = 'top-left', elements = { - { label = _U('confirm_no'), value = 'no' }, - { label = _U('confirm_yes'), value = 'yes' } - } - }, function(data2, menu2) - + {label = _U('confirm_no'), value = 'no'}, + {label = _U('confirm_yes'), value = 'yes'} + }}, function(data2, menu2) if data2.current.value == 'yes' then local newPlate = exports['esx_vehicleshop']:GeneratePlate() local vehicle = GetVehiclePedIsIn(playerPed, false) @@ -540,11 +495,10 @@ function OpenShopMenu(elements, restoreCoords, shopCoords) isInShopMenu = false ESX.UI.Menu.CloseAll() - DeleteSpawnedVehicles() FreezeEntityPosition(playerPed, false) SetEntityVisible(playerPed, true) - + ESX.Game.Teleport(playerPed, restoreCoords) else ESX.ShowNotification(_U('vehicleshop_money')) @@ -554,12 +508,10 @@ function OpenShopMenu(elements, restoreCoords, shopCoords) else menu2.close() end - end, function(data2, menu2) menu2.close() end) - - end, function(data, menu) + end, function(data, menu) isInShopMenu = false ESX.UI.Menu.CloseAll() @@ -626,13 +578,7 @@ function WaitForVehicleToLoad(modelHash) while not HasModelLoaded(modelHash) do Citizen.Wait(0) - - DisableControlAction(0, Keys['TOP'], true) - DisableControlAction(0, Keys['DOWN'], true) - DisableControlAction(0, Keys['LEFT'], true) - DisableControlAction(0, Keys['RIGHT'], true) - DisableControlAction(0, 176, true) -- ENTER key - DisableControlAction(0, Keys['BACKSPACE'], true) + DisableAllControlActions(0) drawLoadingText(_U('vehicleshop_awaiting_model'), 255, 255, 255, 255) end @@ -648,7 +594,7 @@ function drawLoadingText(text, red, green, blue, alpha) SetTextOutline() SetTextCentre(true) - BeginTextCommandDisplayText("STRING") + BeginTextCommandDisplayText('STRING') AddTextComponentSubstringPlayerName(text) EndTextCommandDisplayText(0.5, 0.5) end @@ -656,36 +602,31 @@ end function OpenPoliceActionsMenu() ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'police_actions', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'police_actions', { title = 'Police', align = 'top-left', elements = { - {label = _U('citizen_interaction'), value = 'citizen_interaction'}, - {label = _U('vehicle_interaction'), value = 'vehicle_interaction'}, - {label = _U('object_spawner'), value = 'object_spawner'} - } - }, function(data, menu) - + {label = _U('citizen_interaction'), value = 'citizen_interaction'}, + {label = _U('vehicle_interaction'), value = 'vehicle_interaction'}, + {label = _U('object_spawner'), value = 'object_spawner'} + }}, function(data, menu) if data.current.value == 'citizen_interaction' then local elements = { - {label = _U('id_card'), value = 'identity_card'}, - {label = _U('search'), value = 'body_search'}, - {label = _U('handcuff'), value = 'handcuff'}, - {label = _U('drag'), value = 'drag'}, - {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, - {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, - {label = _U('fine'), value = 'fine'}, - {label = _U('unpaid_bills'), value = 'unpaid_bills'} + {label = _U('id_card'), value = 'identity_card'}, + {label = _U('search'), value = 'body_search'}, + {label = _U('handcuff'), value = 'handcuff'}, + {label = _U('drag'), value = 'drag'}, + {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, + {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}, + {label = _U('fine'), value = 'fine'}, + {label = _U('unpaid_bills'), value = 'unpaid_bills'} } - + if Config.EnableLicenses then table.insert(elements, { label = _U('license_check'), value = 'license' }) end - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', { title = _U('citizen_interaction'), align = 'top-left', elements = elements @@ -714,7 +655,6 @@ function OpenPoliceActionsMenu() elseif action == 'unpaid_bills' then OpenUnpaidBillsMenu(closestPlayer) end - else ESX.ShowNotification(_U('no_players_nearby')) end @@ -724,38 +664,34 @@ function OpenPoliceActionsMenu() elseif data.current.value == 'vehicle_interaction' then local elements = {} local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - local vehicle = ESX.Game.GetVehicleInDirection() - + local vehicle = ESX.Game.GetVehicleInDirection() + if DoesEntityExist(vehicle) then - table.insert(elements, {label = _U('vehicle_info'), value = 'vehicle_infos'}) - table.insert(elements, {label = _U('pick_lock'), value = 'hijack_vehicle'}) - table.insert(elements, {label = _U('impound'), value = 'impound'}) + table.insert(elements, {label = _U('vehicle_info'), value = 'vehicle_infos'}) + table.insert(elements, {label = _U('pick_lock'), value = 'hijack_vehicle'}) + table.insert(elements, {label = _U('impound'), value = 'impound'}) end - + table.insert(elements, {label = _U('search_database'), value = 'search_database'}) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'vehicle_interaction', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_interaction', { title = _U('vehicle_interaction'), align = 'top-left', elements = elements }, function(data2, menu2) - coords = GetEntityCoords(playerPed) + local coords = GetEntityCoords(playerPed) vehicle = ESX.Game.GetVehicleInDirection() action = data2.current.value - + if action == 'search_database' then LookupVehicle() elseif DoesEntityExist(vehicle) then - local vehicleData = ESX.Game.GetVehicleProperties(vehicle) if action == 'vehicle_infos' then + local vehicleData = ESX.Game.GetVehicleProperties(vehicle) OpenVehicleInfosMenu(vehicleData) - elseif action == 'hijack_vehicle' then if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 3.0) then - TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_WELDING", 0, true) + TaskStartScenarioInPlace(playerPed, 'WORLD_HUMAN_WELDING', 0, true) Citizen.Wait(20000) ClearPedTasksImmediately(playerPed) @@ -764,34 +700,32 @@ function OpenPoliceActionsMenu() ESX.ShowNotification(_U('vehicle_unlocked')) end elseif action == 'impound' then - -- is the script busy? - if CurrentTask.Busy then + if currentTask.busy then return end ESX.ShowHelpNotification(_U('impound_prompt')) - TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) - - CurrentTask.Busy = true - CurrentTask.Task = ESX.SetTimeout(10000, function() + + currentTask.busy = true + currentTask.task = ESX.SetTimeout(10000, function() ClearPedTasks(playerPed) ImpoundVehicle(vehicle) Citizen.Wait(100) -- sleep the entire script to let stuff sink back to reality end) - + -- keep track of that vehicle! Citizen.CreateThread(function() - while CurrentTask.Busy do + while currentTask.busy do Citizen.Wait(1000) - + vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71) - if not DoesEntityExist(vehicle) and CurrentTask.Busy then + if not DoesEntityExist(vehicle) and currentTask.busy then ESX.ShowNotification(_U('impound_canceled_moved')) - ESX.ClearTimeout(CurrentTask.Task) + ESX.ClearTimeout(currentTask.task) ClearPedTasks(playerPed) - CurrentTask.Busy = false + currentTask.busy = false break end end @@ -804,73 +738,55 @@ function OpenPoliceActionsMenu() end, function(data2, menu2) menu2.close() end) - elseif data.current.value == 'object_spawner' then - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'citizen_interaction', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', { title = _U('traffic_interaction'), align = 'top-left', elements = { - {label = _U('cone'), value = 'prop_roadcone02a'}, - {label = _U('barrier'), value = 'prop_barrier_work05'}, - {label = _U('spikestrips'), value = 'p_ld_stinger_s'}, - {label = _U('box'), value = 'prop_boxpile_07d'}, - {label = _U('cash'), value = 'hei_prop_cash_crate_half_full'} - } - }, function(data2, menu2) - local model = data2.current.value + {label = _U('cone'), model = 'prop_roadcone02a'}, + {label = _U('barrier'), model = 'prop_barrier_work05'}, + {label = _U('spikestrips'), model = 'p_ld_stinger_s'}, + {label = _U('box'), model = 'prop_boxpile_07d'}, + {label = _U('cash'), model = 'hei_prop_cash_crate_half_full'} + }}, function(data2, menu2) local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) local forward = GetEntityForwardVector(playerPed) local x, y, z = table.unpack(coords + forward * 1.0) - if model == 'prop_roadcone02a' then + if data2.current.model == 'prop_roadcone02a' then z = z - 2.0 end - ESX.Game.SpawnObject(model, { - x = x, - y = y, - z = z - }, function(obj) + ESX.Game.SpawnObject(data2.current.model, {x = x, y = y, z = z}, function(obj) SetEntityHeading(obj, GetEntityHeading(playerPed)) PlaceObjectOnGroundProperly(obj) end) - end, function(data2, menu2) menu2.close() end) end - end, function(data, menu) menu.close() end) end function OpenIdentityCardMenu(player) - ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) + local elements = {} + local nameLabel = _U('name', data.name) + local jobLabel, sexLabel, dobLabel, heightLabel, idLabel - local elements = {} - local nameLabel = _U('name', data.name) - local jobLabel = nil - local sexLabel = nil - local dobLabel = nil - local heightLabel = nil - local idLabel = nil - - if data.job.grade_label ~= nil and data.job.grade_label ~= '' then + if data.job.grade_label and data.job.grade_label ~= '' then jobLabel = _U('job', data.job.label .. ' - ' .. data.job.grade_label) else jobLabel = _U('job', data.job.label) end - + if Config.EnableESXIdentity then - nameLabel = _U('name', data.firstname .. ' ' .. data.lastname) - - if data.sex ~= nil then + + if data.sex then if string.lower(data.sex) == 'm' then sexLabel = _U('sex', _U('male')) else @@ -879,78 +795,66 @@ function OpenIdentityCardMenu(player) else sexLabel = _U('sex', _U('unknown')) end - - if data.dob ~= nil then + + if data.dob then dobLabel = _U('dob', data.dob) else dobLabel = _U('dob', _U('unknown')) end - - if data.height ~= nil then + + if data.height then heightLabel = _U('height', data.height) else heightLabel = _U('height', _U('unknown')) end - - if data.name ~= nil then + + if data.name then idLabel = _U('id', data.name) else idLabel = _U('id', _U('unknown')) end - end - + local elements = { - {label = nameLabel, value = nil}, - {label = jobLabel, value = nil}, + {label = nameLabel}, + {label = jobLabel} } - + if Config.EnableESXIdentity then - table.insert(elements, {label = sexLabel, value = nil}) - table.insert(elements, {label = dobLabel, value = nil}) - table.insert(elements, {label = heightLabel, value = nil}) - table.insert(elements, {label = idLabel, value = nil}) + table.insert(elements, {label = sexLabel}) + table.insert(elements, {label = dobLabel}) + table.insert(elements, {label = heightLabel}) + table.insert(elements, {label = idLabel}) end - - if data.drunk ~= nil then - table.insert(elements, {label = _U('bac', data.drunk), value = nil}) + + if data.drunk then + table.insert(elements, {label = _U('bac', data.drunk)}) end - - if data.licenses ~= nil then - - table.insert(elements, {label = _U('license_label'), value = nil}) - + + if data.licenses then + table.insert(elements, {label = _U('license_label')}) + for i=1, #data.licenses, 1 do - table.insert(elements, {label = data.licenses[i].label, value = nil}) + table.insert(elements, {label = data.licenses[i].label}) end - end - - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', - { + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', { title = _U('citizen_interaction'), align = 'top-left', - elements = elements, - }, function(data, menu) - - end, function(data, menu) + elements = elements + }, nil, function(data, menu) menu.close() end) - end, GetPlayerServerId(player)) - end function OpenBodySearchMenu(player) - ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - local elements = {} for i=1, #data.accounts, 1 do - if data.accounts[i].name == 'black_money' and data.accounts[i].money > 0 then - table.insert(elements, { label = _U('confiscate_dirty', ESX.Math.Round(data.accounts[i].money)), value = 'black_money', @@ -960,10 +864,9 @@ function OpenBodySearchMenu(player) break end - end - table.insert(elements, {label = _U('guns_label'), value = nil}) + table.insert(elements, {label = _U('guns_label')}) for i=1, #data.weapons, 1 do table.insert(elements, { @@ -974,7 +877,7 @@ function OpenBodySearchMenu(player) }) end - table.insert(elements, {label = _U('inventory_label'), value = nil}) + table.insert(elements, {label = _U('inventory_label')}) for i=1, #data.inventory, 1 do if data.inventory[i].count > 0 then @@ -987,35 +890,23 @@ function OpenBodySearchMenu(player) end end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'body_search', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'body_search', { title = _U('search'), align = 'top-left', - elements = elements, - }, - function(data, menu) - - local itemType = data.current.itemType - local itemName = data.current.value - local amount = data.current.amount - - if data.current.value ~= nil then - TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), itemType, itemName, amount) + elements = elements + }, function(data, menu) + if data.current.value then + TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), data.current.itemType, data.current.value, data.current.amount) OpenBodySearchMenu(player) end - end, function(data, menu) menu.close() end) - end, GetPlayerServerId(player)) - end function OpenFineMenu(player) - - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'fine', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'fine', { title = _U('fine'), align = 'top-left', elements = { @@ -1023,58 +914,46 @@ function OpenFineMenu(player) {label = _U('minor_offense'), value = 1}, {label = _U('average_offense'), value = 2}, {label = _U('major_offense'), value = 3} - } - }, function(data, menu) + }}, function(data, menu) OpenFineCategoryMenu(player, data.current.value) end, function(data, menu) menu.close() end) - end function OpenFineCategoryMenu(player, category) - ESX.TriggerServerCallback('esx_policejob:getFineList', function(fines) - local elements = {} - for i=1, #fines, 1 do + for k,fine in ipairs(fines) do table.insert(elements, { - label = fines[i].label .. ' $' .. fines[i].amount .. '', - value = fines[i].id, - amount = fines[i].amount, - fineLabel = fines[i].label + label = ('%s %s'):format(fine.label, _U('armory_item', ESX.Math.GroupDigits(fine.amount))), + value = fine.id, + amount = fine.amount, + fineLabel = fine.label }) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'fine_category', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'fine_category', { title = _U('fine'), align = 'top-left', - elements = elements, + elements = elements }, function(data, menu) - - local label = data.current.fineLabel - local amount = data.current.amount - menu.close() if Config.EnablePlayerManagement then - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', _U('fine_total', label), amount) + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), 'society_police', _U('fine_total', data.current.fineLabel), data.current.amount) else - TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', _U('fine_total', label), amount) + TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(player), '', _U('fine_total', data.current.fineLabel), data.current.amount) end ESX.SetTimeout(300, function() OpenFineCategoryMenu(player, category) end) - end, function(data, menu) menu.close() end) - end, category) - end function LookupVehicle() @@ -1114,13 +993,13 @@ function ShowPlayerLicense(player) end end end - + if Config.EnableESXIdentity then targetName = data.firstname .. ' ' .. data.lastname else targetName = data.name end - + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'manage_license', { title = _U('license_revoke'), @@ -1129,9 +1008,9 @@ function ShowPlayerLicense(player) }, function(data, menu) ESX.ShowNotification(_U('licence_you_revoked', data.current.label, targetName)) TriggerServerEvent('esx_policejob:message', GetPlayerServerId(player), _U('license_revoked', data.current.label)) - + TriggerServerEvent('esx_license:removeLicense', GetPlayerServerId(player), data.current.type) - + ESX.SetTimeout(300, function() ShowPlayerLicense(player) end) @@ -1146,55 +1025,44 @@ function OpenUnpaidBillsMenu(player) local elements = {} ESX.TriggerServerCallback('esx_billing:getTargetBills', function(bills) - for i=1, #bills, 1 do + for k,bill in ipairs(bills) do table.insert(elements, { - label = bills[i].label .. ' - $' .. bills[i].amount .. '', - value = bills[i].id + label = ('%s - %s'):format(bill.label, _U('armory_item', ESX.Math.GroupDigits(bill.amount))), + billId = bills[i].id }) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'billing', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'billing', { title = _U('unpaid_bills'), align = 'top-left', elements = elements - }, function(data, menu) - - end, function(data, menu) + }, nil, function(data, menu) menu.close() end) end, GetPlayerServerId(player)) end function OpenVehicleInfosMenu(vehicleData) - ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(retrivedInfo) - - local elements = {} - - table.insert(elements, {label = _U('plate', retrivedInfo.plate), value = nil}) + local elements = {{label = _U('plate', retrivedInfo.plate)}} if retrivedInfo.owner == nil then - table.insert(elements, {label = _U('owner_unknown'), value = nil}) + table.insert(elements, {label = _U('owner_unknown')}) else - table.insert(elements, {label = _U('owner', retrivedInfo.owner), value = nil}) + table.insert(elements, {label = _U('owner', retrivedInfo.owner)}) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_infos', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_infos', { title = _U('vehicle_info'), align = 'top-left', elements = elements }, nil, function(data, menu) menu.close() end) - end, vehicleData.plate) - end function OpenGetWeaponMenu() - ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons) local elements = {} @@ -1207,24 +1075,20 @@ function OpenGetWeaponMenu() end end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_get_weapon', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_get_weapon', { title = _U('get_weapon_menu'), align = 'top-left', elements = elements }, function(data, menu) - menu.close() ESX.TriggerServerCallback('esx_policejob:removeArmoryWeapon', function() OpenGetWeaponMenu() end, data.current.value) - end, function(data, menu) menu.close() end) end) - end function OpenPutWeaponMenu() @@ -1243,26 +1107,22 @@ function OpenPutWeaponMenu() end end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_put_weapon', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'armory_put_weapon', { title = _U('put_weapon_menu'), align = 'top-left', elements = elements }, function(data, menu) - menu.close() ESX.TriggerServerCallback('esx_policejob:addArmoryWeapon', function() OpenPutWeaponMenu() end, data.current.value, true) - end, function(data, menu) menu.close() end) end function OpenBuyWeaponsMenu() - local elements = {} local playerPed = PlayerPedId() PlayerData = ESX.GetPlayerData() @@ -1270,13 +1130,11 @@ function OpenBuyWeaponsMenu() for k,v in ipairs(Config.AuthorizedWeapons[PlayerData.job.grade_name]) do local weaponNum, weapon = ESX.GetWeapon(v.weapon) local components, label = {} - local hasWeapon = HasPedGotWeapon(playerPed, GetHashKey(v.weapon), false) if v.components then for i=1, #v.components do if v.components[i] then - local component = weapon.components[i] local hasComponent = HasPedGotWeaponComponent(playerPed, GetHashKey(v.weapon), component.hash) @@ -1330,7 +1188,6 @@ function OpenBuyWeaponsMenu() align = 'top-left', elements = elements }, function(data, menu) - if data.current.hasWeapon then if #data.current.components > 0 then OpenWeaponComponentShop(data.current.components, data.current.name, menu) @@ -1343,18 +1200,15 @@ function OpenBuyWeaponsMenu() end menu.close() - OpenBuyWeaponsMenu() else ESX.ShowNotification(_U('armory_money')) end end, data.current.name, 1) end - end, function(data, menu) menu.close() end) - end function OpenWeaponComponentShop(components, weaponName, parentShop) @@ -1363,7 +1217,6 @@ function OpenWeaponComponentShop(components, weaponName, parentShop) align = 'top-left', elements = components }, function(data, menu) - if data.current.hasComponent then ESX.ShowNotification(_U('armory_hascomponent')) else @@ -1375,23 +1228,19 @@ function OpenWeaponComponentShop(components, weaponName, parentShop) menu.close() parentShop.close() - OpenBuyWeaponsMenu() else ESX.ShowNotification(_U('armory_money')) end end, weaponName, 2, data.current.componentNum) end - end, function(data, menu) menu.close() end) end function OpenGetStocksMenu() - ESX.TriggerServerCallback('esx_policejob:getStockItems', function(items) - local elements = {} for i=1, #items, 1 do @@ -1401,19 +1250,16 @@ function OpenGetStocksMenu() }) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { title = _U('police_stock'), align = 'top-left', elements = elements }, function(data, menu) - local itemName = data.current.value ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { title = _U('quantity') }, function(data2, menu2) - local count = tonumber(data2.value) if count == nil then @@ -1426,23 +1272,17 @@ function OpenGetStocksMenu() Citizen.Wait(300) OpenGetStocksMenu() end - end, function(data2, menu2) menu2.close() end) - end, function(data, menu) menu.close() end) - end) - end function OpenPutStocksMenu() - ESX.TriggerServerCallback('esx_policejob:getPlayerInventory', function(inventory) - local elements = {} for i=1, #inventory.items, 1 do @@ -1457,19 +1297,16 @@ function OpenPutStocksMenu() end end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { title = _U('inventory'), align = 'top-left', elements = elements }, function(data, menu) - local itemName = data.current.value ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { title = _U('quantity') }, function(data2, menu2) - local count = tonumber(data2.value) if count == nil then @@ -1482,22 +1319,19 @@ function OpenPutStocksMenu() Citizen.Wait(300) OpenPutStocksMenu() end - end, function(data2, menu2) menu2.close() end) - end, function(data, menu) menu.close() end) end) - end RegisterNetEvent('esx:setJob') AddEventHandler('esx:setJob', function(job) PlayerData.job = job - + Citizen.Wait(5000) TriggerServerEvent('esx_policejob:forceBlip') end) @@ -1515,7 +1349,7 @@ end) -- don't show dispatches if the player isn't in service AddEventHandler('esx_phone:cancelMessage', function(dispatchNumber) - if type(PlayerData.job.name) == 'string' and PlayerData.job.name == 'police' and PlayerData.job.name == dispatchNumber then + if PlayerData.job and PlayerData.job.name == 'police' and PlayerData.job.name == dispatchNumber then -- if esx_service is enabled if Config.MaxInService ~= -1 and not playerInService then CancelEvent() @@ -1524,38 +1358,27 @@ AddEventHandler('esx_phone:cancelMessage', function(dispatchNumber) end) AddEventHandler('esx_policejob:hasEnteredMarker', function(station, part, partNum) - if part == 'Cloakroom' then CurrentAction = 'menu_cloakroom' CurrentActionMsg = _U('open_cloackroom') CurrentActionData = {} - elseif part == 'Armory' then - CurrentAction = 'menu_armory' CurrentActionMsg = _U('open_armory') CurrentActionData = {station = station} - elseif part == 'Vehicles' then - CurrentAction = 'menu_vehicle_spawner' CurrentActionMsg = _U('garage_prompt') CurrentActionData = {station = station, part = part, partNum = partNum} - elseif part == 'Helicopters' then - CurrentAction = 'Helicopters' CurrentActionMsg = _U('helicopter_prompt') CurrentActionData = {station = station, part = part, partNum = partNum} - elseif part == 'BossActions' then - CurrentAction = 'menu_boss_actions' CurrentActionMsg = _U('open_bossmenu') CurrentActionData = {} - end - end) AddEventHandler('esx_policejob:hasExitedMarker', function(station, part, partNum) @@ -1569,7 +1392,7 @@ end) AddEventHandler('esx_policejob:hasEnteredEntityZone', function(entity) local playerPed = PlayerPedId() - if PlayerData.job ~= nil and PlayerData.job.name == 'police' and IsPedOnFoot(playerPed) then + if PlayerData.job and PlayerData.job.name == 'police' and IsPedOnFoot(playerPed) then CurrentAction = 'remove_entity' CurrentActionMsg = _U('remove_prop') CurrentActionData = {entity = entity} @@ -1618,18 +1441,15 @@ AddEventHandler('esx_policejob:handcuff', function() DisplayRadar(false) if Config.EnableHandcuffTimer then - - if HandcuffTimer.Active then - ESX.ClearTimeout(HandcuffTimer.Task) + if handcuffTimer.active then + ESX.ClearTimeout(handcuffTimer.task) end StartHandcuffTimer() end - else - - if Config.EnableHandcuffTimer and HandcuffTimer.Active then - ESX.ClearTimeout(HandcuffTimer.Task) + if Config.EnableHandcuffTimer and handcuffTimer.active then + ESX.ClearTimeout(handcuffTimer.task) end ClearPedSecondaryTask(playerPed) @@ -1640,7 +1460,6 @@ AddEventHandler('esx_policejob:handcuff', function() DisplayRadar(true) end end) - end) RegisterNetEvent('esx_policejob:unrestrain') @@ -1657,20 +1476,20 @@ AddEventHandler('esx_policejob:unrestrain', function() DisplayRadar(true) -- end timer - if Config.EnableHandcuffTimer and HandcuffTimer.Active then - ESX.ClearTimeout(HandcuffTimer.Task) + if Config.EnableHandcuffTimer and handcuffTimer.active then + ESX.ClearTimeout(handcuffTimer.task) end end end) RegisterNetEvent('esx_policejob:drag') -AddEventHandler('esx_policejob:drag', function(copID) +AddEventHandler('esx_policejob:drag', function(copId) if not IsHandcuffed then return end - DragStatus.IsDragged = not DragStatus.IsDragged - DragStatus.CopId = tonumber(copID) + dragStatus.isDragged = not dragStatus.isDragged + dragStatus.CopId = copId end) Citizen.CreateThread(function() @@ -1683,19 +1502,19 @@ Citizen.CreateThread(function() if IsHandcuffed then playerPed = PlayerPedId() - if DragStatus.IsDragged then - targetPed = GetPlayerPed(GetPlayerFromServerId(DragStatus.CopId)) + if dragStatus.isDragged then + targetPed = GetPlayerPed(GetPlayerFromServerId(dragStatus.CopId)) -- undrag if target is in an vehicle if not IsPedSittingInAnyVehicle(targetPed) then AttachEntityToEntity(playerPed, targetPed, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) else - DragStatus.IsDragged = false + dragStatus.isDragged = false DetachEntity(playerPed, true, false) end if IsPedDeadOrDying(targetPed, true) then - DragStatus.IsDragged = false + dragStatus.isDragged = false DetachEntity(playerPed, true, false) end @@ -1732,7 +1551,7 @@ AddEventHandler('esx_policejob:putInVehicle', function() if freeSeat then TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) - DragStatus.IsDragged = false + dragStatus.isDragged = false end end end @@ -1753,7 +1572,7 @@ end) -- Handcuff Citizen.CreateThread(function() while true do - Citizen.Wait(1) + Citizen.Wait(0) local playerPed = PlayerPedId() if IsHandcuffed then @@ -1763,32 +1582,32 @@ Citizen.CreateThread(function() DisableControlAction(0, 257, true) -- Attack 2 DisableControlAction(0, 25, true) -- Aim DisableControlAction(0, 263, true) -- Melee Attack 1 - DisableControlAction(0, Keys['W'], true) -- W - DisableControlAction(0, Keys['A'], true) -- A - DisableControlAction(0, 31, true) -- S (fault in Keys table!) - DisableControlAction(0, 30, true) -- D (fault in Keys table!) + DisableControlAction(0, 32, true) -- W + DisableControlAction(0, 34, true) -- A + DisableControlAction(0, 31, true) -- S + DisableControlAction(0, 30, true) -- D - DisableControlAction(0, Keys['R'], true) -- Reload - DisableControlAction(0, Keys['SPACE'], true) -- Jump - DisableControlAction(0, Keys['Q'], true) -- Cover - DisableControlAction(0, Keys['TAB'], true) -- Select Weapon - DisableControlAction(0, Keys['F'], true) -- Also 'enter'? + DisableControlAction(0, 45, true) -- Reload + DisableControlAction(0, 22, true) -- Jump + DisableControlAction(0, 44, true) -- Cover + DisableControlAction(0, 37, true) -- Select Weapon + DisableControlAction(0, 23, true) -- Also 'enter'? - DisableControlAction(0, Keys['F1'], true) -- Disable phone - DisableControlAction(0, Keys['F2'], true) -- Inventory - DisableControlAction(0, Keys['F3'], true) -- Animations - DisableControlAction(0, Keys['F6'], true) -- Job + DisableControlAction(0, 288, true) -- Disable phone + DisableControlAction(0, 289, true) -- Inventory + DisableControlAction(0, 170, true) -- Animations + DisableControlAction(0, 167, true) -- Job - DisableControlAction(0, Keys['V'], true) -- Disable changing view - DisableControlAction(0, Keys['C'], true) -- Disable looking behind - DisableControlAction(0, Keys['X'], true) -- Disable clearing animation - DisableControlAction(2, Keys['P'], true) -- Disable pause screen + DisableControlAction(0, 0, true) -- Disable changing view + DisableControlAction(0, 26, true) -- Disable looking behind + DisableControlAction(0, 73, true) -- Disable clearing animation + DisableControlAction(2, 199, true) -- Disable pause screen DisableControlAction(0, 59, true) -- Disable steering in vehicle DisableControlAction(0, 71, true) -- Disable driving forward in vehicle DisableControlAction(0, 72, true) -- Disable reversing in vehicle - DisableControlAction(2, Keys['LEFTCTRL'], true) -- Disable going stealth + DisableControlAction(2, 36, true) -- Disable going stealth DisableControlAction(0, 47, true) -- Disable weapon DisableControlAction(0, 264, true) -- Disable melee @@ -1833,10 +1652,9 @@ end) -- Display markers Citizen.CreateThread(function() while true do - Citizen.Wait(0) - if PlayerData.job ~= nil and PlayerData.job.name == 'police' then + if PlayerData.job and PlayerData.job.name == 'police' then local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) @@ -1914,9 +1732,8 @@ Citizen.CreateThread(function() end if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum)) then - if - (LastStation ~= nil and LastPart ~= nil and LastPartNum ~= nil) and + (LastStation and LastPart and LastPartNum) and (LastStation ~= currentStation or LastPart ~= currentPart or LastPartNum ~= currentPartNum) then TriggerEvent('esx_policejob:hasExitedMarker', LastStation, LastPart, LastPartNum) @@ -1929,7 +1746,6 @@ Citizen.CreateThread(function() LastPartNum = currentPartNum TriggerEvent('esx_policejob:hasEnteredMarker', currentStation, currentPart, currentPartNum) - end if not hasExited and not isInMarker and HasAlreadyEnteredMarker then @@ -1944,7 +1760,6 @@ Citizen.CreateThread(function() else Citizen.Wait(500) end - end end) @@ -1987,7 +1802,7 @@ Citizen.CreateThread(function() LastEntity = closestEntity end else - if LastEntity ~= nil then + if LastEntity then TriggerEvent('esx_policejob:hasExitedEntityZone', LastEntity) LastEntity = nil end @@ -1998,13 +1813,12 @@ end) -- Key Controls Citizen.CreateThread(function() while true do - Citizen.Wait(0) - if CurrentAction ~= nil then + if CurrentAction then ESX.ShowHelpNotification(CurrentActionMsg) - if IsControlJustReleased(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'police' then + if IsControlJustReleased(0, 38) and PlayerData.job and PlayerData.job.name == 'police' then if CurrentAction == 'menu_cloakroom' then OpenCloakroomMenu() @@ -2046,12 +1860,12 @@ Citizen.CreateThread(function() elseif CurrentAction == 'remove_entity' then DeleteEntity(CurrentActionData.entity) end - + CurrentAction = nil end end -- CurrentAction end - - if IsControlJustReleased(0, Keys['F6']) and not isDead and PlayerData.job ~= nil and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') then + + if IsControlJustReleased(0, 167) and not isDead and PlayerData.job and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') then if Config.MaxInService == -1 then OpenPoliceActionsMenu() elseif playerInService then @@ -2060,13 +1874,13 @@ Citizen.CreateThread(function() ESX.ShowNotification(_U('service_not')) end end - - if IsControlJustReleased(0, Keys['E']) and CurrentTask.Busy then + + if IsControlJustReleased(0, 38) and currentTask.busy then ESX.ShowNotification(_U('impound_canceled')) - ESX.ClearTimeout(CurrentTask.Task) + ESX.ClearTimeout(currentTask.task) ClearPedTasks(PlayerPedId()) - - CurrentTask.Busy = false + + currentTask.busy = false end end end) @@ -2084,19 +1898,19 @@ function createBlip(id) SetBlipNameToPlayerName(blip, id) -- update blip name SetBlipScale(blip, 0.85) -- set scale SetBlipAsShortRange(blip, true) - + table.insert(blipsCops, blip) -- add blip to array so we can remove it later end end RegisterNetEvent('esx_policejob:updateBlip') AddEventHandler('esx_policejob:updateBlip', function() - + -- Refresh all blips for k, existingBlip in pairs(blipsCops) do RemoveBlip(existingBlip) end - + -- Clean the blip table blipsCops = {} @@ -2108,9 +1922,9 @@ AddEventHandler('esx_policejob:updateBlip', function() if not Config.EnableJobBlip then return end - + -- Is the player a cop? In that case show all the blips for other cops - if PlayerData.job ~= nil and PlayerData.job.name == 'police' then + if PlayerData.job and PlayerData.job.name == 'police' then ESX.TriggerServerCallback('esx_society:getOnlinePlayers', function(players) for i=1, #players, 1 do if players[i].job.name == 'police' then @@ -2128,7 +1942,7 @@ end) AddEventHandler('playerSpawned', function(spawn) isDead = false TriggerEvent('esx_policejob:unrestrain') - + if not hasAlreadyJoined then TriggerServerEvent('esx_policejob:spawned') end @@ -2148,24 +1962,24 @@ AddEventHandler('onResourceStop', function(resource) TriggerServerEvent('esx_service:disableService', 'police') end - if Config.EnableHandcuffTimer and HandcuffTimer.Active then - ESX.ClearTimeout(HandcuffTimer.Task) + if Config.EnableHandcuffTimer and handcuffTimer.active then + ESX.ClearTimeout(handcuffTimer.task) end end end) -- handcuff timer, unrestrain the player after an certain amount of time function StartHandcuffTimer() - if Config.EnableHandcuffTimer and HandcuffTimer.Active then - ESX.ClearTimeout(HandcuffTimer.Task) + if Config.EnableHandcuffTimer and handcuffTimer.active then + ESX.ClearTimeout(handcuffTimer.task) end - HandcuffTimer.Active = true + handcuffTimer.active = true - HandcuffTimer.Task = ESX.SetTimeout(Config.HandcuffTimer, function() + handcuffTimer.task = ESX.SetTimeout(Config.handcuffTimer, function() ESX.ShowNotification(_U('unrestrained_timer')) TriggerEvent('esx_policejob:unrestrain') - HandcuffTimer.Active = false + handcuffTimer.active = false end) end @@ -2174,7 +1988,7 @@ end -- - message owner that his vehicle has been impounded function ImpoundVehicle(vehicle) --local vehicleName = GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))) - ESX.Game.DeleteVehicle(vehicle) + ESX.Game.DeleteVehicle(vehicle) ESX.ShowNotification(_U('impound_successful')) - CurrentTask.Busy = false + currentTask.busy = false end diff --git a/server/main.lua b/server/main.lua index b4898a9b..fb356401 100644 --- a/server/main.lua +++ b/server/main.lua @@ -26,7 +26,7 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, -- does the target player have enough in their inventory? if targetItem.count > 0 and targetItem.count <= amount then - + -- can the player carry the said amount of x item? if sourceItem.limit ~= -1 and (sourceItem.count + amount) > sourceItem.limit then TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) @@ -112,7 +112,7 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count) -- is there enough in the society? if count > 0 and inventoryItem.count >= count then - + -- can the player carry the said amount of x item? if sourceItem.limit ~= -1 and (sourceItem.count + count) > sourceItem.limit then TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) @@ -513,24 +513,24 @@ end) AddEventHandler('playerDropped', function() -- Save the source in case we lose it (which happens a lot) local _source = source - + -- Did the player ever join? if _source ~= nil then local xPlayer = ESX.GetPlayerFromId(_source) - + -- Is it worth telling all clients to refresh? if xPlayer ~= nil and xPlayer.job ~= nil and xPlayer.job.name == 'police' then Citizen.Wait(5000) TriggerClientEvent('esx_policejob:updateBlip', -1) end - end + end end) RegisterServerEvent('esx_policejob:spawned') AddEventHandler('esx_policejob:spawned', function() local _source = source local xPlayer = ESX.GetPlayerFromId(_source) - + if xPlayer ~= nil and xPlayer.job ~= nil and xPlayer.job.name == 'police' then Citizen.Wait(5000) TriggerClientEvent('esx_policejob:updateBlip', -1) From 4778307d7f60d1ff4322ae6cc5dc72cea1635304 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 6 Jul 2019 13:57:13 +0200 Subject: [PATCH 207/253] Fixed #315, use loading prompt instead of drawing text --- client/main.lua | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/client/main.lua b/client/main.lua index 93bb1eff..67bac8ab 100644 --- a/client/main.lua +++ b/client/main.lua @@ -277,8 +277,8 @@ function OpenVehicleSpawnerMenu(type, station, part, partNum) shopCoords = Config.PoliceStations[station].Vehicles[partNum].InsideShop local authorizedVehicles = Config.AuthorizedVehicles[PlayerData.job.grade_name] - if #Config.AuthorizedVehicles['Shared'] > 0 then - for k,vehicle in ipairs(Config.AuthorizedVehicles['Shared']) do + if #Config.AuthorizedVehicles.Shared > 0 then + for k,vehicle in ipairs(Config.AuthorizedVehicles.Shared) do table.insert(shopElements, { label = ('%s - %s'):format(vehicle.label, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))), name = vehicle.label, @@ -300,7 +300,7 @@ function OpenVehicleSpawnerMenu(type, station, part, partNum) }) end else - if #Config.AuthorizedVehicles['Shared'] == 0 then + if #Config.AuthorizedVehicles.Shared == 0 then return end end @@ -413,10 +413,15 @@ function StoreNearbyVehicle(playerCoords) IsBusy = true Citizen.CreateThread(function() + BeginTextCommandBusyString('STRING') + AddTextComponentSubstringPlayerName(_U('garage_storing')) + EndTextCommandBusyString(4) + while IsBusy do - Citizen.Wait(0) - drawLoadingText(_U('garage_storing'), 255, 255, 255, 255) + Citizen.Wait(100) end + + RemoveLoadingPrompt() end) -- Workaround for vehicle not deleting when other players are near it. @@ -522,12 +527,13 @@ function OpenShopMenu(elements, restoreCoords, shopCoords) ESX.Game.Teleport(playerPed, restoreCoords) end, function(data, menu) DeleteSpawnedVehicles() - WaitForVehicleToLoad(data.current.model) + ESX.Game.SpawnLocalVehicle(data.current.model, shopCoords, 0.0, function(vehicle) table.insert(spawnedVehicles, vehicle) TaskWarpPedIntoVehicle(playerPed, vehicle, -1) FreezeEntityPosition(vehicle, true) + SetModelAsNoLongerNeeded(data.current.model) if data.current.livery then SetVehicleModKit(vehicle, 0) @@ -541,10 +547,11 @@ function OpenShopMenu(elements, restoreCoords, shopCoords) table.insert(spawnedVehicles, vehicle) TaskWarpPedIntoVehicle(playerPed, vehicle, -1) FreezeEntityPosition(vehicle, true) + SetModelAsNoLongerNeeded(elements[1].model) if elements[1].livery then SetVehicleModKit(vehicle, 0) - SetVehicleLivery(vehicle,elements[1].livery) + SetVehicleLivery(vehicle, elements[1].livery) end end) end @@ -576,29 +583,19 @@ function WaitForVehicleToLoad(modelHash) if not HasModelLoaded(modelHash) then RequestModel(modelHash) + BeginTextCommandBusyString('STRING') + AddTextComponentSubstringPlayerName(_U('vehicleshop_awaiting_model')) + EndTextCommandBusyString(4) + while not HasModelLoaded(modelHash) do Citizen.Wait(0) DisableAllControlActions(0) - - drawLoadingText(_U('vehicleshop_awaiting_model'), 255, 255, 255, 255) end + + RemoveLoadingPrompt() end end -function drawLoadingText(text, red, green, blue, alpha) - SetTextFont(4) - SetTextScale(0.0, 0.5) - SetTextColour(red, green, blue, alpha) - SetTextDropshadow(0, 0, 0, 0, 255) - SetTextDropShadow() - SetTextOutline() - SetTextCentre(true) - - BeginTextCommandDisplayText('STRING') - AddTextComponentSubstringPlayerName(text) - EndTextCommandDisplayText(0.5, 0.5) -end - function OpenPoliceActionsMenu() ESX.UI.Menu.CloseAll() @@ -1642,7 +1639,7 @@ Citizen.CreateThread(function() SetBlipColour (blip, v.Blip.Colour) SetBlipAsShortRange(blip, true) - BeginTextCommandSetBlipName("STRING") + BeginTextCommandSetBlipName('STRING') AddTextComponentString(_U('map_blip')) EndTextCommandSetBlipName(blip) end From 8a6f3d9e2fa8488780c0056193645323642a5236 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 6 Jul 2019 14:00:27 +0200 Subject: [PATCH 208/253] Fixed #331 --- client/main.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/main.lua b/client/main.lua index 67bac8ab..99314b7d 100644 --- a/client/main.lua +++ b/client/main.lua @@ -977,8 +977,8 @@ function LookupVehicle() end function ShowPlayerLicense(player) - local elements = {} - local targetName + local elements, targetName = {} + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) if data.licenses then for i=1, #data.licenses, 1 do @@ -997,8 +997,7 @@ function ShowPlayerLicense(player) targetName = data.name end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'manage_license', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'manage_license', { title = _U('license_revoke'), align = 'top-left', elements = elements, @@ -1025,7 +1024,7 @@ function OpenUnpaidBillsMenu(player) for k,bill in ipairs(bills) do table.insert(elements, { label = ('%s - %s'):format(bill.label, _U('armory_item', ESX.Math.GroupDigits(bill.amount))), - billId = bills[i].id + billId = bill.id }) end From 633268330cca0174c41a87b5d1d19aa4804c7e1a Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 28 Jul 2019 20:56:39 +0200 Subject: [PATCH 209/253] Fixed handcuffing, closes #314 and #316 --- client/main.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/client/main.lua b/client/main.lua index 99314b7d..fabe8c79 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,5 +1,5 @@ local PlayerData, CurrentActionData, handcuffTimer, dragStatus, blipsCops, currentTask, spawnedVehicles = {}, {}, {}, {}, {}, {}, {} -local HasAlreadyEnteredMarker, isDead, IsHandcuffed, hasAlreadyJoined, playerInService, isInShopMenu = false, false, false, false, false, false +local HasAlreadyEnteredMarker, isDead, isHandcuffed, hasAlreadyJoined, playerInService, isInShopMenu = false, false, false, false, false, false local LastStation, LastPart, LastPartNum, LastEntity, CurrentAction, CurrentActionMsg dragStatus.isDragged = false ESX = nil @@ -1416,11 +1416,11 @@ end) RegisterNetEvent('esx_policejob:handcuff') AddEventHandler('esx_policejob:handcuff', function() - IsHandcuffed = not IsHandcuffed + isHandcuffed = not isHandcuffed local playerPed = PlayerPedId() Citizen.CreateThread(function() - if IsHandcuffed then + if isHandcuffed then RequestAnimDict('mp_arresting') while not HasAnimDictLoaded('mp_arresting') do @@ -1460,9 +1460,9 @@ end) RegisterNetEvent('esx_policejob:unrestrain') AddEventHandler('esx_policejob:unrestrain', function() - if IsHandcuffed then + if isHandcuffed then local playerPed = PlayerPedId() - IsHandcuffed = false + isHandcuffed = false ClearPedSecondaryTask(playerPed) SetEnableHandcuffs(playerPed, false) @@ -1480,7 +1480,7 @@ end) RegisterNetEvent('esx_policejob:drag') AddEventHandler('esx_policejob:drag', function(copId) - if not IsHandcuffed then + if not isHandcuffed then return end @@ -1495,7 +1495,7 @@ Citizen.CreateThread(function() while true do Citizen.Wait(1) - if IsHandcuffed then + if isHandcuffed then playerPed = PlayerPedId() if dragStatus.isDragged then @@ -1528,7 +1528,7 @@ AddEventHandler('esx_policejob:putInVehicle', function() local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) - if not IsHandcuffed then + if not isHandcuffed then return end @@ -1571,7 +1571,7 @@ Citizen.CreateThread(function() Citizen.Wait(0) local playerPed = PlayerPedId() - if IsHandcuffed then + if isHandcuffed then DisableControlAction(0, 1, true) -- Disable pan DisableControlAction(0, 2, true) -- Disable tilt DisableControlAction(0, 24, true) -- Attack @@ -1972,7 +1972,7 @@ function StartHandcuffTimer() handcuffTimer.active = true - handcuffTimer.task = ESX.SetTimeout(Config.handcuffTimer, function() + handcuffTimer.task = ESX.SetTimeout(Config.HandcuffTimer, function() ESX.ShowNotification(_U('unrestrained_timer')) TriggerEvent('esx_policejob:unrestrain') handcuffTimer.active = false From 752c0d5e65881c1e9708651bb1ee60e7b4bc68e1 Mon Sep 17 00:00:00 2001 From: rex2630 Date: Sat, 7 Dec 2019 12:10:01 +0100 Subject: [PATCH 210/253] Add support for new ESX weight system (#365) * Add support for new ESX weight system * Update main.lua * Fix --- server/main.lua | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/server/main.lua b/server/main.lua index fb356401..e2b01235 100644 --- a/server/main.lua +++ b/server/main.lua @@ -28,32 +28,32 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, if targetItem.count > 0 and targetItem.count <= amount then -- can the player carry the said amount of x item? - if sourceItem.limit ~= -1 and (sourceItem.count + amount) > sourceItem.limit then - TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) - else + if sourceXPlayer.canCarryItem(itemName, sourceItem.count) then targetXPlayer.removeInventoryItem(itemName, amount) sourceXPlayer.addInventoryItem (itemName, amount) - TriggerClientEvent('esx:showNotification', _source, _U('you_confiscated', amount, sourceItem.label, targetXPlayer.name)) - TriggerClientEvent('esx:showNotification', target, _U('got_confiscated', amount, sourceItem.label, sourceXPlayer.name)) + sourceXPlayer.showNotification(_U('you_confiscated', amount, sourceItem.label, targetXPlayer.name)) + targetXPlayer.showNotification(_U('got_confiscated', amount, sourceItem.label, sourceXPlayer.name)) + else + sourceXPlayer.showNotification(_U('quantity_invalid')) end else - TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) + sourceXPlayer.showNotification(_U('quantity_invalid')) end elseif itemType == 'item_account' then targetXPlayer.removeAccountMoney(itemName, amount) sourceXPlayer.addAccountMoney (itemName, amount) - TriggerClientEvent('esx:showNotification', _source, _U('you_confiscated_account', amount, itemName, targetXPlayer.name)) - TriggerClientEvent('esx:showNotification', target, _U('got_confiscated_account', amount, itemName, sourceXPlayer.name)) + sourceXPlayer.showNotification(_U('you_confiscated_account', amount, itemName, targetXPlayer.name)) + targetXPlayer.showNotification(_U('got_confiscated_account', amount, itemName, sourceXPlayer.name)) elseif itemType == 'item_weapon' then if amount == nil then amount = 0 end targetXPlayer.removeWeapon(itemName, amount) sourceXPlayer.addWeapon (itemName, amount) - TriggerClientEvent('esx:showNotification', _source, _U('you_confiscated_weapon', ESX.GetWeaponLabel(itemName), targetXPlayer.name, amount)) - TriggerClientEvent('esx:showNotification', target, _U('got_confiscated_weapon', ESX.GetWeaponLabel(itemName), amount, sourceXPlayer.name)) + sourceXPlayer.showNotification(_U('you_confiscated_weapon', ESX.GetWeaponLabel(itemName), targetXPlayer.name, amount)) + targetXPlayer.showNotification(_U('got_confiscated_weapon', ESX.GetWeaponLabel(itemName), amount, sourceXPlayer.name)) end end) @@ -105,7 +105,6 @@ RegisterServerEvent('esx_policejob:getStockItem') AddEventHandler('esx_policejob:getStockItem', function(itemName, count) local _source = source local xPlayer = ESX.GetPlayerFromId(_source) - local sourceItem = xPlayer.getInventoryItem(itemName) TriggerEvent('esx_addoninventory:getSharedInventory', 'society_police', function(inventory) local inventoryItem = inventory.getItem(itemName) @@ -114,15 +113,15 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count) if count > 0 and inventoryItem.count >= count then -- can the player carry the said amount of x item? - if sourceItem.limit ~= -1 and (sourceItem.count + count) > sourceItem.limit then - TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) - else + if xPlayer.canCarryItem(itemName, count) then inventory.removeItem(itemName, count) xPlayer.addInventoryItem(itemName, count) - TriggerClientEvent('esx:showNotification', _source, _U('have_withdrawn', count, inventoryItem.label)) + xPlayer.showNotification(_U('have_withdrawn', count, inventoryItem.label)) + else + xPlayer.showNotification(_U('quantity_invalid')) end else - TriggerClientEvent('esx:showNotification', _source, _U('quantity_invalid')) + xPlayer.showNotification(_U('quantity_invalid')) end end) end) @@ -139,9 +138,9 @@ AddEventHandler('esx_policejob:putStockItems', function(itemName, count) if sourceItem.count >= count and count > 0 then xPlayer.removeInventoryItem(itemName, count) inventory.addItem(itemName, count) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited', count, inventoryItem.label)) + xPlayer.showNotification(_U('have_deposited', count, inventoryItem.label)) else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) + xPlayer.showNotification(_U('quantity_invalid')) end end) end) @@ -558,4 +557,4 @@ end) RegisterServerEvent('esx_policejob:message') AddEventHandler('esx_policejob:message', function(target, msg) TriggerClientEvent('esx:showNotification', target, msg) -end) \ No newline at end of file +end) From 4fd106e321ce5bc80b296d3365330dbae6fec84a Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 4 Jan 2020 11:03:55 +0100 Subject: [PATCH 211/253] Fixed cone not spawning --- client/main.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/client/main.lua b/client/main.lua index fabe8c79..688f7daa 100644 --- a/client/main.lua +++ b/client/main.lua @@ -747,15 +747,10 @@ function OpenPoliceActionsMenu() {label = _U('cash'), model = 'hei_prop_cash_crate_half_full'} }}, function(data2, menu2) local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - local forward = GetEntityForwardVector(playerPed) - local x, y, z = table.unpack(coords + forward * 1.0) + local coords, forward = GetEntityCoords(playerPed), GetEntityForwardVector(playerPed) + local objectCoords = (coords + forward * 1.0) - if data2.current.model == 'prop_roadcone02a' then - z = z - 2.0 - end - - ESX.Game.SpawnObject(data2.current.model, {x = x, y = y, z = z}, function(obj) + ESX.Game.SpawnObject(data2.current.model, objectCoords, function(obj) SetEntityHeading(obj, GetEntityHeading(playerPed)) PlaceObjectOnGroundProperly(obj) end) From 55f4881031ac1c944b81f16c389db91363b483fb Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 4 Jan 2020 11:04:06 +0100 Subject: [PATCH 212/253] Fixed Swedish typo --- locales/sv.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/sv.lua b/locales/sv.lua index 963e91e6..55dd9b3f 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -145,7 +145,7 @@ Locales['sv'] = { ['inventory'] = 'förråd', ['police_stock'] = 'polisförråd', -- Misc - ['remove_prop'] = 'tryck ~INPUT_CONTEXT~ för att ta bort obejektet', + ['remove_prop'] = 'tryck ~INPUT_CONTEXT~ för att ta bort objektet', ['map_blip'] = 'polisstation', ['unrestrained_timer'] = 'dina handklovar har försvunnit', -- Notifications From a64773124f28fa66effcaa7b6e5ecdac58b59301 Mon Sep 17 00:00:00 2001 From: JaeHyeok Kim Date: Sat, 4 Jan 2020 19:05:16 +0900 Subject: [PATCH 213/253] Added Korean support. (#354) * Added Korean localization of the SQL file * Added ko.lua * Fixed ko.lua, Updated resource.lua --- __resource.lua | 2 + locales/ko.lua | 154 ++++++++++++++++++++++++++++++ localization/ko_esx_policejob.sql | 90 +++++++++++++++++ 3 files changed, 246 insertions(+) create mode 100644 locales/ko.lua create mode 100644 localization/ko_esx_policejob.sql diff --git a/__resource.lua b/__resource.lua index dca1b4b1..c6eb4e6e 100644 --- a/__resource.lua +++ b/__resource.lua @@ -15,6 +15,7 @@ server_scripts { 'locales/fi.lua', 'locales/es.lua', 'locales/sv.lua', + 'locales/ko.lua', 'config.lua', 'server/main.lua' } @@ -29,6 +30,7 @@ client_scripts { 'locales/fi.lua', 'locales/es.lua', 'locales/sv.lua', + 'locales/ko.lua', 'config.lua', 'client/main.lua' } diff --git a/locales/ko.lua b/locales/ko.lua new file mode 100644 index 00000000..2a523c0c --- /dev/null +++ b/locales/ko.lua @@ -0,0 +1,154 @@ +Locales['ko'] = { + -- Cloakroom + ['cloakroom'] = '라커룸', + ['citizen_wear'] = '민간인 복장', + ['police_wear'] = '경찰 복장', + ['gilet_wear'] = '오렌지 반사 재킷', + ['bullet_wear'] = '방탄 조끼', + ['no_outfit'] = '당신에게 맞는 유니폼이 없습니다!', + ['open_cloackroom'] = '~y~옷~s~을 변경하려면 ~INPUT_CONTEXT~를 누르십시오.', + -- Armory + ['remove_object'] = '오브젝트를 빼다', + ['deposit_object'] = '오브젝트를 두다', + ['get_weapon'] = '병기고에서 무기를 빼다', + ['put_weapon'] = '병기고에 무기를 넣다', + ['buy_weapons'] = '무기 구매', + ['armory'] = '병기고', + ['open_armory'] = '~INPUT_CONTEXT~를 눌러 ~y~병기고~s~에 접근하십시오.', + ['armory_owned'] = '소유', + ['armory_free'] = '자유', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = '병기고 - 무기 구매', + ['armory_componenttitle'] = '병기고 - 무기 부착물', + ['armory_bought'] = '당신은 ~r~$%s~s~에 ~y~%s~s~를 구매했습니다', + ['armory_money'] = '당신은 이 무기를 살 수 없습니다', + ['armory_hascomponent'] = '이 부착물이 장착되어 있습니다!', + ['get_weapon_menu'] = '병기고 - 무기 빼다', + ['put_weapon_menu'] = '병기고 - 무기 넣다', + -- Vehicles + ['vehicle_menu'] = '차량', + ['vehicle_blocked'] = '모든 스폰 지점이 차단되었습니다!', + ['garage_prompt'] = '~INPUT_CONTEXT~를 눌러 ~y~차량 동작~s~에 액세스하십시오.', + ['garage_title'] = '차량 행동', + ['garage_stored'] = '저장됨', + ['garage_notstored'] = '차고가 아님', + ['garage_storing'] = '차량을 제거하려고 합니다. 주변에 아무도 없는지 확인하십시오.', + ['garage_has_stored'] = '차량이 차고에 보관되었습니다', + ['garage_has_notstored'] = '차고에 차량이 없습니다', + ['garage_notavailable'] = '차량이 차고에 저장되어 있지 않습니다', + ['garage_blocked'] = '차고 출구가 막혔습니다!', + ['garage_empty'] = '차고에 차량이 없습니다.', + ['garage_released'] = '차량이 출시되었습니다', + ['garage_store_nearby'] = '주변에 차량이 없습니다.', + ['garage_storeditem'] = '차고 열기', + ['garage_storeitem'] = '차량 정리', + ['garage_buyitem'] = '차량 상점', + ['helicopter_prompt'] = '~y~헬리콥터 동작~s~에 액세스하려면 ~INPUT_CONTEXT~를 누릅니다.', + ['helicopter_notauthorized'] = '헬리콥터를 구매할 수 없습니다.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = '차량 판매점', + ['vehicleshop_confirm'] = '이 차량을 사고 싶습니까?', + ['vehicleshop_bought'] = '당신은 ~r~$%s~s~에 ~y~%s~s~를 구매했습니다', + ['vehicleshop_money'] = '이 차량을 살 수 없습니다', + ['vehicleshop_awaiting_model'] = '차량이 현재 ~g~다운로드 및 로딩중입니다~s~. 잠시만 기다려주십시오', + ['confirm_no'] = '아니요', + ['confirm_yes'] = '예', + -- Service + ['service_max'] = '서비스에 진입 할 수 없습니다. 최대 임원 : %s/%s', + ['service_not'] = '당신은 서비스를 입력하지 않았습니다! 먼저 변경해야합니다.', + ['service_anonunce'] = '서비스 정보', + ['service_in'] = '당신은 서비스에 들어갔다, 환영합니다!', + ['service_in_announce'] = '~y~%s~s~가 서비스에 들어 왔습니다!', + ['service_out'] = '당신은 서비스를 떠났습니다.', + ['service_out_announce'] = '~y~%s~s~가 서비스를 떠났습니다.', + -- Action Menu + ['citizen_interaction'] = '시민 상호 작용', + ['vehicle_interaction'] = '차량 상호 작용', + ['object_spawner'] = '오브젝트 Spawner', + + ['id_card'] = '신분증', + ['search'] = '수색', + ['handcuff'] = '수갑을 채우다 / 수갑을 풀어주다', + ['drag'] = '호위', + ['put_in_vehicle'] = '차량에 넣다', + ['out_the_vehicle'] = '차량을 끌다', + ['fine'] = '벌금', + ['unpaid_bills'] = '미지급 벌금 관리', + ['license_check'] = '라이선스 관리', + ['license_revoke'] = '라이선스 취소', + ['license_revoked'] = '~b~%s~s~는 ~y~취소~s~입니다!', + ['licence_you_revoked'] = '~y~%s~s~에 속하는 ~b~%s~s~를 취소했습니다.', + ['no_players_nearby'] = '근처에 플레이어가 없습니다!', + ['being_searched'] = '~b~경찰~s~이 당신을 ~y~수색~s~', + -- Vehicle interaction + ['vehicle_info'] = '차량 정보', + ['pick_lock'] = '차량 락픽', + ['vehicle_unlocked'] = '차량 ~g~잠금 해제~s~', + ['no_vehicles_nearby'] = '근처에 차량이 없습니다', + ['impound'] = '차량을 견인하다', + ['impound_prompt'] = '~y~견인~s~을 취소하려면 ~INPUT_CONTEXT~를 누릅니다', + ['impound_canceled'] = '당신은 견인을 취소했습니다', + ['impound_canceled_moved'] = '차량이 움직였기 때문에 견인이 취소되었습니다', + ['impound_successful'] = '당신은 차량을 견인했습니다', + ['search_database'] = '차량 정보', + ['search_database_title'] = '차량 정보 - 등록번호로 검색', + ['search_database_error_invalid'] = '~y~유효한~s~ 등록 번호가 ~r~아닙니다.~s~', + ['search_database_error_not_found'] = '그 ~y~등록 번호~s~는 차량에 등록되지 ~r~않았습니다!~s~', + ['search_database_found'] = '이 차량은 ~b~%s~s~에 ~y~등록되었습니다~s~', + -- Traffic interaction + ['traffic_interaction'] = '교통 상호 작용', + ['cone'] = '원뿔', + ['barrier'] = '장벽', + ['spikestrips'] = '스파이크 스트립', + ['box'] = '상자', + ['cash'] = '현금 상자', + -- ID Card Menu + ['name'] = '이름: %s', + ['job'] = '직업: %s', + ['sex'] = '성별: %s', + ['dob'] = '생일: %s', + ['height'] = '키: %s', + ['id'] = 'ID: %s', + ['bac'] = '혈중 알코올 농도: %s', + ['unknown'] = '알 수 없는', + ['male'] = '남자', + ['female'] = '여자', + -- Body Search Menu + ['guns_label'] = '--- 총 ---', + ['inventory_label'] = '--- 인벤토리 ---', + ['license_label'] = ' --- 라이선스 ---', + ['confiscate'] = '%s 을 압수', + ['confiscate_weapon'] = '%s 와 %s 총알을 압수', + ['confiscate_inv'] = '%sx %s 을 압수', + ['confiscate_dirty'] = '더러운 돈을 압수: $%s', + ['you_confiscated'] = '당신은 ~y~%sx~s~ ~b~%s~s~을 ~b~%s~s~에게서 압수했습니다', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~이(가) ~y~%s~s~에 압수되었습니다', + ['you_confiscated_account'] = '당신은 ~g~$%s~s~ (%s) 를 ~b~%s~s~ 에게서 압수했습니다.', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) 이(가) ~y~%s~s~에 압수되었습니다', + ['you_confiscated_weapon'] = '당신은 ~b~%s~s~을 ~b~%s~s~에게서 압수하고 ~o~%s~s~ 총알도 압수했습니다.', + ['got_confiscated_weapon'] = '당신의 ~b~%s~s~와 ~o~%s~s~ 총알이 ~y~%s~s~에 의해 압수되었습니다.', + ['traffic_offense'] = '교통 위반', + ['minor_offense'] = '경범죄', + ['average_offense'] = '일반 범죄', + ['major_offense'] = '심각한 범죄', + ['fine_total'] = '벌금: %s', + -- Vehicle Info Menu + ['plate'] = '번호판: %s', + ['owner_unknown'] = '소유자: 알 수 없는', + ['owner'] = '소유자: %s', + -- Boss Menu + ['open_bossmenu'] = '~INPUT_CONTEXT~를 눌러 메뉴를 엽니다.', + ['quantity_invalid'] = '유효하지 않은 수량', + ['have_withdrawn'] = '당신은 ~y~%sx~s~ ~b~%s~s~ 뺐다 ', + ['have_deposited'] = '당신은 ~y~%sx~s~ ~b~%s~s~ 넣었다', + ['quantity'] = '수량', + ['inventory'] = '인벤토리', + ['police_stock'] = '경찰 자리', + -- Misc + ['remove_prop'] = '~INPUT_CONTEXT~를 눌러 오브젝트를 삭제하십시오.', + ['map_blip'] = '경찰서', + ['unrestrained_timer'] = '당신의 수갑이 천천히 풀리는 것을 느낍니다.', + -- Notifications + ['alert_police'] = '경찰 경보', + ['phone_police'] = '경찰', +} diff --git a/localization/ko_esx_policejob.sql b/localization/ko_esx_policejob.sql new file mode 100644 index 00000000..c3041914 --- /dev/null +++ b/localization/ko_esx_policejob.sql @@ -0,0 +1,90 @@ +USE `essentialmode`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police', '경찰', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police', '경찰', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', '경찰', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', '경찰') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','순경',20,'{}','{}'), + ('police',1,'officer','경장',40,'{}','{}'), + ('police',2,'sergeant','경사',60,'{}','{}'), + ('police',3,'lieutenant','경위',85,'{}','{}'), + ('police',4,'boss','경찰국장',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int(11) DEFAULT NULL, + `category` int(11) DEFAULT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('경적 남용', 30, 0), + ('연속으로 라인을 넘음', 40, 0), + ('역주행', 250, 0), + ('불법 U턴', 250, 0), + ('불법적인 오프로드 운전', 170, 0), + ('공무원 명령 미준수', 30, 0), + ('불법적으로 차량 정지', 150, 0), + ('불법 주차', 70, 0), + ('오른쪽으로 양보하지 않음', 70, 0), + ('등록되지 않은 차량', 90, 0), + ('정지선 지키지 않음', 105, 0), + ('빨간불에서 멈추지 않음', 130, 0), + ('위험한 추월', 100, 0), + ('불법 차량 운전', 100, 0), + ('무면허 운전', 1500, 0), + ('뺑소니', 800, 0), + ('5 km 이상 과속', 90, 0), + ('5-15 km 과속', 120, 0), + ('15-30 km 과속', 180, 0), + ('30 km 이상 과속', 300, 0), + ('교통방해', 110, 1), + ('공공질서 문제', 90, 1), + ('무질서한 행동', 90, 1), + ('공무집행 방해', 130, 1), + ('민간인에 대한 모욕', 75, 1), + ('공무원에 대한 모욕', 110, 1), + ('민간인에 대한 언어폭력', 90, 1), + ('공무원에 대한 언어폭력', 150, 1), + ('허위 정보 제공', 250, 1), + ('부패 시도', 1500, 1), + ('도시에서 무기 사용', 120, 2), + ('도시에서 위험한 무기 사용', 300, 2), + ('총기 면허 없음', 600, 2), + ('불법 무기 소지', 700, 2), + ('절도 도구 소지', 300, 2), + ('차량 절도', 1800, 2), + ('마약 판매/분배', 1500, 2), + ('마약 제조', 1500, 2), + ('마약 소지 ', 650, 2), + ('민간인 납치', 1500, 2), + ('공무원 납치', 2000, 2), + ('강도', 650, 2), + ('상점의 무장 강도', 650, 2), + ('은행의 무장 강도', 1500, 2), + ('민간인에 대한 폭행', 2000, 3), + ('공무원에 대한 폭행', 2500, 3), + ('민간인 살인 시도', 3000, 3), + ('공무원 살인 시도', 5000, 3), + ('민간인 살인', 10000, 3), + ('공무원 살인', 30000, 3), + ('우발적 살인', 1800, 3), + ('사기', 2000, 2); +; From 9c6b828dba69f205d141cd94ba9a18adf8e926b4 Mon Sep 17 00:00:00 2001 From: Viktor <35453587+LifeGoal@users.noreply.github.com> Date: Sat, 4 Jan 2020 11:06:25 +0100 Subject: [PATCH 214/253] Swedish locale update (#340) * sv.lua completion * Update sv.lua --- locales/sv.lua | 54 +++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/locales/sv.lua b/locales/sv.lua index 55dd9b3f..bbba9d4e 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -26,33 +26,33 @@ Locales['sv'] = { ['get_weapon_menu'] = 'vapenförråd - Ta ut vapen', ['put_weapon_menu'] = 'vapenförråd - Spara vapen', -- Vehicles - ['vehicle_menu'] = 'vehicle', - ['vehicle_blocked'] = 'all available spawn points are currently blocked!', - ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', - ['garage_title'] = 'vehicle Actions', - ['garage_stored'] = 'stored', - ['garage_notstored'] = 'not in garage', - ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', - ['garage_has_stored'] = 'the vehicle has been stored in your garage', - ['garage_has_notstored'] = 'no nearby owned vehicles were found', - ['garage_notavailable'] = 'your vehicle is not stored in the garage.', - ['garage_blocked'] = 'there\'s no available spawn points!', - ['garage_empty'] = 'you dont have any vehicles in your garage.', - ['garage_released'] = 'your vehicle has been released from the garage.', - ['garage_store_nearby'] = 'there is no nearby vehicles.', - ['garage_storeditem'] = 'open garage', - ['garage_storeitem'] = 'store vehicle in garage', - ['garage_buyitem'] = 'vehicle shop', - ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', - ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', - ['shop_item'] = '$%s', - ['vehicleshop_title'] = 'vehicle Shop', - ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', - ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', - ['vehicleshop_money'] = 'you cannot afford that vehicle', - ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', - ['confirm_no'] = 'no', - ['confirm_yes'] = 'yes', + ['vehicle_menu'] = 'fordon', + ['vehicle_blocked'] = 'det finns ingen tillgänglig plats att ställa ut fordonet på!', + ['garage_prompt'] = 'tryck ~INPUT_CONTEXT~ för att komma åt ~y~garaget~s~.', + ['garage_title'] = 'garage', + ['garage_stored'] = 'inställt', + ['garage_notstored'] = 'uttaget', + ['garage_storing'] = 'vi håller på att ställa in ditt fordon, se till att ingen är i närheten.', + ['garage_has_stored'] = 'fordonet har ställts in i garaget', + ['garage_has_notstored'] = 'inget ägt fordon finns i närheten', + ['garage_notavailable'] = 'ditt fordon är inte inställt i ditt garage.', + ['garage_blocked'] = 'det finns ingen tillgänglig plats att ställa ut fordonet på!', + ['garage_empty'] = 'du har inga fordon i ditt garage.', + ['garage_released'] = 'ditt fordon har tagits ut från garaget.', + ['garage_store_nearby'] = 'det finns inget fordon i närheten.', + ['garage_storeditem'] = 'öppna garage', + ['garage_storeitem'] = 'ställ in fordon', + ['garage_buyitem'] = 'fordonshandel', + ['helicopter_prompt'] = 'klicka på ~INPUT_CONTEXT~ för att komma åt ~y~garaget~s~.', + ['helicopter_notauthorized'] = 'du har inte behörighet till att köpa en helikopter.', + ['shop_item'] = '%s SEK', + ['vehicleshop_title'] = 'fordonshandel', + ['vehicleshop_confirm'] = 'vill du köpa detta fordon?', + ['vehicleshop_bought'] = 'du köpte ~y~%s~s~ för ~r~$%s~s~', + ['vehicleshop_money'] = 'du har inte råd med detta fordon', + ['vehicleshop_awaiting_model'] = 'fordonet ~g~LADDAS NED OCH LADDAS IN~s~ var god vänta', + ['confirm_no'] = 'nej', + ['confirm_yes'] = 'ja', -- Service ['service_max'] = 'du kan inte gå tjänst, poliser i tjänst: %s/%s', ['service_not'] = 'du är inte i tjänst! Byt om för att gå in i tjänst.', From 176adafc08c037f892c28e9ae44263893b223844 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 4 Jan 2020 11:15:47 +0100 Subject: [PATCH 215/253] Added missing requirements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: EDWernars Co-Authored-By: Petr 'celestian' Čech Co-Authored-By: kandasoranyan --- README.md | 18 ++++++++++++++---- __resource.lua | 3 ++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c8757c21..ec62e9de 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,16 @@ # esx_policejob +This resource for ESX adds police armories, vehicle garages and ability for cops to search, handcuff people and much more. + ### Requirements * Auto mode - * [esx_billing](https://github.com/FXServer-ESX/fxserver-esx_billing) + * [esx_billing](https://github.com/ESX-Org/esx_billing) + * [esx_vehicleshop](https://github.com/ESX-Org/esx_vehicleshop) * Player management (boss actions and armory with buyable weapons) - * [esx_society](https://github.com/FXServer-ESX/fxserver-esx_society) - * [esx_datastore](https://github.com/FXServer-ESX/fxserver-esx_datastore) + * [esx_addoninventory](https://github.com/ESX-Org/esx_addoninventory) + * [esx_datastore](https://github.com/ESX-Org/esx_datastore) + * [esx_society](https://github.com/ESX-Org/esx_society) * ESX Identity Support * [esx_identity](https://github.com/ESX-Org/esx_identity) @@ -14,6 +18,9 @@ * ESX License Support * [esx_license](https://github.com/ESX-Org/esx_license) +* ESX Service Support + * [esx_service](https://github.com/ESX-Org/esx_service) + ## Download & Installation ### Using [fvm](https://github.com/qlaffont/fvm-installer) @@ -39,15 +46,18 @@ git clone https://github.com/ESX-Org/esx_policejob [esx]/esx_policejob ``` start esx_policejob ``` + - * If you want player management you have to set `Config.EnablePlayerManagement` to `true` in `config.lua` * If you want armory management you have to set `Config.EnableArmoryManagement` to `true` in `config.lua` * If you want license management you have to set `Config.EnableLicenses` to `true` in `config.lua` + * If you want service management you have to set `Config.MaxInService` to a higher value than `-1` in `config.lua` + # Legal ### License esx_policejob - police script for ESX -Copyright (C) 2015-2018 Jérémie N'gadi +Copyright (C) 2015-2020 Jérémie N'gadi 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. diff --git a/__resource.lua b/__resource.lua index dca1b4b1..76c7da85 100644 --- a/__resource.lua +++ b/__resource.lua @@ -35,5 +35,6 @@ client_scripts { dependencies { 'es_extended', - 'esx_billing' + 'esx_billing', + 'esx_vehicleshop' } \ No newline at end of file From d733fe5428f113fe67056172ccbbfc1ccf5a79eb Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 19 Jan 2020 16:30:30 +0100 Subject: [PATCH 216/253] Minor code cleanup, use latest esx_identity code --- README.md | 3 +- client/main.lua | 83 +++++------------------ locales/br.lua | 1 - locales/de.lua | 1 - locales/en.lua | 3 +- locales/es.lua | 1 - locales/fi.lua | 1 - locales/fr.lua | 1 - locales/ko.lua | 1 - locales/pl.lua | 3 +- locales/sv.lua | 1 - server/main.lua | 175 +++++++++++++++++++----------------------------- 12 files changed, 88 insertions(+), 186 deletions(-) diff --git a/README.md b/README.md index ec62e9de..ee0709f4 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ git clone https://github.com/ESX-Org/esx_policejob [esx]/esx_policejob ## Installation - Import `esx_policejob.sql` in your database -- Add this in your server.cfg : +- Add this to your server.cfg: ``` start esx_policejob @@ -52,7 +52,6 @@ start esx_policejob * If you want license management you have to set `Config.EnableLicenses` to `true` in `config.lua` * If you want service management you have to set `Config.MaxInService` to a higher value than `-1` in `config.lua` - # Legal ### License esx_policejob - police script for ESX diff --git a/client/main.lua b/client/main.lua index 688f7daa..315b175f 100644 --- a/client/main.lua +++ b/client/main.lua @@ -610,7 +610,7 @@ function OpenPoliceActionsMenu() if data.current.value == 'citizen_interaction' then local elements = { {label = _U('id_card'), value = 'identity_card'}, - {label = _U('search'), value = 'body_search'}, + {label = _U('search'), value = 'search'}, {label = _U('handcuff'), value = 'handcuff'}, {label = _U('drag'), value = 'drag'}, {label = _U('put_in_vehicle'), value = 'put_in_vehicle'}, @@ -634,8 +634,7 @@ function OpenPoliceActionsMenu() if action == 'identity_card' then OpenIdentityCardMenu(closestPlayer) - elseif action == 'body_search' then - TriggerServerEvent('esx_policejob:message', GetPlayerServerId(closestPlayer), _U('being_searched')) + elseif action == 'search' then OpenBodySearchMenu(closestPlayer) elseif action == 'handcuff' then TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(closestPlayer)) @@ -765,58 +764,15 @@ end function OpenIdentityCardMenu(player) ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - local elements = {} - local nameLabel = _U('name', data.name) - local jobLabel, sexLabel, dobLabel, heightLabel, idLabel - - if data.job.grade_label and data.job.grade_label ~= '' then - jobLabel = _U('job', data.job.label .. ' - ' .. data.job.grade_label) - else - jobLabel = _U('job', data.job.label) - end - - if Config.EnableESXIdentity then - nameLabel = _U('name', data.firstname .. ' ' .. data.lastname) - - if data.sex then - if string.lower(data.sex) == 'm' then - sexLabel = _U('sex', _U('male')) - else - sexLabel = _U('sex', _U('female')) - end - else - sexLabel = _U('sex', _U('unknown')) - end - - if data.dob then - dobLabel = _U('dob', data.dob) - else - dobLabel = _U('dob', _U('unknown')) - end - - if data.height then - heightLabel = _U('height', data.height) - else - heightLabel = _U('height', _U('unknown')) - end - - if data.name then - idLabel = _U('id', data.name) - else - idLabel = _U('id', _U('unknown')) - end - end - local elements = { - {label = nameLabel}, - {label = jobLabel} + {label = _U('name', data.name)}, + {label = _U('job', ('%s - %s'):format(data.job.label, data.job.grade_label))} } if Config.EnableESXIdentity then - table.insert(elements, {label = sexLabel}) - table.insert(elements, {label = dobLabel}) - table.insert(elements, {label = heightLabel}) - table.insert(elements, {label = idLabel}) + table.insert(elements, {label = _U('sex', _U(data.sex))}) + table.insert(elements, {label = _U('dob', data.dob)}) + table.insert(elements, {label = _U('height', data.height)}) end if data.drunk then @@ -949,8 +905,7 @@ function OpenFineCategoryMenu(player, category) end function LookupVehicle() - ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'lookup_vehicle', - { + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'lookup_vehicle', { title = _U('search_database_title'), }, function(data, menu) local length = string.len(data.value) @@ -972,32 +927,26 @@ function LookupVehicle() end function ShowPlayerLicense(player) - local elements, targetName = {} + local elements = {} - ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) - if data.licenses then - for i=1, #data.licenses, 1 do - if data.licenses[i].label and data.licenses[i].type then + ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(playerData) + if playerData.licenses then + for i=1, #playerData.licenses, 1 do + if playerData.licenses[i].label and playerData.licenses[i].type then table.insert(elements, { - label = data.licenses[i].label, - type = data.licenses[i].type + label = playerData.licenses[i].label, + type = playerData.licenses[i].type }) end end end - if Config.EnableESXIdentity then - targetName = data.firstname .. ' ' .. data.lastname - else - targetName = data.name - end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'manage_license', { title = _U('license_revoke'), align = 'top-left', elements = elements, }, function(data, menu) - ESX.ShowNotification(_U('licence_you_revoked', data.current.label, targetName)) + ESX.ShowNotification(_U('licence_you_revoked', data.current.label, playerData.name)) TriggerServerEvent('esx_policejob:message', GetPlayerServerId(player), _U('license_revoked', data.current.label)) TriggerServerEvent('esx_license:removeLicense', GetPlayerServerId(player), data.current.type) diff --git a/locales/br.lua b/locales/br.lua index 9f040eab..13ad287c 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -108,7 +108,6 @@ Locales['br'] = { ['sex'] = 'sex: %s', ['dob'] = 'DOB: %s', ['height'] = 'height: %s', - ['id'] = 'ID: %s', ['bac'] = 'BAC: %s', ['unknown'] = 'unknown', ['male'] = 'male', diff --git a/locales/de.lua b/locales/de.lua index 2f5a9b07..eb6ee554 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -108,7 +108,6 @@ Locales['de'] = { ['sex'] = 'sex: %s', ['dob'] = 'DOB: %s', ['height'] = 'height: %s', - ['id'] = 'ID: %s', ['bac'] = 'BAC: %s', ['unknown'] = 'unknown', ['male'] = 'male', diff --git a/locales/en.lua b/locales/en.lua index 69a6b496..323f4e7d 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -108,7 +108,6 @@ Locales['en'] = { ['sex'] = 'sex: %s', ['dob'] = 'DOB: %s', ['height'] = 'height: %s', - ['id'] = 'ID: %s', ['bac'] = 'BAC: %s', ['unknown'] = 'unknown', ['male'] = 'male', @@ -117,7 +116,7 @@ Locales['en'] = { ['guns_label'] = '--- Guns ---', ['inventory_label'] = '--- Inventory ---', ['license_label'] = ' --- Licenses ---', - ['confiscate'] = 'confiscate %s', + ['confiscate'] = 'sieze illegal items', ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'confiscate %sx %s', ['confiscate_dirty'] = 'confiscate dirty money: $%s', diff --git a/locales/es.lua b/locales/es.lua index 202b444e..c9c05cc5 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -108,7 +108,6 @@ Locales['es'] = { ['sex'] = 'sex: %s', ['dob'] = 'DOB: %s', ['height'] = 'height: %s', - ['id'] = 'ID: %s', ['bac'] = 'BAC: %s', ['unknown'] = 'unknown', ['male'] = 'male', diff --git a/locales/fi.lua b/locales/fi.lua index 89fce3ff..93c8af21 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -108,7 +108,6 @@ Locales['fi'] = { ['sex'] = 'sukupuoli: %s', ['dob'] = 'syntymäaika: %s', ['height'] = 'pituus: %s', - ['id'] = 'ID: %s', ['bac'] = 'alkometri: %s', ['unknown'] = 'tuntematon', ['male'] = 'mies', diff --git a/locales/fr.lua b/locales/fr.lua index 2165e130..8f3071cc 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -108,7 +108,6 @@ Locales['fr'] = { ['sex'] = 'sexe: %s', ['dob'] = 'DOB: %s', ['height'] = 'taille: %s', - ['id'] = 'ID: %s', ['bac'] = 'BAC: %s', ['unknown'] = 'inconnu', ['male'] = 'homme', diff --git a/locales/ko.lua b/locales/ko.lua index 2a523c0c..cf7fe418 100644 --- a/locales/ko.lua +++ b/locales/ko.lua @@ -108,7 +108,6 @@ Locales['ko'] = { ['sex'] = '성별: %s', ['dob'] = '생일: %s', ['height'] = '키: %s', - ['id'] = 'ID: %s', ['bac'] = '혈중 알코올 농도: %s', ['unknown'] = '알 수 없는', ['male'] = '남자', diff --git a/locales/pl.lua b/locales/pl.lua index 3ce1d255..210092ca 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -108,8 +108,7 @@ Locales['pl'] = { ['sex'] = 'płeć: %s', ['dob'] = 'data urodzenia: %s', ['height'] = 'wzrost: %s', - ['id'] = 'iD: %s', - ['bac'] = 'bAC: %s', + ['bac'] = 'BAC: %s', ['unknown'] = 'nieznany', ['male'] = 'mężczyzna', ['female'] = 'kobieta', diff --git a/locales/sv.lua b/locales/sv.lua index bbba9d4e..a79aef07 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -108,7 +108,6 @@ Locales['sv'] = { ['sex'] = 'kön: %s', ['dob'] = 'födelsedatum: %s', ['height'] = 'längd: %s', - ['id'] = 'ID: %s', ['bac'] = 'alkohol i blodet: %s', ['unknown'] = 'okänt', ['male'] = 'man', diff --git a/server/main.lua b/server/main.lua index e2b01235..06097983 100644 --- a/server/main.lua +++ b/server/main.lua @@ -9,7 +9,7 @@ end TriggerEvent('esx_phone:registerNumber', 'police', _U('alert_police'), true, true) TriggerEvent('esx_society:registerSociety', 'police', 'Police', 'society_police', 'society_police', 'society_police', {type = 'public'}) -RegisterServerEvent('esx_policejob:confiscatePlayerItem') +RegisterNetEvent('esx_policejob:confiscatePlayerItem') AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, itemName, amount) local _source = source local sourceXPlayer = ESX.GetPlayerFromId(_source) @@ -57,7 +57,7 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, end end) -RegisterServerEvent('esx_policejob:handcuff') +RegisterNetEvent('esx_policejob:handcuff') AddEventHandler('esx_policejob:handcuff', function(target) local xPlayer = ESX.GetPlayerFromId(source) @@ -68,7 +68,7 @@ AddEventHandler('esx_policejob:handcuff', function(target) end end) -RegisterServerEvent('esx_policejob:drag') +RegisterNetEvent('esx_policejob:drag') AddEventHandler('esx_policejob:drag', function(target) local xPlayer = ESX.GetPlayerFromId(source) @@ -79,7 +79,7 @@ AddEventHandler('esx_policejob:drag', function(target) end end) -RegisterServerEvent('esx_policejob:putInVehicle') +RegisterNetEvent('esx_policejob:putInVehicle') AddEventHandler('esx_policejob:putInVehicle', function(target) local xPlayer = ESX.GetPlayerFromId(source) @@ -90,7 +90,7 @@ AddEventHandler('esx_policejob:putInVehicle', function(target) end end) -RegisterServerEvent('esx_policejob:OutVehicle') +RegisterNetEvent('esx_policejob:OutVehicle') AddEventHandler('esx_policejob:OutVehicle', function(target) local xPlayer = ESX.GetPlayerFromId(source) @@ -101,7 +101,7 @@ AddEventHandler('esx_policejob:OutVehicle', function(target) end end) -RegisterServerEvent('esx_policejob:getStockItem') +RegisterNetEvent('esx_policejob:getStockItem') AddEventHandler('esx_policejob:getStockItem', function(itemName, count) local _source = source local xPlayer = ESX.GetPlayerFromId(_source) @@ -126,7 +126,7 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count) end) end) -RegisterServerEvent('esx_policejob:putStockItems') +RegisterNetEvent('esx_policejob:putStockItems') AddEventHandler('esx_policejob:putStockItems', function(itemName, count) local xPlayer = ESX.GetPlayerFromId(source) local sourceItem = xPlayer.getInventoryItem(itemName) @@ -145,68 +145,44 @@ AddEventHandler('esx_policejob:putStockItems', function(itemName, count) end) end) -ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, cb, target) - if Config.EnableESXIdentity then - local xPlayer = ESX.GetPlayerFromId(target) - local result = MySQL.Sync.fetchAll('SELECT firstname, lastname, sex, dateofbirth, height FROM users WHERE identifier = @identifier', { - ['@identifier'] = xPlayer.identifier - }) +ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, cb, target, notify) + local xPlayer = ESX.GetPlayerFromId(target) - local firstname = result[1].firstname - local lastname = result[1].lastname - local sex = result[1].sex - local dob = result[1].dateofbirth - local height = result[1].height + if notify then + xPlayer.showNotification(_U('being_searched')) + end + if xPlayer then local data = { - name = GetPlayerName(target), - job = xPlayer.job, - inventory = xPlayer.inventory, - accounts = xPlayer.accounts, - weapons = xPlayer.loadout, - firstname = firstname, - lastname = lastname, - sex = sex, - dob = dob, - height = height + name = xPlayer.getName(), + job = xPlayer.job.label, + grade = xPlayer.job.grade_label, + inventory = xPlayer.getInventory(), + accounts = xPlayer.getAccounts(), + weapons = xPlayer.getLoadout() } - TriggerEvent('esx_status:getStatus', target, 'drunk', function(status) - if status ~= nil then - data.drunk = math.floor(status.percent) - end - end) + if Config.EnableESXIdentity then + data.dob = xPlayer.get('dateofbirth') + data.height = xPlayer.get('height') - if Config.EnableLicenses then - TriggerEvent('esx_license:getLicenses', target, function(licenses) - data.licenses = licenses - cb(data) - end) - else - cb(data) + if xPlayer.get('sex') == 'm' then data.sex = 'male' else data.sex = 'female' end end - else - local xPlayer = ESX.GetPlayerFromId(target) - - local data = { - name = GetPlayerName(target), - job = xPlayer.job, - inventory = xPlayer.inventory, - accounts = xPlayer.accounts, - weapons = xPlayer.loadout - } TriggerEvent('esx_status:getStatus', target, 'drunk', function(status) if status then - data.drunk = math.floor(status.percent) + data.drunk = ESX.Math.Round(status.percent) + end + + if Config.EnableLicenses then + TriggerEvent('esx_license:getLicenses', target, function(licenses) + data.licenses = licenses + cb(data) + end) + else + cb(data) end end) - - TriggerEvent('esx_license:getLicenses', target, function(licenses) - data.licenses = licenses - end) - - cb(data) end end) @@ -219,28 +195,35 @@ ESX.RegisterServerCallback('esx_policejob:getFineList', function(source, cb, cat end) ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, plate) - MySQL.Async.fetchAll('SELECT owner FROM owned_vehicles WHERE plate = @plate', { ['@plate'] = plate }, function(result) - - local retrivedInfo = { - plate = plate - } + local retrivedInfo = {plate = plate} if result[1] then - MySQL.Async.fetchAll('SELECT name, firstname, lastname FROM users WHERE identifier = @identifier', { - ['@identifier'] = result[1].owner - }, function(result2) - - if Config.EnableESXIdentity then - retrivedInfo.owner = result2[1].firstname .. ' ' .. result2[1].lastname - else - retrivedInfo.owner = result2[1].name - end + local xPlayer = ESX.GetPlayerFromIdentifier(result[1].owner) + -- is the owner online? + if xPlayer then + retrivedInfo.owner = xPlayer.getName() cb(retrivedInfo) - end) + else + MySQL.Async.fetchAll('SELECT name, firstname, lastname FROM users WHERE identifier = @identifier', { + ['@identifier'] = result[1].owner + }, function(result2) + if result2[1] then + if Config.EnableESXIdentity then + retrivedInfo.owner = ('%s %s'):format(result2[1].firstname, result2[1].lastname) + else + retrivedInfo.owner = result2[1].name + end + + cb(retrivedInfo) + else + cb(retrivedInfo) + end + end) + end else cb(retrivedInfo) end @@ -251,14 +234,13 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleFromPlate', function(source, MySQL.Async.fetchAll('SELECT owner FROM owned_vehicles WHERE plate = @plate', { ['@plate'] = plate }, function(result) - if result[1] ~= nil then - + if result[1] then MySQL.Async.fetchAll('SELECT name, firstname, lastname FROM users WHERE identifier = @identifier', { ['@identifier'] = result[1].owner }, function(result2) if Config.EnableESXIdentity then - cb(result2[1].firstname .. ' ' .. result2[1].lastname, true) + cb(('%s %s'):format(result2[1].firstname, result2[1].lastname), true) else cb(result2[1].name, true) end @@ -290,12 +272,7 @@ ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon', function(source, cb, end TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) - local weapons = store.get('weapons') - - if weapons == nil then - weapons = {} - end - + local weapons = store.get('weapons') or {} local foundWeapon = false for i=1, #weapons, 1 do @@ -323,12 +300,7 @@ ESX.RegisterServerCallback('esx_policejob:removeArmoryWeapon', function(source, xPlayer.addWeapon(weaponName, 500) TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) - - local weapons = store.get('weapons') - - if weapons == nil then - weapons = {} - end + local weapons = store.get('weapons') or {} local foundWeapon = false @@ -342,7 +314,7 @@ ESX.RegisterServerCallback('esx_policejob:removeArmoryWeapon', function(source, if not foundWeapon then table.insert(weapons, { - name = weaponName, + name = weaponName, count = 0 }) end @@ -382,7 +354,6 @@ ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weapo elseif type == 2 then local price = selectedWeapon.components[componentNum] local weaponNum, weapon = ESX.GetWeapon(weaponName) - local component = weapon.components[componentNum] if component then @@ -402,7 +373,6 @@ ESX.RegisterServerCallback('esx_policejob:buyWeapon', function(source, cb, weapo end end) - ESX.RegisterServerCallback('esx_policejob:buyJobVehicle', function(source, cb, vehicleProps, type) local xPlayer = ESX.GetPlayerFromId(source) local price = getPriceFromHash(vehicleProps.model, xPlayer.job.grade_name, type) @@ -464,7 +434,6 @@ ESX.RegisterServerCallback('esx_policejob:storeNearbyVehicle', function(source, end end) end - end) function getPriceFromHash(hashKey, jobGrade, type) @@ -506,37 +475,36 @@ ESX.RegisterServerCallback('esx_policejob:getPlayerInventory', function(source, local xPlayer = ESX.GetPlayerFromId(source) local items = xPlayer.inventory - cb( { items = items } ) + cb({items = items}) end) AddEventHandler('playerDropped', function() -- Save the source in case we lose it (which happens a lot) - local _source = source + local playerId = source -- Did the player ever join? - if _source ~= nil then - local xPlayer = ESX.GetPlayerFromId(_source) + if playerId then + local xPlayer = ESX.GetPlayerFromId(playerId) -- Is it worth telling all clients to refresh? - if xPlayer ~= nil and xPlayer.job ~= nil and xPlayer.job.name == 'police' then + if xPlayer and xPlayer.job.name == 'police' then Citizen.Wait(5000) TriggerClientEvent('esx_policejob:updateBlip', -1) end end end) -RegisterServerEvent('esx_policejob:spawned') +RegisterNetEvent('esx_policejob:spawned') AddEventHandler('esx_policejob:spawned', function() - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) + local xPlayer = ESX.GetPlayerFromId(playerId) - if xPlayer ~= nil and xPlayer.job ~= nil and xPlayer.job.name == 'police' then + if xPlayer and xPlayer.job.name == 'police' then Citizen.Wait(5000) TriggerClientEvent('esx_policejob:updateBlip', -1) end end) -RegisterServerEvent('esx_policejob:forceBlip') +RegisterNetEvent('esx_policejob:forceBlip') AddEventHandler('esx_policejob:forceBlip', function() TriggerClientEvent('esx_policejob:updateBlip', -1) end) @@ -553,8 +521,3 @@ AddEventHandler('onResourceStop', function(resource) TriggerEvent('esx_phone:removeNumber', 'police') end end) - -RegisterServerEvent('esx_policejob:message') -AddEventHandler('esx_policejob:message', function(target, msg) - TriggerClientEvent('esx:showNotification', target, msg) -end) From 950ea7e626bb80ec8419db6d4e4e0b58698858d2 Mon Sep 17 00:00:00 2001 From: rex2630 Date: Sun, 19 Jan 2020 16:45:08 +0100 Subject: [PATCH 217/253] Replace __resource.lua with fxmanifest.lua --- __resource.lua => fxmanifest.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename __resource.lua => fxmanifest.lua (90%) diff --git a/__resource.lua b/fxmanifest.lua similarity index 90% rename from __resource.lua rename to fxmanifest.lua index ec94a2c4..85852ca4 100644 --- a/__resource.lua +++ b/fxmanifest.lua @@ -1,4 +1,6 @@ -resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' +fx_version 'adamant' + +game 'gta5' description 'ESX Police Job' @@ -39,4 +41,4 @@ dependencies { 'es_extended', 'esx_billing', 'esx_vehicleshop' -} \ No newline at end of file +} From 4150f8c9111582683487f1096db460a704a135d2 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 22 Jan 2020 12:20:37 +0100 Subject: [PATCH 218/253] Cloakroom cleanup --- client/main.lua | 118 +++++-------- config.lua | 434 ++++++++++++++++++++++++++---------------------- server/main.lua | 2 +- 3 files changed, 280 insertions(+), 274 deletions(-) diff --git a/client/main.lua b/client/main.lua index 315b175f..ebb4e7a7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -25,28 +25,24 @@ function cleanPlayer(playerPed) ResetPedMovementClipset(playerPed, 0) end -function setUniform(job, playerPed) +function setUniform(uniform, playerPed) TriggerEvent('skinchanger:getSkin', function(skin) - if skin.sex == 0 then - if Config.Uniforms[job].male then - TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].male) - else - ESX.ShowNotification(_U('no_outfit')) - end + local uniformObject - if job == 'bullet_wear' then + if skin.sex == 0 then + uniformObject = Config.Uniforms[uniform].male + else + uniformObject = Config.Uniforms[uniform].female + end + + if uniformObject then + TriggerEvent('skinchanger:loadClothes', skin, uniformObject) + + if uniform == 'bullet_wear' then SetPedArmour(playerPed, 100) end else - if Config.Uniforms[job].female then - TriggerEvent('skinchanger:loadClothes', skin, Config.Uniforms[job].female) - else - ESX.ShowNotification(_U('no_outfit')) - end - - if job == 'bullet_wear' then - SetPedArmour(playerPed, 100) - end + ESX.ShowNotification(_U('no_outfit')) end end) end @@ -56,31 +52,20 @@ function OpenCloakroomMenu() local grade = PlayerData.job.grade_name local elements = { - { label = _U('citizen_wear'), value = 'citizen_wear' }, - { label = _U('bullet_wear'), value = 'bullet_wear' }, - { label = _U('gilet_wear'), value = 'gilet_wear' } + {label = _U('citizen_wear'), value = 'citizen_wear'}, + {label = _U('bullet_wear'), uniform = 'bullet_wear'}, + {label = _U('gilet_wear'), uniform = 'gilet_wear'}, + {label = _U('police_wear'), uniform = grade} } - if grade == 'recruit' then - table.insert(elements, {label = _U('police_wear'), value = 'recruit_wear'}) - elseif grade == 'officer' then - table.insert(elements, {label = _U('police_wear'), value = 'officer_wear'}) - elseif grade == 'sergeant' then - table.insert(elements, {label = _U('police_wear'), value = 'sergeant_wear'}) - elseif grade == 'intendent' then - table.insert(elements, {label = _U('police_wear'), value = 'intendent_wear'}) - elseif grade == 'lieutenant' then - table.insert(elements, {label = _U('police_wear'), value = 'lieutenant_wear'}) - elseif grade == 'chef' then - table.insert(elements, {label = _U('police_wear'), value = 'chef_wear'}) - elseif grade == 'boss' then - table.insert(elements, {label = _U('police_wear'), value = 'boss_wear'}) - end + if Config.EnableCustomPeds then + for k,v in ipairs(Config.CustomPeds.shared) do + table.insert(elements, {label = v.label, value = 'freemode_ped', maleModel = v.maleModel, femaleModel = v.femaleModel}) + end - if Config.EnableNonFreemodePeds then - table.insert(elements, {label = 'Sheriff wear', value = 'freemode_ped', maleModel = 's_m_y_sheriff_01', femaleModel = 's_f_y_sheriff_01'}) - table.insert(elements, {label = 'Police wear', value = 'freemode_ped', maleModel = 's_m_y_cop_01', femaleModel = 's_f_y_cop_01'}) - table.insert(elements, {label = 'Swat wear', value = 'freemode_ped', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'}) + for k,v in ipairs(Config.CustomPeds[grade]) do + table.insert(elements, {label = v.label, value = 'freemode_ped', maleModel = v.maleModel, femaleModel = v.femaleModel}) + end end ESX.UI.Menu.CloseAll() @@ -111,7 +96,7 @@ function OpenCloakroomMenu() end) end - if Config.MaxInService ~= -1 then + if Config.EnableESXService then ESX.TriggerServerCallback('esx_service:isInService', function(isInService) if isInService then playerInService = false @@ -133,8 +118,8 @@ function OpenCloakroomMenu() end end - if Config.MaxInService ~= -1 and data.current.value ~= 'citizen_wear' then - local serviceOk = 'waiting' + if Config.EnableESXService and data.current.value ~= 'citizen_wear' then + local awaitService ESX.TriggerServerCallback('esx_service:isInService', function(isInService) if not isInService then @@ -143,7 +128,7 @@ function OpenCloakroomMenu() if not canTakeService then ESX.ShowNotification(_U('service_max', inServiceCount, maxInService)) else - serviceOk = true + awaitService = true playerInService = true local notification = { @@ -160,36 +145,24 @@ function OpenCloakroomMenu() end, 'police') else - serviceOk = true + awaitService = true end end, 'police') - while type(serviceOk) == 'string' do + while awaitService == nil do Citizen.Wait(5) end -- if we couldn't enter service don't let the player get changed - if not serviceOk then + if not awaitService then return end end - if - data.current.value == 'recruit_wear' or - data.current.value == 'officer_wear' or - data.current.value == 'sergeant_wear' or - data.current.value == 'intendent_wear' or - data.current.value == 'lieutenant_wear' or - data.current.value == 'chef_wear' or - data.current.value == 'boss_wear' or - data.current.value == 'bullet_wear' or - data.current.value == 'gilet_wear' - then - setUniform(data.current.value, playerPed) - end - - if data.current.value == 'freemode_ped' then - local modelHash = '' + if data.current.uniform then + setUniform(data.current.uniform, playerPed) + elseif data.current.value == 'freemode_ped' then + local modelHash ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) if skin.sex == 0 then @@ -201,6 +174,7 @@ function OpenCloakroomMenu() ESX.Streaming.RequestModel(modelHash, function() SetPlayerModel(PlayerId(), modelHash) SetModelAsNoLongerNeeded(modelHash) + SetPedDefaultComponentVariation(PlayerPedId()) TriggerEvent('esx:restoreLoadout') end) @@ -413,15 +387,15 @@ function StoreNearbyVehicle(playerCoords) IsBusy = true Citizen.CreateThread(function() - BeginTextCommandBusyString('STRING') + BeginTextCommandBusyspinnerOn('STRING') AddTextComponentSubstringPlayerName(_U('garage_storing')) - EndTextCommandBusyString(4) + EndTextCommandBusyspinnerOn(4) while IsBusy do Citizen.Wait(100) end - RemoveLoadingPrompt() + BusyspinnerOff() end) -- Workaround for vehicle not deleting when other players are near it. @@ -583,16 +557,16 @@ function WaitForVehicleToLoad(modelHash) if not HasModelLoaded(modelHash) then RequestModel(modelHash) - BeginTextCommandBusyString('STRING') + BeginTextCommandBusyspinnerOn('STRING') AddTextComponentSubstringPlayerName(_U('vehicleshop_awaiting_model')) - EndTextCommandBusyString(4) + EndTextCommandBusyspinnerOn(4) while not HasModelLoaded(modelHash) do Citizen.Wait(0) DisableAllControlActions(0) end - RemoveLoadingPrompt() + BusyspinnerOff() end end @@ -620,7 +594,7 @@ function OpenPoliceActionsMenu() } if Config.EnableLicenses then - table.insert(elements, { label = _U('license_check'), value = 'license' }) + table.insert(elements, {label = _U('license_check'), value = 'license'}) end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', { @@ -1291,7 +1265,7 @@ end) AddEventHandler('esx_phone:cancelMessage', function(dispatchNumber) if PlayerData.job and PlayerData.job.name == 'police' and PlayerData.job.name == dispatchNumber then -- if esx_service is enabled - if Config.MaxInService ~= -1 and not playerInService then + if Config.EnableESXService and not playerInService then CancelEvent() end end @@ -1855,7 +1829,7 @@ AddEventHandler('esx_policejob:updateBlip', function() blipsCops = {} -- Enable blip? - if Config.MaxInService ~= -1 and not playerInService then + if Config.EnableESXService and not playerInService then return end @@ -1898,7 +1872,7 @@ AddEventHandler('onResourceStop', function(resource) TriggerEvent('esx_policejob:unrestrain') TriggerEvent('esx_phone:removeSpecialContact', 'police') - if Config.MaxInService ~= -1 then + if Config.EnableESXService then TriggerServerEvent('esx_service:disableService', 'police') end diff --git a/config.lua b/config.lua index d7712724..a47eaa62 100644 --- a/config.lua +++ b/config.lua @@ -2,21 +2,23 @@ Config = {} Config.DrawDistance = 100.0 Config.MarkerType = 1 -Config.MarkerSize = { x = 1.5, y = 1.5, z = 0.5 } -Config.MarkerColor = { r = 50, g = 50, b = 204 } +Config.MarkerSize = {x = 1.5, y = 1.5, z = 0.5} +Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false Config.EnableArmoryManagement = false Config.EnableESXIdentity = false -- enable if you're using esx_identity -Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds Config.EnableLicenses = false -- enable if you're using esx_license Config.EnableHandcuffTimer = true -- enable handcuff timer? will unrestrain player after the time ends Config.HandcuffTimer = 10 * 60000 -- 10 mins -Config.EnableJobBlip = false -- enable blips for colleagues, requires esx_society +Config.EnableJobBlip = false -- enable blips for cops on duty, requires esx_society +Config.EnableCustomPeds = false -- enable custom peds in cloak room? See Config.CustomPeds below to customize peds + +Config.EnableESXService = false -- enable esx service? +Config.MaxInService = 5 -Config.MaxInService = -1 Config.Locale = 'fr' Config.PoliceStations = { @@ -44,10 +46,10 @@ Config.PoliceStations = { Spawner = vector3(454.6, -1017.4, 28.4), InsideShop = vector3(228.5, -993.5, -99.5), SpawnPoints = { - { coords = vector3(438.4, -1018.3, 27.7), heading = 90.0, radius = 6.0 }, - { coords = vector3(441.0, -1024.2, 28.3), heading = 90.0, radius = 6.0 }, - { coords = vector3(453.5, -1022.2, 28.0), heading = 90.0, radius = 6.0 }, - { coords = vector3(450.9, -1016.5, 28.1), heading = 90.0, radius = 6.0 } + {coords = vector3(438.4, -1018.3, 27.7), heading = 90.0, radius = 6.0}, + {coords = vector3(441.0, -1024.2, 28.3), heading = 90.0, radius = 6.0}, + {coords = vector3(453.5, -1022.2, 28.0), heading = 90.0, radius = 6.0}, + {coords = vector3(450.9, -1016.5, 28.1), heading = 90.0, radius = 6.0} } }, @@ -55,8 +57,8 @@ Config.PoliceStations = { Spawner = vector3(473.3, -1018.8, 28.0), InsideShop = vector3(228.5, -993.5, -99.0), SpawnPoints = { - { coords = vector3(475.9, -1021.6, 28.0), heading = 276.1, radius = 6.0 }, - { coords = vector3(484.1, -1023.1, 27.5), heading = 302.5, radius = 6.0 } + {coords = vector3(475.9, -1021.6, 28.0), heading = 276.1, radius = 6.0}, + {coords = vector3(484.1, -1023.1, 27.5), heading = 302.5, radius = 6.0} } } }, @@ -66,7 +68,7 @@ Config.PoliceStations = { Spawner = vector3(461.1, -981.5, 43.6), InsideShop = vector3(477.0, -1106.4, 43.0), SpawnPoints = { - { coords = vector3(449.5, -981.2, 43.6), heading = 92.6, radius = 10.0 } + {coords = vector3(449.5, -981.2, 43.6), heading = 92.6, radius = 10.0} } } }, @@ -81,70 +83,70 @@ Config.PoliceStations = { Config.AuthorizedWeapons = { recruit = { - { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, - { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, - { weapon = 'WEAPON_STUNGUN', price = 1500 }, - { weapon = 'WEAPON_FLASHLIGHT', price = 80 } + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 1500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 80} }, officer = { - { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, - { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, - { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, - { weapon = 'WEAPON_STUNGUN', price = 500 }, - { weapon = 'WEAPON_FLASHLIGHT', price = 0 } + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 0} }, sergeant = { - { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, - { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, - { weapon = 'WEAPON_PUMPSHOTGUN', components = { 2000, 6000, nil }, price = 70000 }, - { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, - { weapon = 'WEAPON_STUNGUN', price = 500 }, - { weapon = 'WEAPON_FLASHLIGHT', price = 0 } + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, + {weapon = 'WEAPON_PUMPSHOTGUN', components = {2000, 6000, nil}, price = 70000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 0} }, intendent = { - { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, - { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, - { weapon = 'WEAPON_PUMPSHOTGUN', components = { 2000, 6000, nil }, price = 70000 }, - { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, - { weapon = 'WEAPON_STUNGUN', price = 500 }, - { weapon = 'WEAPON_FLASHLIGHT', price = 0 } + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, + {weapon = 'WEAPON_PUMPSHOTGUN', components = {2000, 6000, nil}, price = 70000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 0} }, lieutenant = { - { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, - { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, - { weapon = 'WEAPON_PUMPSHOTGUN', components = { 2000, 6000, nil }, price = 70000 }, - { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, - { weapon = 'WEAPON_STUNGUN', price = 500 }, - { weapon = 'WEAPON_FLASHLIGHT', price = 0 } + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, + {weapon = 'WEAPON_PUMPSHOTGUN', components = {2000, 6000, nil}, price = 70000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 0} }, chef = { - { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, - { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, - { weapon = 'WEAPON_PUMPSHOTGUN', components = { 2000, 6000, nil }, price = 70000 }, - { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, - { weapon = 'WEAPON_STUNGUN', price = 500 }, - { weapon = 'WEAPON_FLASHLIGHT', price = 0 } + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, + {weapon = 'WEAPON_PUMPSHOTGUN', components = {2000, 6000, nil}, price = 70000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 0} }, boss = { - { weapon = 'WEAPON_APPISTOL', components = { 0, 0, 1000, 4000, nil }, price = 10000 }, - { weapon = 'WEAPON_ADVANCEDRIFLE', components = { 0, 6000, 1000, 4000, 8000, nil }, price = 50000 }, - { weapon = 'WEAPON_PUMPSHOTGUN', components = { 2000, 6000, nil }, price = 70000 }, - { weapon = 'WEAPON_NIGHTSTICK', price = 0 }, - { weapon = 'WEAPON_STUNGUN', price = 500 }, - { weapon = 'WEAPON_FLASHLIGHT', price = 0 } + {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, + {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, + {weapon = 'WEAPON_PUMPSHOTGUN', components = {2000, 6000, nil}, price = 70000}, + {weapon = 'WEAPON_NIGHTSTICK', price = 0}, + {weapon = 'WEAPON_STUNGUN', price = 500}, + {weapon = 'WEAPON_FLASHLIGHT', price = 0} } } Config.AuthorizedVehicles = { Shared = { - { model = 'police', label = 'Police Cruiser', price = 10000 }, - { model = 'pbus', label = 'Police Prison Bus', price = 5000 } + {model = 'police', label = 'Police Cruiser', price = 10000}, + {model = 'pbus', label = 'Police Prison Bus', price = 5000} }, recruit = { @@ -152,12 +154,12 @@ Config.AuthorizedVehicles = { }, officer = { - { model = 'police3', label = 'Police Interceptor', price = 20000 } + {model = 'police3', label = 'Police Interceptor', price = 20000} }, sergeant = { - { model = 'policet', label = 'Police Transporter', price = 18500 }, - { model = 'policeb', label = 'Police Bike', price = 30500 } + {model = 'policet', label = 'Police Transporter', price = 18500}, + {model = 'policeb', label = 'Police Bike', price = 30500} }, intendent = { @@ -165,8 +167,8 @@ Config.AuthorizedVehicles = { }, lieutenant = { - { model = 'riot', label = 'Police Riot', price = 70000 }, - { model = 'fbi2', label = 'FIB SUV', price = 60000 } + {model = 'riot', label = 'Police Riot', price = 70000}, + {model = 'fbi2', label = 'FIB SUV', price = 60000} }, chef = { @@ -188,204 +190,234 @@ Config.AuthorizedHelicopters = { intendent = {}, lieutenant = { - { model = 'polmav', label = 'Police Maverick', livery = 0, price = 200000 } + {model = 'polmav', label = 'Police Maverick', livery = 0, price = 200000} }, chef = { - { model = 'polmav', label = 'Police Maverick', livery = 0, price = 150000 } + {model = 'polmav', label = 'Police Maverick', livery = 0, price = 150000} }, boss = { - { model = 'polmav', label = 'Police Maverick', livery = 0, price = 100000 } + {model = 'polmav', label = 'Police Maverick', livery = 0, price = 100000} + } +} + + +Config.CustomPeds = { + shared = { + {label = 'Sheriff Ped', maleModel = 's_m_y_sheriff_01', femaleModel = 's_f_y_sheriff_01'}, + {label = 'Police Ped', maleModel = 's_m_y_cop_01', femaleModel = 's_f_y_cop_01'} + }, + + recruit = {}, + + officer = {}, + + sergeant = {}, + + intendent = {}, + + lieutenant = {}, + + chef = {}, + + boss = { + {label = 'SWAT Ped', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'} } } -- CHECK SKINCHANGER CLIENT MAIN.LUA for matching elements - Config.Uniforms = { - recruit_wear = { + recruit = { male = { - ['tshirt_1'] = 59, ['tshirt_2'] = 1, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = 46, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 59, tshirt_2 = 1, + torso_1 = 55, torso_2 = 0, + decals_1 = 0, decals_2 = 0, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = 46, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 }, female = { - ['tshirt_1'] = 36, ['tshirt_2'] = 1, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = 45, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 36, tshirt_2 = 1, + torso_1 = 48, torso_2 = 0, + decals_1 = 0, decals_2 = 0, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = 45, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 } }, - officer_wear = { + + officer = { male = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 58, tshirt_2 = 0, + torso_1 = 55, torso_2 = 0, + decals_1 = 0, decals_2 = 0, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 }, female = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 0, ['decals_2'] = 0, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 35, tshirt_2 = 0, + torso_1 = 48, torso_2 = 0, + decals_1 = 0, decals_2 = 0, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 } }, - sergeant_wear = { + + sergeant = { male = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 8, ['decals_2'] = 1, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 58, tshirt_2 = 0, + torso_1 = 55, torso_2 = 0, + decals_1 = 8, decals_2 = 1, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 }, female = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 7, ['decals_2'] = 1, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 35, tshirt_2 = 0, + torso_1 = 48, torso_2 = 0, + decals_1 = 7, decals_2 = 1, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 } }, - intendent_wear = { + + intendent = { male = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 8, ['decals_2'] = 2, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 58, tshirt_2 = 0, + torso_1 = 55, torso_2 = 0, + decals_1 = 8, decals_2 = 2, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 }, female = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 7, ['decals_2'] = 2, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 35, tshirt_2 = 0, + torso_1 = 48, torso_2 = 0, + decals_1 = 7, decals_2 = 2, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 } }, - lieutenant_wear = { -- currently the same as intendent_wear + + lieutenant = {-- currently the same as intendent male = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 8, ['decals_2'] = 2, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 58, tshirt_2 = 0, + torso_1 = 55, torso_2 = 0, + decals_1 = 8, decals_2 = 2, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 }, female = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 7, ['decals_2'] = 2, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 35, tshirt_2 = 0, + torso_1 = 48, torso_2 = 0, + decals_1 = 7, decals_2 = 2, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 } }, - chef_wear = { + + chef = { male = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 8, ['decals_2'] = 3, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 58, tshirt_2 = 0, + torso_1 = 55, torso_2 = 0, + decals_1 = 8, decals_2 = 3, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 }, female = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 7, ['decals_2'] = 3, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 35, tshirt_2 = 0, + torso_1 = 48, torso_2 = 0, + decals_1 = 7, decals_2 = 3, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 } }, - boss_wear = { -- currently the same as chef_wear + + boss = {-- currently the same as chef male = { - ['tshirt_1'] = 58, ['tshirt_2'] = 0, - ['torso_1'] = 55, ['torso_2'] = 0, - ['decals_1'] = 8, ['decals_2'] = 3, - ['arms'] = 41, - ['pants_1'] = 25, ['pants_2'] = 0, - ['shoes_1'] = 25, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 58, tshirt_2 = 0, + torso_1 = 55, torso_2 = 0, + decals_1 = 8, decals_2 = 3, + arms = 41, + pants_1 = 25, pants_2 = 0, + shoes_1 = 25, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 }, female = { - ['tshirt_1'] = 35, ['tshirt_2'] = 0, - ['torso_1'] = 48, ['torso_2'] = 0, - ['decals_1'] = 7, ['decals_2'] = 3, - ['arms'] = 44, - ['pants_1'] = 34, ['pants_2'] = 0, - ['shoes_1'] = 27, ['shoes_2'] = 0, - ['helmet_1'] = -1, ['helmet_2'] = 0, - ['chain_1'] = 0, ['chain_2'] = 0, - ['ears_1'] = 2, ['ears_2'] = 0 + tshirt_1 = 35, tshirt_2 = 0, + torso_1 = 48, torso_2 = 0, + decals_1 = 7, decals_2 = 3, + arms = 44, + pants_1 = 34, pants_2 = 0, + shoes_1 = 27, shoes_2 = 0, + helmet_1 = -1, helmet_2 = 0, + chain_1 = 0, chain_2 = 0, + ears_1 = 2, ears_2 = 0 } }, + bullet_wear = { male = { - ['bproof_1'] = 11, ['bproof_2'] = 1 + bproof_1 = 11, bproof_2 = 1 }, female = { - ['bproof_1'] = 13, ['bproof_2'] = 1 + bproof_1 = 13, bproof_2 = 1 } }, + gilet_wear = { male = { - ['tshirt_1'] = 59, ['tshirt_2'] = 1 + tshirt_1 = 59, tshirt_2 = 1 }, female = { - ['tshirt_1'] = 36, ['tshirt_2'] = 1 + tshirt_1 = 36, tshirt_2 = 1 } } - -} \ No newline at end of file +} diff --git a/server/main.lua b/server/main.lua index 06097983..c30f3fc1 100644 --- a/server/main.lua +++ b/server/main.lua @@ -2,7 +2,7 @@ ESX = nil TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) -if Config.MaxInService ~= -1 then +if Config.EnableESXService then TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) end From eb31314f02f9f1f26126d3647fd26ce4bed4a098 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 22 Jan 2020 12:33:51 +0100 Subject: [PATCH 219/253] Minor code improvements, drag once, improved coords distance code --- client/main.lua | 196 ++++++++++++++++++++++-------------------------- 1 file changed, 89 insertions(+), 107 deletions(-) diff --git a/client/main.lua b/client/main.lua index ebb4e7a7..dc06a9c4 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1337,43 +1337,40 @@ AddEventHandler('esx_policejob:handcuff', function() isHandcuffed = not isHandcuffed local playerPed = PlayerPedId() - Citizen.CreateThread(function() - if isHandcuffed then + if isHandcuffed then + RequestAnimDict('mp_arresting') + while not HasAnimDictLoaded('mp_arresting') do + Citizen.Wait(100) + end - RequestAnimDict('mp_arresting') - while not HasAnimDictLoaded('mp_arresting') do - Citizen.Wait(100) - end + TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) - TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) + SetEnableHandcuffs(playerPed, true) + DisablePlayerFiring(playerPed, true) + SetCurrentPedWeapon(playerPed, GetHashKey('WEAPON_UNARMED'), true) -- unarm player + SetPedCanPlayGestureAnims(playerPed, false) + FreezeEntityPosition(playerPed, true) + DisplayRadar(false) - SetEnableHandcuffs(playerPed, true) - DisablePlayerFiring(playerPed, true) - SetCurrentPedWeapon(playerPed, GetHashKey('WEAPON_UNARMED'), true) -- unarm player - SetPedCanPlayGestureAnims(playerPed, false) - FreezeEntityPosition(playerPed, true) - DisplayRadar(false) - - if Config.EnableHandcuffTimer then - if handcuffTimer.active then - ESX.ClearTimeout(handcuffTimer.task) - end - - StartHandcuffTimer() - end - else - if Config.EnableHandcuffTimer and handcuffTimer.active then + if Config.EnableHandcuffTimer then + if handcuffTimer.active then ESX.ClearTimeout(handcuffTimer.task) end - ClearPedSecondaryTask(playerPed) - SetEnableHandcuffs(playerPed, false) - DisablePlayerFiring(playerPed, false) - SetPedCanPlayGestureAnims(playerPed, true) - FreezeEntityPosition(playerPed, false) - DisplayRadar(true) + StartHandcuffTimer() end - end) + else + if Config.EnableHandcuffTimer and handcuffTimer.active then + ESX.ClearTimeout(handcuffTimer.task) + end + + ClearPedSecondaryTask(playerPed) + SetEnableHandcuffs(playerPed, false) + DisablePlayerFiring(playerPed, false) + SetPedCanPlayGestureAnims(playerPed, true) + FreezeEntityPosition(playerPed, false) + DisplayRadar(true) + end end) RegisterNetEvent('esx_policejob:unrestrain') @@ -1398,43 +1395,37 @@ end) RegisterNetEvent('esx_policejob:drag') AddEventHandler('esx_policejob:drag', function(copId) - if not isHandcuffed then - return + if isHandcuffed then + dragStatus.isDragged = not dragStatus.isDragged + dragStatus.CopId = copId end - - dragStatus.isDragged = not dragStatus.isDragged - dragStatus.CopId = copId end) Citizen.CreateThread(function() - local playerPed - local targetPed + local wasDragged while true do - Citizen.Wait(1) + Citizen.Wait(0) + local playerPed = PlayerPedId() - if isHandcuffed then - playerPed = PlayerPedId() + if isHandcuffed and dragStatus.isDragged then + local targetPed = GetPlayerPed(GetPlayerFromServerId(dragStatus.CopId)) - if dragStatus.isDragged then - targetPed = GetPlayerPed(GetPlayerFromServerId(dragStatus.CopId)) - - -- undrag if target is in an vehicle - if not IsPedSittingInAnyVehicle(targetPed) then + if DoesEntityExist(targetPed) and IsPedOnFoot(targetPed) and not IsPedDeadOrDying(targetPed, true) then + if not wasDragged then AttachEntityToEntity(playerPed, targetPed, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true) + wasDragged = true else - dragStatus.isDragged = false - DetachEntity(playerPed, true, false) + Citizen.Wait(1000) end - - if IsPedDeadOrDying(targetPed, true) then - dragStatus.isDragged = false - DetachEntity(playerPed, true, false) - end - else + wasDragged = false + dragStatus.isDragged = false DetachEntity(playerPed, true, false) end + elseif wasDragged then + wasDragged = false + DetachEntity(playerPed, true, false) else Citizen.Wait(500) end @@ -1443,29 +1434,27 @@ end) RegisterNetEvent('esx_policejob:putInVehicle') AddEventHandler('esx_policejob:putInVehicle', function() - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) + if isHandcuffed then + local playerPed = PlayerPedId() + local coords = GetEntityCoords(playerPed) - if not isHandcuffed then - return - end + if IsAnyVehicleNearPoint(coords, 5.0) then + local vehicle = GetClosestVehicle(coords, 5.0, 0, 71) - if IsAnyVehicleNearPoint(coords, 5.0) then - local vehicle = GetClosestVehicle(coords, 5.0, 0, 71) + if DoesEntityExist(vehicle) then + local maxSeats, freeSeat = GetVehicleMaxNumberOfPassengers(vehicle) - if DoesEntityExist(vehicle) then - local maxSeats, freeSeat = GetVehicleMaxNumberOfPassengers(vehicle) - - for i=maxSeats - 1, 0, -1 do - if IsVehicleSeatFree(vehicle, i) then - freeSeat = i - break + for i=maxSeats - 1, 0, -1 do + if IsVehicleSeatFree(vehicle, i) then + freeSeat = i + break + end end - end - if freeSeat then - TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) - dragStatus.isDragged = false + if freeSeat then + TaskWarpPedIntoVehicle(playerPed, vehicle, freeSeat) + dragStatus.isDragged = false + end end end end @@ -1475,12 +1464,10 @@ RegisterNetEvent('esx_policejob:OutVehicle') AddEventHandler('esx_policejob:OutVehicle', function() local playerPed = PlayerPedId() - if not IsPedSittingInAnyVehicle(playerPed) then - return + if IsPedSittingInAnyVehicle(playerPed) then + local vehicle = GetVehiclePedIsIn(playerPed, false) + TaskLeaveVehicle(playerPed, vehicle, 16) end - - local vehicle = GetVehiclePedIsIn(playerPed, false) - TaskLeaveVehicle(playerPed, vehicle, 16) end) -- Handcuff @@ -1546,7 +1533,6 @@ end) -- Create blips Citizen.CreateThread(function() - for k,v in pairs(Config.PoliceStations) do local blip = AddBlipForCoord(v.Blip.Coords) @@ -1557,89 +1543,86 @@ Citizen.CreateThread(function() SetBlipAsShortRange(blip, true) BeginTextCommandSetBlipName('STRING') - AddTextComponentString(_U('map_blip')) + AddTextComponentSubstringPlayerName(_U('map_blip')) EndTextCommandSetBlipName(blip) end - end) --- Display markers +-- Draw markers and more Citizen.CreateThread(function() while true do Citizen.Wait(0) if PlayerData.job and PlayerData.job.name == 'police' then - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) + local playerCoords = GetEntityCoords(playerPed) local isInMarker, hasExited, letSleep = false, false, true local currentStation, currentPart, currentPartNum for k,v in pairs(Config.PoliceStations) do - for i=1, #v.Cloakrooms, 1 do - local distance = GetDistanceBetweenCoords(coords, v.Cloakrooms[i], true) + local distance = #(playerCoords - v.Cloakrooms[i]) if distance < Config.DrawDistance then DrawMarker(20, v.Cloakrooms[i], 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) letSleep = false - end - if distance < Config.MarkerSize.x then - isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Cloakroom', i + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Cloakroom', i + end end end for i=1, #v.Armories, 1 do - local distance = GetDistanceBetweenCoords(coords, v.Armories[i], true) + local distance = #(playerCoords - v.Armories[i]) if distance < Config.DrawDistance then DrawMarker(21, v.Armories[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) letSleep = false - end - if distance < Config.MarkerSize.x then - isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Armory', i + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Armory', i + end end end for i=1, #v.Vehicles, 1 do - local distance = GetDistanceBetweenCoords(coords, v.Vehicles[i].Spawner, true) + local distance = #(playerCoords - v.Vehicles[i].Spawner) if distance < Config.DrawDistance then DrawMarker(36, v.Vehicles[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) letSleep = false - end - if distance < Config.MarkerSize.x then - isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Vehicles', i + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Vehicles', i + end end end for i=1, #v.Helicopters, 1 do - local distance = GetDistanceBetweenCoords(coords, v.Helicopters[i].Spawner, true) + local distance = #(playerCoords - v.Helicopters[i].Spawner) if distance < Config.DrawDistance then DrawMarker(34, v.Helicopters[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) letSleep = false - end - if distance < Config.MarkerSize.x then - isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Helicopters', i + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'Helicopters', i + end end end if Config.EnablePlayerManagement and PlayerData.job.grade_name == 'boss' then for i=1, #v.BossActions, 1 do - local distance = GetDistanceBetweenCoords(coords, v.BossActions[i], true) + local distance = #(playerCoords - v.BossActions[i]) if distance < Config.DrawDistance then DrawMarker(22, v.BossActions[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) letSleep = false - end - if distance < Config.MarkerSize.x then - isInMarker, currentStation, currentPart, currentPartNum = true, k, 'BossActions', i + if distance < Config.MarkerSize.x then + isInMarker, currentStation, currentPart, currentPartNum = true, k, 'BossActions', i + end end end end @@ -1670,7 +1653,6 @@ Citizen.CreateThread(function() if letSleep then Citizen.Wait(500) end - else Citizen.Wait(500) end @@ -1691,17 +1673,17 @@ Citizen.CreateThread(function() Citizen.Wait(500) local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) + local playerCoords = GetEntityCoords(playerPed) local closestDistance = -1 local closestEntity = nil for i=1, #trackedEntities, 1 do - local object = GetClosestObjectOfType(coords, 3.0, GetHashKey(trackedEntities[i]), false, false, false) + local object = GetClosestObjectOfType(playerCoords, 3.0, GetHashKey(trackedEntities[i]), false, false, false) if DoesEntityExist(object) then local objCoords = GetEntityCoords(object) - local distance = GetDistanceBetweenCoords(coords, objCoords, true) + local distance = #(playerCoords - objCoords) if closestDistance == -1 or closestDistance > distance then closestDistance = distance From 7037671420b247852427a291b5ffa57ea2894593 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 22 Jan 2020 14:46:41 +0100 Subject: [PATCH 220/253] Fixed not on duty logic --- client/main.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/main.lua b/client/main.lua index dc06a9c4..d5ef5c40 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1719,7 +1719,7 @@ Citizen.CreateThread(function() if CurrentAction == 'menu_cloakroom' then OpenCloakroomMenu() elseif CurrentAction == 'menu_armory' then - if Config.MaxInService == -1 then + if not Config.EnableESXService then OpenArmoryMenu(CurrentActionData.station) elseif playerInService then OpenArmoryMenu(CurrentActionData.station) @@ -1727,7 +1727,7 @@ Citizen.CreateThread(function() ESX.ShowNotification(_U('service_not')) end elseif CurrentAction == 'menu_vehicle_spawner' then - if Config.MaxInService == -1 then + if not Config.EnableESXService then OpenVehicleSpawnerMenu('car', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) elseif playerInService then OpenVehicleSpawnerMenu('car', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) @@ -1735,7 +1735,7 @@ Citizen.CreateThread(function() ESX.ShowNotification(_U('service_not')) end elseif CurrentAction == 'Helicopters' then - if Config.MaxInService == -1 then + if not Config.EnableESXService then OpenVehicleSpawnerMenu('helicopter', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) elseif playerInService then OpenVehicleSpawnerMenu('helicopter', CurrentActionData.station, CurrentActionData.part, CurrentActionData.partNum) @@ -1762,7 +1762,7 @@ Citizen.CreateThread(function() end -- CurrentAction end if IsControlJustReleased(0, 167) and not isDead and PlayerData.job and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') then - if Config.MaxInService == -1 then + if not Config.EnableESXService then OpenPoliceActionsMenu() elseif playerInService then OpenPoliceActionsMenu() From 355c04bebbffffc848ae7e9da76ca35d182f6196 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 24 Jan 2020 13:25:10 +0100 Subject: [PATCH 221/253] Move vehicle garage to seperate file, see desc for full change --- client/main.lua | 367 ++------------------------------------------- client/vehicle.lua | 322 +++++++++++++++++++++++++++++++++++++++ config.lua | 84 +++++------ fxmanifest.lua | 3 +- locales/br.lua | 4 +- locales/de.lua | 4 +- locales/en.lua | 4 +- locales/es.lua | 4 +- locales/fi.lua | 4 +- locales/fr.lua | 4 +- locales/ko.lua | 4 +- locales/pl.lua | 4 +- locales/sv.lua | 8 +- server/main.lua | 27 +--- 14 files changed, 398 insertions(+), 445 deletions(-) create mode 100644 client/vehicle.lua diff --git a/client/main.lua b/client/main.lua index d5ef5c40..e2d024f5 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,7 +1,6 @@ -local PlayerData, CurrentActionData, handcuffTimer, dragStatus, blipsCops, currentTask, spawnedVehicles = {}, {}, {}, {}, {}, {}, {} -local HasAlreadyEnteredMarker, isDead, isHandcuffed, hasAlreadyJoined, playerInService, isInShopMenu = false, false, false, false, false, false +local CurrentActionData, handcuffTimer, dragStatus, blipsCops, currentTask = {}, {}, {}, {}, {} local LastStation, LastPart, LastPartNum, LastEntity, CurrentAction, CurrentActionMsg -dragStatus.isDragged = false +dragStatus.isDragged, isInShopMenu = false, false ESX = nil Citizen.CreateThread(function() @@ -14,7 +13,7 @@ Citizen.CreateThread(function() Citizen.Wait(10) end - PlayerData = ESX.GetPlayerData() + ESX.PlayerData = ESX.GetPlayerData() end) function cleanPlayer(playerPed) @@ -49,7 +48,7 @@ end function OpenCloakroomMenu() local playerPed = PlayerPedId() - local grade = PlayerData.job.grade_name + local grade = ESX.PlayerData.job.grade_name local elements = { {label = _U('citizen_wear'), value = 'citizen_wear'}, @@ -230,346 +229,6 @@ function OpenArmoryMenu(station) end) end -function OpenVehicleSpawnerMenu(type, station, part, partNum) - local playerCoords = GetEntityCoords(PlayerPedId()) - PlayerData = ESX.GetPlayerData() - local elements = { - {label = _U('garage_storeditem'), action = 'garage'}, - {label = _U('garage_storeitem'), action = 'store_garage'}, - {label = _U('garage_buyitem'), action = 'buy_vehicle'} - } - - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle', { - title = _U('garage_title'), - align = 'top-left', - elements = elements - }, function(data, menu) - if data.current.action == 'buy_vehicle' then - local shopElements, shopCoords = {} - - if type == 'car' then - shopCoords = Config.PoliceStations[station].Vehicles[partNum].InsideShop - local authorizedVehicles = Config.AuthorizedVehicles[PlayerData.job.grade_name] - - if #Config.AuthorizedVehicles.Shared > 0 then - for k,vehicle in ipairs(Config.AuthorizedVehicles.Shared) do - table.insert(shopElements, { - label = ('%s - %s'):format(vehicle.label, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))), - name = vehicle.label, - model = vehicle.model, - price = vehicle.price, - type = 'car' - }) - end - end - - if #authorizedVehicles > 0 then - for k,vehicle in ipairs(authorizedVehicles) do - table.insert(shopElements, { - label = ('%s - %s'):format(vehicle.label, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))), - name = vehicle.label, - model = vehicle.model, - price = vehicle.price, - type = 'car' - }) - end - else - if #Config.AuthorizedVehicles.Shared == 0 then - return - end - end - elseif type == 'helicopter' then - shopCoords = Config.PoliceStations[station].Helicopters[partNum].InsideShop - local authorizedHelicopters = Config.AuthorizedHelicopters[PlayerData.job.grade_name] - - if #authorizedHelicopters > 0 then - for k,vehicle in ipairs(authorizedHelicopters) do - table.insert(shopElements, { - label = ('%s - %s'):format(vehicle.label, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))), - name = vehicle.label, - model = vehicle.model, - price = vehicle.price, - livery = vehicle.livery or nil, - type = 'helicopter' - }) - end - else - ESX.ShowNotification(_U('helicopter_notauthorized')) - return - end - end - - OpenShopMenu(shopElements, playerCoords, shopCoords) - elseif data.current.action == 'garage' then - local garage = {} - - ESX.TriggerServerCallback('esx_vehicleshop:retrieveJobVehicles', function(jobVehicles) - if #jobVehicles > 0 then - for k,v in ipairs(jobVehicles) do - local props = json.decode(v.vehicle) - local vehicleName = GetLabelText(GetDisplayNameFromVehicleModel(props.model)) - local label = ('%s - %s: '):format(vehicleName, props.plate) - - if v.stored then - label = label .. ('%s'):format(_U('garage_stored')) - else - label = label .. ('%s'):format(_U('garage_notstored')) - end - - table.insert(garage, { - label = label, - stored = v.stored, - model = props.model, - vehicleProps = props - }) - end - - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_garage', { - title = _U('garage_title'), - align = 'top-left', - elements = garage - }, function(data2, menu2) - if data2.current.stored then - local foundSpawn, spawnPoint = GetAvailableVehicleSpawnPoint(station, part, partNum) - - if foundSpawn then - menu2.close() - - ESX.Game.SpawnVehicle(data2.current.model, spawnPoint.coords, spawnPoint.heading, function(vehicle) - ESX.Game.SetVehicleProperties(vehicle, data2.current.vehicleProps) - - TriggerServerEvent('esx_vehicleshop:setJobVehicleState', data2.current.vehicleProps.plate, false) - ESX.ShowNotification(_U('garage_released')) - end) - end - else - ESX.ShowNotification(_U('garage_notavailable')) - end - end, function(data2, menu2) - menu2.close() - end) - else - ESX.ShowNotification(_U('garage_empty')) - end - end, type) - elseif data.current.action == 'store_garage' then - StoreNearbyVehicle(playerCoords) - end - end, function(data, menu) - menu.close() - end) -end - -function StoreNearbyVehicle(playerCoords) - local vehicles, vehiclePlates = ESX.Game.GetVehiclesInArea(playerCoords, 30.0), {} - - if #vehicles > 0 then - for k,v in ipairs(vehicles) do - - -- Make sure the vehicle we're saving is empty, or else it wont be deleted - if GetVehicleNumberOfPassengers(v) == 0 and IsVehicleSeatFree(v, -1) then - table.insert(vehiclePlates, { - vehicle = v, - plate = ESX.Math.Trim(GetVehicleNumberPlateText(v)) - }) - end - end - else - ESX.ShowNotification(_U('garage_store_nearby')) - return - end - - ESX.TriggerServerCallback('esx_policejob:storeNearbyVehicle', function(storeSuccess, foundNum) - if storeSuccess then - local vehicleId = vehiclePlates[foundNum] - local attempts = 0 - ESX.Game.DeleteVehicle(vehicleId.vehicle) - IsBusy = true - - Citizen.CreateThread(function() - BeginTextCommandBusyspinnerOn('STRING') - AddTextComponentSubstringPlayerName(_U('garage_storing')) - EndTextCommandBusyspinnerOn(4) - - while IsBusy do - Citizen.Wait(100) - end - - BusyspinnerOff() - end) - - -- Workaround for vehicle not deleting when other players are near it. - while DoesEntityExist(vehicleId.vehicle) do - Citizen.Wait(500) - attempts = attempts + 1 - - -- Give up - if attempts > 30 then - break - end - - vehicles = ESX.Game.GetVehiclesInArea(playerCoords, 30.0) - if #vehicles > 0 then - for k,v in ipairs(vehicles) do - if ESX.Math.Trim(GetVehicleNumberPlateText(v)) == vehicleId.plate then - ESX.Game.DeleteVehicle(v) - break - end - end - end - end - - IsBusy = false - ESX.ShowNotification(_U('garage_has_stored')) - else - ESX.ShowNotification(_U('garage_has_notstored')) - end - end, vehiclePlates) -end - -function GetAvailableVehicleSpawnPoint(station, part, partNum) - local spawnPoints = Config.PoliceStations[station][part][partNum].SpawnPoints - local found, foundSpawnPoint = false, nil - - for i=1, #spawnPoints, 1 do - if ESX.Game.IsSpawnPointClear(spawnPoints[i].coords, spawnPoints[i].radius) then - found, foundSpawnPoint = true, spawnPoints[i] - break - end - end - - if found then - return true, foundSpawnPoint - else - ESX.ShowNotification(_U('vehicle_blocked')) - return false - end -end - -function OpenShopMenu(elements, restoreCoords, shopCoords) - local playerPed = PlayerPedId() - isInShopMenu = true - - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop', { - title = _U('vehicleshop_title'), - align = 'top-left', - elements = elements - }, function(data, menu) - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop_confirm', { - title = _U('vehicleshop_confirm', data.current.name, data.current.price), - align = 'top-left', - elements = { - {label = _U('confirm_no'), value = 'no'}, - {label = _U('confirm_yes'), value = 'yes'} - }}, function(data2, menu2) - if data2.current.value == 'yes' then - local newPlate = exports['esx_vehicleshop']:GeneratePlate() - local vehicle = GetVehiclePedIsIn(playerPed, false) - local props = ESX.Game.GetVehicleProperties(vehicle) - props.plate = newPlate - - ESX.TriggerServerCallback('esx_policejob:buyJobVehicle', function (bought) - if bought then - ESX.ShowNotification(_U('vehicleshop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price))) - - isInShopMenu = false - ESX.UI.Menu.CloseAll() - DeleteSpawnedVehicles() - FreezeEntityPosition(playerPed, false) - SetEntityVisible(playerPed, true) - - ESX.Game.Teleport(playerPed, restoreCoords) - else - ESX.ShowNotification(_U('vehicleshop_money')) - menu2.close() - end - end, props, data.current.type) - else - menu2.close() - end - end, function(data2, menu2) - menu2.close() - end) - end, function(data, menu) - isInShopMenu = false - ESX.UI.Menu.CloseAll() - - DeleteSpawnedVehicles() - FreezeEntityPosition(playerPed, false) - SetEntityVisible(playerPed, true) - - ESX.Game.Teleport(playerPed, restoreCoords) - end, function(data, menu) - DeleteSpawnedVehicles() - WaitForVehicleToLoad(data.current.model) - - ESX.Game.SpawnLocalVehicle(data.current.model, shopCoords, 0.0, function(vehicle) - table.insert(spawnedVehicles, vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - FreezeEntityPosition(vehicle, true) - SetModelAsNoLongerNeeded(data.current.model) - - if data.current.livery then - SetVehicleModKit(vehicle, 0) - SetVehicleLivery(vehicle, data.current.livery) - end - end) - end) - - WaitForVehicleToLoad(elements[1].model) - ESX.Game.SpawnLocalVehicle(elements[1].model, shopCoords, 0.0, function(vehicle) - table.insert(spawnedVehicles, vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - FreezeEntityPosition(vehicle, true) - SetModelAsNoLongerNeeded(elements[1].model) - - if elements[1].livery then - SetVehicleModKit(vehicle, 0) - SetVehicleLivery(vehicle, elements[1].livery) - end - end) -end - -Citizen.CreateThread(function() - while true do - Citizen.Wait(0) - - if isInShopMenu then - DisableControlAction(0, 75, true) -- Disable exit vehicle - DisableControlAction(27, 75, true) -- Disable exit vehicle - else - Citizen.Wait(500) - end - end -end) - -function DeleteSpawnedVehicles() - while #spawnedVehicles > 0 do - local vehicle = spawnedVehicles[1] - ESX.Game.DeleteVehicle(vehicle) - table.remove(spawnedVehicles, 1) - end -end - -function WaitForVehicleToLoad(modelHash) - modelHash = (type(modelHash) == 'number' and modelHash or GetHashKey(modelHash)) - - if not HasModelLoaded(modelHash) then - RequestModel(modelHash) - - BeginTextCommandBusyspinnerOn('STRING') - AddTextComponentSubstringPlayerName(_U('vehicleshop_awaiting_model')) - EndTextCommandBusyspinnerOn(4) - - while not HasModelLoaded(modelHash) do - Citizen.Wait(0) - DisableAllControlActions(0) - end - - BusyspinnerOff() - end -end - function OpenPoliceActionsMenu() ESX.UI.Menu.CloseAll() @@ -1041,7 +700,7 @@ function OpenBuyWeaponsMenu() local playerPed = PlayerPedId() PlayerData = ESX.GetPlayerData() - for k,v in ipairs(Config.AuthorizedWeapons[PlayerData.job.grade_name]) do + for k,v in ipairs(Config.AuthorizedWeapons[ESX.PlayerData.job.grade_name]) do local weaponNum, weapon = ESX.GetWeapon(v.weapon) local components, label = {} local hasWeapon = HasPedGotWeapon(playerPed, GetHashKey(v.weapon), false) @@ -1244,7 +903,7 @@ end RegisterNetEvent('esx:setJob') AddEventHandler('esx:setJob', function(job) - PlayerData.job = job + ESX.PlayerData.job = job Citizen.Wait(5000) TriggerServerEvent('esx_policejob:forceBlip') @@ -1263,7 +922,7 @@ end) -- don't show dispatches if the player isn't in service AddEventHandler('esx_phone:cancelMessage', function(dispatchNumber) - if PlayerData.job and PlayerData.job.name == 'police' and PlayerData.job.name == dispatchNumber then + if ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' and ESX.PlayerData.job.name == dispatchNumber then -- if esx_service is enabled if Config.EnableESXService and not playerInService then CancelEvent() @@ -1306,7 +965,7 @@ end) AddEventHandler('esx_policejob:hasEnteredEntityZone', function(entity) local playerPed = PlayerPedId() - if PlayerData.job and PlayerData.job.name == 'police' and IsPedOnFoot(playerPed) then + if ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' and IsPedOnFoot(playerPed) then CurrentAction = 'remove_entity' CurrentActionMsg = _U('remove_prop') CurrentActionData = {entity = entity} @@ -1553,7 +1212,7 @@ Citizen.CreateThread(function() while true do Citizen.Wait(0) - if PlayerData.job and PlayerData.job.name == 'police' then + if ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' then local playerPed = PlayerPedId() local playerCoords = GetEntityCoords(playerPed) local isInMarker, hasExited, letSleep = false, false, true @@ -1612,7 +1271,7 @@ Citizen.CreateThread(function() end end - if Config.EnablePlayerManagement and PlayerData.job.grade_name == 'boss' then + if Config.EnablePlayerManagement and ESX.PlayerData.job.grade_name == 'boss' then for i=1, #v.BossActions, 1 do local distance = #(playerCoords - v.BossActions[i]) @@ -1714,7 +1373,7 @@ Citizen.CreateThread(function() if CurrentAction then ESX.ShowHelpNotification(CurrentActionMsg) - if IsControlJustReleased(0, 38) and PlayerData.job and PlayerData.job.name == 'police' then + if IsControlJustReleased(0, 38) and ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' then if CurrentAction == 'menu_cloakroom' then OpenCloakroomMenu() @@ -1761,7 +1420,7 @@ Citizen.CreateThread(function() end end -- CurrentAction end - if IsControlJustReleased(0, 167) and not isDead and PlayerData.job and PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') then + if IsControlJustReleased(0, 167) and not isDead and ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'police_actions') then if not Config.EnableESXService then OpenPoliceActionsMenu() elseif playerInService then @@ -1820,7 +1479,7 @@ AddEventHandler('esx_policejob:updateBlip', function() end -- Is the player a cop? In that case show all the blips for other cops - if PlayerData.job and PlayerData.job.name == 'police' then + if ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' then ESX.TriggerServerCallback('esx_society:getOnlinePlayers', function(players) for i=1, #players, 1 do if players[i].job.name == 'police' then diff --git a/client/vehicle.lua b/client/vehicle.lua new file mode 100644 index 00000000..a0af0aec --- /dev/null +++ b/client/vehicle.lua @@ -0,0 +1,322 @@ + +local spawnedVehicles = {} + +function OpenVehicleSpawnerMenu(type, station, part, partNum) + local playerCoords = GetEntityCoords(PlayerPedId()) + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle', { + title = _U('garage_title'), + align = 'top-left', + elements = { + {label = _U('garage_storeditem'), action = 'garage'}, + {label = _U('garage_storeitem'), action = 'store_garage'}, + {label = _U('garage_buyitem'), action = 'buy_vehicle'} + }}, function(data, menu) + if data.current.action == 'buy_vehicle' then + local shopElements = {} + local shopCoords = Config.PoliceStations[station][part][partNum].InsideShop + local authorizedVehicles = Config.AuthorizedVehicles[type][ESX.PlayerData.job.grade_name] + + if #authorizedVehicles > 0 then + for k,vehicle in ipairs(authorizedVehicles) do + if IsModelInCdimage(vehicle.model) then + local vehicleLabel = GetLabelText(GetDisplayNameFromVehicleModel(vehicle.model)) + + table.insert(shopElements, { + label = ('%s - %s'):format(vehicleLabel, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))), + name = vehicleLabel, + model = vehicle.model, + price = vehicle.price, + props = vehicle.props, + type = type + }) + end + end + + if #shopElements > 0 then + OpenShopMenu(shopElements, playerCoords, shopCoords) + else + ESX.ShowNotification(_U('garage_notauthorized')) + end + else + ESX.ShowNotification(_U('garage_notauthorized')) + end + elseif data.current.action == 'garage' then + local garage = {} + + ESX.TriggerServerCallback('esx_vehicleshop:retrieveJobVehicles', function(jobVehicles) + if #jobVehicles > 0 then + local allVehicleProps = {} + + for k,v in ipairs(jobVehicles) do + local props = json.decode(v.vehicle) + + if IsModelInCdimage(props.model) then + local vehicleName = GetLabelText(GetDisplayNameFromVehicleModel(props.model)) + local label = ('%s - %s: '):format(vehicleName, props.plate) + + if v.stored then + label = label .. ('%s'):format(_U('garage_stored')) + else + label = label .. ('%s'):format(_U('garage_notstored')) + end + + table.insert(garage, { + label = label, + stored = v.stored, + model = props.model, + plate = props.plate + }) + + allVehicleProps[props.plate] = props + end + end + + if #garage > 0 then + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_garage', { + title = _U('garage_title'), + align = 'top-left', + elements = garage + }, function(data2, menu2) + if data2.current.stored then + local foundSpawn, spawnPoint = GetAvailableVehicleSpawnPoint(station, part, partNum) + + if foundSpawn then + menu2.close() + + ESX.Game.SpawnVehicle(data2.current.model, spawnPoint.coords, spawnPoint.heading, function(vehicle) + local vehicleProps = allVehicleProps[data2.current.plate] + ESX.Game.SetVehicleProperties(vehicle, vehicleProps) + + TriggerServerEvent('esx_vehicleshop:setJobVehicleState', data2.current.plate, false) + ESX.ShowNotification(_U('garage_released')) + end) + end + else + ESX.ShowNotification(_U('garage_notavailable')) + end + end, function(data2, menu2) + menu2.close() + end) + else + ESX.ShowNotification(_U('garage_empty')) + end + else + ESX.ShowNotification(_U('garage_empty')) + end + end, type) + elseif data.current.action == 'store_garage' then + StoreNearbyVehicle(playerCoords) + end + end, function(data, menu) + menu.close() + end) +end + +function StoreNearbyVehicle(playerCoords) + local vehicles, vehiclePlates = ESX.Game.GetVehiclesInArea(playerCoords, 30.0), {} + + if #vehicles > 0 then + for k,v in ipairs(vehicles) do + + -- Make sure the vehicle we're saving is empty, or else it wont be deleted + if GetVehicleNumberOfPassengers(v) == 0 and IsVehicleSeatFree(v, -1) then + table.insert(vehiclePlates, { + vehicle = v, + plate = ESX.Math.Trim(GetVehicleNumberPlateText(v)) + }) + end + end + else + ESX.ShowNotification(_U('garage_store_nearby')) + return + end + + ESX.TriggerServerCallback('esx_policejob:storeNearbyVehicle', function(storeSuccess, foundNum) + if storeSuccess then + local vehicleId = vehiclePlates[foundNum] + local attempts = 0 + ESX.Game.DeleteVehicle(vehicleId.vehicle) + IsBusy = true + + Citizen.CreateThread(function() + BeginTextCommandBusyspinnerOn('STRING') + AddTextComponentSubstringPlayerName(_U('garage_storing')) + EndTextCommandBusyspinnerOn(4) + + while IsBusy do + Citizen.Wait(100) + end + + BusyspinnerOff() + end) + + -- Workaround for vehicle not deleting when other players are near it. + while DoesEntityExist(vehicleId.vehicle) do + Citizen.Wait(500) + attempts = attempts + 1 + + -- Give up + if attempts > 30 then + break + end + + vehicles = ESX.Game.GetVehiclesInArea(playerCoords, 30.0) + if #vehicles > 0 then + for k,v in ipairs(vehicles) do + if ESX.Math.Trim(GetVehicleNumberPlateText(v)) == vehicleId.plate then + ESX.Game.DeleteVehicle(v) + break + end + end + end + end + + IsBusy = false + ESX.ShowNotification(_U('garage_has_stored')) + else + ESX.ShowNotification(_U('garage_has_notstored')) + end + end, vehiclePlates) +end + +function GetAvailableVehicleSpawnPoint(station, part, partNum) + local spawnPoints = Config.PoliceStations[station][part][partNum].SpawnPoints + local found, foundSpawnPoint = false, nil + + for i=1, #spawnPoints, 1 do + if ESX.Game.IsSpawnPointClear(spawnPoints[i].coords, spawnPoints[i].radius) then + found, foundSpawnPoint = true, spawnPoints[i] + break + end + end + + if found then + return true, foundSpawnPoint + else + ESX.ShowNotification(_U('vehicle_blocked')) + return false + end +end + +function OpenShopMenu(elements, restoreCoords, shopCoords) + local playerPed = PlayerPedId() + isInShopMenu = true + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop', { + title = _U('vehicleshop_title'), + align = 'top-left', + elements = elements + }, function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop_confirm', { + title = _U('vehicleshop_confirm', data.current.name, data.current.price), + align = 'top-left', + elements = { + {label = _U('confirm_no'), value = 'no'}, + {label = _U('confirm_yes'), value = 'yes'} + }}, function(data2, menu2) + if data2.current.value == 'yes' then + local newPlate = exports['esx_vehicleshop']:GeneratePlate() + local vehicle = GetVehiclePedIsIn(playerPed, false) + local props = ESX.Game.GetVehicleProperties(vehicle) + props.plate = newPlate + + ESX.TriggerServerCallback('esx_policejob:buyJobVehicle', function (bought) + if bought then + ESX.ShowNotification(_U('vehicleshop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price))) + + isInShopMenu = false + ESX.UI.Menu.CloseAll() + DeleteSpawnedVehicles() + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + + ESX.Game.Teleport(playerPed, restoreCoords) + else + ESX.ShowNotification(_U('vehicleshop_money')) + menu2.close() + end + end, props, data.current.type) + else + menu2.close() + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + isInShopMenu = false + ESX.UI.Menu.CloseAll() + + DeleteSpawnedVehicles() + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + + ESX.Game.Teleport(playerPed, restoreCoords) + end, function(data, menu) + DeleteSpawnedVehicles() + WaitForVehicleToLoad(data.current.model) + + ESX.Game.SpawnLocalVehicle(data.current.model, shopCoords, 0.0, function(vehicle) + table.insert(spawnedVehicles, vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + FreezeEntityPosition(vehicle, true) + SetModelAsNoLongerNeeded(data.current.model) + + if data.current.props then + ESX.Game.SetVehicleProperties(vehicle, data.current.props) + end + end) + end) + + WaitForVehicleToLoad(elements[1].model) + ESX.Game.SpawnLocalVehicle(elements[1].model, shopCoords, 0.0, function(vehicle) + table.insert(spawnedVehicles, vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + FreezeEntityPosition(vehicle, true) + SetModelAsNoLongerNeeded(elements[1].model) + + if elements[1].props then + ESX.Game.SetVehicleProperties(vehicle, elements[1].props) + end + end) +end + +Citizen.CreateThread(function() + while true do + Citizen.Wait(0) + + if isInShopMenu then + DisableControlAction(0, 75, true) -- Disable exit vehicle + DisableControlAction(27, 75, true) -- Disable exit vehicle + else + Citizen.Wait(500) + end + end +end) + +function DeleteSpawnedVehicles() + while #spawnedVehicles > 0 do + local vehicle = spawnedVehicles[1] + ESX.Game.DeleteVehicle(vehicle) + table.remove(spawnedVehicles, 1) + end +end + +function WaitForVehicleToLoad(modelHash) + modelHash = (type(modelHash) == 'number' and modelHash or GetHashKey(modelHash)) + + if not HasModelLoaded(modelHash) then + RequestModel(modelHash) + + BeginTextCommandBusyspinnerOn('STRING') + AddTextComponentSubstringPlayerName(_U('vehicleshop_awaiting_model')) + EndTextCommandBusyspinnerOn(4) + + while not HasModelLoaded(modelHash) do + Citizen.Wait(0) + DisableAllControlActions(0) + end + + BusyspinnerOff() + end +end diff --git a/config.lua b/config.lua index a47eaa62..f3de61a0 100644 --- a/config.lua +++ b/config.lua @@ -144,65 +144,53 @@ Config.AuthorizedWeapons = { } Config.AuthorizedVehicles = { - Shared = { - {model = 'police', label = 'Police Cruiser', price = 10000}, - {model = 'pbus', label = 'Police Prison Bus', price = 5000} + car = { + recruit = {}, + + officer = { + {model = 'police3', price = 20000} + }, + + sergeant = { + {model = 'policet', price = 18500}, + {model = 'policeb', price = 30500} + }, + + intendent = {}, + + lieutenant = { + {model = 'riot', price = 70000}, + {model = 'fbi2', price = 60000} + }, + + chef = {}, + + boss = {} }, - recruit = { + helicopter = { + recruit = {}, - }, + officer = {}, - officer = { - {model = 'police3', label = 'Police Interceptor', price = 20000} - }, + sergeant = {}, - sergeant = { - {model = 'policet', label = 'Police Transporter', price = 18500}, - {model = 'policeb', label = 'Police Bike', price = 30500} - }, + intendent = {}, - intendent = { + lieutenant = { + {model = 'polmav', props = {modLivery = 0}, price = 200000} + }, - }, - - lieutenant = { - {model = 'riot', label = 'Police Riot', price = 70000}, - {model = 'fbi2', label = 'FIB SUV', price = 60000} - }, - - chef = { - - }, - - boss = { + chef = { + {model = 'polmav', props = {modLivery = 0}, price = 150000} + }, + boss = { + {model = 'polmav', props = {modLivery = 0}, price = 100000} + } } } -Config.AuthorizedHelicopters = { - recruit = {}, - - officer = {}, - - sergeant = {}, - - intendent = {}, - - lieutenant = { - {model = 'polmav', label = 'Police Maverick', livery = 0, price = 200000} - }, - - chef = { - {model = 'polmav', label = 'Police Maverick', livery = 0, price = 150000} - }, - - boss = { - {model = 'polmav', label = 'Police Maverick', livery = 0, price = 100000} - } -} - - Config.CustomPeds = { shared = { {label = 'Sheriff Ped', maleModel = 's_m_y_sheriff_01', femaleModel = 's_f_y_sheriff_01'}, diff --git a/fxmanifest.lua b/fxmanifest.lua index 85852ca4..af5949ca 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -34,7 +34,8 @@ client_scripts { 'locales/sv.lua', 'locales/ko.lua', 'config.lua', - 'client/main.lua' + 'client/main.lua', + 'client/vehicle.lua' } dependencies { diff --git a/locales/br.lua b/locales/br.lua index 13ad287c..e47dda49 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -20,7 +20,7 @@ Locales['br'] = { ['armory_item'] = '$%s', ['armory_weapontitle'] = 'armory - Buy weapon', ['armory_componenttitle'] = 'armory - Weapon attatchments', - ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', ['armory_money'] = 'you cannot afford that weapon', ['armory_hascomponent'] = 'you have that attatchment equiped!', ['get_weapon_menu'] = 'armory - Withdraw Weapon', @@ -43,8 +43,8 @@ Locales['br'] = { ['garage_storeditem'] = 'open garage', ['garage_storeitem'] = 'store vehicle in garage', ['garage_buyitem'] = 'vehicle shop', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', - ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', ['shop_item'] = '$%s', ['vehicleshop_title'] = 'vehicle Shop', ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', diff --git a/locales/de.lua b/locales/de.lua index eb6ee554..7492e226 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -20,7 +20,7 @@ Locales['de'] = { ['armory_item'] = '$%s', ['armory_weapontitle'] = 'armory - Buy weapon', ['armory_componenttitle'] = 'armory - Weapon attatchments', - ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', ['armory_money'] = 'you cannot afford that weapon', ['armory_hascomponent'] = 'you have that attatchment equiped!', ['get_weapon_menu'] = 'armory - Withdraw Weapon', @@ -43,8 +43,8 @@ Locales['de'] = { ['garage_storeditem'] = 'open garage', ['garage_storeitem'] = 'store vehicle in garage', ['garage_buyitem'] = 'vehicle shop', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', - ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', ['shop_item'] = '$%s', ['vehicleshop_title'] = 'vehicle Shop', ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', diff --git a/locales/en.lua b/locales/en.lua index 323f4e7d..0a30a598 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -20,7 +20,7 @@ Locales['en'] = { ['armory_item'] = '$%s', ['armory_weapontitle'] = 'armory - Buy weapon', ['armory_componenttitle'] = 'armory - Weapon attatchments', - ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', ['armory_money'] = 'you cannot afford that weapon', ['armory_hascomponent'] = 'you have that attatchment equiped!', ['get_weapon_menu'] = 'armory - Withdraw Weapon', @@ -43,8 +43,8 @@ Locales['en'] = { ['garage_storeditem'] = 'open garage', ['garage_storeitem'] = 'store vehicle in garage', ['garage_buyitem'] = 'vehicle shop', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', - ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', ['shop_item'] = '$%s', ['vehicleshop_title'] = 'vehicle Shop', ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', diff --git a/locales/es.lua b/locales/es.lua index c9c05cc5..354c89e6 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -20,7 +20,7 @@ Locales['es'] = { ['armory_item'] = '$%s', ['armory_weapontitle'] = 'armory - Buy weapon', ['armory_componenttitle'] = 'armory - Weapon attatchments', - ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', ['armory_money'] = 'you cannot afford that weapon', ['armory_hascomponent'] = 'you have that attatchment equiped!', ['get_weapon_menu'] = 'armory - Withdraw Weapon', @@ -43,8 +43,8 @@ Locales['es'] = { ['garage_storeditem'] = 'open garage', ['garage_storeitem'] = 'store vehicle in garage', ['garage_buyitem'] = 'vehicle shop', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', - ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', ['shop_item'] = '$%s', ['vehicleshop_title'] = 'vehicle Shop', ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', diff --git a/locales/fi.lua b/locales/fi.lua index 93c8af21..b0f5d7d9 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -20,7 +20,7 @@ Locales['fi'] = { ['armory_item'] = '$%s', ['armory_weapontitle'] = 'armory - Buy weapon', ['armory_componenttitle'] = 'armory - Weapon attatchments', - ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', ['armory_money'] = 'you cannot afford that weapon', ['armory_hascomponent'] = 'you have that attatchment equiped!', ['get_weapon_menu'] = 'armory - Withdraw Weapon', @@ -43,8 +43,8 @@ Locales['fi'] = { ['garage_storeditem'] = 'open garage', ['garage_storeitem'] = 'store vehicle in garage', ['garage_buyitem'] = 'vehicle shop', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', - ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', ['shop_item'] = '$%s', ['vehicleshop_title'] = 'vehicle Shop', ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', diff --git a/locales/fr.lua b/locales/fr.lua index 8f3071cc..d30a825b 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -20,7 +20,7 @@ Locales['fr'] = { ['armory_item'] = '$%s', ['armory_weapontitle'] = 'armurerie - Acheter une arme', ['armory_componenttitle'] = 'armurerie - Accessoires d\'armes', - ['armory_bought'] = 'vous achetez un ~y~%s~s~ pour ~r~$%s~s~', + ['armory_bought'] = 'vous achetez un ~y~%s~s~ pour ~g~$%s~s~', ['armory_money'] = 'vous ne pouvez pas acheter cette arme', ['armory_hascomponent'] = 'vous avez cet accessoire équipé!', ['get_weapon_menu'] = 'armurerie - Retirer arme', @@ -43,8 +43,8 @@ Locales['fr'] = { ['garage_storeditem'] = 'ouvrir le garage', ['garage_storeitem'] = 'ranger le véhicule', ['garage_buyitem'] = 'magasin véhicule', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', ['helicopter_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder aux ~y~Actions de l\'hélicoptère~s~.', - ['helicopter_notauthorized'] = 'vous n\'êtes pas autorisé à acheter un hélicoptère.', ['shop_item'] = '$%s', ['vehicleshop_title'] = 'magasin véhicule', ['vehicleshop_confirm'] = 'voulez-vous acheter ce véhicule?', diff --git a/locales/ko.lua b/locales/ko.lua index cf7fe418..ea2c093c 100644 --- a/locales/ko.lua +++ b/locales/ko.lua @@ -20,7 +20,7 @@ Locales['ko'] = { ['armory_item'] = '$%s', ['armory_weapontitle'] = '병기고 - 무기 구매', ['armory_componenttitle'] = '병기고 - 무기 부착물', - ['armory_bought'] = '당신은 ~r~$%s~s~에 ~y~%s~s~를 구매했습니다', + ['armory_bought'] = '당신은 ~g~$%s~s~에 ~y~%s~s~를 구매했습니다', ['armory_money'] = '당신은 이 무기를 살 수 없습니다', ['armory_hascomponent'] = '이 부착물이 장착되어 있습니다!', ['get_weapon_menu'] = '병기고 - 무기 빼다', @@ -43,8 +43,8 @@ Locales['ko'] = { ['garage_storeditem'] = '차고 열기', ['garage_storeitem'] = '차량 정리', ['garage_buyitem'] = '차량 상점', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', ['helicopter_prompt'] = '~y~헬리콥터 동작~s~에 액세스하려면 ~INPUT_CONTEXT~를 누릅니다.', - ['helicopter_notauthorized'] = '헬리콥터를 구매할 수 없습니다.', ['shop_item'] = '$%s', ['vehicleshop_title'] = '차량 판매점', ['vehicleshop_confirm'] = '이 차량을 사고 싶습니까?', diff --git a/locales/pl.lua b/locales/pl.lua index 210092ca..ab5e8678 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -20,7 +20,7 @@ Locales['pl'] = { ['armory_item'] = '$%s', ['armory_weapontitle'] = 'armory - Buy weapon', ['armory_componenttitle'] = 'armory - Weapon attatchments', - ['armory_bought'] = 'you bought an ~y~%s~s~ for ~r~$%s~s~', + ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', ['armory_money'] = 'you cannot afford that weapon', ['armory_hascomponent'] = 'you have that attatchment equiped!', ['get_weapon_menu'] = 'armory - Withdraw Weapon', @@ -43,8 +43,8 @@ Locales['pl'] = { ['garage_storeditem'] = 'open garage', ['garage_storeitem'] = 'store vehicle in garage', ['garage_buyitem'] = 'vehicle shop', + ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', - ['helicopter_notauthorized'] = 'you\'re not authorized to buy helicopters.', ['shop_item'] = '$%s', ['vehicleshop_title'] = 'vehicle Shop', ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', diff --git a/locales/sv.lua b/locales/sv.lua index a79aef07..04f52ed0 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -43,12 +43,12 @@ Locales['sv'] = { ['garage_storeditem'] = 'öppna garage', ['garage_storeitem'] = 'ställ in fordon', ['garage_buyitem'] = 'fordonshandel', - ['helicopter_prompt'] = 'klicka på ~INPUT_CONTEXT~ för att komma åt ~y~garaget~s~.', - ['helicopter_notauthorized'] = 'du har inte behörighet till att köpa en helikopter.', + ['garage_notauthorized'] = 'du har inte tillgång till att köpa dessa fordon.', + ['helicopter_prompt'] = 'tryck ~INPUT_CONTEXT~ för att komma åt ~y~helikoptergaraget~s~.', ['shop_item'] = '%s SEK', ['vehicleshop_title'] = 'fordonshandel', ['vehicleshop_confirm'] = 'vill du köpa detta fordon?', - ['vehicleshop_bought'] = 'du köpte ~y~%s~s~ för ~r~$%s~s~', + ['vehicleshop_bought'] = 'du köpte ~y~%s~s~ för ~g~%s SEK~s~', ['vehicleshop_money'] = 'du har inte råd med detta fordon', ['vehicleshop_awaiting_model'] = 'fordonet ~g~LADDAS NED OCH LADDAS IN~s~ var god vänta', ['confirm_no'] = 'nej', @@ -76,7 +76,7 @@ Locales['sv'] = { ['unpaid_bills'] = 'se obetalda räkningar', ['license_check'] = 'se licenser', ['license_revoke'] = 'återkalla licenser', - ['license_revoked'] = 'Ditt ~b~%s~s~ har blivit ~y~återkallat~s~!', + ['license_revoked'] = 'ditt ~b~%s~s~ har blivit ~y~återkallat~s~!', ['licence_you_revoked'] = 'du återkallade ett ~b~%s~s~ som tillhörde ~y~%s~s~', ['no_players_nearby'] = 'det finns ingen i närheten', ['being_searched'] = 'du blir ~y~visiterad~s~ av ~b~Polisen~s~', diff --git a/server/main.lua b/server/main.lua index c30f3fc1..e328e551 100644 --- a/server/main.lua +++ b/server/main.lua @@ -436,29 +436,12 @@ ESX.RegisterServerCallback('esx_policejob:storeNearbyVehicle', function(source, end end) -function getPriceFromHash(hashKey, jobGrade, type) - if type == 'helicopter' then - local vehicles = Config.AuthorizedHelicopters[jobGrade] +function getPriceFromHash(vehicleHash, jobGrade, type) + local vehicles = Config.AuthorizedVehicles[type][jobGrade] - for k,v in ipairs(vehicles) do - if GetHashKey(v.model) == hashKey then - return v.price - end - end - elseif type == 'car' then - local vehicles = Config.AuthorizedVehicles[jobGrade] - local shared = Config.AuthorizedVehicles['Shared'] - - for k,v in ipairs(vehicles) do - if GetHashKey(v.model) == hashKey then - return v.price - end - end - - for k,v in ipairs(shared) do - if GetHashKey(v.model) == hashKey then - return v.price - end + for k,v in ipairs(vehicles) do + if GetHashKey(v.model) == vehicleHash then + return v.price end end From a5e8e7f6b8def681fd5b97d4970bb28398a33130 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 24 Jan 2020 13:25:25 +0100 Subject: [PATCH 222/253] Update main.lua --- client/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/client/main.lua b/client/main.lua index e2d024f5..94676317 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,4 +1,5 @@ local CurrentActionData, handcuffTimer, dragStatus, blipsCops, currentTask = {}, {}, {}, {}, {} +local HasAlreadyEnteredMarker, isDead, isHandcuffed, hasAlreadyJoined, playerInService = false, false, false, false, false local LastStation, LastPart, LastPartNum, LastEntity, CurrentAction, CurrentActionMsg dragStatus.isDragged, isInShopMenu = false, false ESX = nil From c37a2170d713e974792682716a4a378f7a846bec Mon Sep 17 00:00:00 2001 From: rex2630 Date: Fri, 24 Jan 2020 17:05:54 +0100 Subject: [PATCH 223/253] Added Czech locale (#384) * Update fxmanifest.lua * Create cs.lua --- fxmanifest.lua | 2 + locales/cs.lua | 153 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 locales/cs.lua diff --git a/fxmanifest.lua b/fxmanifest.lua index af5949ca..cddca542 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -18,6 +18,7 @@ server_scripts { 'locales/es.lua', 'locales/sv.lua', 'locales/ko.lua', + 'locales/cs.lua', 'config.lua', 'server/main.lua' } @@ -33,6 +34,7 @@ client_scripts { 'locales/es.lua', 'locales/sv.lua', 'locales/ko.lua', + 'locales/cs.lua', 'config.lua', 'client/main.lua', 'client/vehicle.lua' diff --git a/locales/cs.lua b/locales/cs.lua new file mode 100644 index 00000000..eff426e6 --- /dev/null +++ b/locales/cs.lua @@ -0,0 +1,153 @@ +Locales['cs'] = { + -- Cloakroom + ['cloakroom'] = 'satna', + ['citizen_wear'] = 'civilní oblek', + ['police_wear'] = 'policejní oblek', + ['gilet_wear'] = 'oranžová reflexní vesta', + ['bullet_wear'] = 'neprůstřelná vesta', + ['no_outfit'] = 'není zde žádná uniforma, která by ti sedla!', + ['open_cloackroom'] = 'stiskni ~INPUT_CONTEXT~ pro změnu ~y~oblečení~s~.', + -- Armory + ['remove_object'] = 'vzít objekt', + ['deposit_object'] = 'odevzdat objekt', + ['get_weapon'] = 'vzít zbraň ze zbrojnice', + ['put_weapon'] = 'uchovat zbraň ve zbrojnici', + ['buy_weapons'] = 'koupit zbraně', + ['armory'] = 'zbrojnice', + ['open_armory'] = 'stiskni ~INPUT_CONTEXT~ pro přístup do ~y~zbrojnice~s~.', + ['armory_owned'] = 'vlastněno', + ['armory_free'] = 'zdarma', + ['armory_item'] = '$%s', + ['armory_weapontitle'] = 'zbrojnice', + ['armory_componenttitle'] = 'zbrojnice - Příslušenství ke zbraním', + ['armory_bought'] = 'zakoupil jsi ~y~%s~s~ za ~r~$%s~s~', + ['armory_money'] = 'nemáš dostatek peněz na tuto zbraň', + ['armory_hascomponent'] = 'toto příslušenství máš již nainstalováno!', + ['get_weapon_menu'] = 'zbrojnice - Vzít zbraň', + ['put_weapon_menu'] = 'zbrojnice - Uchovat zbraň', + -- Vehicles + ['vehicle_menu'] = 'vozidlo', + ['vehicle_blocked'] = 'vsechny dostupne spawn pointy jsou blokovany!', + ['garage_prompt'] = 'stiskni ~INPUT_CONTEXT~ pro otevreni ~y~akce vozidel~s~.', + ['garage_title'] = 'akce vozidel', + ['garage_stored'] = 'uloženo', + ['garage_notstored'] = 'není v garáži', + ['garage_storing'] = 'pokousime se o odstraneni vozidla, ujisti se, ze kolem nej nejsou hraci.', + ['garage_has_stored'] = 'vozidlo bylo ulozeno do garaze', + ['garage_has_notstored'] = 'zadne nejblizsi vlastnene vozidlo nenalezeno', + ['garage_notavailable'] = 'tvoje vozidlo neni ulozeno v garazi.', + ['garage_blocked'] = 'nejsou zde zadne spawn pointy!', + ['garage_empty'] = 'zadne vozidlo nemas v garazi.', + ['garage_released'] = 'tvoje vozidlo bylo vyjmuto z garaze.', + ['garage_store_nearby'] = 'nejsou poblíž zádná vozidla.', + ['garage_storeditem'] = 'otevřít garáž', + ['garage_storeitem'] = 'uchovat vozidlo v garáži', + ['garage_buyitem'] = 'prodej vozidel', + ['garage_notauthorized'] = 'nemas opravneni ke koupi tohoto vozidla.', + ['helicopter_prompt'] = 'stiskni ~INPUT_CONTEXT~ pro pristup k ~y~akcim Helikopter~s~.', + ['shop_item'] = '$%s', + ['vehicleshop_title'] = 'prodejce vozidel', + ['vehicleshop_confirm'] = 'opravdu chces koupit toto vozidlo?', + ['vehicleshop_bought'] = 'koupil jsi ~y~%s~s~ za ~r~$%s~s~', + ['vehicleshop_money'] = 'toto vozidlo si nemuzete dovolit', + ['vehicleshop_awaiting_model'] = 'vozidlo se prave ~g~stahuje a nacita~s~ prosim pockej', + ['confirm_no'] = 'ne', + ['confirm_yes'] = 'ano', + -- Service + ['service_max'] = 'nemuzete vstoupit do sluzby, max dustojníci v provozu: %s/%s', + ['service_not'] = 'nezadali jste sluzbu! Nejprve se musíte zmenit.', + ['service_anonunce'] = 'informace o sluzbe', + ['service_in'] = 'vstoupil jsi do sluzby, vitej!', + ['service_in_announce'] = 'operator ~y~%s~s~ se pripojil do sluzby!', + ['service_out'] = 'opustil jsi sluzbu.', + ['service_out_announce'] = 'operator ~y~%s~s~ opustil jejich sluzbu.', + -- Action Menu + ['citizen_interaction'] = 'Interakce s občanem', + ['vehicle_interaction'] = 'Interakce vozidla', + ['object_spawner'] = 'Objekty', + + ['id_card'] = 'Občanský průkaz', + ['search'] = 'prohledat', + ['handcuff'] = 'poutat / odpoutat', + ['drag'] = 'prenést', + ['put_in_vehicle'] = 'vlozit do vozidla', + ['out_the_vehicle'] = 'vytahnout z vozidla', + ['fine'] = 'pokuta', + ['unpaid_bills'] = 'spravovat nezaplacené pokuty', + ['license_check'] = 'spravovat průkazy', + ['license_revoke'] = 'zneplatnit průkaz', + ['license_revoked'] = 'vase ~b~%s~s~ bylo ~y~zruseno~s~!', + ['licence_you_revoked'] = 'zrusil jsi ~b~%s~s~ ktery patril ~y~%s~s~', + ['no_players_nearby'] = 'zadny hrac pobliz!', + ['being_searched'] = 'prave jsi ~y~prohledavan~s~ ~b~policii~s~', + -- Vehicle interaction + ['vehicle_info'] = 'informace o vozidle', + ['pick_lock'] = 'vypáčit vozidlo', + ['vehicle_unlocked'] = 'vozidlo je ~g~Odemčeno~s~', + ['no_vehicles_nearby'] = 'there is no vehicles nearby', + ['impound'] = 'odtahnout vozidlo', + ['impound_prompt'] = 'zmackni ~INPUT_CONTEXT~ pro zruseni ~y~odtahnuti~s~', + ['impound_canceled'] = 'zrusil jsi odtah', + ['impound_canceled_moved'] = 'odtah byl zrusen,protoze se vozidlo pohlo!', + ['impound_successful'] = 'uspesne jsi odtahl vozidlo', + ['search_database'] = 'informace o vozidle', + ['search_database_title'] = 'informace o vozidle - pomocí registracnich cisel', + ['search_database_error_invalid'] = 'tohle ~r~neni~s~ ~y~spravne~s~ registracni cislo', + ['search_database_error_not_found'] = 'toto ~y~registracni cislo~s~ je ~r~nespravne~s~ pro toto vozidlo!', + ['search_database_found'] = 'vozidlo bylo ~y~registrovano~s~ k ~b~%s~s~', + -- Traffic interaction + ['traffic_interaction'] = 'interakce provozu', + ['cone'] = 'kuzel', + ['barrier'] = 'bariera', + ['spikestrips'] = 'ostnaty pas', + ['box'] = 'box', + ['cash'] = 'box penez', + -- ID Card Menu + ['name'] = 'jméno: %s', + ['job'] = 'práce: %s', + ['sex'] = 'pohlaví: %s', + ['dob'] = 'DOB: %s', + ['height'] = 'výška: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'neznámé', + ['male'] = 'muž', + ['female'] = 'žena', + -- Body Search Menu + ['guns_label'] = '--- Zbraně ---', + ['inventory_label'] = '--- Inventář ---', + ['license_label'] = ' --- Průkazy ---', + ['confiscate'] = 'zabavit %s', + ['confiscate_weapon'] = 'zabavit %s s %s naboji', + ['confiscate_inv'] = 'zabavit %sx %s', + ['confiscate_dirty'] = 'zabavit spinave penize: $%s', + ['you_confiscated'] = 'zabavil jsi ~y~%sx~s~ ~b~%s~s~ od ~b~%s~s~', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ byly zabaveny od ~y~%s~s~', + ['you_confiscated_account'] = 'zabavil jsi ~g~$%s~s~ (%s) od ~b~%s~s~', + ['got_confiscated_account'] = '~g~$%s~s~ (%s) byly zabaveny ~y~%s~s~', + ['you_confiscated_weapon'] = 'zabavil jsi ~b~%s~s~ od ~b~%s~s~ s ~o~%s~s~ naboji ', + ['got_confiscated_weapon'] = 'tvoje ~b~%s~s~ s ~o~%s~s~ bylo zabaveno od ~y~%s~s~', + ['traffic_offense'] = 'dopravní přestupek', + ['minor_offense'] = 'malý přestupek', + ['average_offense'] = 'přestupek', + ['major_offense'] = 'trestný čin', + ['fine_total'] = 'pokuta: %s', + -- Vehicle Info Menu + ['plate'] = 'SPZ: %s', + ['owner_unknown'] = 'vlastník: Neznámý', + ['owner'] = 'vlastník: %s', + -- Boss Menu + ['open_bossmenu'] = 'stiskni ~INPUT_CONTEXT~ pro otevření menu', + ['quantity_invalid'] = 'neplatné množství', + ['have_withdrawn'] = 'vybral jsi ~y~%sx~s~ ~b~%s~s~', + ['have_deposited'] = 'vložil jsi ~y~%sx~s~ ~b~%s~s~', + ['quantity'] = 'množství', + ['inventory'] = 'inventář', + ['police_stock'] = 'policejní sklad', + -- Misc + ['remove_prop'] = 'stiskni ~INPUT_CONTEXT~ pro odstranění předmětu', + ['map_blip'] = 'policejní stanice', + ['unrestrained_timer'] = 'cítíš, že tvé pouta pomalu ztrácejí přilnavost a padají.', + -- Notifications + ['alert_police'] = 'policejní poplach', + ['phone_police'] = 'policie', +} From 7f75fe55b92fabea9c676c211d3db85dcbc5af56 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 30 Jan 2020 11:37:54 +0100 Subject: [PATCH 224/253] Revert unfinished code --- locales/en.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/en.lua b/locales/en.lua index 0a30a598..2a08acd5 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -116,7 +116,7 @@ Locales['en'] = { ['guns_label'] = '--- Guns ---', ['inventory_label'] = '--- Inventory ---', ['license_label'] = ' --- Licenses ---', - ['confiscate'] = 'sieze illegal items', + ['confiscate'] = 'confiscate %s', ['confiscate_weapon'] = 'confiscate %s with %s bullets', ['confiscate_inv'] = 'confiscate %sx %s', ['confiscate_dirty'] = 'confiscate dirty money: $%s', From d83ad88adec0003ae43c0216a3f23ce92679e876 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 30 Jan 2020 12:04:55 +0100 Subject: [PATCH 225/253] Fixed ranks, fixes #387 and closes #142 --- config.lua | 86 +------------------------------ esx_policejob.sql | 2 +- localization/de_esx_policejob.sql | 7 ++- localization/en_esx_policejob.sql | 1 - localization/fi_esx_policejob.sql | 1 - localization/ko_esx_policejob.sql | 1 - localization/sv_esx_policejob.sql | 7 ++- 7 files changed, 9 insertions(+), 96 deletions(-) diff --git a/config.lua b/config.lua index f3de61a0..7af9bb20 100644 --- a/config.lua +++ b/config.lua @@ -106,15 +106,6 @@ Config.AuthorizedWeapons = { {weapon = 'WEAPON_FLASHLIGHT', price = 0} }, - intendent = { - {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, - {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, - {weapon = 'WEAPON_PUMPSHOTGUN', components = {2000, 6000, nil}, price = 70000}, - {weapon = 'WEAPON_NIGHTSTICK', price = 0}, - {weapon = 'WEAPON_STUNGUN', price = 500}, - {weapon = 'WEAPON_FLASHLIGHT', price = 0} - }, - lieutenant = { {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, @@ -124,15 +115,6 @@ Config.AuthorizedWeapons = { {weapon = 'WEAPON_FLASHLIGHT', price = 0} }, - chef = { - {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, - {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, - {weapon = 'WEAPON_PUMPSHOTGUN', components = {2000, 6000, nil}, price = 70000}, - {weapon = 'WEAPON_NIGHTSTICK', price = 0}, - {weapon = 'WEAPON_STUNGUN', price = 500}, - {weapon = 'WEAPON_FLASHLIGHT', price = 0} - }, - boss = { {weapon = 'WEAPON_APPISTOL', components = {0, 0, 1000, 4000, nil}, price = 10000}, {weapon = 'WEAPON_ADVANCEDRIFLE', components = {0, 6000, 1000, 4000, 8000, nil}, price = 50000}, @@ -156,15 +138,11 @@ Config.AuthorizedVehicles = { {model = 'policeb', price = 30500} }, - intendent = {}, - lieutenant = { {model = 'riot', price = 70000}, {model = 'fbi2', price = 60000} }, - chef = {}, - boss = {} }, @@ -175,16 +153,10 @@ Config.AuthorizedVehicles = { sergeant = {}, - intendent = {}, - lieutenant = { {model = 'polmav', props = {modLivery = 0}, price = 200000} }, - chef = { - {model = 'polmav', props = {modLivery = 0}, price = 150000} - }, - boss = { {model = 'polmav', props = {modLivery = 0}, price = 100000} } @@ -203,12 +175,8 @@ Config.CustomPeds = { sergeant = {}, - intendent = {}, - lieutenant = {}, - chef = {}, - boss = { {label = 'SWAT Ped', maleModel = 's_m_y_swat_01', femaleModel = 's_m_y_swat_01'} } @@ -291,7 +259,7 @@ Config.Uniforms = { } }, - intendent = { + lieutenant = { male = { tshirt_1 = 58, tshirt_2 = 0, torso_1 = 55, torso_2 = 0, @@ -316,57 +284,7 @@ Config.Uniforms = { } }, - lieutenant = {-- currently the same as intendent - male = { - tshirt_1 = 58, tshirt_2 = 0, - torso_1 = 55, torso_2 = 0, - decals_1 = 8, decals_2 = 2, - arms = 41, - pants_1 = 25, pants_2 = 0, - shoes_1 = 25, shoes_2 = 0, - helmet_1 = -1, helmet_2 = 0, - chain_1 = 0, chain_2 = 0, - ears_1 = 2, ears_2 = 0 - }, - female = { - tshirt_1 = 35, tshirt_2 = 0, - torso_1 = 48, torso_2 = 0, - decals_1 = 7, decals_2 = 2, - arms = 44, - pants_1 = 34, pants_2 = 0, - shoes_1 = 27, shoes_2 = 0, - helmet_1 = -1, helmet_2 = 0, - chain_1 = 0, chain_2 = 0, - ears_1 = 2, ears_2 = 0 - } - }, - - chef = { - male = { - tshirt_1 = 58, tshirt_2 = 0, - torso_1 = 55, torso_2 = 0, - decals_1 = 8, decals_2 = 3, - arms = 41, - pants_1 = 25, pants_2 = 0, - shoes_1 = 25, shoes_2 = 0, - helmet_1 = -1, helmet_2 = 0, - chain_1 = 0, chain_2 = 0, - ears_1 = 2, ears_2 = 0 - }, - female = { - tshirt_1 = 35, tshirt_2 = 0, - torso_1 = 48, torso_2 = 0, - decals_1 = 7, decals_2 = 3, - arms = 44, - pants_1 = 34, pants_2 = 0, - shoes_1 = 27, shoes_2 = 0, - helmet_1 = -1, helmet_2 = 0, - chain_1 = 0, chain_2 = 0, - ears_1 = 2, ears_2 = 0 - } - }, - - boss = {-- currently the same as chef + boss = { male = { tshirt_1 = 58, tshirt_2 = 0, torso_1 = 55, torso_2 = 0, diff --git a/esx_policejob.sql b/esx_policejob.sql index ca16562e..a5a8afaa 100644 --- a/esx_policejob.sql +++ b/esx_policejob.sql @@ -13,7 +13,7 @@ INSERT INTO `addon_inventory` (name, label, shared) VALUES ; INSERT INTO `jobs` (name, label) VALUES - ('police','LSPD') + ('police', 'LSPD') ; INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES diff --git a/localization/de_esx_policejob.sql b/localization/de_esx_policejob.sql index dee8b026..0eea7a4d 100644 --- a/localization/de_esx_policejob.sql +++ b/localization/de_esx_policejob.sql @@ -19,13 +19,12 @@ INSERT INTO `jobs` (name, label) VALUES INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES ('police',0,'recruit','Rekrut',20,'{}','{}'), ('police',1,'officer','Officier',40,'{}','{}'), - ('police',2,'sergeant','Sergent',40,'{}','{}'), - ('police',3,'lieutenant','Lieutenant',65,'{}','{}'), - ('police',4,'boss','Commandant',80,'{}','{}') + ('police',2,'sergeant','Sergent',60,'{}','{}'), + ('police',3,'lieutenant','Lieutenant',85,'{}','{}'), + ('police',4,'boss','Commandant',100,'{}','{}') ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, `amount` int(11) DEFAULT NULL, diff --git a/localization/en_esx_policejob.sql b/localization/en_esx_policejob.sql index 479c7bd4..4e32909c 100644 --- a/localization/en_esx_policejob.sql +++ b/localization/en_esx_policejob.sql @@ -25,7 +25,6 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, `amount` int(11) DEFAULT NULL, diff --git a/localization/fi_esx_policejob.sql b/localization/fi_esx_policejob.sql index dd51d4cf..0765c9e8 100644 --- a/localization/fi_esx_policejob.sql +++ b/localization/fi_esx_policejob.sql @@ -25,7 +25,6 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, `amount` int(11) DEFAULT NULL, diff --git a/localization/ko_esx_policejob.sql b/localization/ko_esx_policejob.sql index c3041914..365f1d32 100644 --- a/localization/ko_esx_policejob.sql +++ b/localization/ko_esx_policejob.sql @@ -25,7 +25,6 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, `amount` int(11) DEFAULT NULL, diff --git a/localization/sv_esx_policejob.sql b/localization/sv_esx_policejob.sql index d880d38e..7ba82bf0 100644 --- a/localization/sv_esx_policejob.sql +++ b/localization/sv_esx_policejob.sql @@ -18,14 +18,13 @@ INSERT INTO `jobs` (name, label) VALUES INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES ('police',0,'recruit','Aspirant',20,'{}','{}'), - ('police',1,'officer','Biträdande Rikspolischef',40,'{}','{}'), - ('police',2,'sergeant','Assistent',60,'{}','{}'), - ('police',3,'lieutenant','Inspektör',85,'{}','{}'), + ('police',1,'officer','Assistent',40,'{}','{}'), + ('police',2,'sergeant','Inspektör',60,'{}','{}'), + ('police',3,'lieutenant','Kommissarie',85,'{}','{}'), ('police',4,'boss','Rikspolischef',100,'{}','{}') ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, `amount` int(11) DEFAULT NULL, From 98a68bd107383163bd62788c01dcec0dcd3755d0 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 6 Feb 2020 10:54:04 +0100 Subject: [PATCH 226/253] Added "exception handler" to missing authorized vehicle list --- client/vehicle.lua | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/client/vehicle.lua b/client/vehicle.lua index a0af0aec..2a0d04b4 100644 --- a/client/vehicle.lua +++ b/client/vehicle.lua @@ -17,24 +17,28 @@ function OpenVehicleSpawnerMenu(type, station, part, partNum) local shopCoords = Config.PoliceStations[station][part][partNum].InsideShop local authorizedVehicles = Config.AuthorizedVehicles[type][ESX.PlayerData.job.grade_name] - if #authorizedVehicles > 0 then - for k,vehicle in ipairs(authorizedVehicles) do - if IsModelInCdimage(vehicle.model) then - local vehicleLabel = GetLabelText(GetDisplayNameFromVehicleModel(vehicle.model)) + if authorizedVehicles then + if #authorizedVehicles > 0 then + for k,vehicle in ipairs(authorizedVehicles) do + if IsModelInCdimage(vehicle.model) then + local vehicleLabel = GetLabelText(GetDisplayNameFromVehicleModel(vehicle.model)) - table.insert(shopElements, { - label = ('%s - %s'):format(vehicleLabel, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))), - name = vehicleLabel, - model = vehicle.model, - price = vehicle.price, - props = vehicle.props, - type = type - }) + table.insert(shopElements, { + label = ('%s - %s'):format(vehicleLabel, _U('shop_item', ESX.Math.GroupDigits(vehicle.price))), + name = vehicleLabel, + model = vehicle.model, + price = vehicle.price, + props = vehicle.props, + type = type + }) + end end - end - if #shopElements > 0 then - OpenShopMenu(shopElements, playerCoords, shopCoords) + if #shopElements > 0 then + OpenShopMenu(shopElements, playerCoords, shopCoords) + else + ESX.ShowNotification(_U('garage_notauthorized')) + end else ESX.ShowNotification(_U('garage_notauthorized')) end From 6d89fd9283bc04a2fb10a6b6802c67a23f3cc6fe Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 6 Feb 2020 11:22:43 +0100 Subject: [PATCH 227/253] Corrected locales --- locales/br.lua | 2 +- locales/cs.lua | 2 +- locales/sv.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/locales/br.lua b/locales/br.lua index e47dda49..5bd1cbee 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -48,7 +48,7 @@ Locales['br'] = { ['shop_item'] = '$%s', ['vehicleshop_title'] = 'vehicle Shop', ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', - ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', + ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~g~$%s~s~', ['vehicleshop_money'] = 'you cannot afford that vehicle', ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', ['confirm_no'] = 'no', diff --git a/locales/cs.lua b/locales/cs.lua index eff426e6..be112891 100644 --- a/locales/cs.lua +++ b/locales/cs.lua @@ -20,7 +20,7 @@ Locales['cs'] = { ['armory_item'] = '$%s', ['armory_weapontitle'] = 'zbrojnice', ['armory_componenttitle'] = 'zbrojnice - Příslušenství ke zbraním', - ['armory_bought'] = 'zakoupil jsi ~y~%s~s~ za ~r~$%s~s~', + ['armory_bought'] = 'zakoupil jsi ~y~%s~s~ za ~g~$%s~s~', ['armory_money'] = 'nemáš dostatek peněz na tuto zbraň', ['armory_hascomponent'] = 'toto příslušenství máš již nainstalováno!', ['get_weapon_menu'] = 'zbrojnice - Vzít zbraň', diff --git a/locales/sv.lua b/locales/sv.lua index 04f52ed0..8a7d4295 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -20,7 +20,7 @@ Locales['sv'] = { ['armory_item'] = '%s SEK', ['armory_weapontitle'] = 'vapenförråd - Köp vapen', ['armory_componenttitle'] = 'vapenförråd - Vapen tillbehör', - ['armory_bought'] = 'du köpte ~y~%s~s~ för ~r~%s SEK~s~', + ['armory_bought'] = 'du köpte ~y~%s~s~ för ~g~%s SEK~s~', ['armory_money'] = 'du har inte råd med det vapnet', ['armory_hascomponent'] = 'du har redan det tillbehöret!', ['get_weapon_menu'] = 'vapenförråd - Ta ut vapen', From 259cbc5b08c0d1587225d1d7389db8d82ea9443e Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 6 Feb 2020 13:05:43 +0100 Subject: [PATCH 228/253] Fixed identity job --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 94676317..f0dfacaf 100644 --- a/client/main.lua +++ b/client/main.lua @@ -400,7 +400,7 @@ function OpenIdentityCardMenu(player) ESX.TriggerServerCallback('esx_policejob:getOtherPlayerData', function(data) local elements = { {label = _U('name', data.name)}, - {label = _U('job', ('%s - %s'):format(data.job.label, data.job.grade_label))} + {label = _U('job', ('%s - %s'):format(data.job, data.grade))} } if Config.EnableESXIdentity then From f83e05c83b4a2accb4c97782910faf49f51bef87 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 12 Feb 2020 10:48:21 +0100 Subject: [PATCH 229/253] Fixed searching for vehicles, closes #398 Co-Authored-By: mortdudley --- client/main.lua | 30 ++++++++++++++++++++---------- locales/br.lua | 2 -- locales/cs.lua | 2 -- locales/de.lua | 2 -- locales/en.lua | 2 -- locales/es.lua | 2 -- locales/fi.lua | 2 -- locales/fr.lua | 2 -- locales/ko.lua | 2 -- locales/pl.lua | 2 -- locales/sv.lua | 2 -- server/main.lua | 35 +++++------------------------------ 12 files changed, 25 insertions(+), 60 deletions(-) diff --git a/client/main.lua b/client/main.lua index f0dfacaf..1305acde 100644 --- a/client/main.lua +++ b/client/main.lua @@ -543,17 +543,28 @@ function LookupVehicle() title = _U('search_database_title'), }, function(data, menu) local length = string.len(data.value) - if data.value == nil or length < 2 or length > 13 then + if not data.value or length < 2 or length > 8 then ESX.ShowNotification(_U('search_database_error_invalid')) else - ESX.TriggerServerCallback('esx_policejob:getVehicleFromPlate', function(owner, found) - if found then - ESX.ShowNotification(_U('search_database_found', owner)) + ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(retrivedInfo) + local elements = {{label = _U('plate', retrivedInfo.plate)}} + menu.close() + + if not retrivedInfo.owner then + table.insert(elements, {label = _U('owner_unknown')}) else - ESX.ShowNotification(_U('search_database_error_not_found')) + table.insert(elements, {label = _U('owner', retrivedInfo.owner)}) end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_infos', { + title = _U('vehicle_info'), + align = 'top-left', + elements = elements + }, nil, function(data2, menu2) + menu2.close() + end) end, data.value) - menu.close() + end end, function(data, menu) menu.close() @@ -620,7 +631,7 @@ function OpenVehicleInfosMenu(vehicleData) ESX.TriggerServerCallback('esx_policejob:getVehicleInfos', function(retrivedInfo) local elements = {{label = _U('plate', retrivedInfo.plate)}} - if retrivedInfo.owner == nil then + if not retrivedInfo.owner then table.insert(elements, {label = _U('owner_unknown')}) else table.insert(elements, {label = _U('owner', retrivedInfo.owner)}) @@ -699,7 +710,6 @@ end function OpenBuyWeaponsMenu() local elements = {} local playerPed = PlayerPedId() - PlayerData = ESX.GetPlayerData() for k,v in ipairs(Config.AuthorizedWeapons[ESX.PlayerData.job.grade_name]) do local weaponNum, weapon = ESX.GetWeapon(v.weapon) @@ -836,7 +846,7 @@ function OpenGetStocksMenu() }, function(data2, menu2) local count = tonumber(data2.value) - if count == nil then + if not count then ESX.ShowNotification(_U('quantity_invalid')) else menu2.close() @@ -883,7 +893,7 @@ function OpenPutStocksMenu() }, function(data2, menu2) local count = tonumber(data2.value) - if count == nil then + if not count then ESX.ShowNotification(_U('quantity_invalid')) else menu2.close() diff --git a/locales/br.lua b/locales/br.lua index 5bd1cbee..cadc743f 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -93,8 +93,6 @@ Locales['br'] = { ['search_database'] = 'informação do veículo', ['search_database_title'] = 'informações do veículo - pesquisa com número de registro', ['search_database_error_invalid'] = 'que ~r~não~s~ é um número de registro ~y~válido~s~', - ['search_database_error_not_found'] = 'esse número de ~y~registror~s~ ~r~não~s~ está registrado em um veículo!', - ['search_database_found'] = 'o veículo está ~y~registrado~s~ para ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'Interagir com as rodovias', ['cone'] = 'Cones', diff --git a/locales/cs.lua b/locales/cs.lua index be112891..0c494b2f 100644 --- a/locales/cs.lua +++ b/locales/cs.lua @@ -93,8 +93,6 @@ Locales['cs'] = { ['search_database'] = 'informace o vozidle', ['search_database_title'] = 'informace o vozidle - pomocí registracnich cisel', ['search_database_error_invalid'] = 'tohle ~r~neni~s~ ~y~spravne~s~ registracni cislo', - ['search_database_error_not_found'] = 'toto ~y~registracni cislo~s~ je ~r~nespravne~s~ pro toto vozidlo!', - ['search_database_found'] = 'vozidlo bylo ~y~registrovano~s~ k ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'interakce provozu', ['cone'] = 'kuzel', diff --git a/locales/de.lua b/locales/de.lua index 7492e226..5ed2776f 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -93,8 +93,6 @@ Locales['de'] = { ['search_database'] = 'vehicle information', ['search_database_title'] = 'vehicle information - search with registration number', ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', - ['search_database_error_not_found'] = 'that ~y~registration number~s~ is ~r~not~s~ registered to an vehicle!', - ['search_database_found'] = 'the vehicle is ~y~registered~s~ to ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'Straßeninteraktionen', ['cone'] = 'Hütchen', diff --git a/locales/en.lua b/locales/en.lua index 2a08acd5..e7585c78 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -93,8 +93,6 @@ Locales['en'] = { ['search_database'] = 'vehicle information', ['search_database_title'] = 'vehicle information - search with registration number', ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', - ['search_database_error_not_found'] = 'that ~y~registration number~s~ is ~r~not~s~ registered to an vehicle!', - ['search_database_found'] = 'the vehicle is ~y~registered~s~ to ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'interaction Traffic', ['cone'] = 'cone', diff --git a/locales/es.lua b/locales/es.lua index 354c89e6..ce0001cb 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -93,8 +93,6 @@ Locales['es'] = { ['search_database'] = 'vehicle information', ['search_database_title'] = 'vehicle information - search with registration number', ['search_database_error_invalid'] = 'that is ~r~not~s~ a ~y~valid~s~ registration number', - ['search_database_error_not_found'] = 'that ~y~registration number~s~ is ~r~not~s~ registered to an vehicle!', - ['search_database_found'] = 'the vehicle is ~y~registered~s~ to ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'Rutas de interacción', ['cone'] = 'Cono', diff --git a/locales/fi.lua b/locales/fi.lua index b0f5d7d9..abf04045 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -93,8 +93,6 @@ Locales['fi'] = { ['search_database'] = 'ajoneuvon tiedot', ['search_database_title'] = 'ajoneuvon tiedot - etsi rekisterinumerolla', ['search_database_error_invalid'] = 'tämä ~r~ei ole~s~ ~y~voimassa oleva~s~ rekisterinumero', - ['search_database_error_not_found'] = 'tämä ~y~rekisterinumero~s~ ~r~ei~s~ ole rekistöröity ajoneuvoon!', - ['search_database_found'] = 'ajoneuvo on ~y~rekistöröity~s~ henkilölle ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'liikenteen vuorovaikutus', ['cone'] = 'kartio', diff --git a/locales/fr.lua b/locales/fr.lua index d30a825b..3eaf1a6d 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -93,8 +93,6 @@ Locales['fr'] = { ['search_database'] = 'vehicle information', ['search_database_title'] = 'informations sur le véhicule - recherche avec numéro d\'enregistrement', ['search_database_error_invalid'] = 'Ce n\'est ~r~pas~s~ un ~y~numéro d\'enregistrement valide~s~', - ['search_database_error_not_found'] = 'ce ~y~numéro d\'enregistrement ~s~est~r~ pas ~s~ enregistré sur un véhicule!', - ['search_database_found'] = 'le véhicule est ~y~enregistré~s~ à ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'interaction routière', ['cone'] = 'plot', diff --git a/locales/ko.lua b/locales/ko.lua index ea2c093c..e85e9998 100644 --- a/locales/ko.lua +++ b/locales/ko.lua @@ -93,8 +93,6 @@ Locales['ko'] = { ['search_database'] = '차량 정보', ['search_database_title'] = '차량 정보 - 등록번호로 검색', ['search_database_error_invalid'] = '~y~유효한~s~ 등록 번호가 ~r~아닙니다.~s~', - ['search_database_error_not_found'] = '그 ~y~등록 번호~s~는 차량에 등록되지 ~r~않았습니다!~s~', - ['search_database_found'] = '이 차량은 ~b~%s~s~에 ~y~등록되었습니다~s~', -- Traffic interaction ['traffic_interaction'] = '교통 상호 작용', ['cone'] = '원뿔', diff --git a/locales/pl.lua b/locales/pl.lua index ab5e8678..2f2a0479 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -93,8 +93,6 @@ Locales['pl'] = { ['search_database'] = 'informacje o pojeździe', ['search_database_title'] = 'informacjeo pojeździe - przeszukaj używając numeru rejestracyjnego', ['search_database_error_invalid'] = 'to ~r~nie~s~ jest ~y~poprawny~s~ rnumer rejestracyjny', - ['search_database_error_not_found'] = 'ten ~y~numer rejestracyjny~s~ ~r~nie jest~s~ zarejestrowany do tego pojazdu!', - ['search_database_found'] = 'pojazd jest ~y~zarejestrowany~s~ do ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'interakcje dla ruchu drogowego', ['cone'] = 'pachołek', diff --git a/locales/sv.lua b/locales/sv.lua index 8a7d4295..ba2c2179 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -93,8 +93,6 @@ Locales['sv'] = { ['search_database'] = 'fordonsuppgifter', ['search_database_title'] = 'fordonsuppgifter - sök med registreringsnummer', ['search_database_error_invalid'] = 'det är ~r~inte~s~ ett ~y~giltigt~s~ registreringsnummer', - ['search_database_error_not_found'] = 'det ~y~registreringsnummeret~s~ är ~r~inte~s~ registrerat till något fordon!', - ['search_database_found'] = 'detta fordon är ~y~registrerat~s~ till ~b~%s~s~', -- Traffic interaction ['traffic_interaction'] = 'trafiksåtgärder', ['cone'] = 'kon', diff --git a/server/main.lua b/server/main.lua index e328e551..b15030ce 100644 --- a/server/main.lua +++ b/server/main.lua @@ -207,22 +207,19 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, if xPlayer then retrivedInfo.owner = xPlayer.getName() cb(retrivedInfo) - else - MySQL.Async.fetchAll('SELECT name, firstname, lastname FROM users WHERE identifier = @identifier', { + elseif Config.EnableESXIdentity then + MySQL.Async.fetchAll('SELECT firstname, lastname FROM users WHERE identifier = @identifier', { ['@identifier'] = result[1].owner }, function(result2) if result2[1] then - if Config.EnableESXIdentity then - retrivedInfo.owner = ('%s %s'):format(result2[1].firstname, result2[1].lastname) - else - retrivedInfo.owner = result2[1].name - end - + retrivedInfo.owner = ('%s %s'):format(result2[1].firstname, result2[1].lastname) cb(retrivedInfo) else cb(retrivedInfo) end end) + else + cb(retrivedInfo) end else cb(retrivedInfo) @@ -230,28 +227,6 @@ ESX.RegisterServerCallback('esx_policejob:getVehicleInfos', function(source, cb, end) end) -ESX.RegisterServerCallback('esx_policejob:getVehicleFromPlate', function(source, cb, plate) - MySQL.Async.fetchAll('SELECT owner FROM owned_vehicles WHERE plate = @plate', { - ['@plate'] = plate - }, function(result) - if result[1] then - MySQL.Async.fetchAll('SELECT name, firstname, lastname FROM users WHERE identifier = @identifier', { - ['@identifier'] = result[1].owner - }, function(result2) - - if Config.EnableESXIdentity then - cb(('%s %s'):format(result2[1].firstname, result2[1].lastname), true) - else - cb(result2[1].name, true) - end - - end) - else - cb(_U('unknown'), false) - end - end) -end) - ESX.RegisterServerCallback('esx_policejob:getArmoryWeapons', function(source, cb) TriggerEvent('esx_datastore:getSharedDataStore', 'society_police', function(store) local weapons = store.get('weapons') From 2da774ad8aa7dd241f8940038e4faeaa91f99f2c Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 14 Apr 2020 16:51:30 +0200 Subject: [PATCH 230/253] Latest ESX code --- esx_policejob.sql | 2 +- localization/de_esx_policejob.sql | 2 +- localization/en_esx_policejob.sql | 2 +- localization/fi_esx_policejob.sql | 2 +- localization/ko_esx_policejob.sql | 2 +- localization/pl_esx_policejob.sql | 2 +- localization/sv_esx_policejob.sql | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/esx_policejob.sql b/esx_policejob.sql index a5a8afaa..b6a06d86 100644 --- a/esx_policejob.sql +++ b/esx_policejob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_police', 'Police', 1) diff --git a/localization/de_esx_policejob.sql b/localization/de_esx_policejob.sql index 0eea7a4d..78f2d4f5 100644 --- a/localization/de_esx_policejob.sql +++ b/localization/de_esx_policejob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_police','Polizei',1) diff --git a/localization/en_esx_policejob.sql b/localization/en_esx_policejob.sql index 4e32909c..a449c2b4 100644 --- a/localization/en_esx_policejob.sql +++ b/localization/en_esx_policejob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_police', 'Police', 1) diff --git a/localization/fi_esx_policejob.sql b/localization/fi_esx_policejob.sql index 0765c9e8..3e471aba 100644 --- a/localization/fi_esx_policejob.sql +++ b/localization/fi_esx_policejob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_police', 'Poliisi', 1) diff --git a/localization/ko_esx_policejob.sql b/localization/ko_esx_policejob.sql index 365f1d32..7e6393ef 100644 --- a/localization/ko_esx_policejob.sql +++ b/localization/ko_esx_policejob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_police', '경찰', 1) diff --git a/localization/pl_esx_policejob.sql b/localization/pl_esx_policejob.sql index 1512644e..b2c1d924 100644 --- a/localization/pl_esx_policejob.sql +++ b/localization/pl_esx_policejob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_police', 'Police', 1) diff --git a/localization/sv_esx_policejob.sql b/localization/sv_esx_policejob.sql index 7ba82bf0..3f68feb0 100644 --- a/localization/sv_esx_policejob.sql +++ b/localization/sv_esx_policejob.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `addon_account` (name, label, shared) VALUES ('society_police', 'Polis', 1) From df1c7bdd3cf9111e17d3a0269f09a512e804d987 Mon Sep 17 00:00:00 2001 From: shortybsd Date: Sat, 16 May 2020 22:50:20 -0500 Subject: [PATCH 231/253] Update esx_policejob.sql int - Integer display width is deprecated and will be removed in a future release. --- esx_policejob.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esx_policejob.sql b/esx_policejob.sql index b6a06d86..fcc92964 100644 --- a/esx_policejob.sql +++ b/esx_policejob.sql @@ -25,10 +25,10 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, PRIMARY KEY (`id`) ); From 225ea83bd97dd0feaab930954c4c171e62093261 Mon Sep 17 00:00:00 2001 From: shortybsd Date: Sat, 16 May 2020 22:51:03 -0500 Subject: [PATCH 232/253] Update de_esx_policejob.sql int - Integer display width is deprecated and will be removed in a future release. --- localization/de_esx_policejob.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/localization/de_esx_policejob.sql b/localization/de_esx_policejob.sql index 78f2d4f5..0e7aabb4 100644 --- a/localization/de_esx_policejob.sql +++ b/localization/de_esx_policejob.sql @@ -25,10 +25,10 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, PRIMARY KEY (`id`) ); From 3f4c32ceea32db71ba72aa128e903eb27847f173 Mon Sep 17 00:00:00 2001 From: shortybsd Date: Sat, 16 May 2020 22:51:52 -0500 Subject: [PATCH 233/253] Update en_esx_policejob.sql int - Integer display width is deprecated and will be removed in a future release. --- localization/en_esx_policejob.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/localization/en_esx_policejob.sql b/localization/en_esx_policejob.sql index a449c2b4..0eec900b 100644 --- a/localization/en_esx_policejob.sql +++ b/localization/en_esx_policejob.sql @@ -25,10 +25,10 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, PRIMARY KEY (`id`) ); From d75543a2e6f236cd2f626b29aa06f742f29314d6 Mon Sep 17 00:00:00 2001 From: shortybsd Date: Sat, 16 May 2020 22:52:50 -0500 Subject: [PATCH 234/253] Update fi_esx_policejob.sql int - Integer display width is deprecated and will be removed in a future release. --- localization/fi_esx_policejob.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/localization/fi_esx_policejob.sql b/localization/fi_esx_policejob.sql index 3e471aba..3dd9281e 100644 --- a/localization/fi_esx_policejob.sql +++ b/localization/fi_esx_policejob.sql @@ -25,10 +25,10 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, PRIMARY KEY (`id`) ); From 52ef10b74dad2701a7ddb5ca32617b78d72d470a Mon Sep 17 00:00:00 2001 From: shortybsd Date: Sat, 16 May 2020 22:53:48 -0500 Subject: [PATCH 235/253] Update ko_esx_policejob.sql int - Integer display width is deprecated and will be removed in a future release. --- localization/ko_esx_policejob.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/localization/ko_esx_policejob.sql b/localization/ko_esx_policejob.sql index 7e6393ef..8b01a36b 100644 --- a/localization/ko_esx_policejob.sql +++ b/localization/ko_esx_policejob.sql @@ -25,10 +25,10 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, PRIMARY KEY (`id`) ); From 07c7d40157233c63f18abe4cb2b53228ad61dcab Mon Sep 17 00:00:00 2001 From: shortybsd Date: Sat, 16 May 2020 22:55:12 -0500 Subject: [PATCH 236/253] Update pl_esx_policejob.sql int - Integer display width is deprecated and will be removed in a future release. --- localization/pl_esx_policejob.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/localization/pl_esx_policejob.sql b/localization/pl_esx_policejob.sql index b2c1d924..6b915616 100644 --- a/localization/pl_esx_policejob.sql +++ b/localization/pl_esx_policejob.sql @@ -25,10 +25,10 @@ INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_ ; CREATE TABLE `fine_types` ( - `id` int(11) NOT NULL AUTO_INCREMENT, + `id` int NOT NULL AUTO_INCREMENT, `label` varchar(255) DEFAULT NULL, - `amount` int(11) DEFAULT NULL, - `category` int(11) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, PRIMARY KEY (`id`) ); From f7eafa8b7b8f40e235ef5886209e47edbc9df57a Mon Sep 17 00:00:00 2001 From: Arthur Hetem Date: Fri, 3 Jul 2020 13:52:04 -0300 Subject: [PATCH 237/253] Update main.lua (#413) Merging, corrected freemode ped don't return when exit work --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 1305acde..22604987 100644 --- a/client/main.lua +++ b/client/main.lua @@ -78,7 +78,7 @@ function OpenCloakroomMenu() cleanPlayer(playerPed) if data.current.value == 'citizen_wear' then - if Config.EnableNonFreemodePeds then + if Config.EnableCustomPeds then ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) local isMale = skin.sex == 0 From aba3486c8760d404a768e9743cf8773fcb45b945 Mon Sep 17 00:00:00 2001 From: Kevin O'Byrne <62954271+TehZombiJesus@users.noreply.github.com> Date: Fri, 3 Jul 2020 12:53:45 -0400 Subject: [PATCH 238/253] Update fr.lua (#431) Updated french locale. --- locales/fr.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locales/fr.lua b/locales/fr.lua index 3eaf1a6d..df9583c2 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -43,7 +43,7 @@ Locales['fr'] = { ['garage_storeditem'] = 'ouvrir le garage', ['garage_storeitem'] = 'ranger le véhicule', ['garage_buyitem'] = 'magasin véhicule', - ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', + ['garage_notauthorized'] = 'vous n\'êtes pas autorisé à acheter ce type de véhicules.', ['helicopter_prompt'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder aux ~y~Actions de l\'hélicoptère~s~.', ['shop_item'] = '$%s', ['vehicleshop_title'] = 'magasin véhicule', @@ -104,7 +104,7 @@ Locales['fr'] = { ['name'] = 'nom: %s', ['job'] = 'métier: %s', ['sex'] = 'sexe: %s', - ['dob'] = 'DOB: %s', + ['dob'] = 'DDN: %s', ['height'] = 'taille: %s', ['bac'] = 'BAC: %s', ['unknown'] = 'inconnu', From 41c71d4d45435f1ac959f1070ce31fee36ef7540 Mon Sep 17 00:00:00 2001 From: btwlouis <56355239+btwlouis@users.noreply.github.com> Date: Fri, 3 Jul 2020 18:54:38 +0200 Subject: [PATCH 239/253] error with identifier (#445) Change xPlayer to sourceXPlayer and fixing misprinting in the console. --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index b15030ce..3145622b 100644 --- a/server/main.lua +++ b/server/main.lua @@ -16,7 +16,7 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, local targetXPlayer = ESX.GetPlayerFromId(target) if sourceXPlayer.job.name ~= 'police' then - print(('esx_policejob: %s attempted to confiscate!'):format(xPlayer.identifier)) + print(('esx_policejob: %s attempted to confiscate!'):format(sourceXPlayer.identifier)) return end From a3c5de9f87e9ffaa951415b74e266e7b014d981e Mon Sep 17 00:00:00 2001 From: Jougito - Kheros Date: Fri, 3 Jul 2020 18:55:58 +0200 Subject: [PATCH 240/253] Improved realistic out vehicle animation, Markers modification implemented and Added es_esx_policejob.sql (#465) * Improved realistic out vehicle animation. * Markers modification implemented. * Added es_esx_policejob.sql. --- client/main.lua | 12 ++--- config.lua | 2 +- localization/es_esx_policejob.sql | 89 +++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 7 deletions(-) create mode 100644 localization/es_esx_policejob.sql diff --git a/client/main.lua b/client/main.lua index 22604987..a3389f46 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1136,7 +1136,7 @@ AddEventHandler('esx_policejob:OutVehicle', function() if IsPedSittingInAnyVehicle(playerPed) then local vehicle = GetVehiclePedIsIn(playerPed, false) - TaskLeaveVehicle(playerPed, vehicle, 16) + TaskLeaveVehicle(playerPed, vehicle, 64) end end) @@ -1234,7 +1234,7 @@ Citizen.CreateThread(function() local distance = #(playerCoords - v.Cloakrooms[i]) if distance < Config.DrawDistance then - DrawMarker(20, v.Cloakrooms[i], 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(Config.MarkerType.Cloakrooms, v.Cloakrooms[i], 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) letSleep = false if distance < Config.MarkerSize.x then @@ -1247,7 +1247,7 @@ Citizen.CreateThread(function() local distance = #(playerCoords - v.Armories[i]) if distance < Config.DrawDistance then - DrawMarker(21, v.Armories[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(Config.MarkerType.Armories, v.Armories[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) letSleep = false if distance < Config.MarkerSize.x then @@ -1260,7 +1260,7 @@ Citizen.CreateThread(function() local distance = #(playerCoords - v.Vehicles[i].Spawner) if distance < Config.DrawDistance then - DrawMarker(36, v.Vehicles[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(Config.MarkerType.Vehicles, v.Vehicles[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) letSleep = false if distance < Config.MarkerSize.x then @@ -1273,7 +1273,7 @@ Citizen.CreateThread(function() local distance = #(playerCoords - v.Helicopters[i].Spawner) if distance < Config.DrawDistance then - DrawMarker(34, v.Helicopters[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(Config.MarkerType.Helicopters, v.Helicopters[i].Spawner, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) letSleep = false if distance < Config.MarkerSize.x then @@ -1287,7 +1287,7 @@ Citizen.CreateThread(function() local distance = #(playerCoords - v.BossActions[i]) if distance < Config.DrawDistance then - DrawMarker(22, v.BossActions[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) + DrawMarker(Config.MarkerType.BossActions, v.BossActions[i], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, true, false, false, false) letSleep = false if distance < Config.MarkerSize.x then diff --git a/config.lua b/config.lua index 7af9bb20..be41e1d5 100644 --- a/config.lua +++ b/config.lua @@ -1,7 +1,7 @@ Config = {} Config.DrawDistance = 100.0 -Config.MarkerType = 1 +Config.MarkerType = {Cloakrooms = 20, Armories = 21, BossActions = 22, Vehicles = 36, Helicopters = 34} Config.MarkerSize = {x = 1.5, y = 1.5, z = 0.5} Config.MarkerColor = {r = 50, g = 50, b = 204} diff --git a/localization/es_esx_policejob.sql b/localization/es_esx_policejob.sql new file mode 100644 index 00000000..0b6f45d1 --- /dev/null +++ b/localization/es_esx_policejob.sql @@ -0,0 +1,89 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police', 'Policía', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police', 'Policía', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Policía', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', 'Policía') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'recruit','Recluta',20,'{}','{}'), + ('police',1,'officer','Oficial',40,'{}','{}'), + ('police',2,'sergeant','Sargento',60,'{}','{}'), + ('police',3,'lieutenant','Teniente',85,'{}','{}'), + ('police',4,'boss','Jefe',100,'{}','{}') +; + +CREATE TABLE `fine_types` ( + `id` int NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Mal uso del claxon', 30, 0), + ('Cruzar indebidamente la línea continua', 40, 0), + ('Conducir por el lado incorrecto de la carretera', 250, 0), + ('Giro indebido', 250, 0), + ('Conducir indebidamente fuera de la carretera', 170, 0), + ('No hacer caso a una orden de un agente', 30, 0), + ('Detener el vehículo de forma incorrecta', 150, 0), + ('Aparcar en un lugar no habilitado', 70, 0), + ('No ceder al girar a la derecha', 70, 0), + ('No cumplir con los datos de tu vehículo', 90, 0), + ('No pararse en una señal de STOP', 105, 0), + ('No pararse en un semáforo cuando está en rojo', 130, 0), + ('Cruzar indebidamente', 100, 0), + ('Conducir un coche no permitido', 100, 0), + ('Conducir sin carnet de conducción', 1500, 0), + ('Chocar y darse a la fuga', 800, 0), + ('Exceder la velocidad permitida en 5 km/h', 90, 0), + ('Exceder la velocidad permitida entre 5 y 15 km/h', 120, 0), + ('Exceder la velocidad permitida entre 15 y 30 km/h', 180, 0), + ('Exceder la velocidad permitida más de 30 km/h', 300, 0), + ('Generar atasco en una carretera', 110, 1), + ('Intoxicación pública', 90, 1), + ('Conducta alocada', 90, 1), + ('Obstrucción a la justicia', 130, 1), + ('Insultos hacia civiles', 75, 1), + ('Insultos hacia un agente', 110, 1), + ('Amenaza verbar a un civil', 90, 1), + ('Amenaza verbal a un agente', 150, 1), + ('Dar información falsa', 250, 1), + ('Intento de corrupción', 1500, 1), + ('Tendencia de armas en los limites de la ciudad', 120, 2), + ('Tendencia de armas letales en los limites de la ciudad', 300, 2), + ('No tener licencia de armas', 600, 2), + ('Posesión de un arma ilegal', 700, 2), + ('Posesión de herramientas para robos', 300, 2), + ('Desorden público', 1800, 2), + ('Intento de venta o distribución de sustancias ilegales', 1500, 2), + ('Fabricación de sustancias ilegales', 1500, 2), + ('Posesión de sustancias ilegales', 650, 2), + ('Secuestro de un civil', 1500, 2), + ('Secuestro de un agente', 2000, 2), + ('Robo', 650, 2), + ('Robo armado a una tienda', 650, 2), + ('Robo armado a un banco', 1500, 2), + ('Asalto a un civil', 2000, 3), + ('Asalto a un agente', 2500, 3), + ('Intento de asesinato a un civil', 3000, 3), + ('Intento de asesinato a un agente', 5000, 3), + ('Asesinato de un civil', 10000, 3), + ('Asesinato de un policia', 30000, 3), + ('Homicidio involuntario', 1800, 3), + ('Fraude', 2000, 2); +; From 867a56d9e986da72cc727a307f7a04ef2f2e8366 Mon Sep 17 00:00:00 2001 From: BrakingESX247 <67766145+BrakingESX247@users.noreply.github.com> Date: Mon, 20 Jul 2020 14:29:56 +0100 Subject: [PATCH 241/253] Updating config.lua. User-friendlier configuration file. --- config.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/config.lua b/config.lua index be41e1d5..e022c750 100644 --- a/config.lua +++ b/config.lua @@ -1,25 +1,25 @@ Config = {} -Config.DrawDistance = 100.0 +Config.DrawDistance = 10.0 -- How close do you need to be for the markers to be drawn (in GTA units). Config.MarkerType = {Cloakrooms = 20, Armories = 21, BossActions = 22, Vehicles = 36, Helicopters = 34} Config.MarkerSize = {x = 1.5, y = 1.5, z = 0.5} Config.MarkerColor = {r = 50, g = 50, b = 204} -Config.EnablePlayerManagement = false +Config.EnablePlayerManagement = false -- Enable if you want society managing. Config.EnableArmoryManagement = false -Config.EnableESXIdentity = false -- enable if you're using esx_identity -Config.EnableLicenses = false -- enable if you're using esx_license +Config.EnableESXIdentity = false -- Enable if you're using esx_identity +Config.EnableLicenses = false -- Enable if you're using esx_license -Config.EnableHandcuffTimer = true -- enable handcuff timer? will unrestrain player after the time ends -Config.HandcuffTimer = 10 * 60000 -- 10 mins +Config.EnableHandcuffTimer = true -- Enable handcuff timer? will unrestrain player after the time ends +Config.HandcuffTimer = 10 * 60000 -- 10 minutes -Config.EnableJobBlip = false -- enable blips for cops on duty, requires esx_society -Config.EnableCustomPeds = false -- enable custom peds in cloak room? See Config.CustomPeds below to customize peds +Config.EnableJobBlip = false -- Enable blips for cops on duty, requires esx_society +Config.EnableCustomPeds = false -- Enable custom peds in cloak room? See Config.CustomPeds below to customize peds -Config.EnableESXService = false -- enable esx service? -Config.MaxInService = 5 +Config.EnableESXService = false -- Enable esx service? +Config.MaxInService = -1 -- How much people can be in service at once? -Config.Locale = 'fr' +Config.Locale = 'en' Config.PoliceStations = { From c08ed94e006b1e50ee569694db72f0f1a99a5027 Mon Sep 17 00:00:00 2001 From: BrakingESX247 <67766145+BrakingESX247@users.noreply.github.com> Date: Mon, 20 Jul 2020 15:02:25 +0100 Subject: [PATCH 242/253] Update config.lua --- config.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.lua b/config.lua index e022c750..7717309c 100644 --- a/config.lua +++ b/config.lua @@ -7,14 +7,14 @@ Config.MarkerColor = {r = 50, g = 50, b = 204} Config.EnablePlayerManagement = false -- Enable if you want society managing. Config.EnableArmoryManagement = false -Config.EnableESXIdentity = false -- Enable if you're using esx_identity -Config.EnableLicenses = false -- Enable if you're using esx_license +Config.EnableESXIdentity = false -- Enable if you're using esx_identity. +Config.EnableLicenses = false -- Enable if you're using esx_license. -Config.EnableHandcuffTimer = true -- Enable handcuff timer? will unrestrain player after the time ends -Config.HandcuffTimer = 10 * 60000 -- 10 minutes +Config.EnableHandcuffTimer = true -- Enable handcuff timer? will unrestrain player after the time ends. +Config.HandcuffTimer = 10 * 60000 -- 10 minutes. -Config.EnableJobBlip = false -- Enable blips for cops on duty, requires esx_society -Config.EnableCustomPeds = false -- Enable custom peds in cloak room? See Config.CustomPeds below to customize peds +Config.EnableJobBlip = false -- Enable blips for cops on duty, requires esx_society. +Config.EnableCustomPeds = false -- Enable custom peds in cloak room? See Config.CustomPeds below to customize peds. Config.EnableESXService = false -- Enable esx service? Config.MaxInService = -1 -- How much people can be in service at once? From a38b55a3f08ea58594488f726d4f8c9f1ed112f9 Mon Sep 17 00:00:00 2001 From: userMacieG Date: Fri, 7 Aug 2020 01:42:16 +0200 Subject: [PATCH 243/253] Update main.lua (#480) --- server/main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 3145622b..56d569e9 100644 --- a/server/main.lua +++ b/server/main.lua @@ -3,7 +3,9 @@ ESX = nil TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) if Config.EnableESXService then - TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) + if Config.MaxInService ~= -1 then + TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) + end end TriggerEvent('esx_phone:registerNumber', 'police', _U('alert_police'), true, true) From 0554280f32d64f866fedaf48e59ed2f36b42d63b Mon Sep 17 00:00:00 2001 From: userMacieG Date: Fri, 7 Aug 2020 01:42:24 +0200 Subject: [PATCH 244/253] Check for "MaxInService == -1" (#481) If "MaxInService == -1" is true check for service is skipped --- client/main.lua | 50 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/client/main.lua b/client/main.lua index a3389f46..4ae3bf3a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -124,25 +124,41 @@ function OpenCloakroomMenu() ESX.TriggerServerCallback('esx_service:isInService', function(isInService) if not isInService then - ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) - if not canTakeService then - ESX.ShowNotification(_U('service_max', inServiceCount, maxInService)) - else - awaitService = true - playerInService = true + if Config.MaxInService == -1 then + ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) + if not canTakeService then + ESX.ShowNotification(_U('service_max', inServiceCount, maxInService)) + else + awaitService = true + playerInService = true - local notification = { - title = _U('service_anonunce'), - subject = '', - msg = _U('service_in_announce', GetPlayerName(PlayerId())), - iconType = 1 - } + local notification = { + title = _U('service_anonunce'), + subject = '', + msg = _U('service_in_announce', GetPlayerName(PlayerId())), + iconType = 1 + } - TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') - TriggerEvent('esx_policejob:updateBlip') - ESX.ShowNotification(_U('service_in')) - end - end, 'police') + TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') + TriggerEvent('esx_policejob:updateBlip') + ESX.ShowNotification(_U('service_in')) + end + end, 'police') + else + awaitService = true + playerInService = true + + local notification = { + title = _U('service_anonunce'), + subject = '', + msg = _U('service_in_announce', GetPlayerName(PlayerId())), + iconType = 1 + } + + TriggerServerEvent('esx_service:notifyAllInService', notification, 'police') + TriggerEvent('esx_policejob:updateBlip') + ESX.ShowNotification(_U('service_in')) + end else awaitService = true From b846c627243bd7bc12f1d608714dcf5cf51cd9bd Mon Sep 17 00:00:00 2001 From: Tijn Date: Mon, 5 Oct 2020 01:11:51 +0200 Subject: [PATCH 245/253] Add Dutch locale files (#498) * Create nl.lua * Update fxmanifest.lua * Create nl_esx_policejob.lua --- fxmanifest.lua | 2 + locales/nl.lua | 151 ++++++++++++++++++++++++++++++ localization/nl_esx_policejob.lua | 64 +++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 locales/nl.lua create mode 100644 localization/nl_esx_policejob.lua diff --git a/fxmanifest.lua b/fxmanifest.lua index cddca542..fc8283c7 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -19,6 +19,7 @@ server_scripts { 'locales/sv.lua', 'locales/ko.lua', 'locales/cs.lua', + 'locales/nl.lua', 'config.lua', 'server/main.lua' } @@ -35,6 +36,7 @@ client_scripts { 'locales/sv.lua', 'locales/ko.lua', 'locales/cs.lua', + 'locales/nl.lua', 'config.lua', 'client/main.lua', 'client/vehicle.lua' diff --git a/locales/nl.lua b/locales/nl.lua new file mode 100644 index 00000000..26dab1aa --- /dev/null +++ b/locales/nl.lua @@ -0,0 +1,151 @@ +Locales['nl'] = { + -- Cloackroom + ['cloakroom'] = 'Kleedkamer', + ['citizen_wear'] = 'Burgerkleding', + ['police_wear'] = 'Politiekleding', + ['gilet_wear'] = 'Oranje reflecterend vest', + ['bullet_wear'] = 'Kogelwerend vest', + ['no_outfit'] = 'Er zijn geen passende uniformen voor jou!', + ['open_cloackroom'] = 'Druk op ~INPUT_CONTEXT~ om je ~y~kleding~s~ aan te passen.', + -- Wapenkamer + ['remove_object'] = 'Haal item uit kluis', + ['deposit_object'] = 'Leg item in kluis', + ['get_weapon'] = 'Haal wapen uit wapenkamer', + ['put_weapon'] = 'Leg wapen in wapenkamer', + ['buy_weapons'] = 'Koop wapens', + ['armory'] = 'Wapenkamer', + ['open_armory'] = 'Druk op ~INPUT_CONTEXT~ om de ~y~Wapenkamer~s~ te openen.', + ['armory_owned'] = 'In Bezit', + ['armory_free'] = 'Gratis', + ['armory_item'] = '€%s', + ['armory_weapontitle'] = 'Wapenkamer - Koop wapen', + ['armory_componenttitle'] = 'Wapenkamer - Weapon attachments', + ['armory_bought'] = 'Je hebt een ~y~%s~s~ gekocht voor ~g~€%s~s~.', + ['armory_money'] = 'Je kan dit wap niet betalen.', + ['armory_hascomponent'] = 'je hebt dit weapon attachment al!', + ['get_weapon_menu'] = 'Wapenkamer - Pak wapen', + ['put_weapon_menu'] = 'Wapenkamer - Leg wapen weg', + -- Vehicles + ['vehicle_menu'] = 'Voertuig', + ['vehicle_blocked'] = 'Alle spawnpunten zijn geblokkeerd!', + ['garage_prompt'] = 'Druk op ~INPUT_CONTEXT~ om de ~y~Garage~s~ te openen.', + ['garage_title'] = 'Garage', + ['garage_stored'] = 'Beschikbaar', + ['garage_notstored'] = 'Niet in garage', + ['garage_storing'] = 'We proberen je voertuig weg te halen, zorg dat er niemand langs staat.', + ['garage_has_stored'] = 'Het voertuig is opgeslagen in de garage.', + ['garage_has_notstored'] = 'Er zijn geen voertuigen in de buurt gevonden.', + ['garage_notavailable'] = 'Je voertuig is niet opgeslagen in de garage.', + ['garage_blocked'] = 'Er zijn geen beschikbare spawnpunten!', + ['garage_empty'] = 'Je hebt geen voertuigen in je garage.', + ['garage_released'] = 'Je voertuig is uit de garage gehaald.', + ['garage_store_nearby'] = 'Er zijn geen voertuigen in de buurt gevonden.', + ['garage_storeditem'] = 'Open garage', + ['garage_storeitem'] = 'Zet voertuig in garage', + ['garage_buyitem'] = 'Voertuigwinkel', + ['garage_notauthorized'] = 'Je bent niet bevoegd dit type voertuigen te halen.', + ['helicopter_prompt'] = 'Druk op ~INPUT_CONTEXT~ om de ~y~Helikopter Garage~s~ te openen.', + ['shop_item'] = '€%s', + ['vehicleshop_title'] = 'Voertuigwinkel', + ['vehicleshop_confirm'] = 'Wil je dit voertuig kopen?', + ['vehicleshop_bought'] = 'Je hebt een ~y~%s~s~ gekocht voor ~r~€%s~s~.', + ['vehicleshop_money'] = 'Je kan dit voertuig niet betalen.', + ['vehicleshop_awaiting_model'] = 'Dit voertuig is momenteel aan het ~g~DOWNLOADEN & LADEN~s~, even geduld asjeblieft', + ['confirm_no'] = 'Nee', + ['confirm_yes'] = 'Ja', + -- Service + ['service_max'] = 'Je kan niet in dienst gaan, maximale aantal agenten in dienst: %s/%s', + ['service_not'] = 'Je bent niet in dienst! Kleed je eerst om.', + ['service_anonunce'] = 'Dienst Informatie', + ['service_in'] = 'Je bent nu in dienst, welkom!', + ['service_in_announce'] = 'Agent ~y~%s~s~ is nu in dienst!', + ['service_out'] = 'Je bent nu uit dienst, fijne dag.', + ['service_out_announce'] = 'Agent ~y~%s~s~ is nu niet meer in dienst.', + -- Action Menu + ['citizen_interaction'] = 'Burger Interacties', + ['vehicle_interaction'] = 'Voertuig Interacties', + ['object_spawner'] = 'Object Interacties', + + ['id_card'] = 'Identiteitsbewijs', + ['search'] = 'Fouilleren', + ['handcuff'] = 'Boeien / Ontboeien', + ['drag'] = 'Meenemen', + ['put_in_vehicle'] = 'Zet in voertuig', + ['out_the_vehicle'] = 'Haal uit voertuig', + ['fine'] = 'Boete opleggen', + ['unpaid_bills'] = 'Openstaande boetes bekijken', + ['license_check'] = 'Rijbewijzen beheren', + ['license_revoke'] = 'Rijbewijs invorderen', + ['license_revoked'] = 'Je ~b~%s~s~ is ~y~ingevorderd~s~!', + ['licence_you_revoked'] = 'Je hebt een ~b~%s~s~ van ~y~%s~s~ ingevorderd.', + ['no_players_nearby'] = 'Geen spelers in de buurt!', + ['being_searched'] = 'Je wordt ~y~gefouilleerd~s~ door de ~b~Politie~s~', + -- Voertuig Interactie + ['vehicle_info'] = 'Voertuig Informatie', + ['pick_lock'] = 'Breek voertuig open', + ['vehicle_unlocked'] = 'Voertuig ~g~ontgrendeld~s~.', + ['no_vehicles_nearby'] = 'Er zijn geen voertuigen in de buurt gevonden.', + ['impound'] = 'Neem voertuig in beslag', + ['impound_prompt'] = 'Druk op ~INPUT_CONTEXT~ om de ~y~inbeslagname~s~ te annuleren.', + ['impound_canceled'] = 'Je hebt de inbeslagname geannuleerd.', + ['impound_canceled_moved'] = 'De inbeslagname is geannuleerd omdat het voertuig is bewogen.', + ['impound_successful'] = 'Het voertuig is in beslag genomen.', + ['search_database'] = 'Kenteken natrekken', + ['search_database_title'] = 'Voertuig informatie - zoek op kenteken', + ['search_database_error_invalid'] = 'Het ingevoerde kenteken is ~r~ongeldig~s~.', + -- Objecten + ['traffic_interaction'] = 'Verkeers Interacties', + ['cone'] = 'Pion', + ['barrier'] = 'Barriere', + ['box'] = 'Box', + ['fence'] = 'PD Hek', + ['cash'] = 'Pallet met geld', + -- ID Menu + ['name'] = 'Naam: %s', + ['job'] = 'Werk: %s', + ['sex'] = 'Geslacht: %s', + ['dob'] = 'Geboortedatum: %s', + ['height'] = 'Lengte: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'onbekend', + ['male'] = 'man', + ['female'] = 'vrouw', + -- Fouilleren + ['guns_label'] = '--- Wapens ---', + ['inventory_label'] = '--- Inventaris ---', + ['license_label'] = ' --- Papieren ---', + ['confiscate'] = 'Neem %s in beslag', + ['confiscate_weapon'] = 'Neem een %s met %s kogels in beslag', + ['confiscate_inv'] = 'Neem %sx %s in beslag', + ['confiscate_dirty'] = 'Neem zwartgeld in beslag: €%s', + ['you_confiscated'] = 'Je hebt ~y~%sx~s~ ~b~%s~s~ van ~b~%s~s~ in beslag genomen.', + ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ is in beslag genomen door ~y~%s~s~.', + ['you_confiscated_account'] = 'Je hebt ~g~€%s~s~ (%s) van ~b~%s~s~ in beslag genomen.', + ['got_confiscated_account'] = '~g~€%s~s~ (%s) is in beslag genomen door ~y~%s~s~.', + ['you_confiscated_weapon'] = 'Je hebt een ~b~%s~s~ van ~b~%s~s~ met ~o~%s~s~ kogels in beslag genomen.', + ['got_confiscated_weapon'] = 'Je ~b~%s~s~ met ~o~%s~s~ kogels is in beslag genomen door ~y~%s~s~.', + ['traffic_offense'] = 'Verkeersovertreding', + ['minor_offense'] = 'Kleine overtreding', + ['average_offense'] = 'Gemiddelde overtreding', + ['major_offense'] = 'Grote overtreding', + ['fine_total'] = 'Boete: %s', + -- Voertuig Informatie + ['plate'] = 'Kenteken: %s', + ['owner_unknown'] = 'Eigenaar: Onbekend', + ['owner'] = 'Eigenaar: %s', + -- Boss Menu + ['open_bossmenu'] = 'Druk op ~INPUT_CONTEXT~ om het menu te openen.', + ['quantity_invalid'] = 'Ongeldig aantal', + ['have_withdrawn'] = 'Je hebt ~y~%sx~s~ ~b~%s~s~ gepakt.', + ['have_deposited'] = 'Je hebt ~y~%sx~s~ ~b~%s~s~ weg gelegt.', + ['quantity'] = 'Aantal', + ['inventory'] = 'Inventaris', + ['police_stock'] = 'Politie Voorraad', + -- Misc + ['remove_prop'] = 'Druk op ~INPUT_CONTEXT~ om dit object te verwijderen.', + ['map_blip'] = 'Politiebureau', + ['unrestrained_timer'] = 'Je voelt je handboeien langzaam wegglijden.', + -- Notifications + ['alert_police'] = 'politie alert', + ['phone_police'] = 'politie', + } diff --git a/localization/nl_esx_policejob.lua b/localization/nl_esx_policejob.lua new file mode 100644 index 00000000..7862f791 --- /dev/null +++ b/localization/nl_esx_policejob.lua @@ -0,0 +1,64 @@ +USE `es_extended`; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('society_police', 'Politie', 1) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('society_police', 'Politie', 1) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('society_police', 'Politie', 1) +; + +INSERT INTO `jobs` (name, label) VALUES + ('police', 'Politie') +; + +INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES + ('police',0,'aspirant','Aspirant',0,'{}','{}'), + ('police',1,'surveillant','Surveillant',0,'{}','{}'), + ('police',2,'agent','Agent',0,'{}','{}'), + ('police',3,'hoofdagent','Hoofdagent',0,'{}','{}'), + ('police',4,'brigadier','Brigadier',0,'{}','{}'), + ('police',5,'inspecteur','Inspecteur',0,'{}','{}'), + ('police',6,'hoofdinspecteur','Hoofdinspecteur',0,'{}','{}'), + ('police',7,'commissaris','Commissaris',0,'{}','{}'), + ('police',8,'hoofdcommissaris','Hoofdcommissaris',0,'{}','{}'), + ('police',9,'boss','Eerste Hoofdcommissaris',0,'{}','{}') +; + +CREATE TABLE `fine_types` ( + `id` int NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `amount` int DEFAULT NULL, + `category` int DEFAULT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `fine_types` (label, amount, category) VALUES + ('Onnodig claxoneren', 90, 0), + ('Rijden over een doorgetrokken streep', 240, 0), + ('Tegen het verkeer in rijden', 140, 0), + ('Negeren keerverbod (u-turn)', 140, 0), + ('Niet opvolgen aanwijzing van bevoegd ambtenaar', 110, 0), + ('Fout parkeren', 95, 0), + ('Verkeerd voorsorteren', 240, 0), + ('Rijden met een WOK status ', 300, 0), + ('Door rood rijden', 240, 0), + ('Rijden zonder rijbewijs', 340, 0), + ('Snelheid overtreding < 10km', 112, 0), + ('Snelheid overtreding 10 - 20km', 202, 0), + ('Snelheid overtreding 20 - 50km', 670, 0), + ('Snelheid overtreding > 50km', 1000, 0), + ('Openbare dronkenschap', 415, 1), + ('Wanordelijk gedrag', 500, 1), + ('Hulpdiensten hinderen', 700, 1), + ('Belediging ambtenaar in functie', 200, 1), + ('Bedreiging', 980, 1), + ('Illegaal wapen bezit', 2300, 2), + ('Illegaal drugs bezit', 400, 2), + ('Drugshandel', 3000, 3) +; From 9c99e71e2fe42a3e66b15aa8dcf834f00d5e0752 Mon Sep 17 00:00:00 2001 From: SyncEye <50116007+DamjanPetrovicki@users.noreply.github.com> Date: Mon, 5 Oct 2020 01:12:12 +0200 Subject: [PATCH 246/253] Update main.lua (#494) --- server/main.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/server/main.lua b/server/main.lua index 56d569e9..7d2bb3ba 100644 --- a/server/main.lua +++ b/server/main.lua @@ -175,16 +175,16 @@ ESX.RegisterServerCallback('esx_policejob:getOtherPlayerData', function(source, if status then data.drunk = ESX.Math.Round(status.percent) end - - if Config.EnableLicenses then - TriggerEvent('esx_license:getLicenses', target, function(licenses) - data.licenses = licenses - cb(data) - end) - else - cb(data) - end end) + + if Config.EnableLicenses then + TriggerEvent('esx_license:getLicenses', target, function(licenses) + data.licenses = licenses + cb(data) + end) + else + cb(data) + end end end) From 769c0d84f1a969ad7ddb065932aef4db3da17c51 Mon Sep 17 00:00:00 2001 From: Slypher <39607799+Slypher@users.noreply.github.com> Date: Sun, 18 Oct 2020 16:39:23 -0300 Subject: [PATCH 247/253] Null values in notifications Resolving null values in the notification when removing/placing an object in the arsenal --- server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index 7d2bb3ba..a93d0f92 100644 --- a/server/main.lua +++ b/server/main.lua @@ -118,7 +118,7 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count) if xPlayer.canCarryItem(itemName, count) then inventory.removeItem(itemName, count) xPlayer.addInventoryItem(itemName, count) - xPlayer.showNotification(_U('have_withdrawn', count, inventoryItem.label)) + xPlayer.showNotification(_U('have_withdrawn', count, inventoryItem.name)) else xPlayer.showNotification(_U('quantity_invalid')) end @@ -140,7 +140,7 @@ AddEventHandler('esx_policejob:putStockItems', function(itemName, count) if sourceItem.count >= count and count > 0 then xPlayer.removeInventoryItem(itemName, count) inventory.addItem(itemName, count) - xPlayer.showNotification(_U('have_deposited', count, inventoryItem.label)) + xPlayer.showNotification(_U('have_deposited', count, inventoryItem.name)) else xPlayer.showNotification(_U('quantity_invalid')) end From 414253c8096bb39b2026cc04dc49264c1b01734f Mon Sep 17 00:00:00 2001 From: SEOAlexRamon <37023161+seoalexramon@users.noreply.github.com> Date: Thu, 29 Oct 2020 15:45:39 +0100 Subject: [PATCH 248/253] fix: Spanish translation --- locales/es.lua | 124 ++++++++++++++++++++++++------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/locales/es.lua b/locales/es.lua index ce0001cb..6c01770d 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -1,66 +1,66 @@ Locales['es'] = { -- Cloakroom ['cloakroom'] = 'Taquilla', - ['citizen_wear'] = 'Ropa civil', - ['police_wear'] = 'Ropa CNP', - ['gilet_wear'] = 'orange reflective jacket', - ['bullet_wear'] = 'bulletproof vest', - ['no_outfit'] = 'there\'s no uniform that fits you!', - ['open_cloackroom'] = 'Presionar ~INPUT_CONTEXT~ para abrir la taquilla', + ['citizen_wear'] = 'Ropa de civil', + ['police_wear'] = 'Uniforme', + ['gilet_wear'] = 'Chaqueta reflectante naranja', + ['bullet_wear'] = 'Chaleco antibalas', + ['no_outfit'] = '¡No hay ningún uniforme disponible para ti!', + ['open_cloackroom'] = 'Presionar ~INPUT_CONTEXT~ para abrir su taquilla', -- Armory - ['remove_object'] = 'take object', - ['deposit_object'] = 'deposit object', + ['remove_object'] = 'Coger objeto', + ['deposit_object'] = 'Depositar objeto', ['get_weapon'] = 'Coger arma', ['put_weapon'] = 'Depositar arma', ['buy_weapons'] = 'Comprar armas', - ['armory'] = 'Arsenal', - ['open_armory'] = 'Presionarr ~INPUT_CONTEXT~ para acceder a la armeria', - ['armory_owned'] = 'owned', - ['armory_free'] = 'free', + ['armory'] = 'Armeria', + ['open_armory'] = 'Presionar ~INPUT_CONTEXT~ para acceder a la armeria', + ['armory_owned'] = 'Comprada', + ['armory_free'] = 'Gratis', ['armory_item'] = '$%s', - ['armory_weapontitle'] = 'armory - Buy weapon', - ['armory_componenttitle'] = 'armory - Weapon attatchments', - ['armory_bought'] = 'you bought an ~y~%s~s~ for ~g~$%s~s~', - ['armory_money'] = 'you cannot afford that weapon', - ['armory_hascomponent'] = 'you have that attatchment equiped!', - ['get_weapon_menu'] = 'armory - Withdraw Weapon', - ['put_weapon_menu'] = 'armory - Store Weapon', + ['armory_weapontitle'] = 'Armeria - Comprar arma', + ['armory_componenttitle'] = 'Armeria - Complementos del arma', + ['armory_bought'] = 'compraste una ~y~%s~s~ por ~g~$%s~s~', + ['armory_money'] = 'No dispones de suficiente dinero para comprar esta arma', + ['armory_hascomponent'] = '¡Ya dispones de ese complemento!', + ['get_weapon_menu'] = 'Armeria - Retirar arma', + ['put_weapon_menu'] = 'Armeria - Guardar arma', -- Vehicles - ['vehicle_menu'] = 'vehicle', - ['vehicle_blocked'] = 'all available spawn points are currently blocked!', - ['garage_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Vehicle Actions~s~.', - ['garage_title'] = 'vehicle Actions', - ['garage_stored'] = 'stored', - ['garage_notstored'] = 'not in garage', - ['garage_storing'] = 'we\'re attempting to remove the vehicle, make sure no players are around it.', - ['garage_has_stored'] = 'the vehicle has been stored in your garage', + ['vehicle_menu'] = 'Vehículos', + ['vehicle_blocked'] = '¡Todos los puntos de aparición de vehículos están ocupados!', + ['garage_prompt'] = 'Presione ~INPUT_CONTEXT~ para acceder a ~y~Acciones del Vehículo~s~.', + ['garage_title'] = 'Acciones del vehículo', + ['garage_stored'] = 'Guardado', + ['garage_notstored'] = 'No se encuentra en el garaje', + ['garage_storing'] = 'Estamos intentando borrar el vehículo, asegurate de que no haya jugadores cerca.', + ['garage_has_stored'] = 'El vehículo ha sido guardado en su garaje', ['garage_has_notstored'] = 'no nearby owned vehicles were found', - ['garage_notavailable'] = 'your vehicle is not stored in the garage.', - ['garage_blocked'] = 'there\'s no available spawn points!', - ['garage_empty'] = 'you dont have any vehicles in your garage.', + ['garage_notavailable'] = 'Su vehículo no está guardado en el garaje.', + ['garage_blocked'] = '¡No hay ningún punto de spawn disponible!', + ['garage_empty'] = 'No dispones de ningún vehículo en su garaje.', ['garage_released'] = 'your vehicle has been released from the garage.', - ['garage_store_nearby'] = 'there is no nearby vehicles.', - ['garage_storeditem'] = 'open garage', - ['garage_storeitem'] = 'store vehicle in garage', - ['garage_buyitem'] = 'vehicle shop', - ['garage_notauthorized'] = 'you\'re not authorized to buy this kind of vehicles.', + ['garage_store_nearby'] = 'No hay vehículos cercanos.', + ['garage_storeditem'] = 'Abrir garaje', + ['garage_storeitem'] = 'Guardar vehículo en el garaje', + ['garage_buyitem'] = 'Tienda de vehículos', + ['garage_notauthorized'] = 'No estás autorizado a comprar este tipo de vehículos.', ['helicopter_prompt'] = 'press ~INPUT_CONTEXT~ to access the ~y~Helicopter Actions~s~.', ['shop_item'] = '$%s', - ['vehicleshop_title'] = 'vehicle Shop', - ['vehicleshop_confirm'] = 'do you want to buy this vehicle?', - ['vehicleshop_bought'] = 'you have bought ~y~%s~s~ for ~r~$%s~s~', - ['vehicleshop_money'] = 'you cannot afford that vehicle', - ['vehicleshop_awaiting_model'] = 'the vehicle is currently ~g~DOWNLOADING & LOADING~s~ please wait', + ['vehicleshop_title'] = 'Tienda de vehículos', + ['vehicleshop_confirm'] = '¿Quieres comprar este vehículo?', + ['vehicleshop_bought'] = 'Has comprado un ~y~%s~s~ por ~r~$%s~s~', + ['vehicleshop_money'] = 'No tienes suficiente dinero para comprar este vehículo', + ['vehicleshop_awaiting_model'] = 'El vehículo se está ~g~DESCARGANDO Y CARGANDO~s~ porfavor espere', ['confirm_no'] = 'no', - ['confirm_yes'] = 'yes', + ['confirm_yes'] = 'si', -- Service - ['service_max'] = 'you cannot enter service, max officers in service: %s/%s', - ['service_not'] = 'you have not entered service! You\'ll have to get changed first.', - ['service_anonunce'] = 'service information', - ['service_in'] = 'you\'ve entered service, welcome!', - ['service_in_announce'] = 'operator ~y~%s~s~ has entered service!', - ['service_out'] = 'you have left service.', - ['service_out_announce'] = 'operator ~y~%s~s~ has left their service.', + ['service_max'] = 'No puedes entrar de servicio porque se ha alcanzado el número máximo: %s/%s', + ['service_not'] = '¡No has entrado de servicio! Debes hacerlo primeramente.', + ['service_anonunce'] = 'Información de servicio', + ['service_in'] = 'Has entrado de servicio. ¡Bienvenido!', + ['service_in_announce'] = '¡El agente ~y~%s~s~ ha entrado de servicio!', + ['service_out'] = 'Has salido de servicio.', + ['service_out_announce'] = 'El agente ~y~%s~s~ se ha salido de servicio.', -- Action Menu ['citizen_interaction'] = 'Interacción ciudadana', ['vehicle_interaction'] = 'Interacción vehículo', @@ -74,9 +74,9 @@ Locales['es'] = { ['out_the_vehicle'] = 'Sacar del vehículo', ['fine'] = 'Multa', ['unpaid_bills'] = 'manage unpaid bills', - ['license_check'] = 'manage license', - ['license_revoke'] = 'revoke license', - ['license_revoked'] = 'your ~b~%s~s~ has been ~y~revoked~s~!', + ['license_check'] = 'Gestionar licencia', + ['license_revoke'] = 'Revocar licencia', + ['license_revoked'] = 'Su ~b~%s~s~ ha sido ~y~revocar~s~!', ['licence_you_revoked'] = 'you revoked a ~b~%s~s~ which belonged to ~y~%s~s~', ['no_players_nearby'] = 'no hay jugadores cerca', ['being_searched'] = 'you are being ~y~searched~s~ by the ~b~Police~s~', @@ -85,8 +85,8 @@ Locales['es'] = { ['pick_lock'] = 'Forzar coche', ['vehicle_unlocked'] = 'Vehículo desbloqueado~s~', ['no_vehicles_nearby'] = 'No hay vehículos cerca', - ['impound'] = 'impound vehicle', - ['impound_prompt'] = 'press ~INPUT_CONTEXT~ to cancel the ~y~impound~s~', + ['impound'] = 'Confiscar vehículo', + ['impound_prompt'] = 'Presione ~INPUT_CONTEXT~ para cancelar ~y~impound~s~', ['impound_canceled'] = 'you canceled the impound', ['impound_canceled_moved'] = 'the impound has been canceled because the vehicle moved', ['impound_successful'] = 'you have impounded the vehicle', @@ -101,15 +101,15 @@ Locales['es'] = { ['box'] = 'Caja', ['cash'] = 'Dinero', -- ID Card Menu - ['name'] = 'name: %s', - ['job'] = 'job: %s', - ['sex'] = 'sex: %s', + ['name'] = 'Nombre: %s', + ['job'] = 'Trabajo: %s', + ['sex'] = 'Sexo: %s', ['dob'] = 'DOB: %s', - ['height'] = 'height: %s', + ['height'] = 'Altura: %s', ['bac'] = 'BAC: %s', - ['unknown'] = 'unknown', - ['male'] = 'male', - ['female'] = 'female', + ['unknown'] = 'Desconocido', + ['male'] = 'Hombre', + ['female'] = 'Mujer', -- Body Search Menu ['guns_label'] = '--- Armas ---', ['inventory_label'] = '--- Inventario ---', @@ -120,8 +120,8 @@ Locales['es'] = { ['confiscate_dirty'] = 'confiscar dinero negro: €%s', ['you_confiscated'] = 'you confiscated ~y~%sx~s~ ~b~%s~s~ from ~b~%s~s~', ['got_confiscated'] = '~y~%sx~s~ ~b~%s~s~ were confiscated by ~y~%s~s~', - ['you_confiscated_account'] = 'you confiscated ~g~€%s~s~ (%s) from ~b~%s~s~', - ['got_confiscated_account'] = '~g~€%s~s~ (%s) was confiscated by ~y~%s~s~', + ['you_confiscated_account'] = 'Has confiscado ~g~€%s~s~ (%s) de ~b~%s~s~', + ['got_confiscated_account'] = '~g~€%s~s~ (%s) ha sido confiscado por ~y~%s~s~', ['you_confiscated_weapon'] = 'you confiscated ~b~%s~s~ from ~b~%s~s~ with ~o~%s~s~ bullets', ['got_confiscated_weapon'] = 'your ~b~%s~s~ with ~o~%s~s~ bullets was confiscated by ~y~%s~s~', ['traffic_offense'] = 'Delito de tráfico', From 83977e6072d6f9faed764bae6782432d73565661 Mon Sep 17 00:00:00 2001 From: Carmelo Campos <31357533+CarmeloCampos@users.noreply.github.com> Date: Mon, 2 Nov 2020 00:30:11 -0500 Subject: [PATCH 249/253] Fix Bug Duplicate black Money This error consists in that when the black money is confiscated (if it is given twice quickly) the money is doubled and the objective remains in negative money. I know that many use the esx_policejob as the basis for the esx_mafia therefore, this error is very important to solve, since if the money is added together with the black_money it can be duplicated in a phenomenal way. Sorry for my English, I tried to explain myself what else I could. --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 4ae3bf3a..8dda3be2 100644 --- a/client/main.lua +++ b/client/main.lua @@ -495,7 +495,7 @@ function OpenBodySearchMenu(player) }, function(data, menu) if data.current.value then TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), data.current.itemType, data.current.value, data.current.amount) - OpenBodySearchMenu(player) + menu.close() end end, function(data, menu) menu.close() From d6517870dbdd043e65322d5ea818c639dd55bd1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Correia?= Date: Wed, 11 Nov 2020 19:06:34 +0000 Subject: [PATCH 250/253] Added esx_status to requirements Updated requirements to inform users of this project about the feature support "esx_status", currently being used to check if player is dunk. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ee0709f4..5ebe1744 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,9 @@ This resource for ESX adds police armories, vehicle garages and ability for cops * ESX Service Support * [esx_service](https://github.com/ESX-Org/esx_service) +* ESX Status Support + * [esx_service](https://github.com/ESX-Org/esx_status) + ## Download & Installation ### Using [fvm](https://github.com/qlaffont/fvm-installer) @@ -62,4 +65,4 @@ This program Is free software: you can redistribute it And/Or modify it under th 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 +You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/. From f6788b3d14bf12db4ba15623a56ba24c5f3ceeda Mon Sep 17 00:00:00 2001 From: Christopher Gjelten Date: Fri, 13 Nov 2020 12:47:03 +0100 Subject: [PATCH 251/253] =?UTF-8?q?Fix=20in=20README=20after=20merge=20?= =?UTF-8?q?=F0=9F=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ebe1744..16504542 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ This resource for ESX adds police armories, vehicle garages and ability for cops * [esx_service](https://github.com/ESX-Org/esx_service) * ESX Status Support - * [esx_service](https://github.com/ESX-Org/esx_status) + * [esx_status](https://github.com/ESX-Org/esx_status) ## Download & Installation From 1367f5ebaadfd7e26ab7d893f913cdb3ddd2118b Mon Sep 17 00:00:00 2001 From: P0Xyio <58112474+P0Xyio@users.noreply.github.com> Date: Tue, 17 Nov 2020 11:42:04 +0000 Subject: [PATCH 252/253] even better way to fix bug with duplicating money and weapons In my solution, I check if player has weapon/money that officers might want to take server-side. Previous solutions were vulnerable e.g. if two or more officers were searching one player and all took weapon or money at the same time, they would all get that items. --- client/main.lua | 2 +- server/main.lua | 29 +++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/client/main.lua b/client/main.lua index 8dda3be2..4ae3bf3a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -495,7 +495,7 @@ function OpenBodySearchMenu(player) }, function(data, menu) if data.current.value then TriggerServerEvent('esx_policejob:confiscatePlayerItem', GetPlayerServerId(player), data.current.itemType, data.current.value, data.current.amount) - menu.close() + OpenBodySearchMenu(player) end end, function(data, menu) menu.close() diff --git a/server/main.lua b/server/main.lua index 7d2bb3ba..3206b628 100644 --- a/server/main.lua +++ b/server/main.lua @@ -43,19 +43,32 @@ AddEventHandler('esx_policejob:confiscatePlayerItem', function(target, itemType, end elseif itemType == 'item_account' then - targetXPlayer.removeAccountMoney(itemName, amount) - sourceXPlayer.addAccountMoney (itemName, amount) + local targetAccount = targetXPlayer.getAccount(itemName) - sourceXPlayer.showNotification(_U('you_confiscated_account', amount, itemName, targetXPlayer.name)) - targetXPlayer.showNotification(_U('got_confiscated_account', amount, itemName, sourceXPlayer.name)) + -- does the target player have enough money? + if targetAccount.money >= amount then + targetXPlayer.removeAccountMoney(itemName, amount) + sourceXPlayer.addAccountMoney (itemName, amount) + + sourceXPlayer.showNotification(_U('you_confiscated_account', amount, itemName, targetXPlayer.name)) + targetXPlayer.showNotification(_U('got_confiscated_account', amount, itemName, sourceXPlayer.name)) + else + sourceXPlayer.showNotification(_U('quantity_invalid')) + end elseif itemType == 'item_weapon' then if amount == nil then amount = 0 end - targetXPlayer.removeWeapon(itemName, amount) - sourceXPlayer.addWeapon (itemName, amount) - sourceXPlayer.showNotification(_U('you_confiscated_weapon', ESX.GetWeaponLabel(itemName), targetXPlayer.name, amount)) - targetXPlayer.showNotification(_U('got_confiscated_weapon', ESX.GetWeaponLabel(itemName), amount, sourceXPlayer.name)) + -- does the target player have weapon? + if targetXPlayer.hasWeapon(itemName) then + targetXPlayer.removeWeapon(itemName, amount) + sourceXPlayer.addWeapon (itemName, amount) + + sourceXPlayer.showNotification(_U('you_confiscated_weapon', ESX.GetWeaponLabel(itemName), targetXPlayer.name, amount)) + targetXPlayer.showNotification(_U('got_confiscated_weapon', ESX.GetWeaponLabel(itemName), amount, sourceXPlayer.name)) + else + sourceXPlayer.showNotification(_U('quantity_invalid')) + end end end) From f3ff2765940630916309bc0daa56b74607c63872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=BCrkay=20Tanr=C4=B1kulu?= Date: Sun, 20 Dec 2020 06:27:56 +0300 Subject: [PATCH 253/253] Turkish translation implemented --- fxmanifest.lua | 2 + locales/tr.lua | 151 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 locales/tr.lua diff --git a/fxmanifest.lua b/fxmanifest.lua index fc8283c7..5f07436d 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -20,6 +20,7 @@ server_scripts { 'locales/ko.lua', 'locales/cs.lua', 'locales/nl.lua', + 'locales/tr.lua', 'config.lua', 'server/main.lua' } @@ -37,6 +38,7 @@ client_scripts { 'locales/ko.lua', 'locales/cs.lua', 'locales/nl.lua', + 'locales/tr.lua', 'config.lua', 'client/main.lua', 'client/vehicle.lua' diff --git a/locales/tr.lua b/locales/tr.lua new file mode 100644 index 00000000..21a0e1a6 --- /dev/null +++ b/locales/tr.lua @@ -0,0 +1,151 @@ +Locales['tr'] = { + -- Cloakroom + ['cloakroom'] = 'kıyafet Odası', + ['citizen_wear'] = 'sivil kıyafet', + ['police_wear'] = 'polis kıyafeti', + ['gilet_wear'] = 'turuncu ceket', + ['bullet_wear'] = 'kurşun geçirmez yelek', + ['no_outfit'] = ' üniforma yok!', + ['open_cloackroom'] = '~y~Kıyafetinizi~s~ değiştirmek için ~INPUT_CONTEXT~ tuşuna basın. ', + -- Armory + ['remove_object'] = 'obje Al', + ['deposit_object'] = 'obje Koy', + ['get_weapon'] = 'cephanelikten silah al', + ['put_weapon'] = 'cephaneliğe silah koy', + ['buy_weapons'] = 'silah satın al', + ['armory'] = 'cephanelik', + ['open_armory'] = '~y~Cephaneliğe~s~ erişmek için ~INPUT_CONTEXT~ tuşuna basın.', + ['armory_owned'] = 'sahipsin', + ['armory_free'] = 'bedava', + ['armory_item'] = '%s TL', + ['armory_weapontitle'] = 'cephanelik - Silah al', + ['armory_componenttitle'] = 'cephanelik - Silah eklentileri', + ['armory_bought'] = ' %s Lira Karşılığında %s satın aldın', + ['armory_money'] = 'yeteri kadar paran yok.', + ['armory_hascomponent'] = 'bu eklentiye zaten sahipsin !', + ['get_weapon_menu'] = 'cephanelik - Silah al', + ['put_weapon_menu'] = 'cephanelik - Silah koy', + -- Vehicles + ['vehicle_menu'] = 'araç', + ['vehicle_blocked'] = 'tüm Spawn Noktaları Bloke Edilmiş!', + ['garage_prompt'] = '~y~Araç eylemlerine ulaşmak için ~s~ ~INPUT_CONTEXT~ tuşuna basınız.', + ['garage_title'] = 'araç eylemleri', + ['garage_stored'] = 'garajda', + ['garage_notstored'] = 'garajda değil', + ['garage_storing'] = 'arac garaja koyuluyor ama, etrafınızda oyuncu olmadığına emin olun .', + ['garage_has_stored'] = 'araç garajına koyuldu', + ['garage_has_notstored'] = 'yakında sana ait araç yok', + ['garage_notavailable'] = 'aracınız garajda değil.', + ['garage_blocked'] = 'müsait araç çıkarma noktası yok!', + ['garage_empty'] = 'garajında bir araç yok.', + ['garage_released'] = 'aracını garajdan çıkardın.', + ['garage_store_nearby'] = 'yakında araç yok.', + ['garage_storeditem'] = 'garajı Aç', + ['garage_storeitem'] = 'aracı garaja koy', + ['garage_buyitem'] = 'araç Galerisi', + ['garage_notauthorized'] = 'galeriye erişim iznin yok', + ['helicopter_prompt'] = '~y~Helikopter eylemlerine~s~ erişmek için ~INPUT_CONTEXT~ tuşuna basınız.', + ['shop_item'] = '%s TL', + ['vehicleshop_title'] = 'araç galerisi', + ['vehicleshop_confirm'] = 'bu aracı satın almak istiyor musun?', + ['vehicleshop_bought'] = '%s lira Karşılığında %s Satın aldın ', + ['vehicleshop_money'] = 'bu araca paran yetmiyor', + ['vehicleshop_awaiting_model'] = 'araç ~g~Yükleniyor~s~ lütfen bekleyiniz', + ['confirm_no'] = 'hayır', + ['confirm_yes'] = 'evet', + -- Service + ['service_max'] = 'hizmete Giremezsin,Hizmette yeterli polis var: %s/%s', + ['service_not'] = 'hizmete Giremedin! İlk Önce Kıyafetlerini Değiştirmelisin.', + ['service_anonunce'] = 'hizmet Bilgisi', + ['service_in'] = 'hizmete Giriş Yaptın, Hoşgeldin!', + ['service_in_announce'] = 'operatör %s servise giriş yaptı!', + ['service_out'] = 'hizmetten Çıktın.', + ['service_out_announce'] = 'operatör %s servisten çıkış yaptı.', + -- Action Menu + ['citizen_interaction'] = 'vatandaş Etkileşimi', + ['vehicle_interaction'] = 'araç Etkileşimi', + ['object_spawner'] = 'obje Yerleştirici', + + ['id_card'] = 'kimlik Kartı', + ['search'] = 'ara', + ['handcuff'] = 'kelepçele / Kelepçeyi Çöz', + ['drag'] = 'taşı', + ['put_in_vehicle'] = 'araca Koy', + ['out_the_vehicle'] = 'araçtan Çıkar', + ['fine'] = 'ceza', + ['unpaid_bills'] = 'ödenmemiş Faturaları Kontrol Et', + ['license_check'] = 'lisansları Kontrol Et', + ['license_revoke'] = 'lisansa El Koy', + ['license_revoked'] = '~b~%s~s~ lisansın ~y~iptal edildi~s~!', + ['licence_you_revoked'] = '~b~%s~s~ adlı kullanıcıya ait ~y~%s~s~ adlı lisansına el koydun.', + ['no_players_nearby'] = 'yakında oyuncu yok!', + ['being_searched'] = 'üstün ~y~searched~s~ - ~b~Polis~s~ tarafından aranıyor', + -- Vehicle interaction + ['vehicle_info'] = 'araç Bilgisi', + ['pick_lock'] = 'aracın kilidini aç', + ['vehicle_unlocked'] = 'araç ~g~açıldı~s~', + ['no_vehicles_nearby'] = 'yakınlarda araç yok', + ['impound'] = 'araca el koy', + ['impound_prompt'] = 'el konulan aracı geri bırakmak için ~INPUT_CONTEXT~ tuşuna basın', + ['impound_canceled'] = 'el konulma kaldırıldı', + ['impound_canceled_moved'] = 'araç hareket ettiği için el koyma iptal edildi', + ['impound_successful'] = 'araca el koydun', + ['search_database'] = 'araç bilgileri', + ['search_database_title'] = 'araç bilgileri - araç kayıt numarasından ara', + ['search_database_error_invalid'] = 'bu doğru bir araç kayıt numarası değil', + -- Traffic interaction + ['traffic_interaction'] = 'traik işlemleri', + ['cone'] = 'koni', + ['barrier'] = 'bariyer', + ['spikestrips'] = 'emniyet şeridi', + ['box'] = 'kutu', + ['cash'] = 'para kurusu', + -- ID Card Menu + ['name'] = 'isim: %s', + ['job'] = 'meslek: %s', + ['sex'] = 'cinsiyet: %s', + ['dob'] = 'doğum Tarihi: %s', + ['height'] = 'boy: %s', + ['bac'] = 'BAC: %s', + ['unknown'] = 'bilinmiyor', + ['male'] = 'erkek', + ['female'] = 'kadın', + -- Body Search Menu + ['guns_label'] = '--- Silahlar ---', + ['inventory_label'] = '--- Envanter ---', + ['license_label'] = ' --- Lisanslar ---', + ['confiscate'] = 'el koy %s', + ['confiscate_weapon'] = 'el koyuldu %s ve %s mermi', + ['confiscate_inv'] = 'el koyuldu %sx %s', + ['confiscate_dirty'] = 'kara paraya el koyuldu: %s TL', + ['you_confiscated'] = '~b~%s~s~ adlı kişiden ~y~%sx~s~ ~b~%s~s~ aldın ', + ['got_confiscated'] = '~y~%s~s~ adlı kişi ~y~%sx~s~ ~b~%s~s~ eşyanı aldı', + ['you_confiscated_account'] = '~b~%s~s~ adlı oyuncunun ~g~%s TL~s~ (%s) kara parasına el konuldu', + ['got_confiscated_account'] = '~g~%s TL~s~ (%s) kara parana el konuldu ~y~%s~s~', + ['you_confiscated_weapon'] = '~b~%s~s~ adlı oyuncunun ~b~%s~s~ ve ~o~%s~s~ mermilerine el konuldu', + ['got_confiscated_weapon'] = '~b~%s~s~ ve ~o~%s~s~ mermilerine ~y~%s~s~ tarafından el konuldu', + ['traffic_offense'] = 'trafik cezaları', + ['minor_offense'] = 'küçük suç', + ['average_offense'] = 'ortalama suç', + ['major_offense'] = 'büyük suç', + ['fine_total'] = 'ceza: %s', + -- Vehicle Info Menu + ['plate'] = 'plaka: %s', + ['owner_unknown'] = 'sahibi: Bilinmiyor', + ['owner'] = 'sahibi: %s', + -- Boss Menu + ['open_bossmenu'] = 'menüyü açmak için ~INPUT_CONTEXT~ tuşuna basın', + ['quantity_invalid'] = 'miktar hatalı', + ['have_withdrawn'] = '~y~%sx~s~ ~b~%s~s~ çekildi', + ['have_deposited'] = '~y~%sx~s~ ~b~%s~s~ yatırıldı', + ['quantity'] = 'miktar', + ['inventory'] = 'envanter', + ['police_stock'] = 'polis Stoğu', + -- Misc + ['remove_prop'] = 'objeyi silmek için ~INPUT_CONTEXT~ tuşuna basın', + ['map_blip'] = 'polis Karakolu', + ['unrestrained_timer'] = 'ellerinin yavaşça çözüldüğünü hissediyorsun.', + -- Notifications + ['alert_police'] = 'polis Acil Durum', + ['phone_police'] = 'polis', + }