From 609f36d67affa73651de1f0cabee7f7f999a7df4 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Thu, 1 Feb 2024 17:07:58 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Run=20formatter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[esx_addons]/esx_boat/client/main.lua | 420 +++++++++--------- .../[esx_addons]/esx_boat/client/marker.lua | 344 +++++++------- .../[esx_addons]/esx_boat/config.lua | 153 ++++--- .../[esx_addons]/esx_boat/fxmanifest.lua | 46 +- .../[esx_addons]/esx_boat/locales/de.lua | 56 +-- .../[esx_addons]/esx_boat/locales/en.lua | 54 +-- .../[esx_addons]/esx_boat/locales/es.lua | 54 +-- .../[esx_addons]/esx_boat/locales/fr.lua | 54 +-- .../[esx_addons]/esx_boat/locales/hu.lua | 54 +-- .../[esx_addons]/esx_boat/locales/it.lua | 54 +-- .../[esx_addons]/esx_boat/locales/nl.lua | 54 +-- .../[esx_addons]/esx_boat/locales/pl.lua | 54 +-- .../[esx_addons]/esx_boat/locales/si.lua | 56 +-- .../[esx_addons]/esx_boat/locales/sv.lua | 54 +-- .../[esx_addons]/esx_boat/server/main.lua | 168 +++---- 15 files changed, 839 insertions(+), 836 deletions(-) diff --git a/server-data/resources/[esx_addons]/esx_boat/client/main.lua b/server-data/resources/[esx_addons]/esx_boat/client/main.lua index 12671f914..972bbdeb8 100644 --- a/server-data/resources/[esx_addons]/esx_boat/client/main.lua +++ b/server-data/resources/[esx_addons]/esx_boat/client/main.lua @@ -2,240 +2,240 @@ isInShopMenu = false local spawnedVehicles = {} function OpenBoatShop(shop) - isInShopMenu = true - - local playerPed = PlayerPedId() - local elements = { - {unselectable = true, icon = "fas fa-ship", title = _U('boat_shop')} - } - - for _,v in ipairs(Config.Vehicles) do - elements[#elements+1] = { - icon = "fas fa-ship", - title = ('%s - $%s'):format(v.label, ESX.Math.GroupDigits(v.price)), - name = v.label, - model = v.model, - price = v.price, - props = v.props or nil - } - end - - ESX.OpenContext("right", elements, function(_,element) - local elements2 = { - {unselectable = true, icon = "fas fa-ship", title = element.title}, - {icon = "fas fa-eye", title = "View", val = "view"} - } - - ESX.OpenContext("right", elements2, function(_,element2) - if element2.val == "view" then - DeleteSpawnedVehicles() - - ESX.Game.SpawnLocalVehicle(element.model, shop.Inside, shop.Inside.w, function (vehicle) - table.insert(spawnedVehicles, vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - FreezeEntityPosition(vehicle, true) - - if element.props then - ESX.Game.SetVehicleProperties(vehicle, element.props) - end - - local elements3 = { - {unselectable = true, icon = "fas fa-ship", title = element.title}, - {icon = "fas fa-check-double", title = "Buy", value = "buy"}, - {icon = "fas fa-eye", title = "Stop Viewing", value = "stop"} - } - - ESX.OpenContext("right", elements3, function(_,element3) - if element3.value == "buy" then - local plate = exports['esx_vehicleshop']:GeneratePlate() - local _ = GetVehiclePedIsIn(playerPed, false) - local props = ESX.Game.GetVehicleProperties(vehicle) - props.plate = plate - - ESX.TriggerServerCallback('esx_boat:buyBoat', function(bought) - if bought then - ESX.ShowNotification(_U('boat_shop_bought', element.name, ESX.Math.GroupDigits(element.price))) - - DeleteSpawnedVehicles() - isInShopMenu = false - ESX.CloseContext() - - CurrentAction = 'boat_shop' - CurrentActionMsg = _U('boat_shop_open') - - FreezeEntityPosition(playerPed, false) - SetEntityVisible(playerPed, true) - SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z) - else - ESX.ShowNotification(_U('boat_shop_nomoney')) - end - end, props) - elseif element3.value == "stop" then - reset(shop) - end - end, function () - reset(shop) - end) - end) - end - end, function() - isInShopMenu = false - CurrentAction = 'boat_shop' - CurrentActionMsg = _U('boat_shop_open') - end) - end, function() - isInShopMenu = false - CurrentAction = 'boat_shop' - CurrentActionMsg = _U('boat_shop_open') - end) + isInShopMenu = true + + local playerPed = PlayerPedId() + local elements = { + { unselectable = true, icon = "fas fa-ship", title = _U("boat_shop") }, + } + + for _, v in ipairs(Config.Vehicles) do + elements[#elements + 1] = { + icon = "fas fa-ship", + title = ('%s - $%s'):format(v.label, ESX.Math.GroupDigits(v.price)), + name = v.label, + model = v.model, + price = v.price, + props = v.props or nil, + } + end + + ESX.OpenContext("right", elements, function(_, element) + local elements2 = { + { unselectable = true, icon = "fas fa-ship", title = element.title }, + { icon = "fas fa-eye", title = "View", val = "view" }, + } + + ESX.OpenContext("right", elements2, function(_, element2) + if element2.val == "view" then + DeleteSpawnedVehicles() + + ESX.Game.SpawnLocalVehicle(element.model, shop.Inside, shop.Inside.w, function(vehicle) + table.insert(spawnedVehicles, vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + FreezeEntityPosition(vehicle, true) + + if element.props then + ESX.Game.SetVehicleProperties(vehicle, element.props) + end + + local elements3 = { + { unselectable = true, icon = "fas fa-ship", title = element.title }, + { icon = "fas fa-check-double", title = "Buy", value = "buy" }, + { icon = "fas fa-eye", title = "Stop Viewing", value = "stop" }, + } + + ESX.OpenContext("right", elements3, function(_, element3) + if element3.value == "buy" then + local plate = exports["esx_vehicleshop"]:GeneratePlate() + local _ = GetVehiclePedIsIn(playerPed, false) + local props = ESX.Game.GetVehicleProperties(vehicle) + props.plate = plate + + ESX.TriggerServerCallback("esx_boat:buyBoat", function(bought) + if bought then + ESX.ShowNotification(_U("boat_shop_bought", element.name, ESX.Math.GroupDigits(element.price))) + + DeleteSpawnedVehicles() + isInShopMenu = false + ESX.CloseContext() + + CurrentAction = "boat_shop" + CurrentActionMsg = _U("boat_shop_open") + + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z) + else + ESX.ShowNotification(_U("boat_shop_nomoney")) + end + end, props) + elseif element3.value == "stop" then + reset(shop) + end + end, function() + reset(shop) + end) + end) + end + end, function() + isInShopMenu = false + CurrentAction = "boat_shop" + CurrentActionMsg = _U("boat_shop_open") + end) + end, function() + isInShopMenu = false + CurrentAction = "boat_shop" + CurrentActionMsg = _U("boat_shop_open") + end) end function OpenBoatGarage(garage) - ESX.TriggerServerCallback('esx_boat:getGarage', function (ownedBoats) - if #ownedBoats == 0 then - ESX.ShowNotification(_U('garage_noboats')) - else - -- get all available boats - local elements = { - {unselectable = true, icon = "fas fa-ship", title = _U('garage')} - } - for i=1, #ownedBoats, 1 do - ownedBoats[i] = json.decode(ownedBoats[i]) - - elements[#elements+1] = { - icon = "fas fa-ship", - title = getVehicleLabelFromHash(ownedBoats[i].model), - vehicleProps = ownedBoats[i] - } - end - - ESX.OpenContext("right", elements, function(_,element) - local playerPed = PlayerPedId() - local vehicleProps = element.vehicleProps - - if ESX.Game.IsSpawnPointClear(garage.SpawnPoint, 4.0) then - TriggerServerEvent('esx_boat:takeOutVehicle', vehicleProps.plate) - ESX.ShowNotification(_U('garage_taken')) - - ESX.Game.SpawnVehicle(vehicleProps.model, garage.SpawnPoint, garage.SpawnPoint.w, function(vehicle) - TaskWarpPedIntoVehicle(playerPed, vehicle, -1) - ESX.Game.SetVehicleProperties(vehicle, vehicleProps) - end) - - ESX.CloseContext() - else - ESX.ShowNotification(_U('garage_blocked')) - end - end, function() - CurrentAction = 'garage_out' - CurrentActionMsg = _U('garage_open') - end) - end - end) + ESX.TriggerServerCallback("esx_boat:getGarage", function(ownedBoats) + if #ownedBoats == 0 then + ESX.ShowNotification(_U("garage_noboats")) + else + -- get all available boats + local elements = { + { unselectable = true, icon = "fas fa-ship", title = _U("garage") }, + } + for i = 1, #ownedBoats, 1 do + ownedBoats[i] = json.decode(ownedBoats[i]) + + elements[#elements + 1] = { + icon = "fas fa-ship", + title = getVehicleLabelFromHash(ownedBoats[i].model), + vehicleProps = ownedBoats[i], + } + end + + ESX.OpenContext("right", elements, function(_, element) + local playerPed = PlayerPedId() + local vehicleProps = element.vehicleProps + + if ESX.Game.IsSpawnPointClear(garage.SpawnPoint, 4.0) then + TriggerServerEvent("esx_boat:takeOutVehicle", vehicleProps.plate) + ESX.ShowNotification(_U("garage_taken")) + + ESX.Game.SpawnVehicle(vehicleProps.model, garage.SpawnPoint, garage.SpawnPoint.w, function(vehicle) + TaskWarpPedIntoVehicle(playerPed, vehicle, -1) + ESX.Game.SetVehicleProperties(vehicle, vehicleProps) + end) + + ESX.CloseContext() + else + ESX.ShowNotification(_U("garage_blocked")) + end + end, function() + CurrentAction = "garage_out" + CurrentActionMsg = _U("garage_open") + end) + end + end) end function OpenLicenceMenu(shop) - local elements = { - {unselectable = true, icon = "fas fa-ship", title = _U('license_menu')}, - {icon = "fas fa-ship", title = "Purchase Boat License"} - } - - ESX.OpenContext("right", elements, function(_,element) - local elements2 = { - {unselectable = true, icon = "fas fa-ship", title = element.title}, - {icon = "fas fa-check-double", title = _U('license_buy_yes', Config.LicensePrice), val = "yes"}, - {icon = "fas fa-window-close", title = _U('license_buy_no'), val = "no"} - } - - ESX.OpenContext("right", elements2, function(_,element2) - -- If the value is no, close the menu and stop the script. - if element2.val == "no" then + local elements = { + { unselectable = true, icon = "fas fa-ship", title = _U("license_menu") }, + { icon = "fas fa-ship", title = "Purchase Boat License" }, + } + + ESX.OpenContext("right", elements, function(_, element) + local elements2 = { + { unselectable = true, icon = "fas fa-ship", title = element.title }, + { icon = "fas fa-check-double", title = _U("license_buy_yes", Config.LicensePrice), val = "yes" }, + { icon = "fas fa-window-close", title = _U("license_buy_no"), val = "no" }, + } + + ESX.OpenContext("right", elements2, function(_, element2) + -- If the value is no, close the menu and stop the script. + if element2.val == "no" then ESX.CloseContext() - return; + return end - ESX.TriggerServerCallback('esx_boat:buyBoatLicense', function (boughtLicense) - if boughtLicense then - ESX.ShowNotification(_U('license_bought', ESX.Math.GroupDigits(Config.LicensePrice))) - ESX.CloseContext() - - OpenBoatShop(shop) -- parse current shop - else - ESX.ShowNotification(_U('license_nomoney')) - end - end) - end, function() - CurrentAction = 'boat_shop' - CurrentActionMsg = _U('boat_shop_open') - end) - end, function() - CurrentAction = 'boat_shop' - CurrentActionMsg = _U('boat_shop_open') - end) + ESX.TriggerServerCallback("esx_boat:buyBoatLicense", function(boughtLicense) + if boughtLicense then + ESX.ShowNotification(_U("license_bought", ESX.Math.GroupDigits(Config.LicensePrice))) + ESX.CloseContext() + + OpenBoatShop(shop) -- parse current shop + else + ESX.ShowNotification(_U("license_nomoney")) + end + end) + end, function() + CurrentAction = "boat_shop" + CurrentActionMsg = _U("boat_shop_open") + end) + end, function() + CurrentAction = "boat_shop" + CurrentActionMsg = _U("boat_shop_open") + end) end function StoreBoatInGarage(vehicle, teleportCoords) - local vehicleProps = ESX.Game.GetVehicleProperties(vehicle) - - ESX.TriggerServerCallback('esx_boat:storeVehicle', function (rowsChanged) - if rowsChanged > 0 then - ESX.Game.DeleteVehicle(vehicle) - ESX.ShowNotification(_U('garage_stored')) - local playerPed = PlayerPedId() - - ESX.Game.Teleport(playerPed, teleportCoords, function() - SetEntityHeading(playerPed, teleportCoords.w) - end) - else - ESX.ShowNotification(_U('garage_notowner')) - end - end, vehicleProps.plate) + local vehicleProps = ESX.Game.GetVehicleProperties(vehicle) + + ESX.TriggerServerCallback("esx_boat:storeVehicle", function(rowsChanged) + if rowsChanged > 0 then + ESX.Game.DeleteVehicle(vehicle) + ESX.ShowNotification(_U("garage_stored")) + local playerPed = PlayerPedId() + + ESX.Game.Teleport(playerPed, teleportCoords, function() + SetEntityHeading(playerPed, teleportCoords.w) + end) + else + ESX.ShowNotification(_U("garage_notowner")) + end + end, vehicleProps.plate) end -- Key controls CreateThread(function() - while true do - Wait(0) - - if isInShopMenu then - DisableControlAction(0, 75, true) -- Disable exit vehicle - DisableControlAction(27, 75, true) -- Disable exit vehicle - else - Wait(500) - end - end + while true do + Wait(0) + + if isInShopMenu then + DisableControlAction(0, 75, true) -- Disable exit vehicle + DisableControlAction(27, 75, true) -- Disable exit vehicle + else + Wait(500) + end + end end) function DeleteSpawnedVehicles() - while #spawnedVehicles > 0 do - local vehicle = spawnedVehicles[1] - if DoesEntityExist(vehicle) then - ESX.Game.DeleteVehicle(vehicle) - end - table.remove(spawnedVehicles, 1) - end + while #spawnedVehicles > 0 do + local vehicle = spawnedVehicles[1] + if DoesEntityExist(vehicle) then + ESX.Game.DeleteVehicle(vehicle) + end + table.remove(spawnedVehicles, 1) + end end function getVehicleLabelFromHash(hash) - local model = string.lower(GetDisplayNameFromVehicleModel(hash)) + local model = string.lower(GetDisplayNameFromVehicleModel(hash)) - for i=1, #Config.Vehicles, 1 do - if Config.Vehicles[i].model == model then - return Config.Vehicles[i].label - end - end + for i = 1, #Config.Vehicles, 1 do + if Config.Vehicles[i].model == model then + return Config.Vehicles[i].label + end + end - return 'Unknown model [' .. model .. ']' + return "Unknown model [" .. model .. "]" end function reset(shop) - local playerPed = PlayerPedId() - isInShopMenu = false - CurrentAction = 'boat_shop' - CurrentActionMsg = _U('boat_shop_open') - DeleteSpawnedVehicles() - FreezeEntityPosition(playerPed, false) - SetEntityVisible(playerPed, true) - SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z) - ESX.CloseContext() -end \ No newline at end of file + local playerPed = PlayerPedId() + isInShopMenu = false + CurrentAction = "boat_shop" + CurrentActionMsg = _U("boat_shop_open") + DeleteSpawnedVehicles() + FreezeEntityPosition(playerPed, false) + SetEntityVisible(playerPed, true) + SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z) + ESX.CloseContext() +end diff --git a/server-data/resources/[esx_addons]/esx_boat/client/marker.lua b/server-data/resources/[esx_addons]/esx_boat/client/marker.lua index 1b0c27666..3b3871c13 100644 --- a/server-data/resources/[esx_addons]/esx_boat/client/marker.lua +++ b/server-data/resources/[esx_addons]/esx_boat/client/marker.lua @@ -1,199 +1,195 @@ local HasAlreadyEnteredMarker = false -local LastZone = nil +local LastZone = nil -CurrentAction = nil -CurrentActionMsg = '' +CurrentAction = nil +CurrentActionMsg = "" CurrentActionData = {} -- Key controls CreateThread(function() - while true do - Wait(0) - - if CurrentAction then - if IsControlJustReleased(0, 38) then - if CurrentAction == 'boat_shop' then - if not Config.LicenseEnable then - OpenBoatShop(Config.Zones.BoatShops[CurrentActionData.zoneNum]) - else -- check for license - - ESX.TriggerServerCallback('esx_license:checkLicense', function(hasBoatLicense) - if hasBoatLicense then - OpenBoatShop(Config.Zones.BoatShops[CurrentActionData.zoneNum]) - else - OpenLicenceMenu(Config.Zones.BoatShops[CurrentActionData.zoneNum]) - end - end, GetPlayerServerId(PlayerId()), 'boat') - end - elseif CurrentAction == 'garage_out' then - OpenBoatGarage(Config.Zones.Garages[CurrentActionData.zoneNum]) - elseif CurrentAction == 'garage_in' then - StoreBoatInGarage(CurrentActionData.vehicle, Config.Zones.Garages[CurrentActionData.zoneNum].StoreTP) - end - - CurrentAction = nil - ESX.HideUI() - end - else - Wait(500) - end - end + while true do + Wait(0) + + if CurrentAction then + if IsControlJustReleased(0, 38) then + if CurrentAction == "boat_shop" then + if not Config.LicenseEnable then + OpenBoatShop(Config.Zones.BoatShops[CurrentActionData.zoneNum]) + else -- check for license + ESX.TriggerServerCallback("esx_license:checkLicense", function(hasBoatLicense) + if hasBoatLicense then + OpenBoatShop(Config.Zones.BoatShops[CurrentActionData.zoneNum]) + else + OpenLicenceMenu(Config.Zones.BoatShops[CurrentActionData.zoneNum]) + end + end, GetPlayerServerId(PlayerId()), "boat") + end + elseif CurrentAction == "garage_out" then + OpenBoatGarage(Config.Zones.Garages[CurrentActionData.zoneNum]) + elseif CurrentAction == "garage_in" then + StoreBoatInGarage(CurrentActionData.vehicle, Config.Zones.Garages[CurrentActionData.zoneNum].StoreTP) + end + + CurrentAction = nil + ESX.HideUI() + end + else + Wait(500) + end + end end) -AddEventHandler('esx_boat:hasEnteredMarker', function(zone, zoneNum) - if zone == 'boat_shop' then - CurrentAction = 'boat_shop' - CurrentActionMsg = _U('boat_shop_open') - CurrentActionData = { zoneNum = zoneNum } - elseif zone == 'garage_out' then - CurrentAction = 'garage_out' - CurrentActionMsg = _U('garage_open') - CurrentActionData = { zoneNum = zoneNum } - elseif zone == 'garage_in' then - local playerPed = PlayerPedId() - local _ = GetEntityCoords(playerPed) - - if IsPedInAnyVehicle(playerPed, false) then - local vehicle = GetVehiclePedIsIn(playerPed, false) - - if DoesEntityExist(vehicle) and GetPedInVehicleSeat(vehicle, -1) == playerPed then - CurrentAction = 'garage_in' - CurrentActionMsg = _U('garage_store') - CurrentActionData = { vehicle = vehicle, zoneNum = zoneNum } - end - end - end - ESX.TextUI(CurrentActionMsg) +AddEventHandler("esx_boat:hasEnteredMarker", function(zone, zoneNum) + if zone == "boat_shop" then + CurrentAction = "boat_shop" + CurrentActionMsg = _U("boat_shop_open") + CurrentActionData = { zoneNum = zoneNum } + elseif zone == "garage_out" then + CurrentAction = "garage_out" + CurrentActionMsg = _U("garage_open") + CurrentActionData = { zoneNum = zoneNum } + elseif zone == "garage_in" then + local playerPed = PlayerPedId() + local _ = GetEntityCoords(playerPed) + + if IsPedInAnyVehicle(playerPed, false) then + local vehicle = GetVehiclePedIsIn(playerPed, false) + + if DoesEntityExist(vehicle) and GetPedInVehicleSeat(vehicle, -1) == playerPed then + CurrentAction = "garage_in" + CurrentActionMsg = _U("garage_store") + CurrentActionData = { vehicle = vehicle, zoneNum = zoneNum } + end + end + end + ESX.TextUI(CurrentActionMsg) end) -AddEventHandler('esx_boat:hasExitedMarker', function() - if not isInShopMenu then - ESX.CloseContext() - end +AddEventHandler("esx_boat:hasExitedMarker", function() + if not isInShopMenu then + ESX.CloseContext() + end - CurrentAction = nil - ESX.HideUI() + CurrentAction = nil + ESX.HideUI() end) -- Enter / Exit marker events CreateThread(function() - while true do - Wait(0) - - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - local isInMarker, hasExited, letSleep = false, false, true - local currentZone, currentZoneNum - - for i=1, #Config.Zones.BoatShops, 1 do - local distance = #(coords - Config.Zones.BoatShops[i].Outside) - - if distance < Config.DrawDistance then - DrawMarker(Config.MarkerType, Config.Zones.BoatShops[i].Outside, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.Marker.x, Config.Marker.y, Config.Marker.z, Config.Marker.r, Config.Marker.g, Config.Marker.b, 100, false, true, 2, false, nil, nil, false) - letSleep = false - end - - if distance < Config.Marker.x then - isInMarker = true - currentZone = 'boat_shop' - currentZoneNum = i - end - end - - for i=1, #Config.Zones.Garages, 1 do - local distance = #(coords - Config.Zones.Garages[i].GaragePos) - - if distance < Config.DrawDistance then - DrawMarker(Config.MarkerType, Config.Zones.Garages[i].GaragePos, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.Marker.x, Config.Marker.y, Config.Marker.z, Config.Marker.r, Config.Marker.g, Config.Marker.b, 100, false, true, 2, false, nil, nil, false) - letSleep = false - end - - if distance < Config.Marker.x then - isInMarker = true - currentZone = 'garage_out' - currentZoneNum = i - end - - distance = #(coords - Config.Zones.Garages[i].StorePos) - - if distance < Config.DrawDistance then - DrawMarker(Config.MarkerType, Config.Zones.Garages[i].StorePos, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.StoreMarker.x, Config.StoreMarker.y, Config.StoreMarker.z, Config.StoreMarker.r, Config.StoreMarker.g, Config.StoreMarker.b, 100, false, true, 2, false, nil, nil, false) - letSleep = false - end - - if distance < Config.StoreMarker.x then - isInMarker = true - currentZone = 'garage_in' - currentZoneNum = i - end - end - - if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastZone ~= currentZone or LastZoneNum ~= currentZoneNum)) then - if - (LastZone ~= nil and LastZoneNum ~= nil) and - (LastZone ~= currentZone or LastZoneNum ~= currentZoneNum) - then - TriggerEvent('esx_boat:hasExitedMarker', LastZone) - hasExited = true - end - - HasAlreadyEnteredMarker = true - LastZone = currentZone - LastZoneNum = currentZoneNum - - TriggerEvent('esx_boat:hasEnteredMarker', currentZone, currentZoneNum) - end - - if not hasExited and not isInMarker and HasAlreadyEnteredMarker then - HasAlreadyEnteredMarker = false - TriggerEvent('esx_boat:hasExitedMarker') - end - - if letSleep then - Wait(500) - end - end + while true do + Wait(0) + + local playerPed = PlayerPedId() + local coords = GetEntityCoords(playerPed) + local isInMarker, hasExited, letSleep = false, false, true + local currentZone, currentZoneNum + + for i = 1, #Config.Zones.BoatShops, 1 do + local distance = #(coords - Config.Zones.BoatShops[i].Outside) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType, Config.Zones.BoatShops[i].Outside, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.Marker.x, Config.Marker.y, Config.Marker.z, Config.Marker.r, Config.Marker.g, Config.Marker.b, 100, false, true, 2, false, nil, nil, false) + letSleep = false + end + + if distance < Config.Marker.x then + isInMarker = true + currentZone = "boat_shop" + currentZoneNum = i + end + end + + for i = 1, #Config.Zones.Garages, 1 do + local distance = #(coords - Config.Zones.Garages[i].GaragePos) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType, Config.Zones.Garages[i].GaragePos, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.Marker.x, Config.Marker.y, Config.Marker.z, Config.Marker.r, Config.Marker.g, Config.Marker.b, 100, false, true, 2, false, nil, nil, false) + letSleep = false + end + + if distance < Config.Marker.x then + isInMarker = true + currentZone = "garage_out" + currentZoneNum = i + end + + distance = #(coords - Config.Zones.Garages[i].StorePos) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType, Config.Zones.Garages[i].StorePos, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.StoreMarker.x, Config.StoreMarker.y, Config.StoreMarker.z, Config.StoreMarker.r, Config.StoreMarker.g, Config.StoreMarker.b, 100, false, true, 2, false, nil, nil, false) + letSleep = false + end + + if distance < Config.StoreMarker.x then + isInMarker = true + currentZone = "garage_in" + currentZoneNum = i + end + end + + if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastZone ~= currentZone or LastZoneNum ~= currentZoneNum)) then + if (LastZone ~= nil and LastZoneNum ~= nil) and (LastZone ~= currentZone or LastZoneNum ~= currentZoneNum) then + TriggerEvent("esx_boat:hasExitedMarker", LastZone) + hasExited = true + end + + HasAlreadyEnteredMarker = true + LastZone = currentZone + LastZoneNum = currentZoneNum + + TriggerEvent("esx_boat:hasEnteredMarker", currentZone, currentZoneNum) + end + + if not hasExited and not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent("esx_boat:hasExitedMarker") + end + + if letSleep then + Wait(500) + end + end end) -- Blips CreateThread(function() - local blipList = {} - - for i=1, #Config.Zones.Garages, 1 do - table.insert(blipList, { - coords = Config.Zones.Garages[i].GaragePos, - text = _U('blip_garage'), - sprite = 356, - color = 3, - scale = 1.0 - }) - end - - for i=1, #Config.Zones.BoatShops, 1 do - table.insert(blipList, { - coords = Config.Zones.BoatShops[i].Outside, - text = _U('blip_shop'), - sprite = 427, - color = 3, - scale = 1.0 - }) - end - - for i=1, #blipList, 1 do - CreateBlip(blipList[i].coords, blipList[i].text, blipList[i].sprite, blipList[i].color, blipList[i].scale) - end + local blipList = {} + + for i = 1, #Config.Zones.Garages, 1 do + table.insert(blipList, { + coords = Config.Zones.Garages[i].GaragePos, + text = _U("blip_garage"), + sprite = 356, + color = 3, + scale = 1.0, + }) + end + + for i = 1, #Config.Zones.BoatShops, 1 do + table.insert(blipList, { + coords = Config.Zones.BoatShops[i].Outside, + text = _U("blip_shop"), + sprite = 427, + color = 3, + scale = 1.0, + }) + end + + for i = 1, #blipList, 1 do + CreateBlip(blipList[i].coords, blipList[i].text, blipList[i].sprite, blipList[i].color, blipList[i].scale) + end end) function CreateBlip(coords, text, sprite, color, scale) - local blip = AddBlipForCoord(coords.x, coords.y) + local blip = AddBlipForCoord(coords.x, coords.y) - SetBlipSprite(blip, sprite) - SetBlipScale(blip, scale) - SetBlipColour(blip, color) + SetBlipSprite(blip, sprite) + SetBlipScale(blip, scale) + SetBlipColour(blip, color) - SetBlipAsShortRange(blip, true) + SetBlipAsShortRange(blip, true) - BeginTextCommandSetBlipName('STRING') - AddTextComponentSubstringPlayerName(text) - EndTextCommandSetBlipName(blip) -end \ No newline at end of file + BeginTextCommandSetBlipName("STRING") + AddTextComponentSubstringPlayerName(text) + EndTextCommandSetBlipName(blip) +end diff --git a/server-data/resources/[esx_addons]/esx_boat/config.lua b/server-data/resources/[esx_addons]/esx_boat/config.lua index 8381f3110..ab13b6624 100644 --- a/server-data/resources/[esx_addons]/esx_boat/config.lua +++ b/server-data/resources/[esx_addons]/esx_boat/config.lua @@ -1,92 +1,99 @@ -Config = {} +Config = {} -Config.Locale = 'en' +Config.Locale = "en" Config.LicenseEnable = true -- enable boat license? Requires esx_license -Config.LicensePrice = 50000 +Config.LicensePrice = 50000 -Config.MarkerType = 1 -Config.DrawDistance = 10.0 +Config.MarkerType = 1 +Config.DrawDistance = 10.0 Config.Marker = { - r = 100, g = 204, b = 100, -- blue-ish color - x = 1.5, y = 1.5, z = 1.0 -- standard size circle + r = 100, + g = 204, + b = 100, -- blue-ish color + x = 1.5, + y = 1.5, + z = 1.0, -- standard size circle } Config.StoreMarker = { - r = 255, g = 0, b = 0, -- red color - x = 5.0, y = 5.0, z = 1.0 -- big circle for storing boat + r = 255, + g = 0, + b = 0, -- red color + x = 5.0, + y = 5.0, + z = 1.0, -- big circle for storing boat } Config.Zones = { - Garages = { - { -- Shank St, nearby campaign boat garage - GaragePos = vector3(-772.4, -1430.9, 0.5), - SpawnPoint = vector4(-785.39, -1426.3, 0.0, 146.0), - StorePos = vector3(-798.4, -1456.0, 0.0), - StoreTP = vector4(-791.4, -1452.5, 1.5, 318.9) - }, - - { -- Catfish View - GaragePos = vector3(3864.9, 4463.9, 1.6), - SpawnPoint = vector4(3854.4, 4477.2, 0.0, 273.0), - StorePos = vector3(3857.0, 4446.9, 0.0), - StoreTP = vector4(3854.7, 4458.6, 1.8, 355.3) - }, - - { -- Great Ocean Highway - GaragePos = vector3(-1614.0, 5260.1, 2.8), - SpawnPoint = vector4(-1622.5, 5247.1, 0.0, 21.0), - StorePos = vector3(-1600.3, 5261.9, 0.0), - StoreTP = vector4(-1605.7, 5259.0, 2.0, 25.0) - }, - - { -- North Calafia Way - GaragePos = vector3(712.6, 4093.3, 33.7), - SpawnPoint = vector4(712.8, 4080.2, 29.3, 181.0), - StorePos = vector3(705.1, 4110.1, 30.2), - StoreTP = vector4(711.9, 4110.5, 31.3, 180.0) - }, - - { -- Elysian Fields, nearby the airport - GaragePos = vector3(23.8, -2806.8, 4.8), - SpawnPoint = vector4(23.3, -2828.6, 0.8, 181.0), - StorePos = vector3(-1.0, -2799.2, 0.5), - StoreTP = vector4(12.6, -2793.8, 2.5, 355.2) - }, - - { -- Barbareno Rd - GaragePos = vector3(-3427.3, 956.9, 7.3), - SpawnPoint = vector4(-3448.9, 953.8, 0.0, 75.0), - StorePos = vector3(-3436.5, 946.6, 0.3), - StoreTP = vector4(-3427.0, 952.6, 8.3, 0.0) - } - }, - - BoatShops = { - { -- Shank St, nearby campaign boat garage - Outside = vector3(-773.7, -1495.2, 1.6), - Inside = vector4(-798.5, -1503.1, -0.4, 120.0) - } - } - + Garages = { + { -- Shank St, nearby campaign boat garage + GaragePos = vector3(-772.4, -1430.9, 0.5), + SpawnPoint = vector4(-785.39, -1426.3, 0.0, 146.0), + StorePos = vector3(-798.4, -1456.0, 0.0), + StoreTP = vector4(-791.4, -1452.5, 1.5, 318.9), + }, + + { -- Catfish View + GaragePos = vector3(3864.9, 4463.9, 1.6), + SpawnPoint = vector4(3854.4, 4477.2, 0.0, 273.0), + StorePos = vector3(3857.0, 4446.9, 0.0), + StoreTP = vector4(3854.7, 4458.6, 1.8, 355.3), + }, + + { -- Great Ocean Highway + GaragePos = vector3(-1614.0, 5260.1, 2.8), + SpawnPoint = vector4(-1622.5, 5247.1, 0.0, 21.0), + StorePos = vector3(-1600.3, 5261.9, 0.0), + StoreTP = vector4(-1605.7, 5259.0, 2.0, 25.0), + }, + + { -- North Calafia Way + GaragePos = vector3(712.6, 4093.3, 33.7), + SpawnPoint = vector4(712.8, 4080.2, 29.3, 181.0), + StorePos = vector3(705.1, 4110.1, 30.2), + StoreTP = vector4(711.9, 4110.5, 31.3, 180.0), + }, + + { -- Elysian Fields, nearby the airport + GaragePos = vector3(23.8, -2806.8, 4.8), + SpawnPoint = vector4(23.3, -2828.6, 0.8, 181.0), + StorePos = vector3(-1.0, -2799.2, 0.5), + StoreTP = vector4(12.6, -2793.8, 2.5, 355.2), + }, + + { -- Barbareno Rd + GaragePos = vector3(-3427.3, 956.9, 7.3), + SpawnPoint = vector4(-3448.9, 953.8, 0.0, 75.0), + StorePos = vector3(-3436.5, 946.6, 0.3), + StoreTP = vector4(-3427.0, 952.6, 8.3, 0.0), + }, + }, + + BoatShops = { + { -- Shank St, nearby campaign boat garage + Outside = vector3(-773.7, -1495.2, 1.6), + Inside = vector4(-798.5, -1503.1, -0.4, 120.0), + }, + }, } Config.Vehicles = { - {model = 'seashark', label = 'Seashark (Random Color)', price = 7500}, - {model = 'seashark3', label = 'Seashark (Dark Blue)', price = 7500}, - {model = 'suntrap', label = 'Suntrap', price = 10000}, - {model = 'jetmax', label = 'Jetmax', price = 45000}, - {model = 'tropic2', label = 'Tropic', price = 65000}, - {model = 'dinghy2', label = 'Dinghy (Black)', price = 32500}, - {model = 'dinghy', label = 'Dinghy 2 (Random Color)', price = 40000}, - {model = 'speeder', label = 'Speeder', price = 85000}, - {model = 'squalo', label = 'Squalo (Random Color)', price = 61000}, - {model = 'toro', label = 'Toro', price = 200000}, - {model = 'submersible', label = 'Submersible', price = 750000} + { model = "seashark", label = "Seashark (Random Color)", price = 7500 }, + { model = "seashark3", label = "Seashark (Dark Blue)", price = 7500 }, + { model = "suntrap", label = "Suntrap", price = 10000 }, + { model = "jetmax", label = "Jetmax", price = 45000 }, + { model = "tropic2", label = "Tropic", price = 65000 }, + { model = "dinghy2", label = "Dinghy (Black)", price = 32500 }, + { model = "dinghy", label = "Dinghy 2 (Random Color)", price = 40000 }, + { model = "speeder", label = "Speeder", price = 85000 }, + { model = "squalo", label = "Squalo (Random Color)", price = 61000 }, + { model = "toro", label = "Toro", price = 200000 }, + { model = "submersible", label = "Submersible", price = 750000 }, } -exports('getGarages', function() - return Config.Zones.Garages +exports("getGarages", function() + return Config.Zones.Garages end) diff --git a/server-data/resources/[esx_addons]/esx_boat/fxmanifest.lua b/server-data/resources/[esx_addons]/esx_boat/fxmanifest.lua index 2bf6a9fec..dcdd800f8 100644 --- a/server-data/resources/[esx_addons]/esx_boat/fxmanifest.lua +++ b/server-data/resources/[esx_addons]/esx_boat/fxmanifest.lua @@ -1,30 +1,30 @@ -fx_version 'adamant' +fx_version("adamant") -game 'gta5' +game("gta5") -description 'ESX Boat' +description("ESX Boat") -version '0.0.4' +version("1.0.0") -shared_script '@es_extended/imports.lua' +shared_script("@es_extended/imports.lua") -server_scripts { - '@oxmysql/lib/MySQL.lua', - '@es_extended/locale.lua', - 'locales/*.lua', - 'config.lua', - 'server/main.lua' -} +server_scripts({ + "@oxmysql/lib/MySQL.lua", + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", + "server/main.lua", +}) -client_scripts { - '@es_extended/locale.lua', - 'locales/*.lua', - 'config.lua', - 'client/main.lua', - 'client/marker.lua' -} +client_scripts({ + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", + "client/main.lua", + "client/marker.lua", +}) -dependencies { - 'es_extended', - 'esx_vehicleshop' -} +dependencies({ + "es_extended", + "esx_vehicleshop", +}) diff --git a/server-data/resources/[esx_addons]/esx_boat/locales/de.lua b/server-data/resources/[esx_addons]/esx_boat/locales/de.lua index 88607ec59..512b6b472 100644 --- a/server-data/resources/[esx_addons]/esx_boat/locales/de.lua +++ b/server-data/resources/[esx_addons]/esx_boat/locales/de.lua @@ -1,31 +1,31 @@ -Locales['de'] = { - -- shop - ['boat_shop'] = 'Bootsladen', - ['boat_shop_open'] = 'Drücke [E] um auf den Bootsladen zuzugreifen .', - ['boat_shop_confirm'] = 'Kaufen %s for $%s?', - ['boat_shop_bought'] = 'Du hast ein %s für $%s gekauft', - ['boat_shop_nomoney'] = 'Du kannst dir ~r~ dass nicht leisten!', - ['confirm_no'] = 'Nein', - ['confirm_yes'] = 'Ja', +Locales["de"] = { + -- shop + ["boat_shop"] = "Bootsladen", + ["boat_shop_open"] = "Drücke [E] um auf den Bootsladen zuzugreifen .", + ["boat_shop_confirm"] = 'Kaufen %s for $%s?', + ["boat_shop_bought"] = "Du hast ein %s für $%s gekauft", + ["boat_shop_nomoney"] = "Du kannst dir ~r~ dass nicht leisten!", + ["confirm_no"] = "Nein", + ["confirm_yes"] = "Ja", - -- garage - ['garage'] = 'Bootsgarage', - ['garage_open'] = 'Drücke [E] um auf deine Bootsgarage zuzugreifen.', - ['garage_store'] = 'Drücke [E] um auf den Laden in deiner Bootsgarage zuzugreifen.', - ['garage_taken'] = 'Das Boot wurde ausgeparkt!!', - ['garage_stored'] = 'Das Boot wurde sicher in Ihre Garage gelagert!', - ['garage_noboats'] = 'Sie haben besitzen keine Boote! Besuchen Sie den Bootsladen, um eins zu kaufen.', - ['garage_blocked'] = 'Das Boot kann nicht ausgeparkt werden, weil ein anderes Fahrzeug den Spawn-Punkt blockiert!', - ['garage_notowner'] = 'Dieses Boot gehört nicht Ihnen!', + -- garage + ["garage"] = "Bootsgarage", + ["garage_open"] = "Drücke [E] um auf deine Bootsgarage zuzugreifen.", + ["garage_store"] = "Drücke [E] um auf den Laden in deiner Bootsgarage zuzugreifen.", + ["garage_taken"] = "Das Boot wurde ausgeparkt!!", + ["garage_stored"] = "Das Boot wurde sicher in Ihre Garage gelagert!", + ["garage_noboats"] = "Sie haben besitzen keine Boote! Besuchen Sie den Bootsladen, um eins zu kaufen.", + ["garage_blocked"] = "Das Boot kann nicht ausgeparkt werden, weil ein anderes Fahrzeug den Spawn-Punkt blockiert!", + ["garage_notowner"] = "Dieses Boot gehört nicht Ihnen!", - -- license - ['license_menu'] = 'Bootsführerschein erwerben?', - ['license_buy_no'] = 'Nein', - ['license_buy_yes'] = 'Bootsführerschein kaufen $%s', - ['license_bought'] = 'Du hast den Bootsführerschein für $%s gekauft', - ['license_nomoney'] = 'Du kannst dir den ~r~Bootsführerschein nicht leisten!', + -- license + ["license_menu"] = "Bootsführerschein erwerben?", + ["license_buy_no"] = "Nein", + ["license_buy_yes"] = 'Bootsführerschein kaufen $%s', + ["license_bought"] = "Du hast den Bootsführerschein für $%s gekauft", + ["license_nomoney"] = "Du kannst dir den ~r~Bootsführerschein nicht leisten!", - -- blips - ['blip_garage'] = 'Bootsgarage', - ['blip_shop'] = 'Bootsladen', -} \ No newline at end of file + -- blips + ["blip_garage"] = "Bootsgarage", + ["blip_shop"] = "Bootsladen", +} diff --git a/server-data/resources/[esx_addons]/esx_boat/locales/en.lua b/server-data/resources/[esx_addons]/esx_boat/locales/en.lua index 6afb505dd..231e87456 100644 --- a/server-data/resources/[esx_addons]/esx_boat/locales/en.lua +++ b/server-data/resources/[esx_addons]/esx_boat/locales/en.lua @@ -1,31 +1,31 @@ -Locales['en'] = { - -- shop - ['boat_shop'] = 'boat shop', - ['boat_shop_open'] = 'press [E] to access the boat shop.', - ['boat_shop_confirm'] = 'buy %s for $%s?', - ['boat_shop_bought'] = 'you have bought a %s for $%s', - ['boat_shop_nomoney'] = 'you cannot ~r~afford this boat!', - ['confirm_no'] = 'no', - ['confirm_yes'] = 'yes', +Locales["en"] = { + -- shop + ["boat_shop"] = "boat shop", + ["boat_shop_open"] = "press [E] to access the boat shop.", + ["boat_shop_confirm"] = 'buy %s for $%s?', + ["boat_shop_bought"] = "you have bought a %s for $%s", + ["boat_shop_nomoney"] = "you cannot ~r~afford this boat!", + ["confirm_no"] = "no", + ["confirm_yes"] = "yes", - -- garage - ['garage'] = 'boat garage', - ['garage_open'] = 'press [E] to access your boat garage.', - ['garage_store'] = 'press [E] to store the boat in your garage.', - ['garage_taken'] = 'the boat has been taken out!', - ['garage_stored'] = 'the boat has been safely stored in your garage!', - ['garage_noboats'] = 'you don\'t have any stored boats! Visit the boat shop to buy one.', - ['garage_blocked'] = 'the boat cannot be taken out because another vehicle is blocking the spawn point!', - ['garage_notowner'] = 'you don\'t own this boat!', + -- garage + ["garage"] = "boat garage", + ["garage_open"] = "press [E] to access your boat garage.", + ["garage_store"] = "press [E] to store the boat in your garage.", + ["garage_taken"] = "the boat has been taken out!", + ["garage_stored"] = "the boat has been safely stored in your garage!", + ["garage_noboats"] = "you don't have any stored boats! Visit the boat shop to buy one.", + ["garage_blocked"] = "the boat cannot be taken out because another vehicle is blocking the spawn point!", + ["garage_notowner"] = "you don't own this boat!", - -- license - ['license_menu'] = 'buy Boat License?', - ['license_buy_no'] = 'no', - ['license_buy_yes'] = 'buy Boat License $%s', - ['license_bought'] = 'you have bought the Boat License for $%s', - ['license_nomoney'] = 'you cannot ~r~afford the Boat License!', + -- license + ["license_menu"] = "buy Boat License?", + ["license_buy_no"] = "no", + ["license_buy_yes"] = 'buy Boat License $%s', + ["license_bought"] = "you have bought the Boat License for $%s", + ["license_nomoney"] = "you cannot ~r~afford the Boat License!", - -- blips - ['blip_garage'] = 'boat Garage', - ['blip_shop'] = 'boat Shop', + -- blips + ["blip_garage"] = "boat Garage", + ["blip_shop"] = "boat Shop", } diff --git a/server-data/resources/[esx_addons]/esx_boat/locales/es.lua b/server-data/resources/[esx_addons]/esx_boat/locales/es.lua index 8ad7edc08..fe77bbc4a 100644 --- a/server-data/resources/[esx_addons]/esx_boat/locales/es.lua +++ b/server-data/resources/[esx_addons]/esx_boat/locales/es.lua @@ -1,31 +1,31 @@ -Locales['es'] = { - -- shop - ['boat_shop'] = 'Tienda de barcos', - ['boat_shop_open'] = 'Pulsa [E] para acceder a la tienda de barcos.', - ['boat_shop_confirm'] = '¿Comprar %s por %s$?', - ['boat_shop_bought'] = 'Has comprado un %s por %s$', - ['boat_shop_nomoney'] = '¡No puedes ~r~permitirte ese barco!', - ['confirm_no'] = 'No', - ['confirm_yes'] = 'Si', +Locales["es"] = { + -- shop + ["boat_shop"] = "Tienda de barcos", + ["boat_shop_open"] = "Pulsa [E] para acceder a la tienda de barcos.", + ["boat_shop_confirm"] = '¿Comprar %s por %s$?', + ["boat_shop_bought"] = "Has comprado un %s por %s$", + ["boat_shop_nomoney"] = "¡No puedes ~r~permitirte ese barco!", + ["confirm_no"] = "No", + ["confirm_yes"] = "Si", - -- garage - ['garage'] = 'Garaje de barcos', - ['garage_open'] = 'Pulsa [E] para acceder a tu garaje de barcos', - ['garage_store'] = 'Pulsa [E] para almacenar el barco en el garaje', - ['garage_taken'] = '¡El barco ha sido sacado!', - ['garage_stored'] = '¡El barco se ha almacenado en el garaje!', - ['garage_noboats'] = '¡No tienes ningún barco guardado! Visita la tienda de barcos para comprar uno', - ['garage_blocked'] = '¡El barco no ha podido ser sacado, hay un objeto obstruyendo el spawn!', - ['garage_notowner'] = '¡No eres el dueño de ese barco!', + -- garage + ["garage"] = "Garaje de barcos", + ["garage_open"] = "Pulsa [E] para acceder a tu garaje de barcos", + ["garage_store"] = "Pulsa [E] para almacenar el barco en el garaje", + ["garage_taken"] = "¡El barco ha sido sacado!", + ["garage_stored"] = "¡El barco se ha almacenado en el garaje!", + ["garage_noboats"] = "¡No tienes ningún barco guardado! Visita la tienda de barcos para comprar uno", + ["garage_blocked"] = "¡El barco no ha podido ser sacado, hay un objeto obstruyendo el spawn!", + ["garage_notowner"] = "¡No eres el dueño de ese barco!", - -- license - ['license_menu'] = '¿Comprar Licencia de Barcos?', - ['license_buy_no'] = 'No', - ['license_buy_yes'] = 'Comprar Licencia de Barcos %s$', - ['license_bought'] = 'Compraste la Licencia de Barcos por $%s', - ['license_nomoney'] = '¡No puedes ~r~permitirte la Licencia de Barcos!', + -- license + ["license_menu"] = "¿Comprar Licencia de Barcos?", + ["license_buy_no"] = "No", + ["license_buy_yes"] = 'Comprar Licencia de Barcos %s$', + ["license_bought"] = "Compraste la Licencia de Barcos por $%s", + ["license_nomoney"] = "¡No puedes ~r~permitirte la Licencia de Barcos!", - -- blips - ['blip_garage'] = 'Garaje de barcos', - ['blip_shop'] = 'Tienda de barcos', + -- blips + ["blip_garage"] = "Garaje de barcos", + ["blip_shop"] = "Tienda de barcos", } diff --git a/server-data/resources/[esx_addons]/esx_boat/locales/fr.lua b/server-data/resources/[esx_addons]/esx_boat/locales/fr.lua index 9d93feb7b..455374f7d 100644 --- a/server-data/resources/[esx_addons]/esx_boat/locales/fr.lua +++ b/server-data/resources/[esx_addons]/esx_boat/locales/fr.lua @@ -1,31 +1,31 @@ -Locales['fr'] = { - -- shop - ['boat_shop'] = 'magasin de bateaux', - ['boat_shop_open'] = 'appuyez sur [E] pour accéder au magasin de bateaux.', - ['boat_shop_confirm'] = 'voulez-vous acheter %s pour $%s?', - ['boat_shop_bought'] = 'vous avez acheté le %s pour $%s', - ['boat_shop_nomoney'] = 'vous n\'avez pas les moyens ~r~pour acheter ce bateau !', - ['confirm_no'] = 'non', - ['confirm_yes'] = 'oui', +Locales["fr"] = { + -- shop + ["boat_shop"] = "magasin de bateaux", + ["boat_shop_open"] = "appuyez sur [E] pour accéder au magasin de bateaux.", + ["boat_shop_confirm"] = 'voulez-vous acheter %s pour $%s?', + ["boat_shop_bought"] = "vous avez acheté le %s pour $%s", + ["boat_shop_nomoney"] = "vous n'avez pas les moyens ~r~pour acheter ce bateau !", + ["confirm_no"] = "non", + ["confirm_yes"] = "oui", - -- garage - ['garage'] = 'garage à bateaux', - ['garage_open'] = 'appuyez sur [E] pour accéder à votre garage à bateaux.', - ['garage_store'] = 'appuyez sur [E] pour ranger votre bateau dans votre garage.', - ['garage_taken'] = 'le bateau est sorti !', - ['garage_stored'] = 'le bateau a bien été rangé dans votre garage !', - ['garage_noboats'] = 'vous n\'avez aucun bateau ici ! Rendez-vous au magasin de bateaux pour en acheter un.', - ['garage_blocked'] = 'le bateau ne peux pas être sorti car un autre véhicule bloque le point !', - ['garage_notowner'] = 'ce bateau ne vous appartient pas !', + -- garage + ["garage"] = "garage à bateaux", + ["garage_open"] = "appuyez sur [E] pour accéder à votre garage à bateaux.", + ["garage_store"] = "appuyez sur [E] pour ranger votre bateau dans votre garage.", + ["garage_taken"] = "le bateau est sorti !", + ["garage_stored"] = "le bateau a bien été rangé dans votre garage !", + ["garage_noboats"] = "vous n'avez aucun bateau ici ! Rendez-vous au magasin de bateaux pour en acheter un.", + ["garage_blocked"] = "le bateau ne peux pas être sorti car un autre véhicule bloque le point !", + ["garage_notowner"] = "ce bateau ne vous appartient pas !", - -- license - ['license_menu'] = 'acheter un permis de naviguer', - ['license_buy_no'] = 'non', - ['license_buy_yes'] = 'acheter le permis pour $%s', - ['license_bought'] = 'vous avez acheté le permis de naviguer pour $%s', - ['license_nomoney'] = 'vous n\'avez pas les moyens ~r~pour acheter ce permis !', + -- license + ["license_menu"] = "acheter un permis de naviguer", + ["license_buy_no"] = "non", + ["license_buy_yes"] = 'acheter le permis pour $%s', + ["license_bought"] = "vous avez acheté le permis de naviguer pour $%s", + ["license_nomoney"] = "vous n'avez pas les moyens ~r~pour acheter ce permis !", - -- blips - ['blip_garage'] = 'garage à bateaux', - ['blip_shop'] = 'magasin de bateaux', + -- blips + ["blip_garage"] = "garage à bateaux", + ["blip_shop"] = "magasin de bateaux", } diff --git a/server-data/resources/[esx_addons]/esx_boat/locales/hu.lua b/server-data/resources/[esx_addons]/esx_boat/locales/hu.lua index f15ba04c4..d50d8e797 100644 --- a/server-data/resources/[esx_addons]/esx_boat/locales/hu.lua +++ b/server-data/resources/[esx_addons]/esx_boat/locales/hu.lua @@ -1,31 +1,31 @@ -Locales['hu'] = { - -- shop - ['boat_shop'] = 'Hajóbolt', - ['boat_shop_open'] = 'Nyomj [E] hogy megnézd a hajókat', - ['boat_shop_confirm'] = 'hajó: %s ára: $%s', - ['boat_shop_bought'] = 'Vettél %s ennyiért: $%s', - ['boat_shop_nomoney'] = '~r~Ezt nem engedheted meg magadnak!', - ['confirm_no'] = 'Nem', - ['confirm_yes'] = 'Igen', +Locales["hu"] = { + -- shop + ["boat_shop"] = "Hajóbolt", + ["boat_shop_open"] = "Nyomj [E] hogy megnézd a hajókat", + ["boat_shop_confirm"] = 'hajó: %s ára: $%s', + ["boat_shop_bought"] = "Vettél %s ennyiért: $%s", + ["boat_shop_nomoney"] = "~r~Ezt nem engedheted meg magadnak!", + ["confirm_no"] = "Nem", + ["confirm_yes"] = "Igen", - -- garage - ['garage'] = 'Hajógarázs', - ['garage_open'] = 'Nyomj [E] hogy megnyisd a garázst', - ['garage_store'] = 'Nyomj [E] hogy kikösd a hajót', - ['garage_taken'] = 'Sikeresen kivetted a hajót', - ['garage_stored'] = 'Sikeresen leraktad a hajót', - ['garage_noboats'] = '~r~Nincsen hajód', - ['garage_blocked'] = '~r~A lehívási pont blokkolva', - ['garage_notowner'] = '~r~Nem a tied ez a hajó', + -- garage + ["garage"] = "Hajógarázs", + ["garage_open"] = "Nyomj [E] hogy megnyisd a garázst", + ["garage_store"] = "Nyomj [E] hogy kikösd a hajót", + ["garage_taken"] = "Sikeresen kivetted a hajót", + ["garage_stored"] = "Sikeresen leraktad a hajót", + ["garage_noboats"] = "~r~Nincsen hajód", + ["garage_blocked"] = "~r~A lehívási pont blokkolva", + ["garage_notowner"] = "~r~Nem a tied ez a hajó", - -- license - ['license_menu'] = 'Szeretnél venni hajó engedélyt?', - ['license_buy_no'] = 'Nem', - ['license_buy_yes'] = 'Vegyél hajó engedélyt $%s-ért', - ['license_bought'] = 'Vettél hajó engedélyt $%s-ért', - ['license_nomoney'] = '~r~nem engedheted meg magadnak, hogy vegyél hajó engedélyt!', + -- license + ["license_menu"] = "Szeretnél venni hajó engedélyt?", + ["license_buy_no"] = "Nem", + ["license_buy_yes"] = 'Vegyél hajó engedélyt $%s-ért', + ["license_bought"] = "Vettél hajó engedélyt $%s-ért", + ["license_nomoney"] = "~r~nem engedheted meg magadnak, hogy vegyél hajó engedélyt!", - -- blips - ['blip_garage'] = 'Hajógarázs', - ['blip_shop'] = 'Hajóbolt', + -- blips + ["blip_garage"] = "Hajógarázs", + ["blip_shop"] = "Hajóbolt", } diff --git a/server-data/resources/[esx_addons]/esx_boat/locales/it.lua b/server-data/resources/[esx_addons]/esx_boat/locales/it.lua index a771b3c15..33746fa82 100644 --- a/server-data/resources/[esx_addons]/esx_boat/locales/it.lua +++ b/server-data/resources/[esx_addons]/esx_boat/locales/it.lua @@ -1,31 +1,31 @@ -Locales['it'] = { - -- shop - ['boat_shop'] = 'negozio nautico', - ['boat_shop_open'] = 'premi [E] per accedere al negozio nautico.', - ['boat_shop_confirm'] = 'compra %s per $%s?', - ['boat_shop_bought'] = 'hai comprato un %s per $%s', - ['boat_shop_nomoney'] = 'non puoi ~r~permertterti questa barca!', - ['confirm_no'] = 'no', - ['confirm_yes'] = 'si', +Locales["it"] = { + -- shop + ["boat_shop"] = "negozio nautico", + ["boat_shop_open"] = "premi [E] per accedere al negozio nautico.", + ["boat_shop_confirm"] = 'compra %s per $%s?', + ["boat_shop_bought"] = "hai comprato un %s per $%s", + ["boat_shop_nomoney"] = "non puoi ~r~permertterti questa barca!", + ["confirm_no"] = "no", + ["confirm_yes"] = "si", - -- garage - ['garage'] = 'garage barca', - ['garage_open'] = 'premi [E] per accedere al garage della tua barca.', - ['garage_store'] = 'premi [E] per riporre la barca nel tuo garage.', - ['garage_taken'] = 'la barca è stata ritirata', - ['garage_stored'] = 'la barca è stata riposta al sicuro nel tuo garage!', - ['garage_noboats'] = 'non hai barche in deposito! Visita il negozio per acquistarne una.', - ['garage_blocked'] = 'la barca non può essere eliminata perché un altro veicolo sta bloccando il punto di spawn!', - ['garage_notowner'] = 'non possiedi questa barca!', + -- garage + ["garage"] = "garage barca", + ["garage_open"] = "premi [E] per accedere al garage della tua barca.", + ["garage_store"] = "premi [E] per riporre la barca nel tuo garage.", + ["garage_taken"] = "la barca è stata ritirata", + ["garage_stored"] = "la barca è stata riposta al sicuro nel tuo garage!", + ["garage_noboats"] = "non hai barche in deposito! Visita il negozio per acquistarne una.", + ["garage_blocked"] = "la barca non può essere eliminata perché un altro veicolo sta bloccando il punto di spawn!", + ["garage_notowner"] = "non possiedi questa barca!", - -- license - ['license_menu'] = 'acquistare la patente nautica?', - ['license_buy_no'] = 'no', - ['license_buy_yes'] = 'acquista patente nautica $%s', - ['license_bought'] = 'hai acquistato la patente nautica per $%s', - ['license_nomoney'] = 'non puoi ~r~permetterti la patente nautica', + -- license + ["license_menu"] = "acquistare la patente nautica?", + ["license_buy_no"] = "no", + ["license_buy_yes"] = 'acquista patente nautica $%s', + ["license_bought"] = "hai acquistato la patente nautica per $%s", + ["license_nomoney"] = "non puoi ~r~permetterti la patente nautica", - -- blips - ['blip_garage'] = 'garage delle barche', - ['blip_shop'] = 'negozio di barche', + -- blips + ["blip_garage"] = "garage delle barche", + ["blip_shop"] = "negozio di barche", } diff --git a/server-data/resources/[esx_addons]/esx_boat/locales/nl.lua b/server-data/resources/[esx_addons]/esx_boat/locales/nl.lua index 372b858b8..b2fd74df4 100644 --- a/server-data/resources/[esx_addons]/esx_boat/locales/nl.lua +++ b/server-data/resources/[esx_addons]/esx_boat/locales/nl.lua @@ -1,31 +1,31 @@ -Locales['nl'] = { - -- shop - ['boat_shop'] = 'boten winkel', - ['boat_shop_open'] = 'Druk op [E] tom de boten winkelte openen.', - ['boat_shop_confirm'] = 'Koop %s voor €%s?', - ['boat_shop_bought'] = 'Je hebt een gekochteen %s voor €%s', - ['boat_shop_nomoney'] = 'Deze boot kan je niet betalen!', - ['confirm_no'] = 'nee', - ['confirm_yes'] = 'ja', +Locales["nl"] = { + -- shop + ["boat_shop"] = "boten winkel", + ["boat_shop_open"] = "Druk op [E] tom de boten winkelte openen.", + ["boat_shop_confirm"] = 'Koop %s voor €%s?', + ["boat_shop_bought"] = "Je hebt een gekochteen %s voor €%s", + ["boat_shop_nomoney"] = "Deze boot kan je niet betalen!", + ["confirm_no"] = "nee", + ["confirm_yes"] = "ja", - -- garage - ['garage'] = 'boten garage', - ['garage_open'] = 'Druk op [E] om je boten garagete openen.', - ['garage_store'] = 'Druk op [E] om je boot op te slaan.', - ['garage_taken'] = 'de boot staat klaar!', - ['garage_stored'] = 'de boot is opgeslagen in je garage!', - ['garage_noboats'] = 'je hebt geen opgeslagen boten! Ga naar de boten winkel om er een te kopen.', - ['garage_blocked'] = 'de boot kan er niet uit omdat iets het spawnpunt blokkeerd!', - ['garage_notowner'] = 'je bent geen eigenaar van deze boot!', + -- garage + ["garage"] = "boten garage", + ["garage_open"] = "Druk op [E] om je boten garagete openen.", + ["garage_store"] = "Druk op [E] om je boot op te slaan.", + ["garage_taken"] = "de boot staat klaar!", + ["garage_stored"] = "de boot is opgeslagen in je garage!", + ["garage_noboats"] = "je hebt geen opgeslagen boten! Ga naar de boten winkel om er een te kopen.", + ["garage_blocked"] = "de boot kan er niet uit omdat iets het spawnpunt blokkeerd!", + ["garage_notowner"] = "je bent geen eigenaar van deze boot!", - -- license - ['license_menu'] = 'Koop Vaarbewijs?', - ['license_buy_no'] = 'nee', - ['license_buy_yes'] = 'Koop vaarbewijs €%s', - ['license_bought'] = 'je kocht het Vaar Bewijs voor €%s', - ['license_nomoney'] = 'je kan het Vaar Bewijsniet betalen! ', + -- license + ["license_menu"] = "Koop Vaarbewijs?", + ["license_buy_no"] = "nee", + ["license_buy_yes"] = 'Koop vaarbewijs €%s', + ["license_bought"] = "je kocht het Vaar Bewijs voor €%s", + ["license_nomoney"] = "je kan het Vaar Bewijsniet betalen! ", - -- blips - ['blip_garage'] = 'boten garage', - ['blip_shop'] = 'boten winkel', + -- blips + ["blip_garage"] = "boten garage", + ["blip_shop"] = "boten winkel", } diff --git a/server-data/resources/[esx_addons]/esx_boat/locales/pl.lua b/server-data/resources/[esx_addons]/esx_boat/locales/pl.lua index aae3369fd..35406f8ca 100644 --- a/server-data/resources/[esx_addons]/esx_boat/locales/pl.lua +++ b/server-data/resources/[esx_addons]/esx_boat/locales/pl.lua @@ -1,31 +1,31 @@ -Locales['pl'] = { - -- shop - ['boat_shop'] = 'sklep z łodziami', - ['boat_shop_open'] = 'naciśnij [E] aby otworzyć sklep z łodziami.', - ['boat_shop_confirm'] = 'kup %s za $%s?', - ['boat_shop_bought'] = 'zakupiłeś/aś %s za $%s', - ['boat_shop_nomoney'] = 'nie posiadasz ~r~wystarczająco pieniędzy aby zakupić te łódź!', - ['confirm_no'] = 'nie', - ['confirm_yes'] = 'tak', +Locales["pl"] = { + -- shop + ["boat_shop"] = "sklep z łodziami", + ["boat_shop_open"] = "naciśnij [E] aby otworzyć sklep z łodziami.", + ["boat_shop_confirm"] = 'kup %s za $%s?', + ["boat_shop_bought"] = "zakupiłeś/aś %s za $%s", + ["boat_shop_nomoney"] = "nie posiadasz ~r~wystarczająco pieniędzy aby zakupić te łódź!", + ["confirm_no"] = "nie", + ["confirm_yes"] = "tak", - -- garage - ['garage'] = 'garaż: Lodzie', - ['garage_open'] = 'naciśnij [E] aby otworzyć garaż z łodziami.', - ['garage_store'] = 'naciśnij [E] aby schować swoją łódź do garażu', - ['garage_taken'] = 'łódź zostałą wyjęta z garażu', - ['garage_stored'] = 'łódź została schowana do garażu', - ['garage_noboats'] = 'nie posiadasz żadnych łodzi!', - ['garage_blocked'] = 'łódź nie może zostać wyjęta dlatego że coś blokuje jej miejsce narodzenia', - ['garage_notowner'] = 'nie jesteś właścicielem tej łodzi!', + -- garage + ["garage"] = "garaż: Lodzie", + ["garage_open"] = "naciśnij [E] aby otworzyć garaż z łodziami.", + ["garage_store"] = "naciśnij [E] aby schować swoją łódź do garażu", + ["garage_taken"] = "łódź zostałą wyjęta z garażu", + ["garage_stored"] = "łódź została schowana do garażu", + ["garage_noboats"] = "nie posiadasz żadnych łodzi!", + ["garage_blocked"] = "łódź nie może zostać wyjęta dlatego że coś blokuje jej miejsce narodzenia", + ["garage_notowner"] = "nie jesteś właścicielem tej łodzi!", - -- license - ['license_menu'] = 'kup licencje na płwanie łodziami?', - ['license_buy_no'] = 'nie', - ['license_buy_yes'] = 'kup licencje na pływanie łodziami $%s', - ['license_bought'] = 'zakupiłeś/aś licencje na pływanie łodziami za $%s', - ['license_nomoney'] = 'nie posiadasz ~r~wystarczająco pieniędzy aby zakupić licencje na pływanie łodziami!', + -- license + ["license_menu"] = "kup licencje na płwanie łodziami?", + ["license_buy_no"] = "nie", + ["license_buy_yes"] = 'kup licencje na pływanie łodziami $%s', + ["license_bought"] = "zakupiłeś/aś licencje na pływanie łodziami za $%s", + ["license_nomoney"] = "nie posiadasz ~r~wystarczająco pieniędzy aby zakupić licencje na pływanie łodziami!", - -- blips - ['blip_garage'] = 'garaż: Lodzie', - ['blip_shop'] = 'sklep z łodziami', + -- blips + ["blip_garage"] = "garaż: Lodzie", + ["blip_shop"] = "sklep z łodziami", } diff --git a/server-data/resources/[esx_addons]/esx_boat/locales/si.lua b/server-data/resources/[esx_addons]/esx_boat/locales/si.lua index 2db7b3bac..6ad7d2d60 100644 --- a/server-data/resources/[esx_addons]/esx_boat/locales/si.lua +++ b/server-data/resources/[esx_addons]/esx_boat/locales/si.lua @@ -1,31 +1,31 @@ -Locales['si'] = { - -- trgovina - ['boat_shop'] = 'trgovina s čolni', - ['boat_shop_open'] = 'pritisnite [E] za dostop do boat shop.', - ['boat_shop_confirm'] = 'kupi %s za $%s?', - ['boat_shop_bought'] = 'ste kupili a %s za $%s', - ['boat_shop_nomoney'] = 'tega čolna si ne morete ~r~privoliti~!', - ['confirm_no'] = 'ne', - ['confirm_yes'] = 'da', +Locales["si"] = { + -- trgovina + ["boat_shop"] = "trgovina s čolni", + ["boat_shop_open"] = "pritisnite [E] za dostop do boat shop.", + ["boat_shop_confirm"] = 'kupi %s za $%s?', + ["boat_shop_bought"] = "ste kupili a %s za $%s", + ["boat_shop_nomoney"] = "tega čolna si ne morete ~r~privoliti~!", + ["confirm_no"] = "ne", + ["confirm_yes"] = "da", - -- garaža - ['garaža'] = 'garaža za čoln', - ['garage_open'] = 'pritisnite [E] za dostop do vaše garage~čolna~.', - ['garage_store'] = 'pritisnite [E], da shranite~čoln v svoji garaži.', - ['garage_taken'] = 'čoln je bil odpeljan!', - ['garage_stored'] = 'čoln je bil varno shranjen v vaši garaži!', - ['garage_noboats'] = 'Nimate shranjenih čolnov! Obiščite trgovine za čolne in jih kupite.', - ['garage_blocked'] = 'čolna ni mogoče odpeljati, ker drugo vozilo blokira drstitveno točko!', - ['garage_notowner'] = 'niste lastnik tega čolna!', + -- garaža + ["garaža"] = "garaža za čoln", + ["garage_open"] = "pritisnite [E] za dostop do vaše garage~čolna~.", + ["garage_store"] = "pritisnite [E], da shranite~čoln v svoji garaži.", + ["garage_taken"] = "čoln je bil odpeljan!", + ["garage_stored"] = "čoln je bil varno shranjen v vaši garaži!", + ["garage_noboats"] = "Nimate shranjenih čolnov! Obiščite trgovine za čolne in jih kupite.", + ["garage_blocked"] = "čolna ni mogoče odpeljati, ker drugo vozilo blokira drstitveno točko!", + ["garage_notowner"] = "niste lastnik tega čolna!", - -- licenca - ['license_menu'] = 'kupiti licenco za čoln?', - ['license_buy_no'] = 'ne', - ['license_buy_yes'] = 'kupi licenco za čoln $%s', - ['license_bought'] = 'kupili ste licenco čoln za $%s', - ['license_nomoney'] = 'ne morete ~r~privoliti~~čolnske licence!', + -- licenca + ["license_menu"] = "kupiti licenco za čoln?", + ["license_buy_no"] = "ne", + ["license_buy_yes"] = 'kupi licenco za čoln $%s', + ["license_bought"] = "kupili ste licenco čoln za $%s", + ["license_nomoney"] = "ne morete ~r~privoliti~~čolnske licence!", - -- mehurčki - ['blip_garage'] = 'garaža za čoln', - ['blip_shop'] = 'trgovina s čolni', -} \ No newline at end of file + -- mehurčki + ["blip_garage"] = "garaža za čoln", + ["blip_shop"] = "trgovina s čolni", +} diff --git a/server-data/resources/[esx_addons]/esx_boat/locales/sv.lua b/server-data/resources/[esx_addons]/esx_boat/locales/sv.lua index bb51837fe..403a2dde2 100644 --- a/server-data/resources/[esx_addons]/esx_boat/locales/sv.lua +++ b/server-data/resources/[esx_addons]/esx_boat/locales/sv.lua @@ -1,31 +1,31 @@ -Locales['sv'] = { - -- shop - ['boat_shop'] = 'båtaffär', - ['boat_shop_open'] = 'tryck [E] för att öppna båtaffären.', - ['boat_shop_confirm'] = 'köp %s för %s SEK?', - ['boat_shop_bought'] = 'du har köpt en %s för %s SEK', - ['boat_shop_nomoney'] = 'du har ~r~inte råd för denna båt!', - ['confirm_no'] = 'nej', - ['confirm_yes'] = 'ja', +Locales["sv"] = { + -- shop + ["boat_shop"] = "båtaffär", + ["boat_shop_open"] = "tryck [E] för att öppna båtaffären.", + ["boat_shop_confirm"] = 'köp %s för %s SEK?', + ["boat_shop_bought"] = "du har köpt en %s för %s SEK", + ["boat_shop_nomoney"] = "du har ~r~inte råd för denna båt!", + ["confirm_no"] = "nej", + ["confirm_yes"] = "ja", - -- garage - ['garage'] = 'båtgarage', - ['garage_open'] = 'tryck [E] för att öppna båtgaraget.', - ['garage_store'] = 'tryck [E] för att lagra båten i ditt garage.', - ['garage_taken'] = 'båten har släppts från garaget!', - ['garage_stored'] = 'båten har lagrats i garaget!', - ['garage_noboats'] = 'du har inga lagrade båtar! Besök båtaffären för att köpa båtar.', - ['garage_blocked'] = 'båten kan inte tas ur på grund av att en annan båt blokerar spawnpointen!', - ['garage_notowner'] = 'du äger inte denna båt!', + -- garage + ["garage"] = "båtgarage", + ["garage_open"] = "tryck [E] för att öppna båtgaraget.", + ["garage_store"] = "tryck [E] för att lagra båten i ditt garage.", + ["garage_taken"] = "båten har släppts från garaget!", + ["garage_stored"] = "båten har lagrats i garaget!", + ["garage_noboats"] = "du har inga lagrade båtar! Besök båtaffären för att köpa båtar.", + ["garage_blocked"] = "båten kan inte tas ur på grund av att en annan båt blokerar spawnpointen!", + ["garage_notowner"] = "du äger inte denna båt!", - -- license - ['license_menu'] = 'köpa båtlicens?', - ['license_buy_no'] = 'nej', - ['license_buy_yes'] = 'köp båtlicens %s SEK', - ['license_bought'] = 'du köpte båtlicensen för %s SEK', - ['license_nomoney'] = 'du har ~r~inte råd för båtlicensen!', + -- license + ["license_menu"] = "köpa båtlicens?", + ["license_buy_no"] = "nej", + ["license_buy_yes"] = 'köp båtlicens %s SEK', + ["license_bought"] = "du köpte båtlicensen för %s SEK", + ["license_nomoney"] = "du har ~r~inte råd för båtlicensen!", - -- blips - ['blip_garage'] = 'båtgarage', - ['blip_shop'] = 'båtaffär', + -- blips + ["blip_garage"] = "båtgarage", + ["blip_shop"] = "båtaffär", } diff --git a/server-data/resources/[esx_addons]/esx_boat/server/main.lua b/server-data/resources/[esx_addons]/esx_boat/server/main.lua index 98526c607..f074f2aed 100644 --- a/server-data/resources/[esx_addons]/esx_boat/server/main.lua +++ b/server-data/resources/[esx_addons]/esx_boat/server/main.lua @@ -1,107 +1,107 @@ function ParkBoats() - MySQL.update('UPDATE owned_vehicles SET `stored` = true WHERE `stored` = false AND type = @type', { - ['@type'] = 'boat' - }, function (rowsChanged) - if rowsChanged > 0 then - print(('[^2INFO^7] Stored ^5%s^7 %s !'):format(rowsChanged, rowsChanged > 1 and 'boats' or 'boat')) - end - end) + MySQL.update("UPDATE owned_vehicles SET `stored` = true WHERE `stored` = false AND type = @type", { + ["@type"] = "boat", + }, function(rowsChanged) + if rowsChanged > 0 then + print(("[^2INFO^7] Stored ^5%s^7 %s !"):format(rowsChanged, rowsChanged > 1 and "boats" or "boat")) + end + end) end MySQL.ready(function() - ParkBoats() + ParkBoats() end) -ESX.RegisterServerCallback('esx_boat:buyBoat', function(source, cb, vehicleProps) - local xPlayer = ESX.GetPlayerFromId(source) - local price = getPriceFromModel(vehicleProps.model) - - -- vehicle model not found - if price == 0 then - print(('[^2INFO^7] Player ^5%s^7 Attempted To Exploit Shop'):format(xPlayer.source)) - cb(false) - else - if xPlayer.getMoney() >= price then - xPlayer.removeMoney(price, "Boat Purchase") - - MySQL.update('INSERT INTO owned_vehicles (owner, plate, vehicle, type, `stored`) VALUES (@owner, @plate, @vehicle, @type, @stored)', { - ['@owner'] = xPlayer.identifier, - ['@plate'] = vehicleProps.plate, - ['@vehicle'] = json.encode(vehicleProps), - ['@type'] = 'boat', - ['@stored'] = true - }, function() - cb(true) - end) - else - cb(false) - end - end +ESX.RegisterServerCallback("esx_boat:buyBoat", function(source, cb, vehicleProps) + local xPlayer = ESX.GetPlayerFromId(source) + local price = getPriceFromModel(vehicleProps.model) + + -- vehicle model not found + if price == 0 then + print(("[^2INFO^7] Player ^5%s^7 Attempted To Exploit Shop"):format(xPlayer.source)) + cb(false) + else + if xPlayer.getMoney() >= price then + xPlayer.removeMoney(price, "Boat Purchase") + + MySQL.update("INSERT INTO owned_vehicles (owner, plate, vehicle, type, `stored`) VALUES (@owner, @plate, @vehicle, @type, @stored)", { + ["@owner"] = xPlayer.identifier, + ["@plate"] = vehicleProps.plate, + ["@vehicle"] = json.encode(vehicleProps), + ["@type"] = "boat", + ["@stored"] = true, + }, function() + cb(true) + end) + else + cb(false) + end + end end) -RegisterServerEvent('esx_boat:takeOutVehicle') -AddEventHandler('esx_boat:takeOutVehicle', function(plate) - local xPlayer = ESX.GetPlayerFromId(source) - - MySQL.update('UPDATE owned_vehicles SET `stored` = @stored WHERE owner = @owner AND plate = @plate', { - ['@stored'] = false, - ['@owner'] = xPlayer.identifier, - ['@plate'] = plate - }, function(rowsChanged) - if rowsChanged == 0 then - print(('[^2INFO^7] Player ^5%s^7 Attempted To Exploit Garage'):format(xPlayer.source)) - end - end) +RegisterServerEvent("esx_boat:takeOutVehicle") +AddEventHandler("esx_boat:takeOutVehicle", function(plate) + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.update("UPDATE owned_vehicles SET `stored` = @stored WHERE owner = @owner AND plate = @plate", { + ["@stored"] = false, + ["@owner"] = xPlayer.identifier, + ["@plate"] = plate, + }, function(rowsChanged) + if rowsChanged == 0 then + print(("[^2INFO^7] Player ^5%s^7 Attempted To Exploit Garage"):format(xPlayer.source)) + end + end) end) -ESX.RegisterServerCallback('esx_boat:storeVehicle', function (source, cb, plate) - local xPlayer = ESX.GetPlayerFromId(source) +ESX.RegisterServerCallback("esx_boat:storeVehicle", function(source, cb, plate) + local xPlayer = ESX.GetPlayerFromId(source) - MySQL.update('UPDATE owned_vehicles SET `stored` = @stored WHERE owner = @owner AND plate = @plate', { - ['@stored'] = true, - ['@owner'] = xPlayer.identifier, - ['@plate'] = plate - }, function(rowsChanged) - cb(rowsChanged) - end) + MySQL.update("UPDATE owned_vehicles SET `stored` = @stored WHERE owner = @owner AND plate = @plate", { + ["@stored"] = true, + ["@owner"] = xPlayer.identifier, + ["@plate"] = plate, + }, function(rowsChanged) + cb(rowsChanged) + end) end) -ESX.RegisterServerCallback('esx_boat:getGarage', function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) +ESX.RegisterServerCallback("esx_boat:getGarage", function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) - MySQL.query('SELECT vehicle FROM owned_vehicles WHERE owner = @owner AND type = @type AND `stored` = @stored', { - ['@owner'] = xPlayer.identifier, - ['@type'] = 'boat', - ['@stored'] = true - }, function(result) - local vehicles = {} + MySQL.query("SELECT vehicle FROM owned_vehicles WHERE owner = @owner AND type = @type AND `stored` = @stored", { + ["@owner"] = xPlayer.identifier, + ["@type"] = "boat", + ["@stored"] = true, + }, function(result) + local vehicles = {} - for i=1, #result, 1 do - table.insert(vehicles, result[i].vehicle) - end + for i = 1, #result, 1 do + table.insert(vehicles, result[i].vehicle) + end - cb(vehicles) - end) + cb(vehicles) + end) end) -ESX.RegisterServerCallback('esx_boat:buyBoatLicense', function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) +ESX.RegisterServerCallback("esx_boat:buyBoatLicense", function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) - if xPlayer.getMoney() >= Config.LicensePrice then - xPlayer.removeMoney(Config.LicensePrice, "Boat License Purchase") + if xPlayer.getMoney() >= Config.LicensePrice then + xPlayer.removeMoney(Config.LicensePrice, "Boat License Purchase") - TriggerEvent('esx_license:addLicense', source, 'boat', function() - cb(true) - end) - else - cb(false) - end + TriggerEvent("esx_license:addLicense", source, "boat", function() + cb(true) + end) + else + cb(false) + end end) function getPriceFromModel(model) - for _,v in ipairs(Config.Vehicles) do - if GetHashKey(v.model) == model then - return v.price - end - end -end \ No newline at end of file + for _, v in ipairs(Config.Vehicles) do + if GetHashKey(v.model) == model then + return v.price + end + end +end