From 4c1c74b58250e37eec3ba1585b3fe8ef037256f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 1 Aug 2017 14:29:55 +0200 Subject: [PATCH 01/99] 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..529a923a --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# fxserver-esx_property +FXServer ESX Property From cedd80f21752a2eee4a7111ef4d33a549a029f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 1 Aug 2017 14:33:45 +0200 Subject: [PATCH 02/99] Update README.md --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 529a923a..591c5977 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,25 @@ # fxserver-esx_property FXServer ESX Property + +[REQUIREMENTS] + +- instance => https://github.com/FXServer-ESX/fxserver-instance +- cron => https://github.com/FXServer-ESX/fxserver-cron +- esx_addonaccount => https://github.com/FXServer-ESX/fxserver-esx_addonaccount +- esx_addoninventory => https://github.com/FXServer-ESX/fxserver-esx_addoninventory +- 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_property esx_property +``` +3) Import esx_property.sql in your database +4) Add this in your server.cfg : + +``` +start esx_property +``` + From 32575d64f83108e41e473e849fea754432a0a85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 1 Aug 2017 14:43:08 +0200 Subject: [PATCH 03/99] Add files --- __resource.lua | 14 + client/main.lua | 1024 ++++++++++++++++++++++++++++++++++++++++++++++ config.lua | 9 + esx_property.sql | 76 ++++ server/main.lua | 560 +++++++++++++++++++++++++ 5 files changed, 1683 insertions(+) create mode 100644 __resource.lua create mode 100644 client/main.lua create mode 100644 config.lua create mode 100644 esx_property.sql create mode 100644 server/main.lua diff --git a/__resource.lua b/__resource.lua new file mode 100644 index 00000000..5660501e --- /dev/null +++ b/__resource.lua @@ -0,0 +1,14 @@ +resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' + +description 'ESX Property' + +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..1be6f35f --- /dev/null +++ b/client/main.lua @@ -0,0 +1,1024 @@ +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 GUI = {} +GUI.Time = 0 +local OwnedProperties = {} +local Blips = {} +local CurrentProperty = nil +local LastProperty = nil +local LastPart = nil +local HasAlreadyEnteredMarker = false +local CurrentAction = nil +local CurrentActionMsg = '' +local CurrentActionData = {} + +function DrawSub(text, time) + ClearPrints() + SetTextEntry_2('STRING') + AddTextComponentString(text) + DrawSubtitleTimed(time, 1) +end + +function CreateBlips() + + for i=1, #Config.Properties, 1 do + + local property = Config.Properties[i] + + if property.entering ~= nil then + + Blips[property.name] = AddBlipForCoord(property.entering.x, property.entering.y, property.entering.z) + + SetBlipSprite (Blips[property.name], 369) + SetBlipDisplay(Blips[property.name], 4) + SetBlipScale (Blips[property.name], 1.0) + SetBlipAsShortRange(Blips[property.name], true) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentString("Propriété libre") + EndTextCommandSetBlipName(Blips[property.name]) + + end + end + +end + +function GetProperties() + return Config.Properties +end + +function GetProperty(name) + + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name == name then + return Config.Properties[i] + end + end + +end + +function GetGateway(property) + + for i=1, #Config.Properties, 1 do + + local property2 = Config.Properties[i] + + if property2.isGateway and property2.name == property.gateway then + return property2 + end + + end + +end + +function GetGatewayProperties(property) + + local properties = {} + + for i=1, #Config.Properties, 1 do + if Config.Properties[i].gateway == property.name then + table.insert(properties, Config.Properties[i]) + end + end + + return properties + +end + +function EnterProperty(name) + + local property = GetProperty(name) + local playerPed = GetPlayerPed(-1) + CurrentProperty = property + + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name ~= name then + Config.Properties[i].disabled = true + end + end + + TriggerServerEvent('esx_property:saveLastProperty', name) + + TriggerEvent('instance:get', function(instance) + if instance.host == nil then + TriggerEvent('instance:create') + end + end) + + Citizen.CreateThread(function() + + DoScreenFadeOut(800) + + while not IsScreenFadedOut() do + Citizen.Wait(0) + end + + for i=1, #property.ipls, 1 do + + RequestIpl(property.ipls[i]) + + while not IsIplActive(property.ipls[i]) do + Citizen.Wait(0) + end + + end + + SetEntityCoords(playerPed, property.inside.x, property.inside.y, property.inside.z) + + DoScreenFadeIn(800) + + DrawSub(property.label, 5000) + end) + +end + +function ExitProperty(name) + + local property = GetProperty(name) + local playerPed = GetPlayerPed(-1) + local outside = nil + CurrentProperty = nil + + if property.isSingle then + outside = property.outside + else + outside = GetGateway(property).outside + end + + TriggerServerEvent('esx_property:deleteLastProperty') + + Citizen.CreateThread(function() + + DoScreenFadeOut(800) + + while not IsScreenFadedOut() do + Citizen.Wait(0) + end + + SetEntityCoords(playerPed, outside.x, outside.y, outside.z) + + TriggerEvent('instance:get', function(instance) + if instance.host ~= nil then + TriggerEvent('instance:leave') + end + end) + + for i=1, #property.ipls, 1 do + RemoveIpl(property.ipls[i]) + end + + for i=1, #Config.Properties, 1 do + Config.Properties[i].disabled = false + end + + DoScreenFadeIn(800) + + end) + +end + +function SetPropertyOwned(name, owned) + + local property = GetProperty(name) + local entering = nil + local enteringName = nil + + if property.isSingle then + entering = property.entering + enteringName = property.name + else + local gateway = GetGateway(property) + entering = gateway.entering + enteringName = gateway.name + end + + if owned then + + OwnedProperties[name] = true + + RemoveBlip(Blips[enteringName]) + + Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) + + SetBlipSprite(Blips[enteringName], 357) + SetBlipAsShortRange(Blips[enteringName], true) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentString("Propriété") + EndTextCommandSetBlipName(Blips[enteringName]) + + else + + OwnedProperties[name] = nil + + local found = false + + for k,v in pairs(OwnedProperties) do + + local _property = GetProperty(k) + local _gateway = GetGateway(_property) + + if _gateway ~= nil then + + if _gateway.name == enteringName then + found = true + break + end + end + + end + + if not found then + + RemoveBlip(Blips[enteringName]) + + Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) + + SetBlipSprite(Blips[enteringName], 369) + SetBlipAsShortRange(Blips[enteringName], true) + + BeginTextCommandSetBlipName("STRING") + AddTextComponentString("Propriété libre") + EndTextCommandSetBlipName(Blips[enteringName]) + + end + + end + +end + +function PropertyIsOwned(property) + return OwnedProperties[property.name] == true +end + +function OpenPropertyMenu(property) + + local elements = {} + + if PropertyIsOwned(property) then + + table.insert(elements, {label = 'Entrer', value = 'enter'}) + + if not Config.EnablePlayerManagement then + table.insert(elements, {label = 'Rendre', value = 'leave'}) + end + + else + + if not Config.EnablePlayerManagement then + table.insert(elements, {label = 'Acheter', value = 'buy'}) + table.insert(elements, {label = 'Louer', value = 'rent'}) + end + + table.insert(elements, {label = 'Visiter', value = 'visit'}) + + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'property', + { + title = property.label, + align = 'top-left', + elements = elements, + }, + function(data2, menu) + + menu.close() + + if data2.current.value == 'enter' then + EnterProperty(property.name) + end + + if data2.current.value == 'leave' then + TriggerServerEvent('esx_property:removeOwnedProperty', property.name) + end + + if data2.current.value == 'buy' then + TriggerServerEvent('esx_property:buyProperty', property.name) + end + + if data2.current.value == 'rent' then + TriggerServerEvent('esx_property:rentProperty', property.name) + end + + if data2.current.value == 'visit' then + EnterProperty(property.name) + end + + end, + function(data, menu) + + menu.close() + + CurrentAction = 'property_menu' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionData = {property = property} + end + ) + +end + +function OpenGatewayMenu(property) + + if Config.EnablePlayerManagement then + OpenGatewayOwnedPropertiesMenu(gatewayProperties) + else + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'gateway', + { + title = property.name, + align = 'top-left', + elements = { + {label = 'Propriétés acquises', value = 'owned_properties'}, + {label = 'Propriétés disponibles', value = 'available_properties'}, + } + }, + function(data, menu) + + if data.current.value == 'owned_properties' then + OpenGatewayOwnedPropertiesMenu(property) + end + + if data.current.value == 'available_properties' then + OpenGatewayAvailablePropertiesMenu(property) + end + + end, + function(data, menu) + + menu.close() + + CurrentAction = 'gateway_menu' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionData = {property = property} + + end + ) + + end + +end + +function OpenGatewayOwnedPropertiesMenu(property) + + local gatewayProperties = GetGatewayProperties(property) + local elements = {} + + for i=1, #gatewayProperties, 1 do + + if PropertyIsOwned(gatewayProperties[i]) then + table.insert(elements, { + label = gatewayProperties[i].label, + value = gatewayProperties[i].name + }) + end + + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'gateway_owned_properties', + { + title = property.name .. ' - Propriétés Acquises', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + menu.close() + + local elements = { + {label = 'Entrer', value = 'enter'} + } + + if not Config.EnablePlayerManagement then + table.insert(elements, {label = 'Rendre', value = 'leave'}) + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'gateway_owned_properties_actions', + { + title = data.current.label, + align = 'top-left', + elements = elements, + }, + function(data2, menu) + + menu.close() + + if data2.current.value == 'enter' then + EnterProperty(data.current.value) + end + + if data2.current.value == 'leave' then + TriggerServerEvent('esx_property:removeOwnedProperty', data.current.value) + end + + end, + function(data, menu) + menu.close() + end + ) + + end, + function(data, menu) + menu.close() + end + ) + +end + +function OpenGatewayAvailablePropertiesMenu(property) + + local gatewayProperties = GetGatewayProperties(property) + local elements = {} + + for i=1, #gatewayProperties, 1 do + + if not PropertyIsOwned(gatewayProperties[i]) then + table.insert(elements, { + label = gatewayProperties[i].label .. ' $' .. gatewayProperties[i].price, + value = gatewayProperties[i].name, + price = gatewayProperties[i].price + }) + end + + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'gateway_available_properties', + { + title = property.name.. ' - Propriétés Disponbibles', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + menu.close() + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'gateway_available_properties_actions', + { + title = property.name, + align = 'top-left', + elements = { + {label = 'Acheter', value = 'buy'}, + {label = 'Louer', value = 'rent'}, + {label = 'Visiter', value = 'visit'}, + }, + }, + function(data2, menu) + menu.close() + + if data2.current.value == 'buy' then + TriggerServerEvent('esx_property:buyProperty', data.current.value) + end + + if data2.current.value == 'rent' then + TriggerServerEvent('esx_property:rentProperty', data.current.value) + end + + if data2.current.value == 'visit' then + EnterProperty(data.current.value) + end + + end, + function(data, menu) + menu.close() + end + ) + + end, + function(data, menu) + menu.close() + end + ) + +end + +function OpenRoomMenu(property) + + local entering = nil + + if property.isSingle then + entering = property.entering + else + entering = GetGateway(property).entering + end + + ESX.UI.Menu.CloseAll() + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'room', + { + title = property.label, + align = 'top-left', + elements = { + {label = 'Inviter un joueur', value = 'invite_player'}, + {label = 'Dressing', value = 'player_dressing'}, + {label = 'Retirer objet', value = 'room_inventory'}, + {label = 'Déposer objet', value = 'player_inventory'}, + }, + }, + function(data, menu) + + if data.current.value == 'invite_player' then + + local playersInArea = ESX.Game.GetPlayersInArea(entering, 10.0) + local elements = {} + + for i=1, #playersInArea, 1 do + if playersInArea[i] ~= PlayerId() then + table.insert(elements, {label = GetPlayerName(playersInArea[i]), value = playersInArea[i]}) + end + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'room_invite', + { + title = property.label .. ' - Invite', + align = 'top-left', + elements = elements, + }, + function(data, menu) + TriggerEvent('instance:invite', GetPlayerServerId(data.current.value), property.inside) + end, + function(data, menu) + menu.close() + end + ) + + end + + if data.current.value == 'player_dressing' then + + ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) + + local elements = {} + + for i=1, #dressing, 1 do + table.insert(elements, {label = dressing[i].label, value = dressing[i].skin}) + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'player_dressing', + { + title = property.label .. ' - Dressing', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + TriggerEvent('skinchanger:getSkin', function(skin) + + TriggerEvent('skinchanger:loadClothes', skin, data.current.value) + + TriggerEvent('skinchanger:getSkin', function(skin) + TriggerServerEvent('esx_skin:save', skin) + end) + + end) + + end, + function(data, menu) + menu.close() + end + ) + + end) + + end + + if data.current.value == 'room_inventory' then + OpenRoomInventoryMenu(property) + end + + if data.current.value == 'player_inventory' then + OpenPlayerInventoryMenu(property) + end + + end, + function(data, menu) + + menu.close() + + CurrentAction = 'room_menu' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionData = {property = property} + end + ) + +end + +function OpenRoomInventoryMenu(property) + + ESX.TriggerServerCallback('esx_property:getPropertyInventory', function(inventory) + + local elements = {} + + table.insert(elements, {label = 'Argent sale $' .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) + + 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 + + end + + for i=1, #inventory.weapons, 1 do + local weapon = inventory.weapons[i] + table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name) .. ' [' .. weapon.ammo .. ']', type = 'item_weapon', value = weapon.name, ammo = weapon.ammo}) + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'room_inventory', + { + title = property.label .. ' - Inventaire', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + if data.current.type == 'item_weapon' then + + menu.close() + + TriggerServerEvent('esx_property:getItem', data.current.type, data.current.value, data.current.ammo) + + ESX.SetTimeout(300, function() + OpenRoomInventoryMenu(property) + end) + + else + + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'get_item_count', + { + title = 'Quantité ?', + }, + function(data2, menu) + + local quantity = tonumber(data2.value) + + if quantity == nil then + ESX.ShowNotification('Montant invalide') + else + + menu.close() + + TriggerServerEvent('esx_property:getItem', data.current.type, data.current.value, quantity) + + ESX.SetTimeout(300, function() + OpenRoomInventoryMenu(property) + end) + + end + + end, + function(data2,menu) + menu.close() + end + ) + + end + + end, + function(data, menu) + menu.close() + end + ) + + end) + +end + +function OpenPlayerInventoryMenu(property) + + ESX.TriggerServerCallback('esx_property:getPlayerInventory', function(inventory) + + local elements = {} + + table.insert(elements, {label = 'Argent sale $' .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) + + 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 + + end + + 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 .. ' [' .. ammo .. ']', type = 'item_weapon', value = weaponList[i].name, ammo = ammo}) + end + + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'player_inventory', + { + title = property.label .. ' - Inventaire', + align = 'top-left', + elements = elements, + }, + function(data, menu) + + if data.current.type == 'item_weapon' then + + menu.close() + + TriggerServerEvent('esx_property:putItem', data.current.type, data.current.value, data.current.ammo) + + ESX.SetTimeout(300, function() + OpenPlayerInventoryMenu(property) + end) + + else + + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'put_item_count', + { + title = 'Quantité ?', + }, + function(data2, menu) + + menu.close() + + TriggerServerEvent('esx_property:putItem', data.current.type, data.current.value, tonumber(data2.value)) + + ESX.SetTimeout(300, function() + OpenPlayerInventoryMenu(property) + end) + + end, + function(data2,menu) + menu.close() + end + ) + + end + + end, + function(data, menu) + menu.close() + end + ) + + end) + +end + +local FirstSpawn = true + +AddEventHandler('playerSpawned', function() + + if FirstSpawn then + + ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) + if propertyName ~= nil then + EnterProperty(propertyName) + end + end) + + FirstSpawn = false + end + +end) + +AddEventHandler('esx_property:getProperties', function(cb) + cb(GetProperties()) +end) + +AddEventHandler('esx_property:getProperty', function(name, cb) + cb(GetProperty(name)) +end) + +AddEventHandler('esx_property:getGateway', function(property, cb) + cb(GetGateway(property)) +end) + +RegisterNetEvent('esx_property:setPropertyOwned') +AddEventHandler('esx_property:setPropertyOwned', function(name, owned) + SetPropertyOwned(name, owned) +end) + +RegisterNetEvent('esx:playerLoaded') +AddEventHandler('esx:playerLoaded', function(xPlayer) + + ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties) + for i=1, #ownedProperties, 1 do + SetPropertyOwned(ownedProperties[i], true) + end + end) + +end) + +AddEventHandler('esx_property:hasEnteredMarker', function(name, part) + + local property = GetProperty(name) + + if part == 'entering' then + + if property.isSingle then + CurrentAction = 'property_menu' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionData = {property = property} + else + CurrentAction = 'gateway_menu' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionData = {property = property} + end + + end + + if part == 'exit' then + ExitProperty(name) + end + + if part == 'roomMenu' then + CurrentAction = 'room_menu' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionData = {property = property} + end + +end) + +AddEventHandler('esx_property:hasExitedMarker', function(name, part) + ESX.UI.Menu.CloseAll() + CurrentAction = nil +end) + +-- Init +Citizen.CreateThread(function() + + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end + + ESX.TriggerServerCallback('esx_property:getProperties', function(properties) + Config.Properties = properties + CreateBlips() + end) + +end) + +-- Display markers +Citizen.CreateThread(function() + while true do + + Wait(0) + + local coords = GetEntityCoords(GetPlayerPed(-1)) + + for i=1, #Config.Properties, 1 do + + local property = Config.Properties[i] + + if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.DrawDistance) then + DrawMarker(Config.MarkerType, property.entering.x, property.entering.y, property.entering.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 + + if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.DrawDistance) then + DrawMarker(Config.MarkerType, property.exit.x, property.exit.y, property.exit.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 + + if(property.roomMenu ~= nil and PropertyIsOwned(property) and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.DrawDistance) then + DrawMarker(Config.MarkerType, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.RoomMenuMarkerColor.r, Config.RoomMenuMarkerColor.g, Config.RoomMenuMarkerColor.b, 100, false, true, 2, false, false, false, false) + end + + end + + end +end) + +-- Enter / Exit marker events +Citizen.CreateThread(function() + while true do + + Wait(0) + + local coords = GetEntityCoords(GetPlayerPed(-1)) + local isInMarker = false + local currentProperty = nil + local currentPart = nil + + for i=1, #Config.Properties, 1 do + + local property = Config.Properties[i] + + if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'entering' + end + + if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'exit' + end + + if(property.inside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.inside.x, property.inside.y, property.inside.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'inside' + end + + if(property.outside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.outside.x, property.outside.y, property.outside.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'outside' + end + + if(property.roomMenu ~= nil and PropertyIsOwned(property) and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'roomMenu' + end + + end + + if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastProperty ~= currentProperty or LastPart ~= currentPart) ) then + + HasAlreadyEnteredMarker = true + LastProperty = currentProperty + LastPart = currentPart + + TriggerEvent('esx_property:hasEnteredMarker', currentProperty, currentPart) + end + + if not isInMarker and HasAlreadyEnteredMarker then + + HasAlreadyEnteredMarker = false + + TriggerEvent('esx_property:hasExitedMarker', LastProperty, LastPart) + 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 (GetGameTimer() - GUI.Time) > 300 then + + if CurrentAction == 'property_menu' then + OpenPropertyMenu(CurrentActionData.property) + end + + if CurrentAction == 'gateway_menu' then + + if Config.EnablePlayerManagement then + OpenGatewayOwnedPropertiesMenu(CurrentActionData.property) + else + OpenGatewayMenu(CurrentActionData.property) + end + + end + + if CurrentAction == 'room_menu' then + OpenRoomMenu(CurrentActionData.property) + end + + CurrentAction = nil + GUI.Time = GetGameTimer() + + end + + end + + end +end) \ No newline at end of file diff --git a/config.lua b/config.lua new file mode 100644 index 00000000..25c717f8 --- /dev/null +++ b/config.lua @@ -0,0 +1,9 @@ +Config = {} +Config.DrawDistance = 100 +Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} +Config.MarkerColor = {r = 102, g = 102, b = 204} +Config.RoomMenuMarkerColor = {r = 102, g = 204, b = 102} +Config.MarkerType = 1 +Config.Zones = {} +Config.Properties = {} +Config.EnablePlayerManagement = false -- If set to true you need esx_realestateagentjob diff --git a/esx_property.sql b/esx_property.sql new file mode 100644 index 00000000..82419c5b --- /dev/null +++ b/esx_property.sql @@ -0,0 +1,76 @@ +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +); + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"y\":558.667,\"z\":183.297,\"x\":116.392}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','Milla House','{\"y\":834.47540283203,\"z\":234.92024230957,\"x\":-86.692153930664}','{\"y\":422.84088134766,\"z\":144.90005493164,\"x\":372.70159912109}','{\"y\":420.07595825195,\"z\":145.90487670898,\"x\":373.16149902344}','{\"y\":835.64111328125,\"z\":234.7230072021,\"x\":-90.789779663086}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"y\":444.374,\"z\":145.037,\"x\":-212.15144348145}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{\"y\":448.07,\"z\":96.894,\"x\":-1290.834}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"y\":696.314,\"z\":147.784,\"x\":-853.282}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Appartement Moderne 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Appartement Moderne 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Appartement Moderne 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Appartement Mode 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Appartement Mode 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Appartement Mode 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Appartement Vibrant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":211.396}',1300000), + (20,'Vibrant2Apartment','Appartement Vibrant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Appartement Vibrant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Appartement Pèrcant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Appartement Pèrcant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Appartement Pèrcant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Appartement Monochrome 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Appartement Monochrome 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Appartement Monochrome 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Appartement Séduisant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Appartement Séduisant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Appartement Séduisant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Appartement Régal 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Appartement Régal 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Appartement Régal 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Appartement Aqua 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Appartement Aqua 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Appartement Aqua 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + diff --git a/server/main.lua b/server/main.lua new file mode 100644 index 00000000..cff86548 --- /dev/null +++ b/server/main.lua @@ -0,0 +1,560 @@ +ESX = nil + +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +function GetProperty(name) + + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name == name then + return Config.Properties[i] + end + end + +end + +function SetPropertyOwned(name, price, rented, owner) + + MySQL.Async.execute( + 'INSERT INTO owned_properties (name, price, rented, owner) VALUES (@name, @price, @rented, @owner)', + { + ['@name'] = name, + ['@price'] = price, + ['@rented'] = (rented and 1 or 0), + ['@owner'] = owner + }, + function(rowsChanged) + + local xPlayers = ESX.GetPlayers() + + for k,v in pairs(xPlayers) do + if v.identifier == owner then + + TriggerClientEvent('esx_property:setPropertyOwned', v.source, name, true) + + if rented then + TriggerClientEvent('esx:showNotification', v.source, 'Vous avez loué une propriété pour $' .. price) + else + TriggerClientEvent('esx:showNotification', v.source, 'Vous avez acheté une propriété pour $' .. price) + end + + break + end + end + + end + ) + +end + +function RemoveOwnedProperty(name, owner) + + MySQL.Async.execute( + 'DELETE FROM owned_properties WHERE name = @name AND owner = @owner', + { + ['@name'] = name, + ['@owner'] = owner + }, + function(rowsChanged) + + local xPlayers = ESX.GetPlayers() + + for k,v in pairs(xPlayers) do + if v.identifier == owner then + TriggerClientEvent('esx_property:setPropertyOwned', v.source, name, false) + TriggerClientEvent('esx:showNotification', v.source, 'Vous avez rendu une propriété') + break + end + end + + end + ) + +end + +AddEventHandler('onMySQLReady', function () + + MySQL.Async.fetchAll('SELECT * FROM properties', {}, function(properties) + + for i=1, #properties, 1 do + + local entering = nil + local exit = nil + local inside = nil + local outside = nil + local isSingle = nil + local isRoom = nil + local isGateway = nil + local roomMenu = nil + + if properties[i].entering ~= nil then + entering = json.decode(properties[i].entering) + end + + if properties[i].exit ~= nil then + exit = json.decode(properties[i].exit) + end + + if properties[i].inside ~= nil then + inside = json.decode(properties[i].inside) + end + + if properties[i].outside ~= nil then + outside = json.decode(properties[i].outside) + end + + if properties[i].is_single == 0 then + isSingle = false + else + isSingle = true + end + + if properties[i].is_room == 0 then + isRoom = false + else + isRoom = true + end + + if properties[i].is_gateway == 0 then + isGateway = false + else + isGateway = true + end + + if properties[i].room_menu ~= nil then + roomMenu = json.decode(properties[i].room_menu) + end + + table.insert(Config.Properties, { + name = properties[i].name, + label = properties[i].label, + entering = entering, + exit = exit, + inside = inside, + outside = outside, + ipls = json.decode(properties[i].ipls), + gateway = properties[i].gateway, + isSingle = isSingle, + isRoom = isRoom, + isGateway = isGateway, + roomMenu = roomMenu, + price = properties[i].price + }) + + end + + end) + +end) + +AddEventHandler('esx_ownedproperty:getOwnedProperties', function(cb) + + MySQL.Async.fetchAll( + 'SELECT * FROM owned_properties', + {}, + function(result) + + local properties = {} + + for i=1, #result, 1 do + + table.insert(properties, { + id = result[i].id, + name = result[i].name, + price = result[i].price, + rented = (rented == 1 and true or false), + owner = result[i].owner, + }) + end + + cb(properties) + + end + ) + +end) + +AddEventHandler('esx_property:setPropertyOwned', function(name, price, rented, owner) + SetPropertyOwned(name, price, rented, owner) +end) + +AddEventHandler('esx_property:removeOwnedProperty', function(name, owner) + RemoveOwnedProperty(name, owner) +end) + +RegisterServerEvent('esx_property:rentProperty') +AddEventHandler('esx_property:rentProperty', function(propertyName) + + local xPlayer = ESX.GetPlayerFromId(source) + local property = GetProperty(propertyName) + + SetPropertyOwned(propertyName, property.price / 200, true, xPlayer.identifier) + +end) + +RegisterServerEvent('esx_property:buyProperty') +AddEventHandler('esx_property:buyProperty', function(propertyName) + + local xPlayer = ESX.GetPlayerFromId(source) + local property = GetProperty(propertyName) + + if property.price <= xPlayer.get('money') then + + xPlayer.removeMoney(property.price) + SetPropertyOwned(propertyName, property.price, false, xPlayer.identifier) + + else + TriggerClientEvent('esx:showNotification', source, 'Vous n\'avez pas assez d\'argent') + end + +end) + +RegisterServerEvent('esx_property:removeOwnedProperty') +AddEventHandler('esx_property:removeOwnedProperty', function(propertyName) + + local xPlayer = ESX.GetPlayerFromId(source) + + RemoveOwnedProperty(propertyName, xPlayer.identifier) + +end) + +AddEventHandler('esx_property:removeOwnedPropertyIdentifier', function(propertyName, identifier) + RemoveOwnedProperty(propertyName, identifier) +end) + +RegisterServerEvent('esx_property:saveLastProperty') +AddEventHandler('esx_property:saveLastProperty', function(property) + + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.Async.execute( + 'UPDATE users SET last_property = @last_property WHERE identifier = @identifier', + { + ['@last_property'] = property, + ['@identifier'] = xPlayer.identifier + } + ) + +end) + +RegisterServerEvent('esx_property:deleteLastProperty') +AddEventHandler('esx_property:deleteLastProperty', function() + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.Async.execute( + 'UPDATE users SET last_property = NULL WHERE identifier = @identifier', + { + ['@identifier'] = xPlayer.identifier + } + ) +end) + +RegisterServerEvent('esx_property:getItem') +AddEventHandler('esx_property:getItem', function(type, item, count) + + local xPlayer = ESX.GetPlayerFromId(source) + + if type == 'item_standard' then + + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayer.identifier, function(inventory) + + local roomItemCount = inventory.getItem(item).count + + if roomItemCount >= count then + inventory.removeItem(item, count) + xPlayer.addInventoryItem(item, count) + else + TriggerClientEvent('esx:showNotification', source, 'Quantité invalide') + end + + end) + + end + + if type == 'item_account' then + + TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayer.identifier, function(account) + + local roomAccountMoney = account.money + + if roomAccountMoney >= count then + account.removeMoney(count) + xPlayer.addAccountMoney(item, count) + else + TriggerClientEvent('esx:showNotification', source, 'Montant invalide') + end + + end) + + end + + if type == 'item_weapon' then + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + + local storeWeapons = store.get('weapons') + + if storeWeapons == nil then + storeWeapons = {} + end + + local weaponName = nil + local ammo = nil + + for i=1, #storeWeapons, 1 do + if storeWeapons[i].name == item then + + weaponName = storeWeapons[i].name + ammo = storeWeapons[i].ammo + + table.remove(storeWeapons, i) + + break + end + end + + store.set('weapons', storeWeapons) + + xPlayer.addWeapon(weaponName, ammo) + + end) + + end + +end) + +RegisterServerEvent('esx_property:putItem') +AddEventHandler('esx_property:putItem', function(type, item, count) + + local xPlayer = ESX.GetPlayerFromId(source) + + if type == 'item_standard' then + + local playerItemCount = xPlayer.getInventoryItem(item).count + + if playerItemCount >= count then + + xPlayer.removeInventoryItem(item, count) + + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayer.identifier, function(inventory) + inventory.addItem(item, count) + end) + + else + TriggerClientEvent('esx:showNotification', source, 'Quantité invalide') + end + + end + + if type == 'item_account' then + + local playerAccountMoney = xPlayer.getAccount(item).money + + if playerAccountMoney >= count then + + xPlayer.removeAccountMoney(item, count) + + TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayer.identifier, function(account) + account.addMoney(count) + end) + + else + TriggerClientEvent('esx:showNotification', source, 'Montant invalide') + end + + end + + if type == 'item_weapon' then + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + + local storeWeapons = store.get('weapons') + + if storeWeapons == nil then + storeWeapons = {} + end + + table.insert(storeWeapons, { + name = item, + ammo = count + }) + + store.set('weapons', storeWeapons) + + xPlayer.removeWeapon(item) + + end) + + end + +end) + +ESX.RegisterServerCallback('esx_property:getProperties', function(source, cb) + cb(Config.Properties) +end) + +ESX.RegisterServerCallback('esx_property:getOwnedProperties', function(source, cb) + + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.Async.fetchAll( + 'SELECT * FROM owned_properties WHERE owner = @owner', + { + ['@owner'] = xPlayer.identifier + }, + function(ownedProperties) + + local properties = {} + + for i=1, #ownedProperties, 1 do + table.insert(properties, ownedProperties[i].name) + end + + cb(properties) + end + ) + +end) + +ESX.RegisterServerCallback('esx_property:getLastProperty', function(source, cb) + + local xPlayer = ESX.GetPlayerFromId(source) + + MySQL.Async.fetchAll( + 'SELECT * FROM users WHERE identifier = @identifier', + { + ['@identifier'] = xPlayer.identifier + }, + function(users) + cb(users[1].last_property) + end + ) + +end) + +ESX.RegisterServerCallback('esx_property:getPropertyInventory', function(source, cb) + + local xPlayer = ESX.GetPlayerFromId(source) + local blackMoney = 0 + local items = {} + local weapons = {} + + TriggerEvent('esx_addonaccount:getAccount', 'property_black_money', xPlayer.identifier, function(account) + blackMoney = account.money + end) + + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayer.identifier, function(inventory) + items = inventory.items + end) + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + + local storeWeapons = store.get('weapons') + + if storeWeapons ~= nil then + weapons = storeWeapons + end + + end) + + cb({ + blackMoney = blackMoney, + items = items, + weapons = weapons + }) + +end) + +ESX.RegisterServerCallback('esx_property:getPlayerInventory', function(source, cb) + + local xPlayer = ESX.GetPlayerFromId(source) + local blackMoney = xPlayer.getAccount('black_money').money + local items = xPlayer.inventory + + cb({ + blackMoney = blackMoney, + items = items + }) + +end) + +ESX.RegisterServerCallback('esx_property:getPlayerDressing', function(source, cb) + + local xPlayer = ESX.GetPlayerFromId(source) + local dressing = {} + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + + local storeDressing = store.get('dressing') + + if storeDressing ~= nil then + dressing = storeDressing + end + + end) + + cb(dressing) + +end) + +function PayRent(d, h, m) + + MySQL.Async.fetchAll( + 'SELECT * FROM owned_properties WHERE rented = 1', + {}, + function(result) + + local xPlayers = ESX.GetPlayers() + + for i=1, #result, 1 do + + local foundPlayer = false + local xPlayer = nil + + for k,v in pairs(xPlayers) do + if v.identifier == result[i].owner then + foundPlayer = true + xPlayer = v + end + end + + if foundPlayer then + + xPlayer.removeMoney(result[i].price) + TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez ~g~payé~s~ votre loyer : ~g~$' .. result[i].price) + + else + + MySQL.Async.fetchAll( + 'SELECT * FROM users WHERE identifier = @identifier', + { + ['@identifier'] = result[i].owner + }, + function(result2) + + local money = result2[1].money + money = money - result[i].price + + MySQL.Async.execute( + 'UPDATE users SET money = @money WHERE identifier = @identifier', + { + ['@money'] = money, + ['@identifier'] = result[i].owner + } + ) + end + ) + + end + + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) + account.addMoney(result[i].price) + end) + + end + + end + ) + +end + +TriggerEvent('cron:runAt', 22, 0, PayRent) \ No newline at end of file From c3b34569cdae585f09a2d11494c510b5d474f697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 1 Aug 2017 14:54:16 +0200 Subject: [PATCH 04/99] Update SQL --- esx_property.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/esx_property.sql b/esx_property.sql index 82419c5b..877f3498 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -1,3 +1,17 @@ +USE `gta5_gamemode_essential` + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Argent Sale Propriété',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Propriété',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + (1,'property','Propriété',0) +; + CREATE TABLE `owned_properties` ( `id` int(11) NOT NULL AUTO_INCREMENT, From 7ddccc8c273868db42e22c258db64522481b1b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 1 Aug 2017 14:54:59 +0200 Subject: [PATCH 05/99] Update SQL --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index 877f3498..ae820607 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -9,7 +9,7 @@ INSERT INTO `addon_inventory` (name, label, shared) VALUES ; INSERT INTO `datastore` (name, label, shared) VALUES - (1,'property','Propriété',0) + ('property','Propriété',0) ; CREATE TABLE `owned_properties` ( From 3c3be8c6ce8bf02124cd855d06e1ce952c73f907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Tue, 1 Aug 2017 15:42:54 +0200 Subject: [PATCH 06/99] Update SQL --- esx_property.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index ae820607..19c20782 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -1,4 +1,8 @@ -USE `gta5_gamemode_essential` +USE `gta5_gamemode_essential`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; INSERT INTO `addon_account` (name, label, shared) VALUES ('property_black_money','Argent Sale Propriété',0) From 978ffe74f7841b018d43ede00d8aa033d42c5d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 14:10:31 +0200 Subject: [PATCH 07/99] Fix triggerservercallback too early --- client/main.lua | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/client/main.lua b/client/main.lua index 1be6f35f..0da41a9e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -22,6 +22,8 @@ local HasAlreadyEnteredMarker = false local CurrentAction = nil local CurrentActionMsg = '' local CurrentActionData = {} +local FirstSpawn = true +local PlayerLoaded = false function DrawSub(text, time) ClearPrints() @@ -791,16 +793,22 @@ function OpenPlayerInventoryMenu(property) end -local FirstSpawn = true - AddEventHandler('playerSpawned', function() if FirstSpawn then - ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) - if propertyName ~= nil then - EnterProperty(propertyName) + Citizen.CreateThread(function() + + while not PlayerLoaded do + Citizen.Wait(0) end + + ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) + if propertyName ~= nil then + EnterProperty(propertyName) + end + end) + end) FirstSpawn = false @@ -808,6 +816,11 @@ AddEventHandler('playerSpawned', function() end) +RegisterNetEvent('esx:playerLoaded') +AddEventHandler('esx:playerLoaded', function(xPlayer) + PlayerLoaded = true +end) + AddEventHandler('esx_property:getProperties', function(cb) cb(GetProperties()) end) From 7a669782120913f3ca976308c831bcd8ec55eed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 14:20:17 +0200 Subject: [PATCH 08/99] Update esx_property.sql --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index 19c20782..3902765c 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -49,7 +49,7 @@ CREATE TABLE `properties` ( INSERT INTO `properties` VALUES (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"y\":558.667,\"z\":183.297,\"x\":116.392}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','Milla House','{\"y\":834.47540283203,\"z\":234.92024230957,\"x\":-86.692153930664}','{\"y\":422.84088134766,\"z\":144.90005493164,\"x\":372.70159912109}','{\"y\":420.07595825195,\"z\":145.90487670898,\"x\":373.16149902344}','{\"y\":835.64111328125,\"z\":234.7230072021,\"x\":-90.789779663086}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"y\":834.47540283203,\"z\":234.92024230957,\"x\":-86.692153930664}','{\"y\":422.84088134766,\"z\":144.90005493164,\"x\":372.70159912109}','{\"y\":420.07595825195,\"z\":145.90487670898,\"x\":373.16149902344}','{\"y\":835.64111328125,\"z\":234.7230072021,\"x\":-90.789779663086}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"y\":444.374,\"z\":145.037,\"x\":-212.15144348145}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), From ec92041090ada3783229c4da42abea00e0de7398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 15:00:25 +0200 Subject: [PATCH 09/99] Update esx_property.sql --- esx_property.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esx_property.sql b/esx_property.sql index 3902765c..ed5ff2c5 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -66,12 +66,12 @@ INSERT INTO `properties` VALUES (16,'Mody1Apartment','Appartement Mode 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), (17,'Mody2Apartment','Appartement Mode 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), (18,'Mody3Apartment','Appartement Mode 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), - (19,'Vibrant1Apartment','Appartement Vibrant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":211.396}',1300000), + (19,'Vibrant1Apartment','Appartement Vibrant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), (20,'Vibrant2Apartment','Appartement Vibrant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), (21,'Vibrant3Apartment','Appartement Vibrant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), - (22,'Sharp1Apartment','Appartement Pèrcant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), - (23,'Sharp2Apartment','Appartement Pèrcant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), - (24,'Sharp3Apartment','Appartement Pèrcant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Appartement Persan 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Appartement Persan 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Appartement Persan 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), (25,'Monochrome1Apartment','Appartement Monochrome 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), (26,'Monochrome2Apartment','Appartement Monochrome 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), (27,'Monochrome3Apartment','Appartement Monochrome 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), From b5d70e320109349b27ee53686570a06fc6a0353d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 15:07:15 +0200 Subject: [PATCH 10/99] Update esx_property.sql --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index ed5ff2c5..5972de29 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -55,7 +55,7 @@ INSERT INTO `properties` VALUES (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), - (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{\"y\":448.07,\"z\":96.894,\"x\":-1290.834}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":449.541,\"z\":96.902,\"x\":-1289.917}','{\"y\":448.07,\"z\":96.894,\"x\":-1290.834}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"y\":696.314,\"z\":147.784,\"x\":-853.282}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), From 0ed8071194a4ca4a87ab0023f4273b2c056e583b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 15:12:43 +0200 Subject: [PATCH 11/99] Update esx_property.sql --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index 5972de29..ccb7af03 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -55,7 +55,7 @@ INSERT INTO `properties` VALUES (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), - (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":449.541,\"z\":96.902,\"x\":-1289.917}','{\"y\":448.07,\"z\":96.894,\"x\":-1290.834}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"y\":696.314,\"z\":147.784,\"x\":-853.282}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), From ec90b859810dbab95aa43ffef423599cda4f9c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 15:15:31 +0200 Subject: [PATCH 12/99] Update esx_property.sql --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index ccb7af03..c7ad2df0 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -48,7 +48,7 @@ CREATE TABLE `properties` ( ); INSERT INTO `properties` VALUES - (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"y\":558.667,\"z\":183.297,\"x\":116.392}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"y\":558.667,\"z\":182.297,\"x\":116.392}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"y\":834.47540283203,\"z\":234.92024230957,\"x\":-86.692153930664}','{\"y\":422.84088134766,\"z\":144.90005493164,\"x\":372.70159912109}','{\"y\":420.07595825195,\"z\":145.90487670898,\"x\":373.16149902344}','{\"y\":835.64111328125,\"z\":234.7230072021,\"x\":-90.789779663086}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"y\":444.374,\"z\":145.037,\"x\":-212.15144348145}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), From 06f20b3a81bf768bd8d8e68d09306e3668edc3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 15:31:44 +0200 Subject: [PATCH 13/99] Update esx_property.sql --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index c7ad2df0..78dc23a4 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -56,7 +56,7 @@ INSERT INTO `properties` VALUES (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), - (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"y\":696.314,\"z\":147.784,\"x\":-853.282}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), From e935b41c4ba20089e7b37a09217afc2625adaa3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 15:37:58 +0200 Subject: [PATCH 14/99] Update esx_property.sql --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index 78dc23a4..54cc6d33 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -48,7 +48,7 @@ CREATE TABLE `properties` ( ); INSERT INTO `properties` VALUES - (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"y\":558.667,\"z\":182.297,\"x\":116.392}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"y\":834.47540283203,\"z\":234.92024230957,\"x\":-86.692153930664}','{\"y\":422.84088134766,\"z\":144.90005493164,\"x\":372.70159912109}','{\"y\":420.07595825195,\"z\":145.90487670898,\"x\":373.16149902344}','{\"y\":835.64111328125,\"z\":234.7230072021,\"x\":-90.789779663086}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"y\":444.374,\"z\":145.037,\"x\":-212.15144348145}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), From 020bbd1796505c7224a66e338eaea2f0e77c2dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 15:43:40 +0200 Subject: [PATCH 15/99] Update esx_property.sql --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index 54cc6d33..7aaaff3e 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -51,7 +51,7 @@ INSERT INTO `properties` VALUES (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"y\":834.47540283203,\"z\":234.92024230957,\"x\":-86.692153930664}','{\"y\":422.84088134766,\"z\":144.90005493164,\"x\":372.70159912109}','{\"y\":420.07595825195,\"z\":145.90487670898,\"x\":373.16149902344}','{\"y\":835.64111328125,\"z\":234.7230072021,\"x\":-90.789779663086}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), - (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"y\":444.374,\"z\":145.037,\"x\":-212.15144348145}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), From bf8618fee150e8f96a7f4c9941c92f27c4235ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 15:50:05 +0200 Subject: [PATCH 16/99] Update esx_property.sql --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index 7aaaff3e..fe7479c1 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -49,7 +49,7 @@ CREATE TABLE `properties` ( INSERT INTO `properties` VALUES (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"y\":834.47540283203,\"z\":234.92024230957,\"x\":-86.692153930664}','{\"y\":422.84088134766,\"z\":144.90005493164,\"x\":372.70159912109}','{\"y\":420.07595825195,\"z\":145.90487670898,\"x\":373.16149902344}','{\"y\":835.64111328125,\"z\":234.7230072021,\"x\":-90.789779663086}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"y\":422.84088134766,\"z\":144.90005493164,\"x\":372.70159912109}','{\"y\":420.07595825195,\"z\":145.90487670898,\"x\":373.16149902344}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), From 85b4fef217d6f827dcd2f7d818f95536b3be1fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 15:55:17 +0200 Subject: [PATCH 17/99] Update esx_property.sql --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index fe7479c1..d6e8ae83 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -49,7 +49,7 @@ CREATE TABLE `properties` ( INSERT INTO `properties` VALUES (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"y\":422.84088134766,\"z\":144.90005493164,\"x\":372.70159912109}','{\"y\":420.07595825195,\"z\":145.90487670898,\"x\":373.16149902344}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"y\":422.84088134766,\"z\":144.90005493164,\"x\":372.70159912109}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), From 863ad88ecce100e53d3b7dd0c15b87c4d7cc8deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 15:58:24 +0200 Subject: [PATCH 18/99] Update esx_property.sql --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index d6e8ae83..ebd5fb05 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -49,7 +49,7 @@ CREATE TABLE `properties` ( INSERT INTO `properties` VALUES (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"y\":422.84088134766,\"z\":144.90005493164,\"x\":372.70159912109}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), From 8e4b6052ccfdbe393d678ca9f84ccf4bf4869b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 2 Aug 2017 16:03:27 +0200 Subject: [PATCH 19/99] Press [E] to exit property --- client/main.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 0da41a9e..cd7194dd 100644 --- a/client/main.lua +++ b/client/main.lua @@ -868,7 +868,9 @@ AddEventHandler('esx_property:hasEnteredMarker', function(name, part) end if part == 'exit' then - ExitProperty(name) + CurrentAction = 'room_exit' + CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour sortir de la propriété' + CurrentActionData = {propertyName = name} end if part == 'roomMenu' then @@ -1026,6 +1028,10 @@ Citizen.CreateThread(function() OpenRoomMenu(CurrentActionData.property) end + if CurrentAction == 'room_exit' then + ExitProperty(CurrentActionData.propertyName) + end + CurrentAction = nil GUI.Time = GetGameTimer() From 6dcc5f9ef13ee7615dd576c0ee5498f65cfd5edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Mon, 7 Aug 2017 12:19:30 +0200 Subject: [PATCH 20/99] Update esx_property.sql --- esx_property.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esx_property.sql b/esx_property.sql index ebd5fb05..a532e62f 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -1,4 +1,4 @@ -USE `gta5_gamemode_essential`; +USE `essentialmode`; ALTER TABLE `users` ADD COLUMN `last_property` VARCHAR(255) NULL From e1d2884d55e8c0aca5e562ff9c1b089eb26768d4 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:23 +0200 Subject: [PATCH 21/99] 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 e6dd9bfa2b426d22ac09c465031c4b8b436df819 Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Wed, 16 Aug 2017 11:32:40 -0400 Subject: [PATCH 22/99] Multi-language support --- __resource.lua | 6 ++ client/main.lua | 182 ++++++++++++++++++++++++------------------------ config.lua | 1 + locales/en.lua | 30 ++++++++ locales/fr.lua | 30 ++++++++ server/main.lua | 62 ++++++++--------- 6 files changed, 189 insertions(+), 122 deletions(-) create mode 100644 locales/en.lua create mode 100644 locales/fr.lua diff --git a/__resource.lua b/__resource.lua index 5660501e..473a6ccf 100644 --- a/__resource.lua +++ b/__resource.lua @@ -3,12 +3,18 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Property' 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 cd7194dd..36f260bd 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 @@ -41,14 +41,14 @@ function CreateBlips() if property.entering ~= nil then Blips[property.name] = AddBlipForCoord(property.entering.x, property.entering.y, property.entering.z) - + SetBlipSprite (Blips[property.name], 369) SetBlipDisplay(Blips[property.name], 4) SetBlipScale (Blips[property.name], 1.0) SetBlipAsShortRange(Blips[property.name], true) - + BeginTextCommandSetBlipName("STRING") - AddTextComponentString("Propriété libre") + AddTextComponentString(_U('free_prop')) EndTextCommandSetBlipName(Blips[property.name]) end @@ -127,9 +127,9 @@ function EnterProperty(name) end for i=1, #property.ipls, 1 do - + RequestIpl(property.ipls[i]) - + while not IsIplActive(property.ipls[i]) do Citizen.Wait(0) end @@ -215,9 +215,9 @@ function SetPropertyOwned(name, owned) SetBlipSprite(Blips[enteringName], 357) SetBlipAsShortRange(Blips[enteringName], true) - + BeginTextCommandSetBlipName("STRING") - AddTextComponentString("Propriété") + AddTextComponentString(_U('property')) EndTextCommandSetBlipName(Blips[enteringName]) else @@ -232,7 +232,7 @@ function SetPropertyOwned(name, owned) local _gateway = GetGateway(_property) if _gateway ~= nil then - + if _gateway.name == enteringName then found = true break @@ -251,7 +251,7 @@ function SetPropertyOwned(name, owned) SetBlipAsShortRange(Blips[enteringName], true) BeginTextCommandSetBlipName("STRING") - AddTextComponentString("Propriété libre") + AddTextComponentString(_U('free_prop')) EndTextCommandSetBlipName(Blips[enteringName]) end @@ -269,22 +269,22 @@ function OpenPropertyMenu(property) local elements = {} if PropertyIsOwned(property) then - - table.insert(elements, {label = 'Entrer', value = 'enter'}) + + table.insert(elements, {label = _U('enter'), value = 'enter'}) if not Config.EnablePlayerManagement then - table.insert(elements, {label = 'Rendre', value = 'leave'}) + table.insert(elements, {label = _U('leave'), value = 'leave'}) end else if not Config.EnablePlayerManagement then - table.insert(elements, {label = 'Acheter', value = 'buy'}) - table.insert(elements, {label = 'Louer', value = 'rent'}) + table.insert(elements, {label = _U('buy'), value = 'buy'}) + table.insert(elements, {label = _U('rent'), value = 'rent'}) end - table.insert(elements, {label = 'Visiter', value = 'visit'}) - + table.insert(elements, {label = _U('visit'), value = 'visit'}) + end ESX.UI.Menu.Open( @@ -295,9 +295,9 @@ function OpenPropertyMenu(property) elements = elements, }, function(data2, menu) - + menu.close() - + if data2.current.value == 'enter' then EnterProperty(property.name) end @@ -324,7 +324,7 @@ function OpenPropertyMenu(property) menu.close() CurrentAction = 'property_menu' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionMsg = _U('press_to_menu') CurrentActionData = {property = property} end ) @@ -332,7 +332,7 @@ function OpenPropertyMenu(property) end function OpenGatewayMenu(property) - + if Config.EnablePlayerManagement then OpenGatewayOwnedPropertiesMenu(gatewayProperties) else @@ -343,8 +343,8 @@ function OpenGatewayMenu(property) title = property.name, align = 'top-left', elements = { - {label = 'Propriétés acquises', value = 'owned_properties'}, - {label = 'Propriétés disponibles', value = 'available_properties'}, + {label = _U('owned_properties'), value = 'owned_properties'}, + {label = _U('available_properties'), value = 'available_properties'}, } }, function(data, menu) @@ -359,11 +359,11 @@ function OpenGatewayMenu(property) end, function(data, menu) - + menu.close() CurrentAction = 'gateway_menu' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionMsg = _U('press_to_menu') CurrentActionData = {property = property} end @@ -379,7 +379,7 @@ function OpenGatewayOwnedPropertiesMenu(property) local elements = {} for i=1, #gatewayProperties, 1 do - + if PropertyIsOwned(gatewayProperties[i]) then table.insert(elements, { label = gatewayProperties[i].label, @@ -392,20 +392,20 @@ function OpenGatewayOwnedPropertiesMenu(property) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'gateway_owned_properties', { - title = property.name .. ' - Propriétés Acquises', + title = property.name .. ' - ' .. _U('owned_properties'), align = 'top-left', elements = elements, }, function(data, menu) - + menu.close() local elements = { - {label = 'Entrer', value = 'enter'} + {label = _U('enter'), value = 'enter'} } if not Config.EnablePlayerManagement then - table.insert(elements, {label = 'Rendre', value = 'leave'}) + table.insert(elements, {label = _U('leave'), value = 'leave'}) end ESX.UI.Menu.Open( @@ -416,9 +416,9 @@ function OpenGatewayOwnedPropertiesMenu(property) elements = elements, }, function(data2, menu) - + menu.close() - + if data2.current.value == 'enter' then EnterProperty(data.current.value) end @@ -442,12 +442,12 @@ function OpenGatewayOwnedPropertiesMenu(property) end function OpenGatewayAvailablePropertiesMenu(property) - + local gatewayProperties = GetGatewayProperties(property) local elements = {} for i=1, #gatewayProperties, 1 do - + if not PropertyIsOwned(gatewayProperties[i]) then table.insert(elements, { label = gatewayProperties[i].label .. ' $' .. gatewayProperties[i].price, @@ -461,12 +461,12 @@ function OpenGatewayAvailablePropertiesMenu(property) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'gateway_available_properties', { - title = property.name.. ' - Propriétés Disponbibles', + title = property.name.. ' - ' .. _U('available_properties'), align = 'top-left', elements = elements, }, function(data, menu) - + menu.close() ESX.UI.Menu.Open( @@ -475,9 +475,9 @@ function OpenGatewayAvailablePropertiesMenu(property) title = property.name, align = 'top-left', elements = { - {label = 'Acheter', value = 'buy'}, - {label = 'Louer', value = 'rent'}, - {label = 'Visiter', value = 'visit'}, + {label = _U('buy'), value = 'buy'}, + {label = _U('rent'), value = 'rent'}, + {label = _U('visit'), value = 'visit'}, }, }, function(data2, menu) @@ -526,14 +526,14 @@ function OpenRoomMenu(property) title = property.label, align = 'top-left', elements = { - {label = 'Inviter un joueur', value = 'invite_player'}, - {label = 'Dressing', value = 'player_dressing'}, - {label = 'Retirer objet', value = 'room_inventory'}, - {label = 'Déposer objet', value = 'player_inventory'}, + {label = _U('invite_player'), value = 'invite_player'}, + {label = _U('player_clothes'), value = 'player_dressing'}, + {label = _U('remove_object'), value = 'room_inventory'}, + {label = _U('deposit_object'), value = 'player_inventory'}, }, }, function(data, menu) - + if data.current.value == 'invite_player' then local playersInArea = ESX.Game.GetPlayersInArea(entering, 10.0) @@ -548,7 +548,7 @@ function OpenRoomMenu(property) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'room_invite', { - title = property.label .. ' - Invite', + title = property.label .. ' - ' .. _U('invite'), align = 'top-left', elements = elements, }, @@ -563,7 +563,7 @@ function OpenRoomMenu(property) end if data.current.value == 'player_dressing' then - + ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) local elements = {} @@ -575,14 +575,14 @@ function OpenRoomMenu(property) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'player_dressing', { - title = property.label .. ' - Dressing', + title = property.label .. ' - ' .. _U('player_clothes'), align = 'top-left', elements = elements, }, function(data, menu) TriggerEvent('skinchanger:getSkin', function(skin) - + TriggerEvent('skinchanger:loadClothes', skin, data.current.value) TriggerEvent('skinchanger:getSkin', function(skin) @@ -615,7 +615,7 @@ function OpenRoomMenu(property) menu.close() CurrentAction = 'room_menu' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionMsg = _U('press_to_menu') CurrentActionData = {property = property} end ) @@ -628,10 +628,10 @@ function OpenRoomInventoryMenu(property) local elements = {} - table.insert(elements, {label = 'Argent sale $' .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) + table.insert(elements, {label = _U('dirty_money') .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) for i=1, #inventory.items, 1 do - + local item = inventory.items[i] if item.count > 0 then @@ -648,18 +648,18 @@ function OpenRoomInventoryMenu(property) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'room_inventory', { - title = property.label .. ' - Inventaire', + title = property.label .. ' - ' .. _U('inventory'), align = 'top-left', elements = elements, }, function(data, menu) if data.current.type == 'item_weapon' then - + menu.close() TriggerServerEvent('esx_property:getItem', data.current.type, data.current.value, data.current.ammo) - + ESX.SetTimeout(300, function() OpenRoomInventoryMenu(property) end) @@ -669,20 +669,20 @@ function OpenRoomInventoryMenu(property) ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'get_item_count', { - title = 'Quantité ?', + title = _U('amount'), }, function(data2, menu) - + local quantity = tonumber(data2.value) if quantity == nil then - ESX.ShowNotification('Montant invalide') + ESX.ShowNotification(_U('amount_invalid')) else - + menu.close() TriggerServerEvent('esx_property:getItem', data.current.type, data.current.value, quantity) - + ESX.SetTimeout(300, function() OpenRoomInventoryMenu(property) end) @@ -713,16 +713,16 @@ function OpenPlayerInventoryMenu(property) local elements = {} - table.insert(elements, {label = 'Argent sale $' .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) + table.insert(elements, {label = _U('dirty_money') .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) 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 - + end local playerPed = GetPlayerPed(-1) @@ -742,35 +742,35 @@ function OpenPlayerInventoryMenu(property) ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'player_inventory', { - title = property.label .. ' - Inventaire', + title = property.label .. ' - ' .. _U('inventory'), align = 'top-left', elements = elements, }, function(data, menu) - + if data.current.type == 'item_weapon' then - + menu.close() TriggerServerEvent('esx_property:putItem', data.current.type, data.current.value, data.current.ammo) - + ESX.SetTimeout(300, function() OpenPlayerInventoryMenu(property) end) - + else ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'put_item_count', { - title = 'Quantité ?', + title = _U('amount'), }, function(data2, menu) - + menu.close() TriggerServerEvent('esx_property:putItem', data.current.type, data.current.value, tonumber(data2.value)) - + ESX.SetTimeout(300, function() OpenPlayerInventoryMenu(property) end) @@ -840,7 +840,7 @@ end) RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(xPlayer) - + ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties) for i=1, #ownedProperties, 1 do SetPropertyOwned(ownedProperties[i], true) @@ -850,18 +850,18 @@ AddEventHandler('esx:playerLoaded', function(xPlayer) end) AddEventHandler('esx_property:hasEnteredMarker', function(name, part) - + local property = GetProperty(name) if part == 'entering' then if property.isSingle then CurrentAction = 'property_menu' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionMsg = _U('press_to_menu') CurrentActionData = {property = property} else CurrentAction = 'gateway_menu' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionMsg = _U('press_to_menu') CurrentActionData = {property = property} end @@ -869,13 +869,13 @@ AddEventHandler('esx_property:hasEnteredMarker', function(name, part) if part == 'exit' then CurrentAction = 'room_exit' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour sortir de la propriété' + CurrentActionMsg = _U('press_to_exit') CurrentActionData = {propertyName = name} end if part == 'roomMenu' then CurrentAction = 'room_menu' - CurrentActionMsg = 'Appuez sur ~INPUT_CONTEXT~ pour accéder au menu' + CurrentActionMsg = _U('press_to_menu') CurrentActionData = {property = property} end @@ -888,7 +888,7 @@ end) -- Init Citizen.CreateThread(function() - + while ESX == nil do TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) Citizen.Wait(0) @@ -904,11 +904,11 @@ end) -- Display markers Citizen.CreateThread(function() while true do - + Wait(0) - + local coords = GetEntityCoords(GetPlayerPed(-1)) - + for i=1, #Config.Properties, 1 do local property = Config.Properties[i] @@ -933,7 +933,7 @@ end) -- Enter / Exit marker events Citizen.CreateThread(function() while true do - + Wait(0) local coords = GetEntityCoords(GetPlayerPed(-1)) @@ -978,18 +978,18 @@ Citizen.CreateThread(function() end if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastProperty ~= currentProperty or LastPart ~= currentPart) ) then - + HasAlreadyEnteredMarker = true LastProperty = currentProperty LastPart = currentPart - + TriggerEvent('esx_property:hasEnteredMarker', currentProperty, currentPart) end if not isInMarker and HasAlreadyEnteredMarker then - + HasAlreadyEnteredMarker = false - + TriggerEvent('esx_property:hasExitedMarker', LastProperty, LastPart) end @@ -1009,7 +1009,7 @@ Citizen.CreateThread(function() DisplayHelpTextFromStringLabel(0, 0, 1, -1) if IsControlPressed(0, Keys['E']) and (GetGameTimer() - GUI.Time) > 300 then - + if CurrentAction == 'property_menu' then OpenPropertyMenu(CurrentActionData.property) end @@ -1034,10 +1034,10 @@ Citizen.CreateThread(function() CurrentAction = nil GUI.Time = GetGameTimer() - + end end end -end) \ No newline at end of file +end) diff --git a/config.lua b/config.lua index 25c717f8..dcb4bb17 100644 --- a/config.lua +++ b/config.lua @@ -7,3 +7,4 @@ Config.MarkerType = 1 Config.Zones = {} Config.Properties = {} Config.EnablePlayerManagement = false -- If set to true you need esx_realestateagentjob +Config.Locale = 'fr' diff --git a/locales/en.lua b/locales/en.lua new file mode 100644 index 00000000..ce700925 --- /dev/null +++ b/locales/en.lua @@ -0,0 +1,30 @@ +Locales['en'] = { + + ['free_prop'] = 'free property', + ['property'] = 'property', + ['enter'] = 'enter', + ['leave'] = 'leave', + ['buy'] = 'buy', + ['rent'] = 'rent', + ['visit'] = 'visit', + ['press_to_menu'] = 'press ~INPUT_CONTEXT~ to access the menu', + ['owned_properties'] = 'acquired properties', + ['available_properties'] = 'available properties', + ['invite_player'] = 'invite a player', + ['player_clothes'] = 'clothes', + ['remove_object'] = 'remove object', + ['deposit_object'] = 'deposit object', + ['invite'] = 'invite', + ['dirty_money'] = 'dirty money $', + ['inventory'] = 'inventory', + ['amount'] = 'amount?', + ['amount_invalid'] = 'invalid amount', + ['press_to_exit'] = 'press ~INPUT_CONTEXT~ to exit the property', + ['rented_for'] = 'you rented a property for $', + ['purchased_for'] = 'you purchased a property for $', + ['made_property'] = 'you have made a property', + ['not_enough'] = 'you do not have enough money', + ['invalid_quantity'] = 'invalid quantity', + ['paid_rent'] = 'you ~g~paid~s~ your rent: ~g~$', + +} diff --git a/locales/fr.lua b/locales/fr.lua new file mode 100644 index 00000000..2123dcb1 --- /dev/null +++ b/locales/fr.lua @@ -0,0 +1,30 @@ +Locales['fr'] = { + + ['free_prop'] = 'propriété libre', + ['property'] = 'propriété', + ['enter'] = 'entrer', + ['leave'] = 'rendre', + ['buy'] = 'acheter', + ['rent'] = 'louer', + ['visit'] = 'visiter', + ['press_to_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', + ['owned_properties'] = 'propriétés acquises', + ['available_properties'] = 'propriétés disponibles', + ['invite_player'] = 'inviter un joueur', + ['player_clothes'] = 'vêtements', + ['remove_object'] = 'retirer objet', + ['deposit_object'] = 'déposer objet', + ['invite'] = 'inviter', + ['dirty_money'] = 'argent sale $', + ['inventory'] = 'inventaire', + ['amount'] = 'quantité ?', + ['amount_invalid'] = 'montant invalide', + ['press_to_exit'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir de la propriété', + ['rented_for'] = 'vous avez loué une propriété pour $', + ['purchased_for'] = 'vous avez acheté une propriété pour $', + ['made_property'] = 'vous avez rendu une propriété', + ['not_enough'] = 'vous n\'avez pas assez d\'argent', + ['invalid_quantity'] = 'quantité invalide', + ['paid_rent'] = 'vous avez ~g~payé~s~ votre loyer : ~g~$', + +} diff --git a/server/main.lua b/server/main.lua index cff86548..8652a2c3 100644 --- a/server/main.lua +++ b/server/main.lua @@ -15,7 +15,7 @@ end function SetPropertyOwned(name, price, rented, owner) MySQL.Async.execute( - 'INSERT INTO owned_properties (name, price, rented, owner) VALUES (@name, @price, @rented, @owner)', + 'INSERT INTO owned_properties (name, price, rented, owner) VALUES (@name, @price, @rented, @owner)', { ['@name'] = name, ['@price'] = price, @@ -28,13 +28,13 @@ function SetPropertyOwned(name, price, rented, owner) for k,v in pairs(xPlayers) do if v.identifier == owner then - + TriggerClientEvent('esx_property:setPropertyOwned', v.source, name, true) if rented then - TriggerClientEvent('esx:showNotification', v.source, 'Vous avez loué une propriété pour $' .. price) + TriggerClientEvent('esx:showNotification', v.source, _U('rented_for') .. price) else - TriggerClientEvent('esx:showNotification', v.source, 'Vous avez acheté une propriété pour $' .. price) + TriggerClientEvent('esx:showNotification', v.source, _U('purchased_for') .. price) end break @@ -61,7 +61,7 @@ function RemoveOwnedProperty(name, owner) for k,v in pairs(xPlayers) do if v.identifier == owner then TriggerClientEvent('esx_property:setPropertyOwned', v.source, name, false) - TriggerClientEvent('esx:showNotification', v.source, 'Vous avez rendu une propriété') + TriggerClientEvent('esx:showNotification', v.source, _U('made_property')) break end end @@ -74,7 +74,7 @@ end AddEventHandler('onMySQLReady', function () MySQL.Async.fetchAll('SELECT * FROM properties', {}, function(properties) - + for i=1, #properties, 1 do local entering = nil @@ -183,10 +183,10 @@ end) RegisterServerEvent('esx_property:rentProperty') AddEventHandler('esx_property:rentProperty', function(propertyName) - + local xPlayer = ESX.GetPlayerFromId(source) local property = GetProperty(propertyName) - + SetPropertyOwned(propertyName, property.price / 200, true, xPlayer.identifier) end) @@ -203,16 +203,16 @@ AddEventHandler('esx_property:buyProperty', function(propertyName) SetPropertyOwned(propertyName, property.price, false, xPlayer.identifier) else - TriggerClientEvent('esx:showNotification', source, 'Vous n\'avez pas assez d\'argent') + TriggerClientEvent('esx:showNotification', source, _U('not_enough')) end end) RegisterServerEvent('esx_property:removeOwnedProperty') AddEventHandler('esx_property:removeOwnedProperty', function(propertyName) - + local xPlayer = ESX.GetPlayerFromId(source) - + RemoveOwnedProperty(propertyName, xPlayer.identifier) end) @@ -223,9 +223,9 @@ end) RegisterServerEvent('esx_property:saveLastProperty') AddEventHandler('esx_property:saveLastProperty', function(property) - + local xPlayer = ESX.GetPlayerFromId(source) - + MySQL.Async.execute( 'UPDATE users SET last_property = @last_property WHERE identifier = @identifier', { @@ -239,7 +239,7 @@ end) RegisterServerEvent('esx_property:deleteLastProperty') AddEventHandler('esx_property:deleteLastProperty', function() local xPlayer = ESX.GetPlayerFromId(source) - + MySQL.Async.execute( 'UPDATE users SET last_property = NULL WHERE identifier = @identifier', { @@ -256,14 +256,14 @@ AddEventHandler('esx_property:getItem', function(type, item, count) if type == 'item_standard' then TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayer.identifier, function(inventory) - + local roomItemCount = inventory.getItem(item).count - + if roomItemCount >= count then inventory.removeItem(item, count) xPlayer.addInventoryItem(item, count) else - TriggerClientEvent('esx:showNotification', source, 'Quantité invalide') + TriggerClientEvent('esx:showNotification', source, _U('invalid_quantity')) end end) @@ -273,14 +273,14 @@ AddEventHandler('esx_property:getItem', function(type, item, count) if type == 'item_account' then TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayer.identifier, function(account) - + local roomAccountMoney = account.money - + if roomAccountMoney >= count then account.removeMoney(count) xPlayer.addAccountMoney(item, count) else - TriggerClientEvent('esx:showNotification', source, 'Montant invalide') + TriggerClientEvent('esx:showNotification', source, _U('amount_invalid')) end end) @@ -290,7 +290,7 @@ AddEventHandler('esx_property:getItem', function(type, item, count) if type == 'item_weapon' then TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - + local storeWeapons = store.get('weapons') if storeWeapons == nil then @@ -302,12 +302,12 @@ AddEventHandler('esx_property:getItem', function(type, item, count) for i=1, #storeWeapons, 1 do if storeWeapons[i].name == item then - + weaponName = storeWeapons[i].name ammo = storeWeapons[i].ammo - + table.remove(storeWeapons, i) - + break end end @@ -340,7 +340,7 @@ AddEventHandler('esx_property:putItem', function(type, item, count) end) else - TriggerClientEvent('esx:showNotification', source, 'Quantité invalide') + TriggerClientEvent('esx:showNotification', source, _U('invalid_quantity')) end end @@ -358,7 +358,7 @@ AddEventHandler('esx_property:putItem', function(type, item, count) end) else - TriggerClientEvent('esx:showNotification', source, 'Montant invalide') + TriggerClientEvent('esx:showNotification', source, _U('amount_invalid')) end end @@ -366,7 +366,7 @@ AddEventHandler('esx_property:putItem', function(type, item, count) if type == 'item_weapon' then TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - + local storeWeapons = store.get('weapons') if storeWeapons == nil then @@ -447,7 +447,7 @@ ESX.RegisterServerCallback('esx_property:getPropertyInventory', function(source, end) TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - + local storeWeapons = store.get('weapons') if storeWeapons ~= nil then @@ -520,8 +520,8 @@ function PayRent(d, h, m) if foundPlayer then xPlayer.removeMoney(result[i].price) - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez ~g~payé~s~ votre loyer : ~g~$' .. result[i].price) - + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent') .. result[i].price) + else MySQL.Async.fetchAll( @@ -557,4 +557,4 @@ function PayRent(d, h, m) end -TriggerEvent('cron:runAt', 22, 0, PayRent) \ No newline at end of file +TriggerEvent('cron:runAt', 22, 0, PayRent) From 3c433f1f722e8c576b246001d008a9da1d993498 Mon Sep 17 00:00:00 2001 From: TakumiBR <31086346+TakumiBR@users.noreply.github.com> Date: Thu, 17 Aug 2017 08:03:13 -0700 Subject: [PATCH 23/99] Add files via upload --- __resource.lua | 2 ++ locales/br.lua | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 locales/br.lua diff --git a/__resource.lua b/__resource.lua index 473a6ccf..b0b274a4 100644 --- a/__resource.lua +++ b/__resource.lua @@ -4,6 +4,7 @@ description 'ESX Property' 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..b08da2f1 --- /dev/null +++ b/locales/br.lua @@ -0,0 +1,30 @@ +Locales['br'] = { + + ['free_prop'] = 'Propriedade gratuita', + ['property'] = 'Propriedade', + ['enter'] = 'Entrar', + ['leave'] = 'Sair', + ['buy'] = 'Comprar', + ['rent'] = 'Alugar', + ['visit'] = 'Visitar', + ['press_to_menu'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', + ['owned_properties'] = 'Propriedades adquiridas', + ['available_properties'] = 'Propriedades disponíveis', + ['invite_player'] = 'Convidar um jogador', + ['player_clothes'] = 'Roupas', + ['remove_object'] = 'Remover objeto', + ['deposit_object'] = 'Depositar objeto', + ['invite'] = 'Convidar', + ['dirty_money'] = 'Dinheiro sujo $', + ['inventory'] = 'Inventário', + ['amount'] = 'valor?', + ['amount_invalid'] = 'quantidade inválida', + ['press_to_exit'] = 'Pressione ~INPUT_CONTEXT~ para sair da propriedade', + ['rented_for'] = 'Você alugou uma propriedade por $', + ['purchased_for'] = 'Você comprou uma propriedade por $', + ['made_property'] = 'Você criou uma propriedade', + ['not_enough'] = 'Você não tem dinheiro suficiente', + ['invalid_quantity'] = 'Quantidade inválida', + ['paid_rent'] = 'Você ~g~pagou~s~ seu aluguel: ~g~$', + +} From 83b8ddec5e4d7efef82aff4085fc2558816cc337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Thu, 17 Aug 2017 17:41:42 +0200 Subject: [PATCH 24/99] Use new instance code --- __resource.lua | 4 ++++ client/main.lua | 55 ++++++++++++++++++++++++++++++++----------------- locales/en.lua | 1 + locales/fr.lua | 1 + 4 files changed, 42 insertions(+), 19 deletions(-) diff --git a/__resource.lua b/__resource.lua index 473a6ccf..948dceff 100644 --- a/__resource.lua +++ b/__resource.lua @@ -18,3 +18,7 @@ client_scripts { 'config.lua', 'client/main.lua' } + +dependencies { + 'instance' +} \ No newline at end of file diff --git a/client/main.lua b/client/main.lua index 36f260bd..7867679a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -24,6 +24,7 @@ local CurrentActionMsg = '' local CurrentActionData = {} local FirstSpawn = true local PlayerLoaded = false +local Instance = {} function DrawSub(text, time) ClearPrints() @@ -112,12 +113,6 @@ function EnterProperty(name) TriggerServerEvent('esx_property:saveLastProperty', name) - TriggerEvent('instance:get', function(instance) - if instance.host == nil then - TriggerEvent('instance:create') - end - end) - Citizen.CreateThread(function() DoScreenFadeOut(800) @@ -170,12 +165,6 @@ function ExitProperty(name) SetEntityCoords(playerPed, outside.x, outside.y, outside.z) - TriggerEvent('instance:get', function(instance) - if instance.host ~= nil then - TriggerEvent('instance:leave') - end - end) - for i=1, #property.ipls, 1 do RemoveIpl(property.ipls[i]) end @@ -299,7 +288,7 @@ function OpenPropertyMenu(property) menu.close() if data2.current.value == 'enter' then - EnterProperty(property.name) + TriggerEvent('instance:create', 'property', {property = property.name}) end if data2.current.value == 'leave' then @@ -315,7 +304,7 @@ function OpenPropertyMenu(property) end if data2.current.value == 'visit' then - EnterProperty(property.name) + TriggerEvent('instance:create', 'property', {property = property.name}) end end, @@ -420,7 +409,7 @@ function OpenGatewayOwnedPropertiesMenu(property) menu.close() if data2.current.value == 'enter' then - EnterProperty(data.current.value) + TriggerEvent('instance:create', 'property', {property = data.current.value}) end if data2.current.value == 'leave' then @@ -492,7 +481,7 @@ function OpenGatewayAvailablePropertiesMenu(property) end if data2.current.value == 'visit' then - EnterProperty(data.current.value) + TriggerEvent('instance:create', 'property', {property = data.current.value}) end end, @@ -553,7 +542,8 @@ function OpenRoomMenu(property) elements = elements, }, function(data, menu) - TriggerEvent('instance:invite', GetPlayerServerId(data.current.value), property.inside) + TriggerEvent('instance:invite', 'property', GetPlayerServerId(data.current.value), {property = property.name}) + ESX.ShowNotification(_U('you_invited', GetPlayerName(data.current.value))) end, function(data, menu) menu.close() @@ -793,6 +783,15 @@ function OpenPlayerInventoryMenu(property) end +TriggerEvent('instance:registerType', 'property', + function(instance) + EnterProperty(instance.data.property) + end, + function(instance) + ExitProperty(instance.data.property) + end +) + AddEventHandler('playerSpawned', function() if FirstSpawn then @@ -805,7 +804,7 @@ AddEventHandler('playerSpawned', function() ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) if propertyName ~= nil then - EnterProperty(propertyName) + TriggerEvent('instance:create', 'property', {property = propertyName}) end end) @@ -849,6 +848,22 @@ AddEventHandler('esx:playerLoaded', function(xPlayer) end) +RegisterNetEvent('instance:onCreate') +AddEventHandler('instance:onCreate', function(instance) + + if instance.type == 'property' then + TriggerEvent('instance:enter', instance) + end + +end) + +RegisterNetEvent('instance:onPlayerLeft') +AddEventHandler('instance:onPlayerLeft', function(instance, player) + if player == instance.host then + ExitProperty(instance.data.property) + end +end) + AddEventHandler('esx_property:hasEnteredMarker', function(name, part) local property = GetProperty(name) @@ -1029,7 +1044,9 @@ Citizen.CreateThread(function() end if CurrentAction == 'room_exit' then - ExitProperty(CurrentActionData.propertyName) + TriggerEvent('instance:get', function(instance) + TriggerEvent('instance:leave') + end) end CurrentAction = nil diff --git a/locales/en.lua b/locales/en.lua index ce700925..133b42d1 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -11,6 +11,7 @@ Locales['en'] = { ['owned_properties'] = 'acquired properties', ['available_properties'] = 'available properties', ['invite_player'] = 'invite a player', + ['you_invited'] = 'you invited %s', ['player_clothes'] = 'clothes', ['remove_object'] = 'remove object', ['deposit_object'] = 'deposit object', diff --git a/locales/fr.lua b/locales/fr.lua index 2123dcb1..3b7a3567 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -11,6 +11,7 @@ Locales['fr'] = { ['owned_properties'] = 'propriétés acquises', ['available_properties'] = 'propriétés disponibles', ['invite_player'] = 'inviter un joueur', + ['you_invited'] = 'vous avez invité %s', ['player_clothes'] = 'vêtements', ['remove_object'] = 'retirer objet', ['deposit_object'] = 'déposer objet', From 7c91651df417d7b3b9843f86e77844d2dc6f9159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sun, 20 Aug 2017 13:15:31 +0200 Subject: [PATCH 25/99] Fix PayRent --- server/main.lua | 85 ++++++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/server/main.lua b/server/main.lua index 8652a2c3..c8ff535d 100644 --- a/server/main.lua +++ b/server/main.lua @@ -499,58 +499,68 @@ end) function PayRent(d, h, m) MySQL.Async.fetchAll( - 'SELECT * FROM owned_properties WHERE rented = 1', + 'SELECT * FROM users', {}, - function(result) + function(_users) - local xPlayers = ESX.GetPlayers() + local prevMoney = {} + local newMoney = {} - for i=1, #result, 1 do + for i=1, #_users, 1 do + prevMoney[_users[i].identifier] = _users[i].money + newMoney[_users[i].identifier] = _users[i].money + end - local foundPlayer = false - local xPlayer = nil + MySQL.Async.fetchAll( + 'SELECT * FROM owned_properties WHERE rented = 1', + {}, + function(result) + + local xPlayers = ESX.GetPlayers() + + for i=1, #result, 1 do + + local foundPlayer = false + local xPlayer = nil + + for k,v in pairs(xPlayers) do + if v.identifier == result[i].owner then + foundPlayer = true + xPlayer = v + end + end + + if foundPlayer then + + xPlayer.removeMoney(result[i].price) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent') .. result[i].price) + + else + newMoney[result[i].owner] = newMoney[result[i].owner] - result[i].price + end + + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) + account.addMoney(result[i].price) + end) - for k,v in pairs(xPlayers) do - if v.identifier == result[i].owner then - foundPlayer = true - xPlayer = v end - end - if foundPlayer then - - xPlayer.removeMoney(result[i].price) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent') .. result[i].price) - - else - - MySQL.Async.fetchAll( - 'SELECT * FROM users WHERE identifier = @identifier', - { - ['@identifier'] = result[i].owner - }, - function(result2) - - local money = result2[1].money - money = money - result[i].price + for k,v in pairs(prevMoney) do + if v ~= newMoney[k] then MySQL.Async.execute( 'UPDATE users SET money = @money WHERE identifier = @identifier', { - ['@money'] = money, - ['@identifier'] = result[i].owner + ['@money'] = newMoney[k], + ['@identifier'] = k } ) + end - ) + end end - - TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) - account.addMoney(result[i].price) - end) - - end + ) end ) @@ -558,3 +568,6 @@ function PayRent(d, h, m) end TriggerEvent('cron:runAt', 22, 0, PayRent) + + +AddEventHandler('onMySQLReady', PayRent) \ No newline at end of file From 43626c1576e355970ad7247acdeeef3d67c520c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sun, 20 Aug 2017 13:24:12 +0200 Subject: [PATCH 26/99] Remove dev function --- server/main.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/server/main.lua b/server/main.lua index c8ff535d..b7f1d9fe 100644 --- a/server/main.lua +++ b/server/main.lua @@ -568,6 +568,3 @@ function PayRent(d, h, m) end TriggerEvent('cron:runAt', 22, 0, PayRent) - - -AddEventHandler('onMySQLReady', PayRent) \ No newline at end of file From 3687fa30584a59aefb32cb5b4c39c70944f947fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Mon, 21 Aug 2017 21:03:01 +0200 Subject: [PATCH 27/99] Update GetPlayers --- server/main.lua | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/server/main.lua b/server/main.lua index b7f1d9fe..157da815 100644 --- a/server/main.lua +++ b/server/main.lua @@ -26,15 +26,18 @@ function SetPropertyOwned(name, price, rented, owner) local xPlayers = ESX.GetPlayers() - for k,v in pairs(xPlayers) do - if v.identifier == owner then + for i=1, #xPlayers, 1 do - TriggerClientEvent('esx_property:setPropertyOwned', v.source, name, true) + local xPlayer = ESX.GetPlayerFromId(xPlayers[i]) + + if xPlayer.identifier == owner then + + TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true) if rented then - TriggerClientEvent('esx:showNotification', v.source, _U('rented_for') .. price) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for') .. price) else - TriggerClientEvent('esx:showNotification', v.source, _U('purchased_for') .. price) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for') .. price) end break @@ -58,10 +61,13 @@ function RemoveOwnedProperty(name, owner) local xPlayers = ESX.GetPlayers() - for k,v in pairs(xPlayers) do - if v.identifier == owner then - TriggerClientEvent('esx_property:setPropertyOwned', v.source, name, false) - TriggerClientEvent('esx:showNotification', v.source, _U('made_property')) + for i=1, #xPlayers, 1 do + + local xPlayer = ESX.GetPlayerFromId(xPlayers[i]) + + if xPlayer.identifier == owner then + TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, false) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('made_property')) break end end @@ -523,10 +529,13 @@ function PayRent(d, h, m) local foundPlayer = false local xPlayer = nil - for k,v in pairs(xPlayers) do - if v.identifier == result[i].owner then + for j=1, #xPlayers, 1 do + + local xPlayer2 = ESX.GetPlayerFromId(xPlayers[j]) + + if xPlayer2.identifier == result[i].owner then foundPlayer = true - xPlayer = v + xPlayer = xPlayer2 end end From a5448f891a247af6108e36a79e0076ee23676986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sat, 26 Aug 2017 09:23:05 +0200 Subject: [PATCH 28/99] Set last skin when get outfit --- client/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/client/main.lua b/client/main.lua index 7867679a..f76f9bba 100644 --- a/client/main.lua +++ b/client/main.lua @@ -574,6 +574,7 @@ function OpenRoomMenu(property) TriggerEvent('skinchanger:getSkin', function(skin) TriggerEvent('skinchanger:loadClothes', skin, data.current.value) + TriggerEvent('esx_skin:setLastSkin', skin) TriggerEvent('skinchanger:getSkin', function(skin) TriggerServerEvent('esx_skin:save', skin) From b3eb5a46715a9ad0caebdee1ceaccf2b53802b16 Mon Sep 17 00:00:00 2001 From: ultratm Date: Sat, 26 Aug 2017 10:41:02 +0200 Subject: [PATCH 29/99] Added German language --- __resource.lua | 2 + de_esx_property.sql | 94 +++++++++++++++++++++++++++++++++++++++++++++ locales/de.lua | 31 +++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 de_esx_property.sql create mode 100644 locales/de.lua diff --git a/__resource.lua b/__resource.lua index a8c1e5ea..fc295f8e 100644 --- a/__resource.lua +++ b/__resource.lua @@ -4,6 +4,7 @@ description 'ESX Property' server_scripts { '@es_extended/locale.lua', + 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', 'locales/fr.lua', @@ -14,6 +15,7 @@ server_scripts { client_scripts { '@es_extended/locale.lua', + 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', 'locales/fr.lua', diff --git a/de_esx_property.sql b/de_esx_property.sql new file mode 100644 index 00000000..cb819d08 --- /dev/null +++ b/de_esx_property.sql @@ -0,0 +1,94 @@ +USE `essentialmode`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Schwarzgeld',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Immobilien',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('property','Immobilien',0) +; + +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +); + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Appartement Moderne 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Appartement Moderne 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Appartement Moderne 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Appartement Mode 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Appartement Mode 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Appartement Mode 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Appartement Vibrant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Appartement Vibrant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Appartement Vibrant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Appartement Persan 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Appartement Persan 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Appartement Persan 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Appartement Monochrome 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Appartement Monochrome 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Appartement Monochrome 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Appartement Séduisant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Appartement Séduisant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Appartement Séduisant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Appartement Régal 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Appartement Régal 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Appartement Régal 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Appartement Aqua 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Appartement Aqua 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Appartement Aqua 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + diff --git a/locales/de.lua b/locales/de.lua new file mode 100644 index 00000000..ffc3fdf4 --- /dev/null +++ b/locales/de.lua @@ -0,0 +1,31 @@ +Locales['de'] = { + + ['free_prop'] = 'Kostenlose Immobilie', + ['property'] = 'Immobilie', + ['enter'] = 'Eintreten', + ['leave'] = 'Verlassen', + ['buy'] = 'Kaufen', + ['rent'] = 'Mieten', + ['visit'] = 'Ansehen', + ['press_to_menu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', + ['owned_properties'] = 'Gekaufte Immobilien', + ['available_properties'] = 'Verfügbare Immobilien', + ['invite_player'] = 'Spieler einladen', + ['you_invited'] = 'Du hast %s eingeladen', + ['player_clothes'] = 'Kleidung', + ['remove_object'] = 'Objekt nehmen', + ['deposit_object'] = 'Objekt deponieren', + ['invite'] = 'Einladen', + ['dirty_money'] = 'Schwarzgeld $', + ['inventory'] = 'Inventar', + ['amount'] = 'Anzahlt?', + ['amount_invalid'] = 'Ungültiger Wert', + ['press_to_exit'] = 'Drücke ~INPUT_CONTEXT~ um die Immobilie zu verlassen', + ['rented_for'] = 'Du hast eine Immobilie gemietet $', + ['purchased_for'] = 'Du hast eine Immobilie gekauft $', + ['made_property'] = 'Du hast eine Immobilie gemacht', + ['not_enough'] = 'du hast nicht genug Geld', + ['invalid_quantity'] = 'Ungültiger Betrag', + ['paid_rent'] = 'du ~g~bezahlst~s~ deine Miete: ~g~$', + +} From fedf7701b367d8e577a16e327a5d913cbf4aab7f Mon Sep 17 00:00:00 2001 From: TheMrDeivid <31643017+TheMrDeivid@users.noreply.github.com> Date: Tue, 5 Sep 2017 18:23:10 +0100 Subject: [PATCH 30/99] Create esx_offices.sql Added the offices --- esx_offices.sql | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 esx_offices.sql diff --git a/esx_offices.sql b/esx_offices.sql new file mode 100644 index 00000000..638e54e7 --- /dev/null +++ b/esx_offices.sql @@ -0,0 +1,32 @@ +INSERT INTO `properties` VALUES + (43, 'MazeBankBuilding', 'Maze Bank Building', '{\"x\":-79.18,\"y\":-795.92,\"z\":43.35}', NULL, NULL, '{\"x\":-72.50,\"y\":-786.92,\"z\":43.40}', '[]', NULL, 0, 0, 1, NULL, 0), + (44, 'OldSpiceWarm', 'Old Spice Warm', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (45, 'OldSpiceClassical', 'Old Spice Classical', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (46, 'OldSpiceVintage', 'Old Spice Vintage', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (47, 'ExecutiveRich', 'Executive Rich', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (48, 'ExecutiveCool', 'Executive Cool', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (49, 'ExecutiveContrast', 'Executive Contrast', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (50, 'PowerBrokerIce', 'Power Broker Ice', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (51, 'PowerBrokerConservative', 'Power Broker Conservative', NULL, '', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (52, 'PowerBrokerPolished', 'Power Broker Polished', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (53, 'LomBank', 'Lom Bank', '{\"x\":-1581.36,\"y\":-558.23,\"z\":34.07}', NULL, NULL, '{\"x\":-1583.60,\"y\":-555.12,\"z\":34.07}', '[]', NULL, 0, 0, 1, NULL, 0), + (54, 'LBOldSpiceWarm', 'LB Old Spice Warm', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (55, 'LBOldSpiceClassical', 'LB Old Spice Classical', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (56, 'LBOldSpiceVintage', 'LB Old Spice Vintage', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (57, 'LBExecutiveRich', 'LB Executive Rich', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (58, 'LBExecutiveCool', 'LB Executive Cool', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (59, 'LBExecutiveContrast', 'LB Executive Contrast', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (60, 'LBPowerBrokerIce', 'LB Power Broker Ice', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (61, 'LBPowerBrokerConservative', 'LB Power Broker Conservative', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (62, 'LBPowerBrokerPolished', 'LB Power Broker Polished', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (63, 'MazeBankWest', 'Maze Bank West', '{\"x\":-1379.58,\"y\":-499.63,\"z\":32.22}', NULL, NULL, '{\"x\":-1378.95,\"y\":-502.82,\"z\":32.22}', '[]', NULL, 0, 0, 1, NULL, 0), + (64, 'MBWOldSpiceWarm', 'MBW Old Spice Warm', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (65, 'MBWOldSpiceClassical', 'MBW Old Spice Classical', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (66, 'MBWOldSpiceVintage', 'MBW Old Spice Vintage', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (67, 'MBWExecutiveRich', 'MBW Executive Rich', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (68, 'MBWExecutiveCool', 'MBW Executive Cool', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (69, 'MBWExecutive Contrast', 'MBW Executive Contrast', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (70, 'MBWPowerBrokerIce', 'MBW Power Broker Ice', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (71, 'MBWPowerBrokerConvservative', 'MBW Power Broker Convservative', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (72, 'MBWPowerBrokerPolished', 'MBW Power Broker Polished', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000); +; From d66f31618c7197b478fedaecb89ed0d6bcc8f70a Mon Sep 17 00:00:00 2001 From: TheMrDeivid <31643017+TheMrDeivid@users.noreply.github.com> Date: Tue, 5 Sep 2017 18:30:44 +0100 Subject: [PATCH 31/99] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 591c5977..09019b90 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ FXServer ESX Property git clone https://github.com/FXServer-ESX/fxserver-esx_property esx_property ``` 3) Import esx_property.sql in your database -4) Add this in your server.cfg : +4) Import esx_offices.sql in your database if you want the offices to added in your server(The Arcadius Business Centre is not included because realstateagentjob) +5) Add this in your server.cfg : ``` start esx_property ``` - From 2965cdbdcfbb347608fd5cfad61cbe70aff87fb3 Mon Sep 17 00:00:00 2001 From: TheMrDeivid <31643017+TheMrDeivid@users.noreply.github.com> Date: Tue, 5 Sep 2017 19:32:55 +0100 Subject: [PATCH 32/99] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 09019b90..f5388b0b 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,4 @@ git clone https://github.com/FXServer-ESX/fxserver-esx_property esx_property ``` start esx_property ``` +- From 793355f5c80f501ffa3d485507d2a95794619ec2 Mon Sep 17 00:00:00 2001 From: TheMrDeivid <31643017+TheMrDeivid@users.noreply.github.com> Date: Tue, 5 Sep 2017 19:33:10 +0100 Subject: [PATCH 33/99] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f5388b0b..09019b90 100644 --- a/README.md +++ b/README.md @@ -23,4 +23,3 @@ git clone https://github.com/FXServer-ESX/fxserver-esx_property esx_property ``` start esx_property ``` -- From 8a0952f744f5f0352916e3278211ea48b9892c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sat, 9 Sep 2017 17:14:27 +0200 Subject: [PATCH 34/99] Clean up repo --- de_esx_property.sql => localization/de_esx_property.sql | 0 esx_offices.sql => offices.sql | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename de_esx_property.sql => localization/de_esx_property.sql (100%) rename esx_offices.sql => offices.sql (100%) diff --git a/de_esx_property.sql b/localization/de_esx_property.sql similarity index 100% rename from de_esx_property.sql rename to localization/de_esx_property.sql diff --git a/esx_offices.sql b/offices.sql similarity index 100% rename from esx_offices.sql rename to offices.sql From 45f273d9f72dd416b3e957248244785ab561bee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Sun, 10 Sep 2017 11:52:17 +0200 Subject: [PATCH 35/99] Share chest between instances --- client/main.lua | 108 ++++++++++++++++++++++++++---------------------- server/main.lua | 36 +++++++++------- 2 files changed, 78 insertions(+), 66 deletions(-) diff --git a/client/main.lua b/client/main.lua index f76f9bba..3f2cd733 100644 --- a/client/main.lua +++ b/client/main.lua @@ -16,6 +16,7 @@ GUI.Time = 0 local OwnedProperties = {} local Blips = {} local CurrentProperty = nil +local CurrentPropertyOwner = nil local LastProperty = nil local LastPart = nil local HasAlreadyEnteredMarker = false @@ -23,8 +24,6 @@ local CurrentAction = nil local CurrentActionMsg = '' local CurrentActionData = {} local FirstSpawn = true -local PlayerLoaded = false -local Instance = {} function DrawSub(text, time) ClearPrints() @@ -99,11 +98,12 @@ function GetGatewayProperties(property) end -function EnterProperty(name) +function EnterProperty(name, owner) - local property = GetProperty(name) - local playerPed = GetPlayerPed(-1) - CurrentProperty = property + local property = GetProperty(name) + local playerPed = GetPlayerPed(-1) + CurrentProperty = property + CurrentPropertyOwner = owner for i=1, #Config.Properties, 1 do if Config.Properties[i].name ~= name then @@ -288,7 +288,7 @@ function OpenPropertyMenu(property) menu.close() if data2.current.value == 'enter' then - TriggerEvent('instance:create', 'property', {property = property.name}) + TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) end if data2.current.value == 'leave' then @@ -304,7 +304,7 @@ function OpenPropertyMenu(property) end if data2.current.value == 'visit' then - TriggerEvent('instance:create', 'property', {property = property.name}) + TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) end end, @@ -409,7 +409,7 @@ function OpenGatewayOwnedPropertiesMenu(property) menu.close() if data2.current.value == 'enter' then - TriggerEvent('instance:create', 'property', {property = data.current.value}) + TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) end if data2.current.value == 'leave' then @@ -481,7 +481,7 @@ function OpenGatewayAvailablePropertiesMenu(property) end if data2.current.value == 'visit' then - TriggerEvent('instance:create', 'property', {property = data.current.value}) + TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) end end, @@ -498,9 +498,10 @@ function OpenGatewayAvailablePropertiesMenu(property) end -function OpenRoomMenu(property) +function OpenRoomMenu(property, owner) local entering = nil + local elements = {} if property.isSingle then entering = property.entering @@ -508,18 +509,23 @@ function OpenRoomMenu(property) entering = GetGateway(property).entering end + table.insert(elements, {label = _U('invite_player'), value = 'invite_player'}) + + if CurrentPropertyOwner == owner then + table.insert(elements, {label = _U('player_clothes'), value = 'player_dressing'}) + end + + table.insert(elements, {label = _U('remove_object'), value = 'room_inventory'}) + table.insert(elements, {label = _U('deposit_object'), value = 'player_inventory'}) + ESX.UI.Menu.CloseAll() + ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'room', { title = property.label, align = 'top-left', - elements = { - {label = _U('invite_player'), value = 'invite_player'}, - {label = _U('player_clothes'), value = 'player_dressing'}, - {label = _U('remove_object'), value = 'room_inventory'}, - {label = _U('deposit_object'), value = 'player_inventory'}, - }, + elements = elements, }, function(data, menu) @@ -542,7 +548,7 @@ function OpenRoomMenu(property) elements = elements, }, function(data, menu) - TriggerEvent('instance:invite', 'property', GetPlayerServerId(data.current.value), {property = property.name}) + TriggerEvent('instance:invite', 'property', GetPlayerServerId(data.current.value), {property = property.name, owner = owner}) ESX.ShowNotification(_U('you_invited', GetPlayerName(data.current.value))) end, function(data, menu) @@ -593,11 +599,11 @@ function OpenRoomMenu(property) end if data.current.value == 'room_inventory' then - OpenRoomInventoryMenu(property) + OpenRoomInventoryMenu(property, owner) end if data.current.value == 'player_inventory' then - OpenPlayerInventoryMenu(property) + OpenPlayerInventoryMenu(property, owner) end end, @@ -607,13 +613,13 @@ function OpenRoomMenu(property) CurrentAction = 'room_menu' CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property} + CurrentActionData = {property = property, owner = owner} end ) end -function OpenRoomInventoryMenu(property) +function OpenRoomInventoryMenu(property, owner) ESX.TriggerServerCallback('esx_property:getPropertyInventory', function(inventory) @@ -649,10 +655,10 @@ function OpenRoomInventoryMenu(property) menu.close() - TriggerServerEvent('esx_property:getItem', data.current.type, data.current.value, data.current.ammo) + TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, data.current.ammo) ESX.SetTimeout(300, function() - OpenRoomInventoryMenu(property) + OpenRoomInventoryMenu(property, owner) end) else @@ -672,10 +678,10 @@ function OpenRoomInventoryMenu(property) menu.close() - TriggerServerEvent('esx_property:getItem', data.current.type, data.current.value, quantity) + TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, quantity) ESX.SetTimeout(300, function() - OpenRoomInventoryMenu(property) + OpenRoomInventoryMenu(property, owner) end) end @@ -694,11 +700,11 @@ function OpenRoomInventoryMenu(property) end ) - end) + end, owner) end -function OpenPlayerInventoryMenu(property) +function OpenPlayerInventoryMenu(property, owner) ESX.TriggerServerCallback('esx_property:getPlayerInventory', function(inventory) @@ -743,10 +749,10 @@ function OpenPlayerInventoryMenu(property) menu.close() - TriggerServerEvent('esx_property:putItem', data.current.type, data.current.value, data.current.ammo) + TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, data.current.ammo) ESX.SetTimeout(300, function() - OpenPlayerInventoryMenu(property) + OpenPlayerInventoryMenu(property, owner) end) else @@ -760,10 +766,10 @@ function OpenPlayerInventoryMenu(property) menu.close() - TriggerServerEvent('esx_property:putItem', data.current.type, data.current.value, tonumber(data2.value)) + TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, tonumber(data2.value)) ESX.SetTimeout(300, function() - OpenPlayerInventoryMenu(property) + OpenPlayerInventoryMenu(property, owner) end) end, @@ -784,14 +790,18 @@ function OpenPlayerInventoryMenu(property) end -TriggerEvent('instance:registerType', 'property', - function(instance) - EnterProperty(instance.data.property) - end, - function(instance) - ExitProperty(instance.data.property) - end -) +AddEventHandler('instance:loaded', function() + + TriggerEvent('instance:registerType', 'property', + function(instance) + EnterProperty(instance.data.property, instance.data.owner) + end, + function(instance) + ExitProperty(instance.data.property) + end + ) + +end) AddEventHandler('playerSpawned', function() @@ -799,13 +809,13 @@ AddEventHandler('playerSpawned', function() Citizen.CreateThread(function() - while not PlayerLoaded do + while not ESX.IsPlayerLoaded() do Citizen.Wait(0) end ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) if propertyName ~= nil then - TriggerEvent('instance:create', 'property', {property = propertyName}) + TriggerEvent('instance:create', 'property', {property = propertyName, owner = ESX.GetPlayerData().identifier}) end end) @@ -861,7 +871,7 @@ end) RegisterNetEvent('instance:onPlayerLeft') AddEventHandler('instance:onPlayerLeft', function(instance, player) if player == instance.host then - ExitProperty(instance.data.property) + TriggerEvent('instance:leave') end end) @@ -892,7 +902,7 @@ AddEventHandler('esx_property:hasEnteredMarker', function(name, part) if part == 'roomMenu' then CurrentAction = 'room_menu' CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property} + CurrentActionData = {property = property, owner = CurrentPropertyOwner} end end) @@ -937,7 +947,7 @@ Citizen.CreateThread(function() DrawMarker(Config.MarkerType, property.exit.x, property.exit.y, property.exit.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 - if(property.roomMenu ~= nil and PropertyIsOwned(property) and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.DrawDistance) then + if(property.roomMenu ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.DrawDistance) then DrawMarker(Config.MarkerType, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.RoomMenuMarkerColor.r, Config.RoomMenuMarkerColor.g, Config.RoomMenuMarkerColor.b, 100, false, true, 2, false, false, false, false) end @@ -985,7 +995,7 @@ Citizen.CreateThread(function() currentPart = 'outside' end - if(property.roomMenu ~= nil and PropertyIsOwned(property) and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.MarkerSize.x) then + if(property.roomMenu ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.MarkerSize.x) then isInMarker = true currentProperty = property.name currentPart = 'roomMenu' @@ -1041,13 +1051,11 @@ Citizen.CreateThread(function() end if CurrentAction == 'room_menu' then - OpenRoomMenu(CurrentActionData.property) + OpenRoomMenu(CurrentActionData.property, CurrentActionData.owner) end if CurrentAction == 'room_exit' then - TriggerEvent('instance:get', function(instance) - TriggerEvent('instance:leave') - end) + TriggerEvent('instance:leave') end CurrentAction = nil diff --git a/server/main.lua b/server/main.lua index 157da815..fa4067f4 100644 --- a/server/main.lua +++ b/server/main.lua @@ -255,13 +255,15 @@ AddEventHandler('esx_property:deleteLastProperty', function() end) RegisterServerEvent('esx_property:getItem') -AddEventHandler('esx_property:getItem', function(type, item, count) +AddEventHandler('esx_property:getItem', function(owner, type, item, count) - local xPlayer = ESX.GetPlayerFromId(source) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) if type == 'item_standard' then - TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayer.identifier, function(inventory) + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) local roomItemCount = inventory.getItem(item).count @@ -269,7 +271,7 @@ AddEventHandler('esx_property:getItem', function(type, item, count) inventory.removeItem(item, count) xPlayer.addInventoryItem(item, count) else - TriggerClientEvent('esx:showNotification', source, _U('invalid_quantity')) + TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) end end) @@ -278,7 +280,7 @@ AddEventHandler('esx_property:getItem', function(type, item, count) if type == 'item_account' then - TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayer.identifier, function(account) + TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) local roomAccountMoney = account.money @@ -286,7 +288,7 @@ AddEventHandler('esx_property:getItem', function(type, item, count) account.removeMoney(count) xPlayer.addAccountMoney(item, count) else - TriggerClientEvent('esx:showNotification', source, _U('amount_invalid')) + TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) end end) @@ -295,7 +297,7 @@ AddEventHandler('esx_property:getItem', function(type, item, count) if type == 'item_weapon' then - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) local storeWeapons = store.get('weapons') @@ -329,9 +331,11 @@ AddEventHandler('esx_property:getItem', function(type, item, count) end) RegisterServerEvent('esx_property:putItem') -AddEventHandler('esx_property:putItem', function(type, item, count) +AddEventHandler('esx_property:putItem', function(owner, type, item, count) - local xPlayer = ESX.GetPlayerFromId(source) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) if type == 'item_standard' then @@ -341,12 +345,12 @@ AddEventHandler('esx_property:putItem', function(type, item, count) xPlayer.removeInventoryItem(item, count) - TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayer.identifier, function(inventory) + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) inventory.addItem(item, count) end) else - TriggerClientEvent('esx:showNotification', source, _U('invalid_quantity')) + TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) end end @@ -359,19 +363,19 @@ AddEventHandler('esx_property:putItem', function(type, item, count) xPlayer.removeAccountMoney(item, count) - TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayer.identifier, function(account) + TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) account.addMoney(count) end) else - TriggerClientEvent('esx:showNotification', source, _U('amount_invalid')) + TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) end end if type == 'item_weapon' then - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) local storeWeapons = store.get('weapons') @@ -437,9 +441,9 @@ ESX.RegisterServerCallback('esx_property:getLastProperty', function(source, cb) end) -ESX.RegisterServerCallback('esx_property:getPropertyInventory', function(source, cb) +ESX.RegisterServerCallback('esx_property:getPropertyInventory', function(source, cb, owner) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromIdentifier(owner) local blackMoney = 0 local items = {} local weapons = {} From 71cb88f85823989c0d8c9f0e46e4b5d57ef07352 Mon Sep 17 00:00:00 2001 From: o0Coro0o Date: Mon, 11 Sep 2017 21:42:29 +0200 Subject: [PATCH 36/99] Add files via upload Added Spanish language --- locales/es.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 locales/es.lua diff --git a/locales/es.lua b/locales/es.lua new file mode 100644 index 00000000..6f2e99fc --- /dev/null +++ b/locales/es.lua @@ -0,0 +1,31 @@ +Locales['es'] = { + + ['free_prop'] = 'Propiedad libre', + ['property'] = 'Propiedad', + ['enter'] = 'Entrar', + ['leave'] = 'Salir', + ['buy'] = 'Comprar', + ['rent'] = 'Alquilar', + ['visit'] = 'Visitar', + ['press_to_menu'] = 'Presionar ~INPUT_CONTEXT~ para acceder al menú', + ['owned_properties'] = 'Propiedad adquirida', + ['available_properties'] = 'Propiedades disponibles', + ['invite_player'] = 'Invitar a un jugador', + ['you_invited'] = 'Has invitado a %s', + ['player_clothes'] = 'Ropa', + ['remove_object'] = 'Retirar objeto', + ['deposit_object'] = 'Depositar objeto', + ['invite'] = 'Invitar', + ['dirty_money'] = 'Dinero sucio €', + ['inventory'] = 'Inventario', + ['amount'] = '¿Cantidad?', + ['amount_invalid'] = 'Cantidad inválida', + ['press_to_exit'] = 'Presione ~INPUT_CONTEXT~ para salir de la propiedad', + ['rented_for'] = 'Has alquilado una propiedad por €', + ['purchased_for'] = 'Has comprado una propiedad por €', + ['made_property'] = 'Ha hecho una propiedad', + ['not_enough'] = 'n\'No tiene suficiente d\'dinero', + ['invalid_quantity'] = 'Cantidad inválida', + ['paid_rent'] = 'Has ~g~pagado~s~ por el alquiler : ~g~€', + +} From 39ca72ce9602c18761e5093a61502e8d7c2b533e Mon Sep 17 00:00:00 2001 From: Coro Veneno Date: Tue, 12 Sep 2017 23:13:48 +0200 Subject: [PATCH 37/99] Update Spanish Language Added Spanish Language --- __resource.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/__resource.lua b/__resource.lua index fc295f8e..3889864e 100644 --- a/__resource.lua +++ b/__resource.lua @@ -8,6 +8,7 @@ server_scripts { 'locales/br.lua', 'locales/en.lua', 'locales/fr.lua', + 'locales/es.lua', '@mysql-async/lib/MySQL.lua', 'config.lua', 'server/main.lua' @@ -19,10 +20,11 @@ client_scripts { 'locales/br.lua', 'locales/en.lua', 'locales/fr.lua', + 'locales/es.lua', 'config.lua', 'client/main.lua' } dependencies { 'instance' -} \ No newline at end of file +} From d59f61e422a6c8c58219babe7dc89c1660e4defb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Wed, 13 Sep 2017 12:30:05 +0200 Subject: [PATCH 38/99] Fix chest showing when visiting property --- client/main.lua | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 3f2cd733..6f376dae 100644 --- a/client/main.lua +++ b/client/main.lua @@ -24,6 +24,7 @@ local CurrentAction = nil local CurrentActionMsg = '' local CurrentActionData = {} local FirstSpawn = true +local HasChest = false function DrawSub(text, time) ClearPrints() @@ -868,6 +869,29 @@ AddEventHandler('instance:onCreate', function(instance) end) +RegisterNetEvent('instance:onEnter') +AddEventHandler('instance:onEnter', function(instance) + + if instance.type == 'property' then + + local property = GetProperty(instance.data.property) + local isHost = GetPlayerFromServerId(instance.host) == PlayerId() + local isOwned = false + + if PropertyIsOwned(property) == true then + isOwned = true + end + + if(isOwned or not isHost) then + HasChest = true + else + HasChest = false + end + + end + +end) + RegisterNetEvent('instance:onPlayerLeft') AddEventHandler('instance:onPlayerLeft', function(instance, player) if player == instance.host then @@ -938,6 +962,7 @@ Citizen.CreateThread(function() for i=1, #Config.Properties, 1 do local property = Config.Properties[i] + local isHost = false if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.DrawDistance) then DrawMarker(Config.MarkerType, property.entering.x, property.entering.y, property.entering.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) @@ -947,7 +972,7 @@ Citizen.CreateThread(function() DrawMarker(Config.MarkerType, property.exit.x, property.exit.y, property.exit.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 - if(property.roomMenu ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.DrawDistance) then + if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.DrawDistance) then DrawMarker(Config.MarkerType, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.RoomMenuMarkerColor.r, Config.RoomMenuMarkerColor.g, Config.RoomMenuMarkerColor.b, 100, false, true, 2, false, false, false, false) end @@ -995,7 +1020,7 @@ Citizen.CreateThread(function() currentPart = 'outside' end - if(property.roomMenu ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.MarkerSize.x) then + if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.MarkerSize.x) then isInMarker = true currentProperty = property.name currentPart = 'roomMenu' From 7e53fc40412ec6ec0f8697158e9f79b875151d4e 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:13 +0200 Subject: [PATCH 39/99] Update LICENSE.txt --- LICENSE.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 30ace6a8..0bcccde6 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_property + 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_property 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 d41e882fdc0eed0100d77018ca26c00d8abed4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Fri, 15 Sep 2017 15:38:35 +0200 Subject: [PATCH 40/99] chore(resource): Add version --- __resource.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/__resource.lua b/__resource.lua index 3889864e..33a3adc0 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,6 +2,8 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Property' +version '1.0.0' + server_scripts { '@es_extended/locale.lua', 'locales/de.lua', From e9e86905579fc99cbc84fb275671a559bc08e52a Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sun, 8 Oct 2017 12:12:38 +0200 Subject: [PATCH 41/99] chore(style): correct indentation --- .editorconfig | 9 + __resource.lua | 36 +- client/main.lua | 1374 +++++++++++++++--------------- config.lua | 2 +- esx_property.sql | 98 +-- locales/br.lua | 52 +- locales/de.lua | 54 +- locales/en.lua | 54 +- locales/es.lua | 62 +- locales/fr.lua | 54 +- localization/de_esx_property.sql | 98 +-- offices.sql | 62 +- server/main.lua | 702 +++++++-------- 13 files changed, 1333 insertions(+), 1324 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 33a3adc0..0c253fc9 100644 --- a/__resource.lua +++ b/__resource.lua @@ -5,28 +5,28 @@ description 'ESX Property' version '1.0.0' server_scripts { - '@es_extended/locale.lua', - 'locales/de.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/de.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/de.lua', - 'locales/br.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'locales/es.lua', - 'config.lua', - 'client/main.lua' + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'locales/es.lua', + 'config.lua', + 'client/main.lua' } dependencies { - 'instance' + 'instance' } diff --git a/client/main.lua b/client/main.lua index 6f376dae..df395de4 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,13 +1,13 @@ 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 @@ -28,1067 +28,1067 @@ local HasChest = false function DrawSub(text, time) ClearPrints() - SetTextEntry_2('STRING') - AddTextComponentString(text) - DrawSubtitleTimed(time, 1) + SetTextEntry_2('STRING') + AddTextComponentString(text) + DrawSubtitleTimed(time, 1) end function CreateBlips() - for i=1, #Config.Properties, 1 do + for i=1, #Config.Properties, 1 do - local property = Config.Properties[i] + local property = Config.Properties[i] - if property.entering ~= nil then + if property.entering ~= nil then - Blips[property.name] = AddBlipForCoord(property.entering.x, property.entering.y, property.entering.z) + Blips[property.name] = AddBlipForCoord(property.entering.x, property.entering.y, property.entering.z) - SetBlipSprite (Blips[property.name], 369) - SetBlipDisplay(Blips[property.name], 4) - SetBlipScale (Blips[property.name], 1.0) - SetBlipAsShortRange(Blips[property.name], true) + SetBlipSprite (Blips[property.name], 369) + SetBlipDisplay(Blips[property.name], 4) + SetBlipScale (Blips[property.name], 1.0) + SetBlipAsShortRange(Blips[property.name], true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('free_prop')) - EndTextCommandSetBlipName(Blips[property.name]) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(_U('free_prop')) + EndTextCommandSetBlipName(Blips[property.name]) - end - end + end + end end function GetProperties() - return Config.Properties + return Config.Properties end function GetProperty(name) - for i=1, #Config.Properties, 1 do - if Config.Properties[i].name == name then - return Config.Properties[i] - end - end + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name == name then + return Config.Properties[i] + end + end end function GetGateway(property) - for i=1, #Config.Properties, 1 do + for i=1, #Config.Properties, 1 do - local property2 = Config.Properties[i] + local property2 = Config.Properties[i] - if property2.isGateway and property2.name == property.gateway then - return property2 - end + if property2.isGateway and property2.name == property.gateway then + return property2 + end - end + end end function GetGatewayProperties(property) - local properties = {} + local properties = {} - for i=1, #Config.Properties, 1 do - if Config.Properties[i].gateway == property.name then - table.insert(properties, Config.Properties[i]) - end - end + for i=1, #Config.Properties, 1 do + if Config.Properties[i].gateway == property.name then + table.insert(properties, Config.Properties[i]) + end + end - return properties + return properties end function EnterProperty(name, owner) - local property = GetProperty(name) - local playerPed = GetPlayerPed(-1) - CurrentProperty = property - CurrentPropertyOwner = owner + local property = GetProperty(name) + local playerPed = GetPlayerPed(-1) + CurrentProperty = property + CurrentPropertyOwner = owner - for i=1, #Config.Properties, 1 do - if Config.Properties[i].name ~= name then - Config.Properties[i].disabled = true - end - end + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name ~= name then + Config.Properties[i].disabled = true + end + end - TriggerServerEvent('esx_property:saveLastProperty', name) + TriggerServerEvent('esx_property:saveLastProperty', name) - Citizen.CreateThread(function() + Citizen.CreateThread(function() - DoScreenFadeOut(800) + DoScreenFadeOut(800) - while not IsScreenFadedOut() do - Citizen.Wait(0) - end + while not IsScreenFadedOut() do + Citizen.Wait(0) + end - for i=1, #property.ipls, 1 do + for i=1, #property.ipls, 1 do - RequestIpl(property.ipls[i]) + RequestIpl(property.ipls[i]) - while not IsIplActive(property.ipls[i]) do - Citizen.Wait(0) - end + while not IsIplActive(property.ipls[i]) do + Citizen.Wait(0) + end - end + end - SetEntityCoords(playerPed, property.inside.x, property.inside.y, property.inside.z) + SetEntityCoords(playerPed, property.inside.x, property.inside.y, property.inside.z) - DoScreenFadeIn(800) + DoScreenFadeIn(800) - DrawSub(property.label, 5000) - end) + DrawSub(property.label, 5000) + end) end function ExitProperty(name) - local property = GetProperty(name) - local playerPed = GetPlayerPed(-1) - local outside = nil - CurrentProperty = nil + local property = GetProperty(name) + local playerPed = GetPlayerPed(-1) + local outside = nil + CurrentProperty = nil - if property.isSingle then - outside = property.outside - else - outside = GetGateway(property).outside - end + if property.isSingle then + outside = property.outside + else + outside = GetGateway(property).outside + end - TriggerServerEvent('esx_property:deleteLastProperty') + TriggerServerEvent('esx_property:deleteLastProperty') - Citizen.CreateThread(function() + Citizen.CreateThread(function() - DoScreenFadeOut(800) + DoScreenFadeOut(800) - while not IsScreenFadedOut() do - Citizen.Wait(0) - end + while not IsScreenFadedOut() do + Citizen.Wait(0) + end - SetEntityCoords(playerPed, outside.x, outside.y, outside.z) + SetEntityCoords(playerPed, outside.x, outside.y, outside.z) - for i=1, #property.ipls, 1 do - RemoveIpl(property.ipls[i]) - end + for i=1, #property.ipls, 1 do + RemoveIpl(property.ipls[i]) + end - for i=1, #Config.Properties, 1 do - Config.Properties[i].disabled = false - end + for i=1, #Config.Properties, 1 do + Config.Properties[i].disabled = false + end - DoScreenFadeIn(800) + DoScreenFadeIn(800) - end) + end) end function SetPropertyOwned(name, owned) - local property = GetProperty(name) - local entering = nil - local enteringName = nil + local property = GetProperty(name) + local entering = nil + local enteringName = nil - if property.isSingle then - entering = property.entering - enteringName = property.name - else - local gateway = GetGateway(property) - entering = gateway.entering - enteringName = gateway.name - end + if property.isSingle then + entering = property.entering + enteringName = property.name + else + local gateway = GetGateway(property) + entering = gateway.entering + enteringName = gateway.name + end - if owned then + if owned then - OwnedProperties[name] = true + OwnedProperties[name] = true - RemoveBlip(Blips[enteringName]) + RemoveBlip(Blips[enteringName]) - Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) + Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) - SetBlipSprite(Blips[enteringName], 357) - SetBlipAsShortRange(Blips[enteringName], true) + SetBlipSprite(Blips[enteringName], 357) + SetBlipAsShortRange(Blips[enteringName], true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('property')) - EndTextCommandSetBlipName(Blips[enteringName]) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(_U('property')) + EndTextCommandSetBlipName(Blips[enteringName]) - else + else - OwnedProperties[name] = nil + OwnedProperties[name] = nil - local found = false + local found = false - for k,v in pairs(OwnedProperties) do + for k,v in pairs(OwnedProperties) do - local _property = GetProperty(k) - local _gateway = GetGateway(_property) + local _property = GetProperty(k) + local _gateway = GetGateway(_property) - if _gateway ~= nil then + if _gateway ~= nil then - if _gateway.name == enteringName then - found = true - break - end - end + if _gateway.name == enteringName then + found = true + break + end + end - end + end - if not found then + if not found then - RemoveBlip(Blips[enteringName]) + RemoveBlip(Blips[enteringName]) - Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) + Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) - SetBlipSprite(Blips[enteringName], 369) - SetBlipAsShortRange(Blips[enteringName], true) + SetBlipSprite(Blips[enteringName], 369) + SetBlipAsShortRange(Blips[enteringName], true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('free_prop')) - EndTextCommandSetBlipName(Blips[enteringName]) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(_U('free_prop')) + EndTextCommandSetBlipName(Blips[enteringName]) - end + end - end + end end function PropertyIsOwned(property) - return OwnedProperties[property.name] == true + return OwnedProperties[property.name] == true end function OpenPropertyMenu(property) - local elements = {} + local elements = {} - if PropertyIsOwned(property) then + if PropertyIsOwned(property) then - table.insert(elements, {label = _U('enter'), value = 'enter'}) + table.insert(elements, {label = _U('enter'), value = 'enter'}) - if not Config.EnablePlayerManagement then - table.insert(elements, {label = _U('leave'), value = 'leave'}) - end + if not Config.EnablePlayerManagement then + table.insert(elements, {label = _U('leave'), value = 'leave'}) + end - else + else - if not Config.EnablePlayerManagement then - table.insert(elements, {label = _U('buy'), value = 'buy'}) - table.insert(elements, {label = _U('rent'), value = 'rent'}) - end + if not Config.EnablePlayerManagement then + table.insert(elements, {label = _U('buy'), value = 'buy'}) + table.insert(elements, {label = _U('rent'), value = 'rent'}) + end - table.insert(elements, {label = _U('visit'), value = 'visit'}) + table.insert(elements, {label = _U('visit'), value = 'visit'}) - end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'property', - { - title = property.label, - align = 'top-left', - elements = elements, - }, - function(data2, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'property', + { + title = property.label, + align = 'top-left', + elements = elements, + }, + function(data2, menu) - menu.close() + menu.close() - if data2.current.value == 'enter' then - TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) - end + if data2.current.value == 'enter' then + TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) + end - if data2.current.value == 'leave' then - TriggerServerEvent('esx_property:removeOwnedProperty', property.name) - end + if data2.current.value == 'leave' then + TriggerServerEvent('esx_property:removeOwnedProperty', property.name) + end - if data2.current.value == 'buy' then - TriggerServerEvent('esx_property:buyProperty', property.name) - end + if data2.current.value == 'buy' then + TriggerServerEvent('esx_property:buyProperty', property.name) + end - if data2.current.value == 'rent' then - TriggerServerEvent('esx_property:rentProperty', property.name) - end + if data2.current.value == 'rent' then + TriggerServerEvent('esx_property:rentProperty', property.name) + end - if data2.current.value == 'visit' then - TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) - end + if data2.current.value == 'visit' then + TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) + end - end, - function(data, menu) + end, + function(data, menu) - menu.close() + menu.close() - CurrentAction = 'property_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property} - end - ) + CurrentAction = 'property_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} + end + ) end function OpenGatewayMenu(property) - if Config.EnablePlayerManagement then - OpenGatewayOwnedPropertiesMenu(gatewayProperties) - else + if Config.EnablePlayerManagement then + OpenGatewayOwnedPropertiesMenu(gatewayProperties) + else - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'gateway', - { - title = property.name, - align = 'top-left', - elements = { - {label = _U('owned_properties'), value = 'owned_properties'}, - {label = _U('available_properties'), value = 'available_properties'}, - } - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'gateway', + { + title = property.name, + align = 'top-left', + elements = { + {label = _U('owned_properties'), value = 'owned_properties'}, + {label = _U('available_properties'), value = 'available_properties'}, + } + }, + function(data, menu) - if data.current.value == 'owned_properties' then - OpenGatewayOwnedPropertiesMenu(property) - end + if data.current.value == 'owned_properties' then + OpenGatewayOwnedPropertiesMenu(property) + end - if data.current.value == 'available_properties' then - OpenGatewayAvailablePropertiesMenu(property) - end + if data.current.value == 'available_properties' then + OpenGatewayAvailablePropertiesMenu(property) + end - end, - function(data, menu) + end, + function(data, menu) - menu.close() + menu.close() - CurrentAction = 'gateway_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property} + CurrentAction = 'gateway_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} - end - ) + end + ) - end + end end function OpenGatewayOwnedPropertiesMenu(property) - local gatewayProperties = GetGatewayProperties(property) - local elements = {} + local gatewayProperties = GetGatewayProperties(property) + local elements = {} - for i=1, #gatewayProperties, 1 do + for i=1, #gatewayProperties, 1 do - if PropertyIsOwned(gatewayProperties[i]) then - table.insert(elements, { - label = gatewayProperties[i].label, - value = gatewayProperties[i].name - }) - end + if PropertyIsOwned(gatewayProperties[i]) then + table.insert(elements, { + label = gatewayProperties[i].label, + value = gatewayProperties[i].name + }) + end - end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'gateway_owned_properties', - { - title = property.name .. ' - ' .. _U('owned_properties'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'gateway_owned_properties', + { + title = property.name .. ' - ' .. _U('owned_properties'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - menu.close() + menu.close() - local elements = { - {label = _U('enter'), value = 'enter'} - } + local elements = { + {label = _U('enter'), value = 'enter'} + } - if not Config.EnablePlayerManagement then - table.insert(elements, {label = _U('leave'), value = 'leave'}) - end + if not Config.EnablePlayerManagement then + table.insert(elements, {label = _U('leave'), value = 'leave'}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'gateway_owned_properties_actions', - { - title = data.current.label, - align = 'top-left', - elements = elements, - }, - function(data2, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'gateway_owned_properties_actions', + { + title = data.current.label, + align = 'top-left', + elements = elements, + }, + function(data2, menu) - menu.close() + menu.close() - if data2.current.value == 'enter' then - TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) - end + if data2.current.value == 'enter' then + TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) + end - if data2.current.value == 'leave' then - TriggerServerEvent('esx_property:removeOwnedProperty', data.current.value) - end + if data2.current.value == 'leave' then + TriggerServerEvent('esx_property:removeOwnedProperty', data.current.value) + end - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) end function OpenGatewayAvailablePropertiesMenu(property) - local gatewayProperties = GetGatewayProperties(property) - local elements = {} + local gatewayProperties = GetGatewayProperties(property) + local elements = {} - for i=1, #gatewayProperties, 1 do + for i=1, #gatewayProperties, 1 do - if not PropertyIsOwned(gatewayProperties[i]) then - table.insert(elements, { - label = gatewayProperties[i].label .. ' $' .. gatewayProperties[i].price, - value = gatewayProperties[i].name, - price = gatewayProperties[i].price - }) - end + if not PropertyIsOwned(gatewayProperties[i]) then + table.insert(elements, { + label = gatewayProperties[i].label .. ' $' .. gatewayProperties[i].price, + value = gatewayProperties[i].name, + price = gatewayProperties[i].price + }) + end - end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'gateway_available_properties', - { - title = property.name.. ' - ' .. _U('available_properties'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'gateway_available_properties', + { + title = property.name.. ' - ' .. _U('available_properties'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - menu.close() + menu.close() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'gateway_available_properties_actions', - { - title = property.name, - align = 'top-left', - elements = { - {label = _U('buy'), value = 'buy'}, - {label = _U('rent'), value = 'rent'}, - {label = _U('visit'), value = 'visit'}, - }, - }, - function(data2, menu) - menu.close() + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'gateway_available_properties_actions', + { + title = property.name, + align = 'top-left', + elements = { + {label = _U('buy'), value = 'buy'}, + {label = _U('rent'), value = 'rent'}, + {label = _U('visit'), value = 'visit'}, + }, + }, + function(data2, menu) + menu.close() - if data2.current.value == 'buy' then - TriggerServerEvent('esx_property:buyProperty', data.current.value) - end + if data2.current.value == 'buy' then + TriggerServerEvent('esx_property:buyProperty', data.current.value) + end - if data2.current.value == 'rent' then - TriggerServerEvent('esx_property:rentProperty', data.current.value) - end + if data2.current.value == 'rent' then + TriggerServerEvent('esx_property:rentProperty', data.current.value) + end - if data2.current.value == 'visit' then - TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) - end + if data2.current.value == 'visit' then + TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) + end - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) end function OpenRoomMenu(property, owner) - local entering = nil - local elements = {} + local entering = nil + local elements = {} - if property.isSingle then - entering = property.entering - else - entering = GetGateway(property).entering - end + if property.isSingle then + entering = property.entering + else + entering = GetGateway(property).entering + end - table.insert(elements, {label = _U('invite_player'), value = 'invite_player'}) + table.insert(elements, {label = _U('invite_player'), value = 'invite_player'}) - if CurrentPropertyOwner == owner then - table.insert(elements, {label = _U('player_clothes'), value = 'player_dressing'}) - end + if CurrentPropertyOwner == owner then + table.insert(elements, {label = _U('player_clothes'), value = 'player_dressing'}) + end - table.insert(elements, {label = _U('remove_object'), value = 'room_inventory'}) - table.insert(elements, {label = _U('deposit_object'), value = 'player_inventory'}) + table.insert(elements, {label = _U('remove_object'), value = 'room_inventory'}) + table.insert(elements, {label = _U('deposit_object'), value = 'player_inventory'}) - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'room', - { - title = property.label, - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'room', + { + title = property.label, + align = 'top-left', + elements = elements, + }, + function(data, menu) - if data.current.value == 'invite_player' then + if data.current.value == 'invite_player' then - local playersInArea = ESX.Game.GetPlayersInArea(entering, 10.0) - local elements = {} + local playersInArea = ESX.Game.GetPlayersInArea(entering, 10.0) + local elements = {} - for i=1, #playersInArea, 1 do - if playersInArea[i] ~= PlayerId() then - table.insert(elements, {label = GetPlayerName(playersInArea[i]), value = playersInArea[i]}) - end - end + for i=1, #playersInArea, 1 do + if playersInArea[i] ~= PlayerId() then + table.insert(elements, {label = GetPlayerName(playersInArea[i]), value = playersInArea[i]}) + end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'room_invite', - { - title = property.label .. ' - ' .. _U('invite'), - align = 'top-left', - elements = elements, - }, - function(data, menu) - TriggerEvent('instance:invite', 'property', GetPlayerServerId(data.current.value), {property = property.name, owner = owner}) - ESX.ShowNotification(_U('you_invited', GetPlayerName(data.current.value))) - end, - function(data, menu) - menu.close() - end - ) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'room_invite', + { + title = property.label .. ' - ' .. _U('invite'), + align = 'top-left', + elements = elements, + }, + function(data, menu) + TriggerEvent('instance:invite', 'property', GetPlayerServerId(data.current.value), {property = property.name, owner = owner}) + ESX.ShowNotification(_U('you_invited', GetPlayerName(data.current.value))) + end, + function(data, menu) + menu.close() + end + ) - end + end - if data.current.value == 'player_dressing' then + if data.current.value == 'player_dressing' then - ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) + ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) - local elements = {} + local elements = {} - for i=1, #dressing, 1 do - table.insert(elements, {label = dressing[i].label, value = dressing[i].skin}) - end + for i=1, #dressing, 1 do + table.insert(elements, {label = dressing[i].label, value = dressing[i].skin}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'player_dressing', - { - title = property.label .. ' - ' .. _U('player_clothes'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'player_dressing', + { + title = property.label .. ' - ' .. _U('player_clothes'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - TriggerEvent('skinchanger:getSkin', function(skin) + TriggerEvent('skinchanger:getSkin', function(skin) - TriggerEvent('skinchanger:loadClothes', skin, data.current.value) - TriggerEvent('esx_skin:setLastSkin', skin) + TriggerEvent('skinchanger:loadClothes', skin, data.current.value) + TriggerEvent('esx_skin:setLastSkin', skin) - TriggerEvent('skinchanger:getSkin', function(skin) - TriggerServerEvent('esx_skin:save', skin) - end) + TriggerEvent('skinchanger:getSkin', function(skin) + TriggerServerEvent('esx_skin:save', skin) + end) - end) + end) - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end) + end) - end + end - if data.current.value == 'room_inventory' then - OpenRoomInventoryMenu(property, owner) - end + if data.current.value == 'room_inventory' then + OpenRoomInventoryMenu(property, owner) + end - if data.current.value == 'player_inventory' then - OpenPlayerInventoryMenu(property, owner) - end + if data.current.value == 'player_inventory' then + OpenPlayerInventoryMenu(property, owner) + end - end, - function(data, menu) + end, + function(data, menu) - menu.close() + menu.close() - CurrentAction = 'room_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property, owner = owner} - end - ) + CurrentAction = 'room_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property, owner = owner} + end + ) end function OpenRoomInventoryMenu(property, owner) - ESX.TriggerServerCallback('esx_property:getPropertyInventory', function(inventory) + ESX.TriggerServerCallback('esx_property:getPropertyInventory', function(inventory) - local elements = {} + local elements = {} - table.insert(elements, {label = _U('dirty_money') .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) + table.insert(elements, {label = _U('dirty_money') .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) - 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 - for i=1, #inventory.weapons, 1 do - local weapon = inventory.weapons[i] - table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name) .. ' [' .. weapon.ammo .. ']', type = 'item_weapon', value = weapon.name, ammo = weapon.ammo}) - end + for i=1, #inventory.weapons, 1 do + local weapon = inventory.weapons[i] + table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name) .. ' [' .. weapon.ammo .. ']', type = 'item_weapon', value = weapon.name, ammo = weapon.ammo}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'room_inventory', - { - title = property.label .. ' - ' .. _U('inventory'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'room_inventory', + { + title = property.label .. ' - ' .. _U('inventory'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - if data.current.type == 'item_weapon' then + if data.current.type == 'item_weapon' then - menu.close() + menu.close() - TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, data.current.ammo) + TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, data.current.ammo) - ESX.SetTimeout(300, function() - OpenRoomInventoryMenu(property, owner) - end) + ESX.SetTimeout(300, function() + OpenRoomInventoryMenu(property, owner) + end) - else + else - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'get_item_count', - { - title = _U('amount'), - }, - function(data2, menu) + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'get_item_count', + { + title = _U('amount'), + }, + function(data2, menu) - local quantity = tonumber(data2.value) + local quantity = tonumber(data2.value) - if quantity == nil then - ESX.ShowNotification(_U('amount_invalid')) - else + if quantity == nil then + ESX.ShowNotification(_U('amount_invalid')) + else - menu.close() + menu.close() - TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, quantity) + TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, quantity) - ESX.SetTimeout(300, function() - OpenRoomInventoryMenu(property, owner) - end) + ESX.SetTimeout(300, function() + OpenRoomInventoryMenu(property, owner) + end) - end + end - end, - function(data2,menu) - menu.close() - end - ) + end, + function(data2,menu) + menu.close() + end + ) - end + end - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end, owner) + end, owner) end function OpenPlayerInventoryMenu(property, owner) - ESX.TriggerServerCallback('esx_property:getPlayerInventory', function(inventory) + ESX.TriggerServerCallback('esx_property:getPlayerInventory', function(inventory) - local elements = {} + local elements = {} - table.insert(elements, {label = _U('dirty_money') .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) + table.insert(elements, {label = _U('dirty_money') .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) - 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 - local playerPed = GetPlayerPed(-1) - local weaponList = ESX.GetWeaponList() + 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 .. ' [' .. ammo .. ']', type = 'item_weapon', value = weaponList[i].name, ammo = ammo}) - 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 .. ' [' .. ammo .. ']', type = 'item_weapon', value = weaponList[i].name, ammo = ammo}) + end - end + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'player_inventory', - { - title = property.label .. ' - ' .. _U('inventory'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'player_inventory', + { + title = property.label .. ' - ' .. _U('inventory'), + align = 'top-left', + elements = elements, + }, + function(data, menu) - if data.current.type == 'item_weapon' then + if data.current.type == 'item_weapon' then - menu.close() + menu.close() - TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, data.current.ammo) + TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, data.current.ammo) - ESX.SetTimeout(300, function() - OpenPlayerInventoryMenu(property, owner) - end) + ESX.SetTimeout(300, function() + OpenPlayerInventoryMenu(property, owner) + end) - else + else - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'put_item_count', - { - title = _U('amount'), - }, - function(data2, menu) + ESX.UI.Menu.Open( + 'dialog', GetCurrentResourceName(), 'put_item_count', + { + title = _U('amount'), + }, + function(data2, menu) - menu.close() + menu.close() - TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, tonumber(data2.value)) + TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, tonumber(data2.value)) - ESX.SetTimeout(300, function() - OpenPlayerInventoryMenu(property, owner) - end) + ESX.SetTimeout(300, function() + OpenPlayerInventoryMenu(property, owner) + end) - end, - function(data2,menu) - menu.close() - end - ) + end, + function(data2,menu) + menu.close() + end + ) - end + end - end, - function(data, menu) - menu.close() - end - ) + end, + function(data, menu) + menu.close() + end + ) - end) + end) end AddEventHandler('instance:loaded', function() - TriggerEvent('instance:registerType', 'property', - function(instance) - EnterProperty(instance.data.property, instance.data.owner) - end, - function(instance) - ExitProperty(instance.data.property) - end - ) - + TriggerEvent('instance:registerType', 'property', + function(instance) + EnterProperty(instance.data.property, instance.data.owner) + end, + function(instance) + ExitProperty(instance.data.property) + end + ) + end) AddEventHandler('playerSpawned', function() - if FirstSpawn then + if FirstSpawn then - Citizen.CreateThread(function() + Citizen.CreateThread(function() - while not ESX.IsPlayerLoaded() do - Citizen.Wait(0) - end + while not ESX.IsPlayerLoaded() do + Citizen.Wait(0) + end - ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) - if propertyName ~= nil then - TriggerEvent('instance:create', 'property', {property = propertyName, owner = ESX.GetPlayerData().identifier}) - end - end) + ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) + if propertyName ~= nil then + TriggerEvent('instance:create', 'property', {property = propertyName, owner = ESX.GetPlayerData().identifier}) + end + end) - end) + end) - FirstSpawn = false - end + FirstSpawn = false + end end) RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(xPlayer) - PlayerLoaded = true + PlayerLoaded = true end) AddEventHandler('esx_property:getProperties', function(cb) - cb(GetProperties()) + cb(GetProperties()) end) AddEventHandler('esx_property:getProperty', function(name, cb) - cb(GetProperty(name)) + cb(GetProperty(name)) end) AddEventHandler('esx_property:getGateway', function(property, cb) - cb(GetGateway(property)) + cb(GetGateway(property)) end) RegisterNetEvent('esx_property:setPropertyOwned') AddEventHandler('esx_property:setPropertyOwned', function(name, owned) - SetPropertyOwned(name, owned) + SetPropertyOwned(name, owned) end) RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(xPlayer) - ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties) - for i=1, #ownedProperties, 1 do - SetPropertyOwned(ownedProperties[i], true) - end - end) + ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties) + for i=1, #ownedProperties, 1 do + SetPropertyOwned(ownedProperties[i], true) + end + end) end) RegisterNetEvent('instance:onCreate') AddEventHandler('instance:onCreate', function(instance) - if instance.type == 'property' then - TriggerEvent('instance:enter', instance) - end + if instance.type == 'property' then + TriggerEvent('instance:enter', instance) + end end) RegisterNetEvent('instance:onEnter') AddEventHandler('instance:onEnter', function(instance) - - if instance.type == 'property' then - local property = GetProperty(instance.data.property) - local isHost = GetPlayerFromServerId(instance.host) == PlayerId() - local isOwned = false + if instance.type == 'property' then - if PropertyIsOwned(property) == true then - isOwned = true - end + local property = GetProperty(instance.data.property) + local isHost = GetPlayerFromServerId(instance.host) == PlayerId() + local isOwned = false - if(isOwned or not isHost) then - HasChest = true - else - HasChest = false - end + if PropertyIsOwned(property) == true then + isOwned = true + end - end + if(isOwned or not isHost) then + HasChest = true + else + HasChest = false + end + + end end) RegisterNetEvent('instance:onPlayerLeft') AddEventHandler('instance:onPlayerLeft', function(instance, player) - if player == instance.host then - TriggerEvent('instance:leave') - end + if player == instance.host then + TriggerEvent('instance:leave') + end end) AddEventHandler('esx_property:hasEnteredMarker', function(name, part) - local property = GetProperty(name) + local property = GetProperty(name) - if part == 'entering' then + if part == 'entering' then - if property.isSingle then - CurrentAction = 'property_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property} - else - CurrentAction = 'gateway_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property} - end + if property.isSingle then + CurrentAction = 'property_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} + else + CurrentAction = 'gateway_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} + end - end + end - if part == 'exit' then - CurrentAction = 'room_exit' - CurrentActionMsg = _U('press_to_exit') - CurrentActionData = {propertyName = name} - end + if part == 'exit' then + CurrentAction = 'room_exit' + CurrentActionMsg = _U('press_to_exit') + CurrentActionData = {propertyName = name} + end - if part == 'roomMenu' then - CurrentAction = 'room_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property, owner = CurrentPropertyOwner} - end + if part == 'roomMenu' then + CurrentAction = 'room_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property, owner = CurrentPropertyOwner} + end end) AddEventHandler('esx_property:hasExitedMarker', function(name, part) - ESX.UI.Menu.CloseAll() - CurrentAction = nil + ESX.UI.Menu.CloseAll() + CurrentAction = nil end) -- Init 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 - ESX.TriggerServerCallback('esx_property:getProperties', function(properties) - Config.Properties = properties - CreateBlips() - end) + ESX.TriggerServerCallback('esx_property:getProperties', function(properties) + Config.Properties = properties + CreateBlips() + end) end) -- Display markers Citizen.CreateThread(function() - while true do + while true do - Wait(0) + Wait(0) - local coords = GetEntityCoords(GetPlayerPed(-1)) + local coords = GetEntityCoords(GetPlayerPed(-1)) - for i=1, #Config.Properties, 1 do + for i=1, #Config.Properties, 1 do - local property = Config.Properties[i] - local isHost = false + local property = Config.Properties[i] + local isHost = false - if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.DrawDistance) then - DrawMarker(Config.MarkerType, property.entering.x, property.entering.y, property.entering.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 + if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.DrawDistance) then + DrawMarker(Config.MarkerType, property.entering.x, property.entering.y, property.entering.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 - if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.DrawDistance) then - DrawMarker(Config.MarkerType, property.exit.x, property.exit.y, property.exit.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 + if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.DrawDistance) then + DrawMarker(Config.MarkerType, property.exit.x, property.exit.y, property.exit.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 - if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.DrawDistance) then - DrawMarker(Config.MarkerType, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.RoomMenuMarkerColor.r, Config.RoomMenuMarkerColor.g, Config.RoomMenuMarkerColor.b, 100, false, true, 2, false, false, false, false) - end + if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.DrawDistance) then + DrawMarker(Config.MarkerType, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.RoomMenuMarkerColor.r, Config.RoomMenuMarkerColor.g, Config.RoomMenuMarkerColor.b, 100, false, true, 2, false, false, false, false) + end - end + end - end + end end) -- Enter / Exit marker events Citizen.CreateThread(function() - while true do + while true do - Wait(0) + Wait(0) - local coords = GetEntityCoords(GetPlayerPed(-1)) - local isInMarker = false - local currentProperty = nil - local currentPart = nil + local coords = GetEntityCoords(GetPlayerPed(-1)) + local isInMarker = false + local currentProperty = nil + local currentPart = nil - for i=1, #Config.Properties, 1 do + for i=1, #Config.Properties, 1 do - local property = Config.Properties[i] + local property = Config.Properties[i] - if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'entering' - end + if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'entering' + end - if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'exit' - end + if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'exit' + end - if(property.inside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.inside.x, property.inside.y, property.inside.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'inside' - end + if(property.inside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.inside.x, property.inside.y, property.inside.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'inside' + end - if(property.outside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.outside.x, property.outside.y, property.outside.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'outside' - end + if(property.outside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.outside.x, property.outside.y, property.outside.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'outside' + end - if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'roomMenu' - end + if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'roomMenu' + end - end + end - if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastProperty ~= currentProperty or LastPart ~= currentPart) ) then + if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastProperty ~= currentProperty or LastPart ~= currentPart) ) then - HasAlreadyEnteredMarker = true - LastProperty = currentProperty - LastPart = currentPart + HasAlreadyEnteredMarker = true + LastProperty = currentProperty + LastPart = currentPart - TriggerEvent('esx_property:hasEnteredMarker', currentProperty, currentPart) - end + TriggerEvent('esx_property:hasEnteredMarker', currentProperty, currentPart) + end - if not isInMarker and HasAlreadyEnteredMarker then + if not isInMarker and HasAlreadyEnteredMarker then - HasAlreadyEnteredMarker = false + HasAlreadyEnteredMarker = false - TriggerEvent('esx_property:hasExitedMarker', LastProperty, LastPart) - end + TriggerEvent('esx_property:hasExitedMarker', LastProperty, LastPart) + 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 (GetGameTimer() - GUI.Time) > 300 then + if IsControlPressed(0, Keys['E']) and (GetGameTimer() - GUI.Time) > 300 then - if CurrentAction == 'property_menu' then - OpenPropertyMenu(CurrentActionData.property) - end + if CurrentAction == 'property_menu' then + OpenPropertyMenu(CurrentActionData.property) + end - if CurrentAction == 'gateway_menu' then + if CurrentAction == 'gateway_menu' then - if Config.EnablePlayerManagement then - OpenGatewayOwnedPropertiesMenu(CurrentActionData.property) - else - OpenGatewayMenu(CurrentActionData.property) - end + if Config.EnablePlayerManagement then + OpenGatewayOwnedPropertiesMenu(CurrentActionData.property) + else + OpenGatewayMenu(CurrentActionData.property) + end - end + end - if CurrentAction == 'room_menu' then - OpenRoomMenu(CurrentActionData.property, CurrentActionData.owner) - end + if CurrentAction == 'room_menu' then + OpenRoomMenu(CurrentActionData.property, CurrentActionData.owner) + end - if CurrentAction == 'room_exit' then - TriggerEvent('instance:leave') - end + if CurrentAction == 'room_exit' then + TriggerEvent('instance:leave') + end - CurrentAction = nil - GUI.Time = GetGameTimer() + CurrentAction = nil + GUI.Time = GetGameTimer() - end + end - end + end - end + end end) diff --git a/config.lua b/config.lua index dcb4bb17..fe9d76c1 100644 --- a/config.lua +++ b/config.lua @@ -7,4 +7,4 @@ Config.MarkerType = 1 Config.Zones = {} Config.Properties = {} Config.EnablePlayerManagement = false -- If set to true you need esx_realestateagentjob -Config.Locale = 'fr' +Config.Locale = 'fr' diff --git a/esx_property.sql b/esx_property.sql index a532e62f..a2e2439f 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -1,7 +1,7 @@ USE `essentialmode`; -ALTER TABLE `users` - ADD COLUMN `last_property` VARCHAR(255) NULL +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL ; INSERT INTO `addon_account` (name, label, shared) VALUES @@ -17,18 +17,18 @@ INSERT INTO `datastore` (name, label, shared) VALUES ; CREATE TABLE `owned_properties` ( - + `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `price` double NOT NULL, `rented` int(11) NOT NULL, `owner` varchar(60) NOT NULL, - + PRIMARY KEY (`id`) ); CREATE TABLE `properties` ( - + `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `label` varchar(255) DEFAULT NULL, @@ -43,52 +43,52 @@ CREATE TABLE `properties` ( `is_gateway` int(11) DEFAULT NULL, `room_menu` varchar(255) DEFAULT NULL, `price` int(11) NOT NULL, - + PRIMARY KEY (`id`) ); -INSERT INTO `properties` VALUES - (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), - (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), - (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), - (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), - (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), - (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), - (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), - (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), - (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), - (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), - (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), - (13,'Modern1Apartment','Appartement Moderne 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), - (14,'Modern2Apartment','Appartement Moderne 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), - (15,'Modern3Apartment','Appartement Moderne 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), - (16,'Mody1Apartment','Appartement Mode 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), - (17,'Mody2Apartment','Appartement Mode 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), - (18,'Mody3Apartment','Appartement Mode 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), - (19,'Vibrant1Apartment','Appartement Vibrant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), - (20,'Vibrant2Apartment','Appartement Vibrant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), - (21,'Vibrant3Apartment','Appartement Vibrant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), - (22,'Sharp1Apartment','Appartement Persan 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), - (23,'Sharp2Apartment','Appartement Persan 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), - (24,'Sharp3Apartment','Appartement Persan 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), - (25,'Monochrome1Apartment','Appartement Monochrome 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), - (26,'Monochrome2Apartment','Appartement Monochrome 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), - (27,'Monochrome3Apartment','Appartement Monochrome 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), - (28,'Seductive1Apartment','Appartement Séduisant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), - (29,'Seductive2Apartment','Appartement Séduisant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), - (30,'Seductive3Apartment','Appartement Séduisant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), - (31,'Regal1Apartment','Appartement Régal 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), - (32,'Regal2Apartment','Appartement Régal 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), - (33,'Regal3Apartment','Appartement Régal 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), - (34,'Aqua1Apartment','Appartement Aqua 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), - (35,'Aqua2Apartment','Appartement Aqua 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), - (36,'Aqua3Apartment','Appartement Aqua 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), - (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), - (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), - (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), - (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), - (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), - (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Appartement Moderne 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Appartement Moderne 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Appartement Moderne 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Appartement Mode 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Appartement Mode 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Appartement Mode 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Appartement Vibrant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Appartement Vibrant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Appartement Vibrant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Appartement Persan 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Appartement Persan 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Appartement Persan 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Appartement Monochrome 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Appartement Monochrome 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Appartement Monochrome 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Appartement Séduisant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Appartement Séduisant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Appartement Séduisant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Appartement Régal 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Appartement Régal 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Appartement Régal 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Appartement Aqua 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Appartement Aqua 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Appartement Aqua 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) ; diff --git a/locales/br.lua b/locales/br.lua index b08da2f1..042c9d86 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -1,30 +1,30 @@ Locales['br'] = { - ['free_prop'] = 'Propriedade gratuita', - ['property'] = 'Propriedade', - ['enter'] = 'Entrar', - ['leave'] = 'Sair', - ['buy'] = 'Comprar', - ['rent'] = 'Alugar', - ['visit'] = 'Visitar', - ['press_to_menu'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', - ['owned_properties'] = 'Propriedades adquiridas', - ['available_properties'] = 'Propriedades disponíveis', - ['invite_player'] = 'Convidar um jogador', - ['player_clothes'] = 'Roupas', - ['remove_object'] = 'Remover objeto', - ['deposit_object'] = 'Depositar objeto', - ['invite'] = 'Convidar', - ['dirty_money'] = 'Dinheiro sujo $', - ['inventory'] = 'Inventário', - ['amount'] = 'valor?', - ['amount_invalid'] = 'quantidade inválida', - ['press_to_exit'] = 'Pressione ~INPUT_CONTEXT~ para sair da propriedade', - ['rented_for'] = 'Você alugou uma propriedade por $', - ['purchased_for'] = 'Você comprou uma propriedade por $', - ['made_property'] = 'Você criou uma propriedade', - ['not_enough'] = 'Você não tem dinheiro suficiente', - ['invalid_quantity'] = 'Quantidade inválida', - ['paid_rent'] = 'Você ~g~pagou~s~ seu aluguel: ~g~$', + ['free_prop'] = 'Propriedade gratuita', + ['property'] = 'Propriedade', + ['enter'] = 'Entrar', + ['leave'] = 'Sair', + ['buy'] = 'Comprar', + ['rent'] = 'Alugar', + ['visit'] = 'Visitar', + ['press_to_menu'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', + ['owned_properties'] = 'Propriedades adquiridas', + ['available_properties'] = 'Propriedades disponíveis', + ['invite_player'] = 'Convidar um jogador', + ['player_clothes'] = 'Roupas', + ['remove_object'] = 'Remover objeto', + ['deposit_object'] = 'Depositar objeto', + ['invite'] = 'Convidar', + ['dirty_money'] = 'Dinheiro sujo $', + ['inventory'] = 'Inventário', + ['amount'] = 'valor?', + ['amount_invalid'] = 'quantidade inválida', + ['press_to_exit'] = 'Pressione ~INPUT_CONTEXT~ para sair da propriedade', + ['rented_for'] = 'Você alugou uma propriedade por $', + ['purchased_for'] = 'Você comprou uma propriedade por $', + ['made_property'] = 'Você criou uma propriedade', + ['not_enough'] = 'Você não tem dinheiro suficiente', + ['invalid_quantity'] = 'Quantidade inválida', + ['paid_rent'] = 'Você ~g~pagou~s~ seu aluguel: ~g~$', } diff --git a/locales/de.lua b/locales/de.lua index ffc3fdf4..2777520c 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -1,31 +1,31 @@ Locales['de'] = { - ['free_prop'] = 'Kostenlose Immobilie', - ['property'] = 'Immobilie', - ['enter'] = 'Eintreten', - ['leave'] = 'Verlassen', - ['buy'] = 'Kaufen', - ['rent'] = 'Mieten', - ['visit'] = 'Ansehen', - ['press_to_menu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', - ['owned_properties'] = 'Gekaufte Immobilien', - ['available_properties'] = 'Verfügbare Immobilien', - ['invite_player'] = 'Spieler einladen', - ['you_invited'] = 'Du hast %s eingeladen', - ['player_clothes'] = 'Kleidung', - ['remove_object'] = 'Objekt nehmen', - ['deposit_object'] = 'Objekt deponieren', - ['invite'] = 'Einladen', - ['dirty_money'] = 'Schwarzgeld $', - ['inventory'] = 'Inventar', - ['amount'] = 'Anzahlt?', - ['amount_invalid'] = 'Ungültiger Wert', - ['press_to_exit'] = 'Drücke ~INPUT_CONTEXT~ um die Immobilie zu verlassen', - ['rented_for'] = 'Du hast eine Immobilie gemietet $', - ['purchased_for'] = 'Du hast eine Immobilie gekauft $', - ['made_property'] = 'Du hast eine Immobilie gemacht', - ['not_enough'] = 'du hast nicht genug Geld', - ['invalid_quantity'] = 'Ungültiger Betrag', - ['paid_rent'] = 'du ~g~bezahlst~s~ deine Miete: ~g~$', + ['free_prop'] = 'Kostenlose Immobilie', + ['property'] = 'Immobilie', + ['enter'] = 'Eintreten', + ['leave'] = 'Verlassen', + ['buy'] = 'Kaufen', + ['rent'] = 'Mieten', + ['visit'] = 'Ansehen', + ['press_to_menu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', + ['owned_properties'] = 'Gekaufte Immobilien', + ['available_properties'] = 'Verfügbare Immobilien', + ['invite_player'] = 'Spieler einladen', + ['you_invited'] = 'Du hast %s eingeladen', + ['player_clothes'] = 'Kleidung', + ['remove_object'] = 'Objekt nehmen', + ['deposit_object'] = 'Objekt deponieren', + ['invite'] = 'Einladen', + ['dirty_money'] = 'Schwarzgeld $', + ['inventory'] = 'Inventar', + ['amount'] = 'Anzahlt?', + ['amount_invalid'] = 'Ungültiger Wert', + ['press_to_exit'] = 'Drücke ~INPUT_CONTEXT~ um die Immobilie zu verlassen', + ['rented_for'] = 'Du hast eine Immobilie gemietet $', + ['purchased_for'] = 'Du hast eine Immobilie gekauft $', + ['made_property'] = 'Du hast eine Immobilie gemacht', + ['not_enough'] = 'du hast nicht genug Geld', + ['invalid_quantity'] = 'Ungültiger Betrag', + ['paid_rent'] = 'du ~g~bezahlst~s~ deine Miete: ~g~$', } diff --git a/locales/en.lua b/locales/en.lua index 133b42d1..4d2d3b1a 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,31 +1,31 @@ Locales['en'] = { - ['free_prop'] = 'free property', - ['property'] = 'property', - ['enter'] = 'enter', - ['leave'] = 'leave', - ['buy'] = 'buy', - ['rent'] = 'rent', - ['visit'] = 'visit', - ['press_to_menu'] = 'press ~INPUT_CONTEXT~ to access the menu', - ['owned_properties'] = 'acquired properties', - ['available_properties'] = 'available properties', - ['invite_player'] = 'invite a player', - ['you_invited'] = 'you invited %s', - ['player_clothes'] = 'clothes', - ['remove_object'] = 'remove object', - ['deposit_object'] = 'deposit object', - ['invite'] = 'invite', - ['dirty_money'] = 'dirty money $', - ['inventory'] = 'inventory', - ['amount'] = 'amount?', - ['amount_invalid'] = 'invalid amount', - ['press_to_exit'] = 'press ~INPUT_CONTEXT~ to exit the property', - ['rented_for'] = 'you rented a property for $', - ['purchased_for'] = 'you purchased a property for $', - ['made_property'] = 'you have made a property', - ['not_enough'] = 'you do not have enough money', - ['invalid_quantity'] = 'invalid quantity', - ['paid_rent'] = 'you ~g~paid~s~ your rent: ~g~$', + ['free_prop'] = 'free property', + ['property'] = 'property', + ['enter'] = 'enter', + ['leave'] = 'leave', + ['buy'] = 'buy', + ['rent'] = 'rent', + ['visit'] = 'visit', + ['press_to_menu'] = 'press ~INPUT_CONTEXT~ to access the menu', + ['owned_properties'] = 'acquired properties', + ['available_properties'] = 'available properties', + ['invite_player'] = 'invite a player', + ['you_invited'] = 'you invited %s', + ['player_clothes'] = 'clothes', + ['remove_object'] = 'remove object', + ['deposit_object'] = 'deposit object', + ['invite'] = 'invite', + ['dirty_money'] = 'dirty money $', + ['inventory'] = 'inventory', + ['amount'] = 'amount?', + ['amount_invalid'] = 'invalid amount', + ['press_to_exit'] = 'press ~INPUT_CONTEXT~ to exit the property', + ['rented_for'] = 'you rented a property for $', + ['purchased_for'] = 'you purchased a property for $', + ['made_property'] = 'you have made a property', + ['not_enough'] = 'you do not have enough money', + ['invalid_quantity'] = 'invalid quantity', + ['paid_rent'] = 'you ~g~paid~s~ your rent: ~g~$', } diff --git a/locales/es.lua b/locales/es.lua index 6f2e99fc..c069fd30 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -1,31 +1,31 @@ -Locales['es'] = { - - ['free_prop'] = 'Propiedad libre', - ['property'] = 'Propiedad', - ['enter'] = 'Entrar', - ['leave'] = 'Salir', - ['buy'] = 'Comprar', - ['rent'] = 'Alquilar', - ['visit'] = 'Visitar', - ['press_to_menu'] = 'Presionar ~INPUT_CONTEXT~ para acceder al menú', - ['owned_properties'] = 'Propiedad adquirida', - ['available_properties'] = 'Propiedades disponibles', - ['invite_player'] = 'Invitar a un jugador', - ['you_invited'] = 'Has invitado a %s', - ['player_clothes'] = 'Ropa', - ['remove_object'] = 'Retirar objeto', - ['deposit_object'] = 'Depositar objeto', - ['invite'] = 'Invitar', - ['dirty_money'] = 'Dinero sucio €', - ['inventory'] = 'Inventario', - ['amount'] = '¿Cantidad?', - ['amount_invalid'] = 'Cantidad inválida', - ['press_to_exit'] = 'Presione ~INPUT_CONTEXT~ para salir de la propiedad', - ['rented_for'] = 'Has alquilado una propiedad por €', - ['purchased_for'] = 'Has comprado una propiedad por €', - ['made_property'] = 'Ha hecho una propiedad', - ['not_enough'] = 'n\'No tiene suficiente d\'dinero', - ['invalid_quantity'] = 'Cantidad inválida', - ['paid_rent'] = 'Has ~g~pagado~s~ por el alquiler : ~g~€', - -} +Locales['es'] = { + + ['free_prop'] = 'Propiedad libre', + ['property'] = 'Propiedad', + ['enter'] = 'Entrar', + ['leave'] = 'Salir', + ['buy'] = 'Comprar', + ['rent'] = 'Alquilar', + ['visit'] = 'Visitar', + ['press_to_menu'] = 'Presionar ~INPUT_CONTEXT~ para acceder al menú', + ['owned_properties'] = 'Propiedad adquirida', + ['available_properties'] = 'Propiedades disponibles', + ['invite_player'] = 'Invitar a un jugador', + ['you_invited'] = 'Has invitado a %s', + ['player_clothes'] = 'Ropa', + ['remove_object'] = 'Retirar objeto', + ['deposit_object'] = 'Depositar objeto', + ['invite'] = 'Invitar', + ['dirty_money'] = 'Dinero sucio €', + ['inventory'] = 'Inventario', + ['amount'] = '¿Cantidad?', + ['amount_invalid'] = 'Cantidad inválida', + ['press_to_exit'] = 'Presione ~INPUT_CONTEXT~ para salir de la propiedad', + ['rented_for'] = 'Has alquilado una propiedad por €', + ['purchased_for'] = 'Has comprado una propiedad por €', + ['made_property'] = 'Ha hecho una propiedad', + ['not_enough'] = 'n\'No tiene suficiente d\'dinero', + ['invalid_quantity'] = 'Cantidad inválida', + ['paid_rent'] = 'Has ~g~pagado~s~ por el alquiler : ~g~€', + +} diff --git a/locales/fr.lua b/locales/fr.lua index 3b7a3567..b54ff0e3 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,31 +1,31 @@ Locales['fr'] = { - ['free_prop'] = 'propriété libre', - ['property'] = 'propriété', - ['enter'] = 'entrer', - ['leave'] = 'rendre', - ['buy'] = 'acheter', - ['rent'] = 'louer', - ['visit'] = 'visiter', - ['press_to_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', - ['owned_properties'] = 'propriétés acquises', - ['available_properties'] = 'propriétés disponibles', - ['invite_player'] = 'inviter un joueur', - ['you_invited'] = 'vous avez invité %s', - ['player_clothes'] = 'vêtements', - ['remove_object'] = 'retirer objet', - ['deposit_object'] = 'déposer objet', - ['invite'] = 'inviter', - ['dirty_money'] = 'argent sale $', - ['inventory'] = 'inventaire', - ['amount'] = 'quantité ?', - ['amount_invalid'] = 'montant invalide', - ['press_to_exit'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir de la propriété', - ['rented_for'] = 'vous avez loué une propriété pour $', - ['purchased_for'] = 'vous avez acheté une propriété pour $', - ['made_property'] = 'vous avez rendu une propriété', - ['not_enough'] = 'vous n\'avez pas assez d\'argent', - ['invalid_quantity'] = 'quantité invalide', - ['paid_rent'] = 'vous avez ~g~payé~s~ votre loyer : ~g~$', + ['free_prop'] = 'propriété libre', + ['property'] = 'propriété', + ['enter'] = 'entrer', + ['leave'] = 'rendre', + ['buy'] = 'acheter', + ['rent'] = 'louer', + ['visit'] = 'visiter', + ['press_to_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', + ['owned_properties'] = 'propriétés acquises', + ['available_properties'] = 'propriétés disponibles', + ['invite_player'] = 'inviter un joueur', + ['you_invited'] = 'vous avez invité %s', + ['player_clothes'] = 'vêtements', + ['remove_object'] = 'retirer objet', + ['deposit_object'] = 'déposer objet', + ['invite'] = 'inviter', + ['dirty_money'] = 'argent sale $', + ['inventory'] = 'inventaire', + ['amount'] = 'quantité ?', + ['amount_invalid'] = 'montant invalide', + ['press_to_exit'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir de la propriété', + ['rented_for'] = 'vous avez loué une propriété pour $', + ['purchased_for'] = 'vous avez acheté une propriété pour $', + ['made_property'] = 'vous avez rendu une propriété', + ['not_enough'] = 'vous n\'avez pas assez d\'argent', + ['invalid_quantity'] = 'quantité invalide', + ['paid_rent'] = 'vous avez ~g~payé~s~ votre loyer : ~g~$', } diff --git a/localization/de_esx_property.sql b/localization/de_esx_property.sql index cb819d08..900472cd 100644 --- a/localization/de_esx_property.sql +++ b/localization/de_esx_property.sql @@ -1,7 +1,7 @@ USE `essentialmode`; -ALTER TABLE `users` - ADD COLUMN `last_property` VARCHAR(255) NULL +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL ; INSERT INTO `addon_account` (name, label, shared) VALUES @@ -17,18 +17,18 @@ INSERT INTO `datastore` (name, label, shared) VALUES ; CREATE TABLE `owned_properties` ( - + `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `price` double NOT NULL, `rented` int(11) NOT NULL, `owner` varchar(60) NOT NULL, - + PRIMARY KEY (`id`) ); CREATE TABLE `properties` ( - + `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `label` varchar(255) DEFAULT NULL, @@ -43,52 +43,52 @@ CREATE TABLE `properties` ( `is_gateway` int(11) DEFAULT NULL, `room_menu` varchar(255) DEFAULT NULL, `price` int(11) NOT NULL, - + PRIMARY KEY (`id`) ); -INSERT INTO `properties` VALUES - (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), - (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), - (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), - (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), - (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), - (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), - (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), - (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), - (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), - (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), - (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), - (13,'Modern1Apartment','Appartement Moderne 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), - (14,'Modern2Apartment','Appartement Moderne 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), - (15,'Modern3Apartment','Appartement Moderne 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), - (16,'Mody1Apartment','Appartement Mode 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), - (17,'Mody2Apartment','Appartement Mode 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), - (18,'Mody3Apartment','Appartement Mode 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), - (19,'Vibrant1Apartment','Appartement Vibrant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), - (20,'Vibrant2Apartment','Appartement Vibrant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), - (21,'Vibrant3Apartment','Appartement Vibrant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), - (22,'Sharp1Apartment','Appartement Persan 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), - (23,'Sharp2Apartment','Appartement Persan 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), - (24,'Sharp3Apartment','Appartement Persan 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), - (25,'Monochrome1Apartment','Appartement Monochrome 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), - (26,'Monochrome2Apartment','Appartement Monochrome 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), - (27,'Monochrome3Apartment','Appartement Monochrome 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), - (28,'Seductive1Apartment','Appartement Séduisant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), - (29,'Seductive2Apartment','Appartement Séduisant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), - (30,'Seductive3Apartment','Appartement Séduisant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), - (31,'Regal1Apartment','Appartement Régal 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), - (32,'Regal2Apartment','Appartement Régal 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), - (33,'Regal3Apartment','Appartement Régal 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), - (34,'Aqua1Apartment','Appartement Aqua 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), - (35,'Aqua2Apartment','Appartement Aqua 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), - (36,'Aqua3Apartment','Appartement Aqua 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), - (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), - (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), - (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), - (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), - (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), - (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Appartement de base','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Appartement Moderne 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Appartement Moderne 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Appartement Moderne 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Appartement Mode 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Appartement Mode 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Appartement Mode 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Appartement Vibrant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Appartement Vibrant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Appartement Vibrant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Appartement Persan 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Appartement Persan 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Appartement Persan 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Appartement Monochrome 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Appartement Monochrome 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Appartement Monochrome 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Appartement Séduisant 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Appartement Séduisant 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Appartement Séduisant 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Appartement Régal 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Appartement Régal 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Appartement Régal 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Appartement Aqua 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Appartement Aqua 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Appartement Aqua 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) ; diff --git a/offices.sql b/offices.sql index 638e54e7..5947c03f 100644 --- a/offices.sql +++ b/offices.sql @@ -1,32 +1,32 @@ INSERT INTO `properties` VALUES - (43, 'MazeBankBuilding', 'Maze Bank Building', '{\"x\":-79.18,\"y\":-795.92,\"z\":43.35}', NULL, NULL, '{\"x\":-72.50,\"y\":-786.92,\"z\":43.40}', '[]', NULL, 0, 0, 1, NULL, 0), - (44, 'OldSpiceWarm', 'Old Spice Warm', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (45, 'OldSpiceClassical', 'Old Spice Classical', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (46, 'OldSpiceVintage', 'Old Spice Vintage', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (47, 'ExecutiveRich', 'Executive Rich', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (48, 'ExecutiveCool', 'Executive Cool', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (49, 'ExecutiveContrast', 'Executive Contrast', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (50, 'PowerBrokerIce', 'Power Broker Ice', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (51, 'PowerBrokerConservative', 'Power Broker Conservative', NULL, '', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (52, 'PowerBrokerPolished', 'Power Broker Polished', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (53, 'LomBank', 'Lom Bank', '{\"x\":-1581.36,\"y\":-558.23,\"z\":34.07}', NULL, NULL, '{\"x\":-1583.60,\"y\":-555.12,\"z\":34.07}', '[]', NULL, 0, 0, 1, NULL, 0), - (54, 'LBOldSpiceWarm', 'LB Old Spice Warm', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (55, 'LBOldSpiceClassical', 'LB Old Spice Classical', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (56, 'LBOldSpiceVintage', 'LB Old Spice Vintage', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (57, 'LBExecutiveRich', 'LB Executive Rich', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (58, 'LBExecutiveCool', 'LB Executive Cool', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (59, 'LBExecutiveContrast', 'LB Executive Contrast', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (60, 'LBPowerBrokerIce', 'LB Power Broker Ice', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (61, 'LBPowerBrokerConservative', 'LB Power Broker Conservative', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (62, 'LBPowerBrokerPolished', 'LB Power Broker Polished', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (63, 'MazeBankWest', 'Maze Bank West', '{\"x\":-1379.58,\"y\":-499.63,\"z\":32.22}', NULL, NULL, '{\"x\":-1378.95,\"y\":-502.82,\"z\":32.22}', '[]', NULL, 0, 0, 1, NULL, 0), - (64, 'MBWOldSpiceWarm', 'MBW Old Spice Warm', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), - (65, 'MBWOldSpiceClassical', 'MBW Old Spice Classical', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), - (66, 'MBWOldSpiceVintage', 'MBW Old Spice Vintage', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), - (67, 'MBWExecutiveRich', 'MBW Executive Rich', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), - (68, 'MBWExecutiveCool', 'MBW Executive Cool', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), - (69, 'MBWExecutive Contrast', 'MBW Executive Contrast', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), - (70, 'MBWPowerBrokerIce', 'MBW Power Broker Ice', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), - (71, 'MBWPowerBrokerConvservative', 'MBW Power Broker Convservative', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), - (72, 'MBWPowerBrokerPolished', 'MBW Power Broker Polished', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000); -; + (43, 'MazeBankBuilding', 'Maze Bank Building', '{\"x\":-79.18,\"y\":-795.92,\"z\":43.35}', NULL, NULL, '{\"x\":-72.50,\"y\":-786.92,\"z\":43.40}', '[]', NULL, 0, 0, 1, NULL, 0), + (44, 'OldSpiceWarm', 'Old Spice Warm', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (45, 'OldSpiceClassical', 'Old Spice Classical', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (46, 'OldSpiceVintage', 'Old Spice Vintage', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (47, 'ExecutiveRich', 'Executive Rich', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (48, 'ExecutiveCool', 'Executive Cool', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (49, 'ExecutiveContrast', 'Executive Contrast', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (50, 'PowerBrokerIce', 'Power Broker Ice', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (51, 'PowerBrokerConservative', 'Power Broker Conservative', NULL, '', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (52, 'PowerBrokerPolished', 'Power Broker Polished', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (53, 'LomBank', 'Lom Bank', '{\"x\":-1581.36,\"y\":-558.23,\"z\":34.07}', NULL, NULL, '{\"x\":-1583.60,\"y\":-555.12,\"z\":34.07}', '[]', NULL, 0, 0, 1, NULL, 0), + (54, 'LBOldSpiceWarm', 'LB Old Spice Warm', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (55, 'LBOldSpiceClassical', 'LB Old Spice Classical', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (56, 'LBOldSpiceVintage', 'LB Old Spice Vintage', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (57, 'LBExecutiveRich', 'LB Executive Rich', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (58, 'LBExecutiveCool', 'LB Executive Cool', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (59, 'LBExecutiveContrast', 'LB Executive Contrast', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (60, 'LBPowerBrokerIce', 'LB Power Broker Ice', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (61, 'LBPowerBrokerConservative', 'LB Power Broker Conservative', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (62, 'LBPowerBrokerPolished', 'LB Power Broker Polished', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (63, 'MazeBankWest', 'Maze Bank West', '{\"x\":-1379.58,\"y\":-499.63,\"z\":32.22}', NULL, NULL, '{\"x\":-1378.95,\"y\":-502.82,\"z\":32.22}', '[]', NULL, 0, 0, 1, NULL, 0), + (64, 'MBWOldSpiceWarm', 'MBW Old Spice Warm', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (65, 'MBWOldSpiceClassical', 'MBW Old Spice Classical', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (66, 'MBWOldSpiceVintage', 'MBW Old Spice Vintage', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (67, 'MBWExecutiveRich', 'MBW Executive Rich', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (68, 'MBWExecutiveCool', 'MBW Executive Cool', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (69, 'MBWExecutive Contrast', 'MBW Executive Contrast', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_02a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (70, 'MBWPowerBrokerIce', 'MBW Power Broker Ice', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (71, 'MBWPowerBrokerConvservative', 'MBW Power Broker Convservative', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), + (72, 'MBWPowerBrokerPolished', 'MBW Power Broker Polished', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_03c\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000); +; diff --git a/server/main.lua b/server/main.lua index fa4067f4..ec5af03b 100644 --- a/server/main.lua +++ b/server/main.lua @@ -4,579 +4,579 @@ TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) function GetProperty(name) - for i=1, #Config.Properties, 1 do - if Config.Properties[i].name == name then - return Config.Properties[i] - end - end + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name == name then + return Config.Properties[i] + end + end end function SetPropertyOwned(name, price, rented, owner) - MySQL.Async.execute( - 'INSERT INTO owned_properties (name, price, rented, owner) VALUES (@name, @price, @rented, @owner)', - { - ['@name'] = name, - ['@price'] = price, - ['@rented'] = (rented and 1 or 0), - ['@owner'] = owner - }, - function(rowsChanged) + MySQL.Async.execute( + 'INSERT INTO owned_properties (name, price, rented, owner) VALUES (@name, @price, @rented, @owner)', + { + ['@name'] = name, + ['@price'] = price, + ['@rented'] = (rented and 1 or 0), + ['@owner'] = owner + }, + function(rowsChanged) - local xPlayers = ESX.GetPlayers() + local xPlayers = ESX.GetPlayers() - for i=1, #xPlayers, 1 do + for i=1, #xPlayers, 1 do - local xPlayer = ESX.GetPlayerFromId(xPlayers[i]) - - if xPlayer.identifier == owner then + local xPlayer = ESX.GetPlayerFromId(xPlayers[i]) - TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true) + if xPlayer.identifier == owner then - if rented then - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for') .. price) - else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for') .. price) - end + TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true) - break - end - end + if rented then + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for') .. price) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for') .. price) + end - end - ) + break + end + end + + end + ) end function RemoveOwnedProperty(name, owner) - MySQL.Async.execute( - 'DELETE FROM owned_properties WHERE name = @name AND owner = @owner', - { - ['@name'] = name, - ['@owner'] = owner - }, - function(rowsChanged) + MySQL.Async.execute( + 'DELETE FROM owned_properties WHERE name = @name AND owner = @owner', + { + ['@name'] = name, + ['@owner'] = owner + }, + function(rowsChanged) - local xPlayers = ESX.GetPlayers() + local xPlayers = ESX.GetPlayers() - for i=1, #xPlayers, 1 do + for i=1, #xPlayers, 1 do - local xPlayer = ESX.GetPlayerFromId(xPlayers[i]) - - if xPlayer.identifier == owner then - TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, false) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('made_property')) - break - end - end + local xPlayer = ESX.GetPlayerFromId(xPlayers[i]) - end - ) + if xPlayer.identifier == owner then + TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, false) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('made_property')) + break + end + end + + end + ) end AddEventHandler('onMySQLReady', function () - MySQL.Async.fetchAll('SELECT * FROM properties', {}, function(properties) + MySQL.Async.fetchAll('SELECT * FROM properties', {}, function(properties) - for i=1, #properties, 1 do + for i=1, #properties, 1 do - local entering = nil - local exit = nil - local inside = nil - local outside = nil - local isSingle = nil - local isRoom = nil - local isGateway = nil - local roomMenu = nil + local entering = nil + local exit = nil + local inside = nil + local outside = nil + local isSingle = nil + local isRoom = nil + local isGateway = nil + local roomMenu = nil - if properties[i].entering ~= nil then - entering = json.decode(properties[i].entering) - end + if properties[i].entering ~= nil then + entering = json.decode(properties[i].entering) + end - if properties[i].exit ~= nil then - exit = json.decode(properties[i].exit) - end + if properties[i].exit ~= nil then + exit = json.decode(properties[i].exit) + end - if properties[i].inside ~= nil then - inside = json.decode(properties[i].inside) - end + if properties[i].inside ~= nil then + inside = json.decode(properties[i].inside) + end - if properties[i].outside ~= nil then - outside = json.decode(properties[i].outside) - end + if properties[i].outside ~= nil then + outside = json.decode(properties[i].outside) + end - if properties[i].is_single == 0 then - isSingle = false - else - isSingle = true - end + if properties[i].is_single == 0 then + isSingle = false + else + isSingle = true + end - if properties[i].is_room == 0 then - isRoom = false - else - isRoom = true - end + if properties[i].is_room == 0 then + isRoom = false + else + isRoom = true + end - if properties[i].is_gateway == 0 then - isGateway = false - else - isGateway = true - end + if properties[i].is_gateway == 0 then + isGateway = false + else + isGateway = true + end - if properties[i].room_menu ~= nil then - roomMenu = json.decode(properties[i].room_menu) - end + if properties[i].room_menu ~= nil then + roomMenu = json.decode(properties[i].room_menu) + end - table.insert(Config.Properties, { - name = properties[i].name, - label = properties[i].label, - entering = entering, - exit = exit, - inside = inside, - outside = outside, - ipls = json.decode(properties[i].ipls), - gateway = properties[i].gateway, - isSingle = isSingle, - isRoom = isRoom, - isGateway = isGateway, - roomMenu = roomMenu, - price = properties[i].price - }) + table.insert(Config.Properties, { + name = properties[i].name, + label = properties[i].label, + entering = entering, + exit = exit, + inside = inside, + outside = outside, + ipls = json.decode(properties[i].ipls), + gateway = properties[i].gateway, + isSingle = isSingle, + isRoom = isRoom, + isGateway = isGateway, + roomMenu = roomMenu, + price = properties[i].price + }) - end + end - end) + end) end) AddEventHandler('esx_ownedproperty:getOwnedProperties', function(cb) - MySQL.Async.fetchAll( - 'SELECT * FROM owned_properties', - {}, - function(result) + MySQL.Async.fetchAll( + 'SELECT * FROM owned_properties', + {}, + function(result) - local properties = {} + local properties = {} - for i=1, #result, 1 do + for i=1, #result, 1 do - table.insert(properties, { - id = result[i].id, - name = result[i].name, - price = result[i].price, - rented = (rented == 1 and true or false), - owner = result[i].owner, - }) - end + table.insert(properties, { + id = result[i].id, + name = result[i].name, + price = result[i].price, + rented = (rented == 1 and true or false), + owner = result[i].owner, + }) + end - cb(properties) + cb(properties) - end - ) + end + ) end) AddEventHandler('esx_property:setPropertyOwned', function(name, price, rented, owner) - SetPropertyOwned(name, price, rented, owner) + SetPropertyOwned(name, price, rented, owner) end) AddEventHandler('esx_property:removeOwnedProperty', function(name, owner) - RemoveOwnedProperty(name, owner) + RemoveOwnedProperty(name, owner) end) RegisterServerEvent('esx_property:rentProperty') AddEventHandler('esx_property:rentProperty', function(propertyName) - local xPlayer = ESX.GetPlayerFromId(source) - local property = GetProperty(propertyName) + local xPlayer = ESX.GetPlayerFromId(source) + local property = GetProperty(propertyName) - SetPropertyOwned(propertyName, property.price / 200, true, xPlayer.identifier) + SetPropertyOwned(propertyName, property.price / 200, true, xPlayer.identifier) end) RegisterServerEvent('esx_property:buyProperty') AddEventHandler('esx_property:buyProperty', function(propertyName) - local xPlayer = ESX.GetPlayerFromId(source) - local property = GetProperty(propertyName) + local xPlayer = ESX.GetPlayerFromId(source) + local property = GetProperty(propertyName) - if property.price <= xPlayer.get('money') then + if property.price <= xPlayer.get('money') then - xPlayer.removeMoney(property.price) - SetPropertyOwned(propertyName, property.price, false, xPlayer.identifier) + xPlayer.removeMoney(property.price) + SetPropertyOwned(propertyName, property.price, false, xPlayer.identifier) - else - TriggerClientEvent('esx:showNotification', source, _U('not_enough')) - end + else + TriggerClientEvent('esx:showNotification', source, _U('not_enough')) + end end) RegisterServerEvent('esx_property:removeOwnedProperty') AddEventHandler('esx_property:removeOwnedProperty', function(propertyName) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - RemoveOwnedProperty(propertyName, xPlayer.identifier) + RemoveOwnedProperty(propertyName, xPlayer.identifier) end) AddEventHandler('esx_property:removeOwnedPropertyIdentifier', function(propertyName, identifier) - RemoveOwnedProperty(propertyName, identifier) + RemoveOwnedProperty(propertyName, identifier) end) RegisterServerEvent('esx_property:saveLastProperty') AddEventHandler('esx_property:saveLastProperty', function(property) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - MySQL.Async.execute( - 'UPDATE users SET last_property = @last_property WHERE identifier = @identifier', - { - ['@last_property'] = property, - ['@identifier'] = xPlayer.identifier - } - ) + MySQL.Async.execute( + 'UPDATE users SET last_property = @last_property WHERE identifier = @identifier', + { + ['@last_property'] = property, + ['@identifier'] = xPlayer.identifier + } + ) end) RegisterServerEvent('esx_property:deleteLastProperty') AddEventHandler('esx_property:deleteLastProperty', function() - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - MySQL.Async.execute( - 'UPDATE users SET last_property = NULL WHERE identifier = @identifier', - { - ['@identifier'] = xPlayer.identifier - } - ) + MySQL.Async.execute( + 'UPDATE users SET last_property = NULL WHERE identifier = @identifier', + { + ['@identifier'] = xPlayer.identifier + } + ) end) RegisterServerEvent('esx_property:getItem') AddEventHandler('esx_property:getItem', function(owner, type, item, count) - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) - if type == 'item_standard' then + if type == 'item_standard' then - TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) - local roomItemCount = inventory.getItem(item).count + local roomItemCount = inventory.getItem(item).count - if roomItemCount >= count then - inventory.removeItem(item, count) - xPlayer.addInventoryItem(item, count) - else - TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) - end + if roomItemCount >= count then + inventory.removeItem(item, count) + xPlayer.addInventoryItem(item, count) + else + TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + end - end) + end) - end + end - if type == 'item_account' then + if type == 'item_account' then - TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) + TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) - local roomAccountMoney = account.money + local roomAccountMoney = account.money - if roomAccountMoney >= count then - account.removeMoney(count) - xPlayer.addAccountMoney(item, count) - else - TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) - end + if roomAccountMoney >= count then + account.removeMoney(count) + xPlayer.addAccountMoney(item, count) + else + TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) + end - end) + end) - end + end - if type == 'item_weapon' then + if type == 'item_weapon' then - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) - local storeWeapons = store.get('weapons') + local storeWeapons = store.get('weapons') - if storeWeapons == nil then - storeWeapons = {} - end + if storeWeapons == nil then + storeWeapons = {} + end - local weaponName = nil - local ammo = nil + local weaponName = nil + local ammo = nil - for i=1, #storeWeapons, 1 do - if storeWeapons[i].name == item then + for i=1, #storeWeapons, 1 do + if storeWeapons[i].name == item then - weaponName = storeWeapons[i].name - ammo = storeWeapons[i].ammo + weaponName = storeWeapons[i].name + ammo = storeWeapons[i].ammo - table.remove(storeWeapons, i) + table.remove(storeWeapons, i) - break - end - end + break + end + end - store.set('weapons', storeWeapons) + store.set('weapons', storeWeapons) - xPlayer.addWeapon(weaponName, ammo) + xPlayer.addWeapon(weaponName, ammo) - end) + end) - end + end end) RegisterServerEvent('esx_property:putItem') AddEventHandler('esx_property:putItem', function(owner, type, item, count) - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) - if type == 'item_standard' then + if type == 'item_standard' then - local playerItemCount = xPlayer.getInventoryItem(item).count + local playerItemCount = xPlayer.getInventoryItem(item).count - if playerItemCount >= count then + if playerItemCount >= count then - xPlayer.removeInventoryItem(item, count) + xPlayer.removeInventoryItem(item, count) - TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) - inventory.addItem(item, count) - end) + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) + inventory.addItem(item, count) + end) - else - TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) - end + else + TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + end - end + end - if type == 'item_account' then + if type == 'item_account' then - local playerAccountMoney = xPlayer.getAccount(item).money + local playerAccountMoney = xPlayer.getAccount(item).money - if playerAccountMoney >= count then + if playerAccountMoney >= count then - xPlayer.removeAccountMoney(item, count) + xPlayer.removeAccountMoney(item, count) - TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) - account.addMoney(count) - end) + TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) + account.addMoney(count) + end) - else - TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) - end + else + TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) + end - end + end - if type == 'item_weapon' then + if type == 'item_weapon' then - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) - local storeWeapons = store.get('weapons') + local storeWeapons = store.get('weapons') - if storeWeapons == nil then - storeWeapons = {} - end + if storeWeapons == nil then + storeWeapons = {} + end - table.insert(storeWeapons, { - name = item, - ammo = count - }) + table.insert(storeWeapons, { + name = item, + ammo = count + }) - store.set('weapons', storeWeapons) + store.set('weapons', storeWeapons) - xPlayer.removeWeapon(item) + xPlayer.removeWeapon(item) - end) + end) - end + end end) ESX.RegisterServerCallback('esx_property:getProperties', function(source, cb) - cb(Config.Properties) + cb(Config.Properties) end) ESX.RegisterServerCallback('esx_property:getOwnedProperties', function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - MySQL.Async.fetchAll( - 'SELECT * FROM owned_properties WHERE owner = @owner', - { - ['@owner'] = xPlayer.identifier - }, - function(ownedProperties) + MySQL.Async.fetchAll( + 'SELECT * FROM owned_properties WHERE owner = @owner', + { + ['@owner'] = xPlayer.identifier + }, + function(ownedProperties) - local properties = {} + local properties = {} - for i=1, #ownedProperties, 1 do - table.insert(properties, ownedProperties[i].name) - end + for i=1, #ownedProperties, 1 do + table.insert(properties, ownedProperties[i].name) + end - cb(properties) - end - ) + cb(properties) + end + ) end) ESX.RegisterServerCallback('esx_property:getLastProperty', function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - MySQL.Async.fetchAll( - 'SELECT * FROM users WHERE identifier = @identifier', - { - ['@identifier'] = xPlayer.identifier - }, - function(users) - cb(users[1].last_property) - end - ) + MySQL.Async.fetchAll( + 'SELECT * FROM users WHERE identifier = @identifier', + { + ['@identifier'] = xPlayer.identifier + }, + function(users) + cb(users[1].last_property) + end + ) end) ESX.RegisterServerCallback('esx_property:getPropertyInventory', function(source, cb, owner) - local xPlayer = ESX.GetPlayerFromIdentifier(owner) - local blackMoney = 0 - local items = {} - local weapons = {} + local xPlayer = ESX.GetPlayerFromIdentifier(owner) + local blackMoney = 0 + local items = {} + local weapons = {} - TriggerEvent('esx_addonaccount:getAccount', 'property_black_money', xPlayer.identifier, function(account) - blackMoney = account.money - end) + TriggerEvent('esx_addonaccount:getAccount', 'property_black_money', xPlayer.identifier, function(account) + blackMoney = account.money + end) - TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayer.identifier, function(inventory) - items = inventory.items - end) + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayer.identifier, function(inventory) + items = inventory.items + end) - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - local storeWeapons = store.get('weapons') + local storeWeapons = store.get('weapons') - if storeWeapons ~= nil then - weapons = storeWeapons - end + if storeWeapons ~= nil then + weapons = storeWeapons + end - end) + end) - cb({ - blackMoney = blackMoney, - items = items, - weapons = weapons - }) + cb({ + blackMoney = blackMoney, + items = items, + weapons = weapons + }) end) ESX.RegisterServerCallback('esx_property:getPlayerInventory', function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) - local blackMoney = xPlayer.getAccount('black_money').money - local items = xPlayer.inventory + local xPlayer = ESX.GetPlayerFromId(source) + local blackMoney = xPlayer.getAccount('black_money').money + local items = xPlayer.inventory - cb({ - blackMoney = blackMoney, - items = items - }) + cb({ + blackMoney = blackMoney, + items = items + }) end) ESX.RegisterServerCallback('esx_property:getPlayerDressing', function(source, cb) - local xPlayer = ESX.GetPlayerFromId(source) - local dressing = {} + local xPlayer = ESX.GetPlayerFromId(source) + local dressing = {} - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - local storeDressing = store.get('dressing') + local storeDressing = store.get('dressing') - if storeDressing ~= nil then - dressing = storeDressing - end + if storeDressing ~= nil then + dressing = storeDressing + end - end) + end) - cb(dressing) + cb(dressing) end) function PayRent(d, h, m) - MySQL.Async.fetchAll( - 'SELECT * FROM users', - {}, - function(_users) + MySQL.Async.fetchAll( + 'SELECT * FROM users', + {}, + function(_users) - local prevMoney = {} - local newMoney = {} + local prevMoney = {} + local newMoney = {} - for i=1, #_users, 1 do - prevMoney[_users[i].identifier] = _users[i].money - newMoney[_users[i].identifier] = _users[i].money - end + for i=1, #_users, 1 do + prevMoney[_users[i].identifier] = _users[i].money + newMoney[_users[i].identifier] = _users[i].money + end - MySQL.Async.fetchAll( - 'SELECT * FROM owned_properties WHERE rented = 1', - {}, - function(result) + MySQL.Async.fetchAll( + 'SELECT * FROM owned_properties WHERE rented = 1', + {}, + function(result) - local xPlayers = ESX.GetPlayers() + local xPlayers = ESX.GetPlayers() - for i=1, #result, 1 do + for i=1, #result, 1 do - local foundPlayer = false - local xPlayer = nil + local foundPlayer = false + local xPlayer = nil - for j=1, #xPlayers, 1 do + for j=1, #xPlayers, 1 do - local xPlayer2 = ESX.GetPlayerFromId(xPlayers[j]) - - if xPlayer2.identifier == result[i].owner then - foundPlayer = true - xPlayer = xPlayer2 - end - end + local xPlayer2 = ESX.GetPlayerFromId(xPlayers[j]) - if foundPlayer then + if xPlayer2.identifier == result[i].owner then + foundPlayer = true + xPlayer = xPlayer2 + end + end - xPlayer.removeMoney(result[i].price) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent') .. result[i].price) + if foundPlayer then - else - newMoney[result[i].owner] = newMoney[result[i].owner] - result[i].price - end + xPlayer.removeMoney(result[i].price) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent') .. result[i].price) - TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) - account.addMoney(result[i].price) - end) + else + newMoney[result[i].owner] = newMoney[result[i].owner] - result[i].price + end - end + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) + account.addMoney(result[i].price) + end) - for k,v in pairs(prevMoney) do - if v ~= newMoney[k] then + end - MySQL.Async.execute( - 'UPDATE users SET money = @money WHERE identifier = @identifier', - { - ['@money'] = newMoney[k], - ['@identifier'] = k - } - ) + for k,v in pairs(prevMoney) do + if v ~= newMoney[k] then - end - end + MySQL.Async.execute( + 'UPDATE users SET money = @money WHERE identifier = @identifier', + { + ['@money'] = newMoney[k], + ['@identifier'] = k + } + ) - end - ) + end + end - end - ) + end + ) + + end + ) end From c44abb871d70ab81b44883cf4fb10155d8b62c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Mon, 16 Oct 2017 13:17:44 +0200 Subject: [PATCH 42/99] fix(datastore): Fix bug when datastore was too big Needs newest esx_datastore (1.0.1) --- client/main.lua | 16 ++++++++++------ server/main.lua | 22 +++++++++++++++++----- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/client/main.lua b/client/main.lua index df395de4..72c97452 100644 --- a/client/main.lua +++ b/client/main.lua @@ -566,7 +566,7 @@ function OpenRoomMenu(property, owner) local elements = {} for i=1, #dressing, 1 do - table.insert(elements, {label = dressing[i].label, value = dressing[i].skin}) + table.insert(elements, {label = dressing[i], value = i}) end ESX.UI.Menu.Open( @@ -580,12 +580,16 @@ function OpenRoomMenu(property, owner) TriggerEvent('skinchanger:getSkin', function(skin) - TriggerEvent('skinchanger:loadClothes', skin, data.current.value) - TriggerEvent('esx_skin:setLastSkin', skin) + ESX.TriggerServerCallback('esx_property:getPlayerOutfit', function(clothes) - TriggerEvent('skinchanger:getSkin', function(skin) - TriggerServerEvent('esx_skin:save', skin) - end) + TriggerEvent('skinchanger:loadClothes', skin, clothes) + TriggerEvent('esx_skin:setLastSkin', skin) + + TriggerEvent('skinchanger:getSkin', function(skin) + TriggerServerEvent('esx_skin:save', skin) + end) + + end, data.current.value) end) diff --git a/server/main.lua b/server/main.lua index ec5af03b..c82747a5 100644 --- a/server/main.lua +++ b/server/main.lua @@ -490,19 +490,31 @@ end) ESX.RegisterServerCallback('esx_property:getPlayerDressing', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) - local dressing = {} TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - local storeDressing = store.get('dressing') + local count = store.count('dressing') + local labels = {} - if storeDressing ~= nil then - dressing = storeDressing + for i=1, count, 1 do + local entry = store.get('dressing', i) + table.insert(labels, entry.label) end + cb(labels) + end) - cb(dressing) +end) + +ESX.RegisterServerCallback('esx_property:getPlayerOutfit', function(source, cb, num) + + local xPlayer = ESX.GetPlayerFromId(source) + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + local outfit = store.get('dressing', num) + cb(outfit.skin) + end) end) From 2d7485a6d2b2cf420f6c91146fbaa952b2fdb753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20N=27gadi?= Date: Mon, 16 Oct 2017 13:18:08 +0200 Subject: [PATCH 43/99] chore(version): Increment version --- __resource.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__resource.lua b/__resource.lua index 0c253fc9..bf4cc7b6 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Property' -version '1.0.0' +version '1.0.1' server_scripts { '@es_extended/locale.lua', From f5bfd82d75e80085d94ddc26d736977046d635b5 Mon Sep 17 00:00:00 2001 From: LuaDeldu Date: Fri, 1 Dec 2017 20:20:45 +0100 Subject: [PATCH 44/99] Removing saved clothes Credits to Eden server --- client/main.lua | 28 ++++++++++++++++++++++++++++ locales/en.lua | 2 ++ locales/fr.lua | 2 ++ server/main.lua | 23 +++++++++++++++++++++++ 4 files changed, 55 insertions(+) diff --git a/client/main.lua b/client/main.lua index 72c97452..986d4d41 100644 --- a/client/main.lua +++ b/client/main.lua @@ -514,6 +514,7 @@ function OpenRoomMenu(property, owner) if CurrentPropertyOwner == owner then table.insert(elements, {label = _U('player_clothes'), value = 'player_dressing'}) + table.insert(elements, {label = _U('remove_cloth'), value = 'remove_cloth'}) end table.insert(elements, {label = _U('remove_object'), value = 'room_inventory'}) @@ -602,6 +603,33 @@ function OpenRoomMenu(property, owner) end) end + + if data.current.value == 'remove_cloth' then + ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) + local elements = {} + + for i=1, #dressing, 1 do + table.insert(elements, {label = dressing[i].label, value = i}) + end + + ESX.UI.Menu.Open( + 'default', GetCurrentResourceName(), 'remove_cloth', + { + title = property.label .. ' - ' .. _U('remove_cloth'), + align = 'top-left', + elements = elements, + }, + function(data, menu) + menu.close() + TriggerServerEvent('esx_property:removeOutfit', data.current.value) + ESX.ShowNotification(_U('removed_cloth')) + end, + function(data, menu) + menu.close() + end + ) + end) + end if data.current.value == 'room_inventory' then OpenRoomInventoryMenu(property, owner) diff --git a/locales/en.lua b/locales/en.lua index 4d2d3b1a..c61b1419 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -13,6 +13,8 @@ Locales['en'] = { ['invite_player'] = 'invite a player', ['you_invited'] = 'you invited %s', ['player_clothes'] = 'clothes', + ['remove_cloth'] = 'remove clothing', + ['removed_cloth'] = 'this outfit has been removed from your wardrobe!', ['remove_object'] = 'remove object', ['deposit_object'] = 'deposit object', ['invite'] = 'invite', diff --git a/locales/fr.lua b/locales/fr.lua index b54ff0e3..c8ac9b7c 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -13,6 +13,8 @@ Locales['fr'] = { ['invite_player'] = 'inviter un joueur', ['you_invited'] = 'vous avez invité %s', ['player_clothes'] = 'vêtements', + ['remove_cloth'] = 'supprimer des tenues', + ['removed_cloth'] = 'cette tenue a bien été supprimée de votre garde robe !', ['remove_object'] = 'retirer objet', ['deposit_object'] = 'déposer objet', ['invite'] = 'inviter', diff --git a/server/main.lua b/server/main.lua index c82747a5..852e47d0 100644 --- a/server/main.lua +++ b/server/main.lua @@ -518,6 +518,29 @@ ESX.RegisterServerCallback('esx_property:getPlayerOutfit', function(source, cb, end) +RegisterServerEvent('esx_property:removeOutfit') +AddEventHandler('esx_property:removeOutfit', function(label) + + local xPlayer = ESX.GetPlayerFromId(source) + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + + local dressing = store.get('dressing') + + if dressing == nil then + dressing = {} + end + + label = label + + table.remove(dressing, label) + + store.set('dressing', dressing) + + end) + +end) + function PayRent(d, h, m) MySQL.Async.fetchAll( From 4fb2d8e1e0ae06dc45a0b4671d14f44788cbc9b8 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 20 Jan 2018 17:54:38 +0100 Subject: [PATCH 45/99] Added english translation --- localization/en_esx_property.sql | 94 ++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 localization/en_esx_property.sql diff --git a/localization/en_esx_property.sql b/localization/en_esx_property.sql new file mode 100644 index 00000000..f01bb700 --- /dev/null +++ b/localization/en_esx_property.sql @@ -0,0 +1,94 @@ +USE `essentialmode`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Money Sale Property',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Property',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('property','Property',0) +; + +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +); + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Basic apartment','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Modern Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Modern Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Modern Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Mody Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Mody Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Mody Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Vibrant Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Vibrant Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Vibrant Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Sharp Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Sharp Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Sharp Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Monochrome Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Monochrome Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Monochrome Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Seductive Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Seductive Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Seductive Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Regal Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Regal Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Regal Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Aqua Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Aqua Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Aqua Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + From 8995284b954a0c4e8c2307ce2e3caadd27d29529 Mon Sep 17 00:00:00 2001 From: David Larsson Date: Sat, 3 Mar 2018 06:29:18 +0100 Subject: [PATCH 46/99] Possibly causing crashed due to rented not exist --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 157da815..2bd2e851 100644 --- a/server/main.lua +++ b/server/main.lua @@ -167,7 +167,7 @@ AddEventHandler('esx_ownedproperty:getOwnedProperties', function(cb) id = result[i].id, name = result[i].name, price = result[i].price, - rented = (rented == 1 and true or false), + rented = (result[i].rented == 1 and true or false), owner = result[i].owner, }) end From 654b3b76653f08400e8cad740f7ee5b2b5fc4190 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 11 Mar 2018 16:35:22 +0100 Subject: [PATCH 47/99] Fixed exploit taking more than you can carry --- .editorconfig | 9 --------- __resource.lua | 2 +- locales/en.lua | 2 ++ server/main.lua | 39 +++++++++++++++++++++------------------ 4 files changed, 24 insertions(+), 28 deletions(-) delete mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 41c2aaf2..00000000 --- a/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -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 bf4cc7b6..14b44010 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Property' -version '1.0.1' +version '1.0.2' server_scripts { '@es_extended/locale.lua', diff --git a/locales/en.lua b/locales/en.lua index c61b1419..3d796192 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -29,5 +29,7 @@ Locales['en'] = { ['not_enough'] = 'you do not have enough money', ['invalid_quantity'] = 'invalid quantity', ['paid_rent'] = 'you ~g~paid~s~ your rent: ~g~$', + ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~w~ in the property!', + ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', } diff --git a/server/main.lua b/server/main.lua index 852e47d0..558ef84b 100644 --- a/server/main.lua +++ b/server/main.lua @@ -257,26 +257,29 @@ end) RegisterServerEvent('esx_property:getItem') AddEventHandler('esx_property:getItem', function(owner, type, item, count) - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) - if type == 'item_standard' then + if type == 'item_standard' then + local sourceItem = xPlayer.getInventoryItem(item) + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) - TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) - - local roomItemCount = inventory.getItem(item).count - - if roomItemCount >= count then - inventory.removeItem(item, count) - xPlayer.addInventoryItem(item, count) - else - TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) - end - - end) - - end + -- is there enough in the property? + if count > 0 and inventory.getItem(item).count >= count then + + -- can the player carry the said amount of x item? + if sourceItem.limit ~= -1 and (sourceItem.count + item) > sourceItem.limit then + TriggerClientEvent('esx:showNotification', _source, _U('player_cannot_hold')) + else + inventory.removeItem(item, count) + xPlayer.addInventoryItem(item, count) + end + else + TriggerClientEvent('esx:showNotification', _source, _U('not_enough_in_property')) + end + end) + end if type == 'item_account' then From b8f06df97606c05e6d8cc6a6ee938f5a00403b54 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 11 Mar 2018 19:06:55 +0100 Subject: [PATCH 48/99] Fixed counting error --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 558ef84b..889e72d8 100644 --- a/server/main.lua +++ b/server/main.lua @@ -269,7 +269,7 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, count) if count > 0 and inventory.getItem(item).count >= count then -- can the player carry the said amount of x item? - if sourceItem.limit ~= -1 and (sourceItem.count + item) > sourceItem.limit then + if sourceItem.limit ~= -1 and (sourceItem.count + count) > sourceItem.limit then TriggerClientEvent('esx:showNotification', _source, _U('player_cannot_hold')) else inventory.removeItem(item, count) From d59eccd00aa9ee11d8ea80e415523dbd9cacd548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Haapam=C3=A4ki?= Date: Tue, 27 Mar 2018 08:54:43 +0300 Subject: [PATCH 49/99] Fixed LomBank and MazeBank menu positions Now you can enter and leave building. Menu marker position moved, so now its behind the main desk. --- offices.sql | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/offices.sql b/offices.sql index 5947c03f..44459157 100644 --- a/offices.sql +++ b/offices.sql @@ -1,24 +1,24 @@ INSERT INTO `properties` VALUES (43, 'MazeBankBuilding', 'Maze Bank Building', '{\"x\":-79.18,\"y\":-795.92,\"z\":43.35}', NULL, NULL, '{\"x\":-72.50,\"y\":-786.92,\"z\":43.40}', '[]', NULL, 0, 0, 1, NULL, 0), - (44, 'OldSpiceWarm', 'Old Spice Warm', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (45, 'OldSpiceClassical', 'Old Spice Classical', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (46, 'OldSpiceVintage', 'Old Spice Vintage', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (47, 'ExecutiveRich', 'Executive Rich', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (48, 'ExecutiveCool', 'Executive Cool', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (49, 'ExecutiveContrast', 'Executive Contrast', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (50, 'PowerBrokerIce', 'Power Broker Ice', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (51, 'PowerBrokerConservative', 'Power Broker Conservative', NULL, '', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), - (52, 'PowerBrokerPolished', 'Power Broker Polished', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-76.49,\"y\":-826.80,\"z\":243.38}', 5000000), + (44, 'OldSpiceWarm', 'Old Spice Warm', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (45, 'OldSpiceClassical', 'Old Spice Classical', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (46, 'OldSpiceVintage', 'Old Spice Vintage', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (47, 'ExecutiveRich', 'Executive Rich', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (48, 'ExecutiveCool', 'Executive Cool', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (49, 'ExecutiveContrast', 'Executive Contrast', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (50, 'PowerBrokerIce', 'Power Broker Ice', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (51, 'PowerBrokerConservative', 'Power Broker Conservative', NULL, '', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (52, 'PowerBrokerPolished', 'Power Broker Polished', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), (53, 'LomBank', 'Lom Bank', '{\"x\":-1581.36,\"y\":-558.23,\"z\":34.07}', NULL, NULL, '{\"x\":-1583.60,\"y\":-555.12,\"z\":34.07}', '[]', NULL, 0, 0, 1, NULL, 0), - (54, 'LBOldSpiceWarm', 'LB Old Spice Warm', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (55, 'LBOldSpiceClassical', 'LB Old Spice Classical', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (56, 'LBOldSpiceVintage', 'LB Old Spice Vintage', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (57, 'LBExecutiveRich', 'LB Executive Rich', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (58, 'LBExecutiveCool', 'LB Executive Cool', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (59, 'LBExecutiveContrast', 'LB Executive Contrast', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (60, 'LBPowerBrokerIce', 'LB Power Broker Ice', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (61, 'LBPowerBrokerConservative', 'LB Power Broker Conservative', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), - (62, 'LBPowerBrokerPolished', 'LB Power Broker Polished', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1577.68,\"y\":-565.91,\"z\":108.52}', 3500000), + (54, 'LBOldSpiceWarm', 'LB Old Spice Warm', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (55, 'LBOldSpiceClassical', 'LB Old Spice Classical', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (56, 'LBOldSpiceVintage', 'LB Old Spice Vintage', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (57, 'LBExecutiveRich', 'LB Executive Rich', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (58, 'LBExecutiveCool', 'LB Executive Cool', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (59, 'LBExecutiveContrast', 'LB Executive Contrast', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_02a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (60, 'LBPowerBrokerIce', 'LB Power Broker Ice', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (61, 'LBPowerBrokerConservative', 'LB Power Broker Conservative', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03b\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), + (62, 'LBPowerBrokerPolished', 'LB Power Broker Polished', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_03c\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), (63, 'MazeBankWest', 'Maze Bank West', '{\"x\":-1379.58,\"y\":-499.63,\"z\":32.22}', NULL, NULL, '{\"x\":-1378.95,\"y\":-502.82,\"z\":32.22}', '[]', NULL, 0, 0, 1, NULL, 0), (64, 'MBWOldSpiceWarm', 'MBW Old Spice Warm', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01a\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), (65, 'MBWOldSpiceClassical', 'MBW Old Spice Classical', NULL, '{\"x\":-1392.74,\"y\":-480.18,\"z\":71.14}', '{\"x\":-1389.43,\"y\":-479.01,\"z\":71.14}', NULL, '[\"ex_sm_15_office_01b\"]', 'MazeBankWest', 0, 1, 0, '{\"x\":-1390.76,\"y\":-479.22,\"z\":72.04}', 2700000), From 1e4ba5285182d218d09b8d2fd33cba5e4ea79a73 Mon Sep 17 00:00:00 2001 From: Cr4zZyBipBiip Date: Wed, 4 Apr 2018 16:51:52 +0200 Subject: [PATCH 50/99] Optimisation de PayRent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Petite modif pour optimiser le PayRent qui faisait crash pas mal de serveur dû au nombre de joueurs importants... Pour vous expliquer le changement, voici ce qu'il faisait auparavant : 1) Selection de tout les utilisateur en DB 2) Sauvegarde dans 2 tableaux de l'argent de CHAQUE users enregistré en DB 3) Selection de tout les utilisateurs qui ont un appart en location 4) On fait le tour de tout les joueurs en ligne, ==> Si en ligne, alors on débite ==> Si horsligne, on stock dans le tableau 2 (newMoney) le nouveau montant de son compte en banque 5) On donne l'argent à l'agent immobilier 6) On fait le tour des 2 tableaux, si prevMoney est différent de newMoney alors on change en DB... ==> Pour rappel... prevMoney et newMoney possède tout les deux TOUT les users de la DB... donc je vous laisse imaginer le travail machine Et donc, on en vient a mon code, voici son fonctionnement : 1) Selection de tout les utilisateurs qui ont un appart en location 2) On recherche si le joueur est en ligne ==> Si oui alors on débite ==> Si non alors on change son compte en banque 3) On paie l'agent immobilier --FIN-- --- server/main.lua | 94 +++++++++++++++++-------------------------------- 1 file changed, 32 insertions(+), 62 deletions(-) diff --git a/server/main.lua b/server/main.lua index 889e72d8..210c14ab 100644 --- a/server/main.lua +++ b/server/main.lua @@ -547,74 +547,44 @@ end) function PayRent(d, h, m) MySQL.Async.fetchAll( - 'SELECT * FROM users', - {}, - function(_users) + 'SELECT * FROM owned_properties WHERE rented = 1', + { - local prevMoney = {} - local newMoney = {} + }, function (result) + local xPlayers = ESX.GetPlayers() - for i=1, #_users, 1 do - prevMoney[_users[i].identifier] = _users[i].money - newMoney[_users[i].identifier] = _users[i].money + for i=1, #result, 1 do + + local foundPlayer = false + local xPlayer = nil + + for j=1, #xPlayers, 1 do + + local xPlayer2 = ESX.GetPlayerFromId(xPlayers[j]) + + if xPlayer2.identifier == result[i].owner then + foundPlayer = true + xPlayer = xPlayer2 + end end - MySQL.Async.fetchAll( - 'SELECT * FROM owned_properties WHERE rented = 1', - {}, - function(result) - - local xPlayers = ESX.GetPlayers() - - for i=1, #result, 1 do - - local foundPlayer = false - local xPlayer = nil - - for j=1, #xPlayers, 1 do - - local xPlayer2 = ESX.GetPlayerFromId(xPlayers[j]) - - if xPlayer2.identifier == result[i].owner then - foundPlayer = true - xPlayer = xPlayer2 - end - end - - if foundPlayer then - - xPlayer.removeMoney(result[i].price) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent') .. result[i].price) - - else - newMoney[result[i].owner] = newMoney[result[i].owner] - result[i].price - end - - TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) - account.addMoney(result[i].price) - end) - - end - - for k,v in pairs(prevMoney) do - if v ~= newMoney[k] then - - MySQL.Async.execute( - 'UPDATE users SET money = @money WHERE identifier = @identifier', - { - ['@money'] = newMoney[k], - ['@identifier'] = k - } - ) - - end - end - - end - ) + if foundPlayer then + xPlayer.removeMoney(result[i].price) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent') .. result[i].price) + else + MySQL.Sync.execute( + 'UPDATE users SET money = money - @money WHERE identifier = @identifier', + { + ['@money'] = result[i].price, + ['@identifier'] = result[i].owner + }) + end + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) + account.addMoney(result[i].price) + end) end - ) + end) end From 64c8193f52abd228983cb975329247e8dd76484d Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 4 May 2018 17:30:39 +0200 Subject: [PATCH 51/99] Optimized paying rent, locate improvements --- __resource.lua | 40 +++++++++++++------------ locales/br.lua | 11 +++++-- locales/de.lua | 10 +++++-- locales/en.lua | 18 ++++++------ locales/es.lua | 8 +++-- locales/fr.lua | 6 ++-- locales/sv.lua | 35 ++++++++++++++++++++++ server/main.lua | 78 ++++++++++++++++++++----------------------------- 8 files changed, 122 insertions(+), 84 deletions(-) create mode 100644 locales/sv.lua diff --git a/__resource.lua b/__resource.lua index 14b44010..b7af0fa7 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,31 +2,33 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Property' -version '1.0.2' +version '1.0.3' server_scripts { - '@es_extended/locale.lua', - 'locales/de.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/de.lua', + 'locales/br.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/de.lua', - 'locales/br.lua', - 'locales/en.lua', - 'locales/fr.lua', - 'locales/es.lua', - 'config.lua', - 'client/main.lua' + '@es_extended/locale.lua', + 'locales/de.lua', + 'locales/br.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'locales/es.lua', + 'locales/sv.lua', + 'config.lua', + 'client/main.lua' } dependencies { - 'instance' + 'instance' } diff --git a/locales/br.lua b/locales/br.lua index 042c9d86..dcd1f666 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -1,5 +1,6 @@ Locales['br'] = { - + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', ['free_prop'] = 'Propriedade gratuita', ['property'] = 'Propriedade', ['enter'] = 'Entrar', @@ -11,7 +12,10 @@ Locales['br'] = { ['owned_properties'] = 'Propriedades adquiridas', ['available_properties'] = 'Propriedades disponíveis', ['invite_player'] = 'Convidar um jogador', + ['you_invited'] = 'you invited ~y~%s~s~ to your property', ['player_clothes'] = 'Roupas', + ['remove_cloth'] = 'remove clothing', + ['removed_cloth'] = 'the outfit has been removed from your wardrobe!', ['remove_object'] = 'Remover objeto', ['deposit_object'] = 'Depositar objeto', ['invite'] = 'Convidar', @@ -25,6 +29,7 @@ Locales['br'] = { ['made_property'] = 'Você criou uma propriedade', ['not_enough'] = 'Você não tem dinheiro suficiente', ['invalid_quantity'] = 'Quantidade inválida', - ['paid_rent'] = 'Você ~g~pagou~s~ seu aluguel: ~g~$', - + ['paid_rent'] = 'Você ~g~pagou~s~ seu aluguel: ~g~$%s~s~', + ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', } diff --git a/locales/de.lua b/locales/de.lua index 2777520c..f82f0567 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -1,5 +1,6 @@ Locales['de'] = { - + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', ['free_prop'] = 'Kostenlose Immobilie', ['property'] = 'Immobilie', ['enter'] = 'Eintreten', @@ -13,6 +14,8 @@ Locales['de'] = { ['invite_player'] = 'Spieler einladen', ['you_invited'] = 'Du hast %s eingeladen', ['player_clothes'] = 'Kleidung', + ['remove_cloth'] = 'remove clothing', + ['removed_cloth'] = 'the outfit has been removed from your wardrobe!', ['remove_object'] = 'Objekt nehmen', ['deposit_object'] = 'Objekt deponieren', ['invite'] = 'Einladen', @@ -26,6 +29,7 @@ Locales['de'] = { ['made_property'] = 'Du hast eine Immobilie gemacht', ['not_enough'] = 'du hast nicht genug Geld', ['invalid_quantity'] = 'Ungültiger Betrag', - ['paid_rent'] = 'du ~g~bezahlst~s~ deine Miete: ~g~$', - + ['paid_rent'] = 'du ~g~bezahlst~s~ deine Miete: ~g~$%s~s~', + ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', } diff --git a/locales/en.lua b/locales/en.lua index 3d796192..6076ae34 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,9 +1,10 @@ Locales['en'] = { - + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', ['free_prop'] = 'free property', ['property'] = 'property', ['enter'] = 'enter', - ['leave'] = 'leave', + ['leave'] = 'leave the property', ['buy'] = 'buy', ['rent'] = 'rent', ['visit'] = 'visit', @@ -11,10 +12,10 @@ Locales['en'] = { ['owned_properties'] = 'acquired properties', ['available_properties'] = 'available properties', ['invite_player'] = 'invite a player', - ['you_invited'] = 'you invited %s', + ['you_invited'] = 'you invited ~y~%s~s~ to your property', ['player_clothes'] = 'clothes', ['remove_cloth'] = 'remove clothing', - ['removed_cloth'] = 'this outfit has been removed from your wardrobe!', + ['removed_cloth'] = 'the outfit has been removed from your wardrobe!', ['remove_object'] = 'remove object', ['deposit_object'] = 'deposit object', ['invite'] = 'invite', @@ -28,8 +29,7 @@ Locales['en'] = { ['made_property'] = 'you have made a property', ['not_enough'] = 'you do not have enough money', ['invalid_quantity'] = 'invalid quantity', - ['paid_rent'] = 'you ~g~paid~s~ your rent: ~g~$', - ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~w~ in the property!', - ['player_cannot_hold'] = 'you do ~r~not~w~ have enough ~y~free space~w~ in your inventory!', - -} + ['paid_rent'] = 'you ~g~paid~s~ your rent: ~g~$%s~s~', + ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', +} \ No newline at end of file diff --git a/locales/es.lua b/locales/es.lua index c069fd30..ba7f0182 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -1,5 +1,6 @@ Locales['es'] = { - + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', ['free_prop'] = 'Propiedad libre', ['property'] = 'Propiedad', ['enter'] = 'Entrar', @@ -13,6 +14,8 @@ Locales['es'] = { ['invite_player'] = 'Invitar a un jugador', ['you_invited'] = 'Has invitado a %s', ['player_clothes'] = 'Ropa', + ['remove_cloth'] = 'remove clothing', + ['removed_cloth'] = 'the outfit has been removed from your wardrobe!', ['remove_object'] = 'Retirar objeto', ['deposit_object'] = 'Depositar objeto', ['invite'] = 'Invitar', @@ -27,5 +30,6 @@ Locales['es'] = { ['not_enough'] = 'n\'No tiene suficiente d\'dinero', ['invalid_quantity'] = 'Cantidad inválida', ['paid_rent'] = 'Has ~g~pagado~s~ por el alquiler : ~g~€', - + ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', } diff --git a/locales/fr.lua b/locales/fr.lua index c8ac9b7c..56f84dc6 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,5 +1,6 @@ Locales['fr'] = { - + ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', ['free_prop'] = 'propriété libre', ['property'] = 'propriété', ['enter'] = 'entrer', @@ -29,5 +30,6 @@ Locales['fr'] = { ['not_enough'] = 'vous n\'avez pas assez d\'argent', ['invalid_quantity'] = 'quantité invalide', ['paid_rent'] = 'vous avez ~g~payé~s~ votre loyer : ~g~$', - + ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', + ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', } diff --git a/locales/sv.lua b/locales/sv.lua new file mode 100644 index 00000000..bbef39c8 --- /dev/null +++ b/locales/sv.lua @@ -0,0 +1,35 @@ +Locales['sv'] = { + ['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~', + ['free_prop'] = 'ledig fastighet', + ['property'] = 'fastighet', + ['enter'] = 'gå in', + ['leave'] = 'lämna', + ['buy'] = 'köp', + ['rent'] = 'hyr', + ['visit'] = 'besök', + ['press_to_menu'] = 'tryck ~INPUT_CONTEXT~ för att komma åt menyn', + ['owned_properties'] = 'upptagna fastigheter', + ['available_properties'] = 'lediga fastigheter', + ['invite_player'] = 'bjud in granne', + ['you_invited'] = 'du bjöd in ~y~%s~s~ till din fastighet', + ['player_clothes'] = 'Kläder', + ['remove_cloth'] = 'ta bort klädstil', + ['removed_cloth'] = 'denna outfit har blivit borttagen från din garderob!', + ['remove_object'] = 'ta ut objekt', + ['deposit_object'] = 'lagra objekt', + ['invite'] = 'bjud in', + ['dirty_money'] = 'Smutsiga pengar: $', + ['inventory'] = 'inventory', + ['amount'] = 'summa?', + ['amount_invalid'] = 'ogiltlig summa', + ['press_to_exit'] = 'tryck ~INPUT_CONTEXT~ för att gå ur fastigheten', + ['rented_for'] = 'du hyrde en fastighet för: ~g~$', + ['purchased_for'] = 'du köpte en fastighet för: ~g~$', + ['made_property'] = 'you have made a property', + ['not_enough'] = 'du har inte tillräckligt med pengar!', + ['invalid_quantity'] = 'ogiltlig mängd', + ['paid_rent'] = 'du ~y~betalade~s~ din hyra: ~g~$%s~s~', + ['not_enough_in_property'] = 'det finns ~r~inte~s~ tillräckligt av ~r~det objektet~s~ i fastigheten!', + ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt med ~y~utrymme~s~ för att hålla det!', +} \ No newline at end of file diff --git a/server/main.lua b/server/main.lua index 5b2a7ed5..052c1092 100644 --- a/server/main.lua +++ b/server/main.lua @@ -263,10 +263,12 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, count) if type == 'item_standard' then local sourceItem = xPlayer.getInventoryItem(item) + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) - + local inventoryItem = inventory.getItem(item) + -- is there enough in the property? - if count > 0 and inventory.getItem(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 @@ -274,6 +276,7 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, count) else inventory.removeItem(item, count) xPlayer.addInventoryItem(item, count) + TriggerClientEvent('esx:showNotification', _source, _U('have_withdrawn', count, inventoryItem.label)) end else TriggerClientEvent('esx:showNotification', _source, _U('not_enough_in_property')) @@ -345,13 +348,13 @@ AddEventHandler('esx_property:putItem', function(owner, type, item, count) local playerItemCount = xPlayer.getInventoryItem(item).count if playerItemCount >= count then - - xPlayer.removeInventoryItem(item, count) - + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) + xPlayer.removeInventoryItem(item, count) inventory.addItem(item, count) + TriggerClientEvent('esx:showNotification', _source, _U('have_deposited', count, inventory.getItem(item).label)) end) - + else TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) end @@ -544,48 +547,31 @@ AddEventHandler('esx_property:removeOutfit', function(label) end) -function PayRent(d, h, m) +function PayRent() + MySQL.Async.fetchAll( + 'SELECT * FROM owned_properties WHERE rented = 1', {}, + function (result) + for i=1, #result, 1 do + local xPlayer = ESX.GetPlayerFromIdentifier(result[i].owner) - MySQL.Async.fetchAll( - 'SELECT * FROM owned_properties WHERE rented = 1', - { - - }, function (result) - local xPlayers = ESX.GetPlayers() - - for i=1, #result, 1 do - - local foundPlayer = false - local xPlayer = nil - - for j=1, #xPlayers, 1 do - - local xPlayer2 = ESX.GetPlayerFromId(xPlayers[j]) - - if xPlayer2.identifier == result[i].owner then - foundPlayer = true - xPlayer = xPlayer2 - end - end - - if foundPlayer then - xPlayer.removeMoney(result[i].price) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent') .. result[i].price) - else - MySQL.Sync.execute( - 'UPDATE users SET money = money - @money WHERE identifier = @identifier', - { - ['@money'] = result[i].price, - ['@identifier'] = result[i].owner - }) - end - - TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) - account.addMoney(result[i].price) - end) - end - end) + -- message player if connected + if xPlayer ~= nil then + xPlayer.removeBank(result[i].price) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent', result[i].price)) + else -- pay rent either way + MySQL.Sync.execute( + 'UPDATE users SET bank = bank - @bank WHERE identifier = @identifier', + { + ['@bank'] = result[i].price, + ['@identifier'] = result[i].owner + }) + end + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) + account.addMoney(result[i].price) + end) + end + end) end TriggerEvent('cron:runAt', 22, 0, PayRent) From 39dd9e94f6a58c97cdf58ef5edaccf6fea08116c Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 4 May 2018 18:21:00 +0200 Subject: [PATCH 52/99] Added missing formatted strings --- locales/es.lua | 2 +- locales/fr.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/locales/es.lua b/locales/es.lua index ba7f0182..b1fb8d07 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -29,7 +29,7 @@ Locales['es'] = { ['made_property'] = 'Ha hecho una propiedad', ['not_enough'] = 'n\'No tiene suficiente d\'dinero', ['invalid_quantity'] = 'Cantidad inválida', - ['paid_rent'] = 'Has ~g~pagado~s~ por el alquiler : ~g~€', + ['paid_rent'] = 'Has ~g~pagado~s~ por el alquiler: ~g~€%s~s~', ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', } diff --git a/locales/fr.lua b/locales/fr.lua index 56f84dc6..ec6f6af3 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -29,7 +29,7 @@ Locales['fr'] = { ['made_property'] = 'vous avez rendu une propriété', ['not_enough'] = 'vous n\'avez pas assez d\'argent', ['invalid_quantity'] = 'quantité invalide', - ['paid_rent'] = 'vous avez ~g~payé~s~ votre loyer : ~g~$', + ['paid_rent'] = 'vous avez ~g~payé~s~ votre loyer: ~g~$%s~s~', ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', } From 678cfd7585bd301def1e936b0ddcf6c91069c068 Mon Sep 17 00:00:00 2001 From: Oldarorn <36448848+Oldarorn@users.noreply.github.com> Date: Sun, 13 May 2018 10:27:55 +0200 Subject: [PATCH 53/99] Update fr.lua --- locales/fr.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locales/fr.lua b/locales/fr.lua index ec6f6af3..61d06b82 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,6 +1,6 @@ Locales['fr'] = { - ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', - ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', + ['have_withdrawn'] = 'vous avez pris ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'vous avez déposé ~y~x%s~s~ ~b~%s~s~', ['free_prop'] = 'propriété libre', ['property'] = 'propriété', ['enter'] = 'entrer', @@ -30,6 +30,6 @@ Locales['fr'] = { ['not_enough'] = 'vous n\'avez pas assez d\'argent', ['invalid_quantity'] = 'quantité invalide', ['paid_rent'] = 'vous avez ~g~payé~s~ votre loyer: ~g~$%s~s~', - ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', - ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', + ['not_enough_in_property'] = 'il n\'a pas assez de ~r~cet objet~s~ dans votre coffre!', + ['player_cannot_hold'] = 'vous n\'avez pas assez ~y~de place~s~ dans votre inventaire!', } From e9fdf989b1d3d4bc1b69bc55c7e6689696330b01 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 19 May 2018 15:40:57 +0200 Subject: [PATCH 54/99] Improved translation (#8) --- locales/en.lua | 2 +- locales/sv.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/locales/en.lua b/locales/en.lua index 6076ae34..4ddf1a61 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -4,7 +4,7 @@ Locales['en'] = { ['free_prop'] = 'free property', ['property'] = 'property', ['enter'] = 'enter', - ['leave'] = 'leave the property', + ['leave'] = 'sell', ['buy'] = 'buy', ['rent'] = 'rent', ['visit'] = 'visit', diff --git a/locales/sv.lua b/locales/sv.lua index bbef39c8..a4485173 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -4,7 +4,7 @@ Locales['sv'] = { ['free_prop'] = 'ledig fastighet', ['property'] = 'fastighet', ['enter'] = 'gå in', - ['leave'] = 'lämna', + ['leave'] = 'sälj', ['buy'] = 'köp', ['rent'] = 'hyr', ['visit'] = 'besök', From 18a9da4b3b08158d3a0d53e189113379e8acb881 Mon Sep 17 00:00:00 2001 From: renildomarcio Date: Mon, 21 May 2018 02:03:52 -0300 Subject: [PATCH 55/99] Update br.lua --- locales/br.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/locales/br.lua b/locales/br.lua index dcd1f666..f922826f 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -1,7 +1,7 @@ Locales['br'] = { - ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', - ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', - ['free_prop'] = 'Propriedade gratuita', + ['have_withdrawn'] = 'você retirou ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'você depositou ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'Propriedade a Venda', ['property'] = 'Propriedade', ['enter'] = 'Entrar', ['leave'] = 'Sair', @@ -14,8 +14,8 @@ Locales['br'] = { ['invite_player'] = 'Convidar um jogador', ['you_invited'] = 'you invited ~y~%s~s~ to your property', ['player_clothes'] = 'Roupas', - ['remove_cloth'] = 'remove clothing', - ['removed_cloth'] = 'the outfit has been removed from your wardrobe!', + ['remove_cloth'] = 'tire a roupa', + ['removed_cloth'] = 'a roupa foi removida do seu guarda-roupa!', ['remove_object'] = 'Remover objeto', ['deposit_object'] = 'Depositar objeto', ['invite'] = 'Convidar', @@ -30,6 +30,6 @@ Locales['br'] = { ['not_enough'] = 'Você não tem dinheiro suficiente', ['invalid_quantity'] = 'Quantidade inválida', ['paid_rent'] = 'Você ~g~pagou~s~ seu aluguel: ~g~$%s~s~', - ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', - ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', + ['not_enough_in_property'] = 'não há o suficiente de que esse item esteja na propriedade!', + ['player_cannot_hold'] = 'você não tem espaço suficiente em seu inventário!', } From 217b7fdbe8a7a84fa8924851f63933c1ca947a5b Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Tue, 5 Jun 2018 20:18:00 +0200 Subject: [PATCH 56/99] Duplication fix Simply fixed is so that it prevents players from storing items in a negative amount. Storing a certain item as -1 and go to take it out and place whatever amount you want and boom you got unlimited amount of said item. --- server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index 052c1092..369af723 100644 --- a/server/main.lua +++ b/server/main.lua @@ -347,7 +347,7 @@ AddEventHandler('esx_property:putItem', function(owner, type, item, count) local playerItemCount = xPlayer.getInventoryItem(item).count - if playerItemCount >= count then + if playerItemCount >= count and count > 0 then TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) xPlayer.removeInventoryItem(item, count) @@ -365,7 +365,7 @@ AddEventHandler('esx_property:putItem', function(owner, type, item, count) local playerAccountMoney = xPlayer.getAccount(item).money - if playerAccountMoney >= count then + if playerAccountMoney >= count and count > 0 then xPlayer.removeAccountMoney(item, count) From 933a016f3a9c7a402486c296662fc1b022754350 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 5 Jun 2018 20:51:16 +0200 Subject: [PATCH 57/99] Added spice to readme --- README.md | 53 +++++++++++++++++++++++++++++++++++++---------------- offices.sql | 2 ++ 2 files changed, 39 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 09019b90..6a08124e 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,46 @@ -# fxserver-esx_property -FXServer ESX Property +# esx_property -[REQUIREMENTS] +### Requirements +- [instance](https://github.com/ESX-Org/instance) +- [cron](https://github.com/ESX-Org/cron) +- [esx_addonaccount](https://github.com/ESX-Org/esx_addonaccount) +- [esx_addoninventory](https://github.com/ESX-Org/esx_addoninventory) +- [esx_datastore](https://github.com/ESX-Org/esx_datastore) -- instance => https://github.com/FXServer-ESX/fxserver-instance -- cron => https://github.com/FXServer-ESX/fxserver-cron -- esx_addonaccount => https://github.com/FXServer-ESX/fxserver-esx_addonaccount -- esx_addoninventory => https://github.com/FXServer-ESX/fxserver-esx_addoninventory -- esx_datastore => https://github.com/FXServer-ESX/fxserver-esx_datastore +## Download & Installation -[INSTALLATION] - -1) CD in your resources/[esx] folder -2) Clone the repository +### Using [fvm](https://github.com/qlaffont/fvm-installer) ``` -git clone https://github.com/FXServer-ESX/fxserver-esx_property esx_property +fvm install --save --folder=esx esx-org/esx_property ``` -3) Import esx_property.sql in your database -4) Import esx_offices.sql in your database if you want the offices to added in your server(The Arcadius Business Centre is not included because realstateagentjob) -5) Add this in your server.cfg : + +### Using Git +``` +cd resources +git clone https://github.com/ESX-Org/esx_property [esx]/esx_property +``` + +### Manually +- Download https://github.com/ESX-Org/esx_property/archive/master.zip +- Put it in the `[esx]` directory + +## Installation +- Import `esx_property.sql` in your database +- Import `esx_offices.sql` in your database if you want the offices to added in your server (The Arcadius Business Centre is not included because realstateagentjob) +- Add this to your `server.cfg`: ``` start esx_property ``` + +# Legal +### License +esx_property - own a property! + +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/offices.sql b/offices.sql index 44459157..f42b93e6 100644 --- a/offices.sql +++ b/offices.sql @@ -1,3 +1,5 @@ +USE `essentialmode`; + INSERT INTO `properties` VALUES (43, 'MazeBankBuilding', 'Maze Bank Building', '{\"x\":-79.18,\"y\":-795.92,\"z\":43.35}', NULL, NULL, '{\"x\":-72.50,\"y\":-786.92,\"z\":43.40}', '[]', NULL, 0, 0, 1, NULL, 0), (44, 'OldSpiceWarm', 'Old Spice Warm', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_01a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), From d0e23580ee75275721d1d77c70acc5cb2b71d2af Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 6 Jun 2018 22:26:54 +0200 Subject: [PATCH 58/99] Added back optional arguments --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 369af723..9341db7c 100644 --- a/server/main.lua +++ b/server/main.lua @@ -547,7 +547,7 @@ AddEventHandler('esx_property:removeOutfit', function(label) end) -function PayRent() +function PayRent(d, h, m) MySQL.Async.fetchAll( 'SELECT * FROM owned_properties WHERE rented = 1', {}, function (result) From 442486118935f3bff651eb45dccb7416abe41d8a Mon Sep 17 00:00:00 2001 From: AdrineX Date: Tue, 12 Jun 2018 20:38:38 +0300 Subject: [PATCH 59/99] Add Finnish lang... --- __resource.lua | 2 ++ locales/fi.lua | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 locales/fi.lua diff --git a/__resource.lua b/__resource.lua index b7af0fa7..3bc48381 100644 --- a/__resource.lua +++ b/__resource.lua @@ -9,6 +9,7 @@ server_scripts { 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', + 'locales/fi.lua', 'locales/fr.lua', 'locales/es.lua', 'locales/sv.lua', @@ -22,6 +23,7 @@ client_scripts { 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', + 'locales/fi.lua', 'locales/fr.lua', 'locales/es.lua', 'locales/sv.lua', diff --git a/locales/fi.lua b/locales/fi.lua new file mode 100644 index 00000000..65e2edf3 --- /dev/null +++ b/locales/fi.lua @@ -0,0 +1,35 @@ +Locales['fi'] = { + ['have_withdrawn'] = 'sinä nostit ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'sinä talletit ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'vapaa kiinteistö', + ['property'] = 'asunto', + ['enter'] = 'sisään', + ['leave'] = 'myy', + ['buy'] = 'osta', + ['rent'] = 'vuokraa', + ['visit'] = 'vieraile', + ['press_to_menu'] = 'paina ~INPUT_CONTEXT~ avataksesi talon valikko', + ['owned_properties'] = 'omistuksessa olevat asunnot', + ['available_properties'] = 'vapaat asunnot', + ['invite_player'] = 'kutsu pelaaja', + ['you_invited'] = 'sinä kutsuit henkilön ~y~%s~s~ kiinteistöösi', + ['player_clothes'] = 'asut', + ['remove_cloth'] = 'poista asu', + ['removed_cloth'] = 'asu poistettiin vaatekaapistasi!', + ['remove_object'] = 'poista esine', + ['deposit_object'] = 'talleta esine', + ['invite'] = 'kutsu', + ['dirty_money'] = 'likainen raha $', + ['inventory'] = 'reppu', + ['amount'] = 'määrä?', + ['amount_invalid'] = 'virheellinen määrä', + ['press_to_exit'] = 'paina ~INPUT_CONTEXT~ poistuaksesi kiinteistöstä', + ['rented_for'] = 'sinä vuokrasit kiinteistön hintaan $', + ['purchased_for'] = 'sinä ostit kiinteistön hintaan $', + ['made_property'] = 'sinä teit kiinteistön', + ['not_enough'] = 'sinulla ei ole tarpeeksi rahaa', + ['invalid_quantity'] = 'virheellinen määrä', + ['paid_rent'] = 'sinä ~g~maksoit~s~ vuokraasi: ~g~$%s~s~', + ['not_enough_in_property'] = 'täällä ei ole enempää ~r~tätä itemiä~s~ tässä kiinteistössä!', + ['player_cannot_hold'] = 'sinulla ~r~ei ole~s~ tarpeeksi ~y~vapaata tilaa~s~ repussasi!', +} \ No newline at end of file From dd0ca39f2e02f570966f5ad0fbd73a20df9e29ae Mon Sep 17 00:00:00 2001 From: AdrineX Date: Wed, 13 Jun 2018 01:06:54 +0300 Subject: [PATCH 60/99] add sql file --- localization/fi_esx_property.sql | 94 ++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 localization/fi_esx_property.sql diff --git a/localization/fi_esx_property.sql b/localization/fi_esx_property.sql new file mode 100644 index 00000000..42f670a3 --- /dev/null +++ b/localization/fi_esx_property.sql @@ -0,0 +1,94 @@ +USE `essentialmode`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Kiinteistö Likainen raha',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Kiinteistö',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('property','Kiinteistö',0) +; + +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +); + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Basic apartment','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Modern Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Modern Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Modern Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Mody Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Mody Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Mody Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Vibrant Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Vibrant Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Vibrant Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Sharp Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Sharp Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Sharp Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Monochrome Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Monochrome Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Monochrome Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Seductive Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Seductive Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Seductive Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Regal Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Regal Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Regal Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Aqua Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Aqua Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Aqua Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + From 13d3bf09e88834ad2d7b9377d98dcdd6bdda2f85 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 1 Jul 2018 13:26:54 +0200 Subject: [PATCH 61/99] Fixed office exit, closes #29 Co-Authored-By: William Plunkett Jr --- offices.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offices.sql b/offices.sql index f42b93e6..be9544eb 100644 --- a/offices.sql +++ b/offices.sql @@ -9,7 +9,7 @@ INSERT INTO `properties` VALUES (48, 'ExecutiveCool', 'Executive Cool', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), (49, 'ExecutiveContrast', 'Executive Contrast', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_02a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), (50, 'PowerBrokerIce', 'Power Broker Ice', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03a\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), - (51, 'PowerBrokerConservative', 'Power Broker Conservative', NULL, '', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), + (51, 'PowerBrokerConservative', 'Power Broker Conservative', NULL, '{"x":-75.69,"y":-827.08,"z":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03b\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), (52, 'PowerBrokerPolished', 'Power Broker Polished', NULL, '{\"x\":-75.69,\"y\":-827.08,\"z\":242.43}', '{\"x\":-75.51,\"y\":-823.90,\"z\":242.43}', NULL, '[\"ex_dt1_11_office_03c\"]', 'MazeBankBuilding', 0, 1, 0, '{\"x\":-71.81,\"y\":-814.34,\"z\":242.39}', 5000000), (53, 'LomBank', 'Lom Bank', '{\"x\":-1581.36,\"y\":-558.23,\"z\":34.07}', NULL, NULL, '{\"x\":-1583.60,\"y\":-555.12,\"z\":34.07}', '[]', NULL, 0, 0, 1, NULL, 0), (54, 'LBOldSpiceWarm', 'LB Old Spice Warm', NULL, '{\"x\":-1579.53,\"y\":-564.89,\"z\":107.62}', '{\"x\":-1576.42,\"y\":-567.57,\"z\":107.62}', NULL, '[\"ex_sm_13_office_01a\"]', 'LomBank', 0, 1, 0, '{\"x\":-1571.26,\"y\":-575.76,\"z\":107.52}', 3500000), From 9af2bf7545c643b15b0d34229fc2a3d32dc96c81 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 1 Jul 2018 14:14:02 +0200 Subject: [PATCH 62/99] Minor fixes, fixed restarting script --- __resource.lua | 5 +- client/main.lua | 30 ++++----- server/main.lua | 159 ++++++++++++++++++++++++++---------------------- 3 files changed, 99 insertions(+), 95 deletions(-) diff --git a/__resource.lua b/__resource.lua index 3bc48381..bbfc1bf1 100644 --- a/__resource.lua +++ b/__resource.lua @@ -2,10 +2,11 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Property' -version '1.0.3' +version '1.0.4' server_scripts { '@es_extended/locale.lua', + '@mysql-async/lib/MySQL.lua', 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', @@ -13,7 +14,6 @@ server_scripts { 'locales/fr.lua', 'locales/es.lua', 'locales/sv.lua', - '@mysql-async/lib/MySQL.lua', 'config.lua', 'server/main.lua' } @@ -32,5 +32,6 @@ client_scripts { } dependencies { + 'es_extended', 'instance' } diff --git a/client/main.lua b/client/main.lua index 986d4d41..f4217902 100644 --- a/client/main.lua +++ b/client/main.lua @@ -11,8 +11,6 @@ local Keys = { } ESX = nil -local GUI = {} -GUI.Time = 0 local OwnedProperties = {} local Blips = {} local CurrentProperty = nil @@ -861,7 +859,13 @@ end) RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(xPlayer) - PlayerLoaded = true + PlayerLoaded = true + + ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties) + for i=1, #ownedProperties, 1 do + SetPropertyOwned(ownedProperties[i], true) + end + end) end) AddEventHandler('esx_property:getProperties', function(cb) @@ -881,17 +885,6 @@ AddEventHandler('esx_property:setPropertyOwned', function(name, owned) SetPropertyOwned(name, owned) end) -RegisterNetEvent('esx:playerLoaded') -AddEventHandler('esx:playerLoaded', function(xPlayer) - - ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties) - for i=1, #ownedProperties, 1 do - SetPropertyOwned(ownedProperties[i], true) - end - end) - -end) - RegisterNetEvent('instance:onCreate') AddEventHandler('instance:onCreate', function(instance) @@ -987,7 +980,7 @@ end) Citizen.CreateThread(function() while true do - Wait(0) + Citizen.Wait(1) local coords = GetEntityCoords(GetPlayerPed(-1)) @@ -1017,7 +1010,7 @@ end) Citizen.CreateThread(function() while true do - Wait(0) + Citizen.Wait(1) local coords = GetEntityCoords(GetPlayerPed(-1)) local isInMarker = false @@ -1083,7 +1076,7 @@ end) Citizen.CreateThread(function() while true do - Citizen.Wait(0) + Citizen.Wait(10) if CurrentAction ~= nil then @@ -1091,7 +1084,7 @@ Citizen.CreateThread(function() AddTextComponentString(CurrentActionMsg) DisplayHelpTextFromStringLabel(0, 0, 1, -1) - if IsControlPressed(0, Keys['E']) and (GetGameTimer() - GUI.Time) > 300 then + if IsControlJustReleased(0, Keys['E']) then if CurrentAction == 'property_menu' then OpenPropertyMenu(CurrentActionData.property) @@ -1116,7 +1109,6 @@ Citizen.CreateThread(function() end CurrentAction = nil - GUI.Time = GetGameTimer() end diff --git a/server/main.lua b/server/main.lua index 9341db7c..816cd764 100644 --- a/server/main.lua +++ b/server/main.lua @@ -1,4 +1,5 @@ ESX = nil +local hasSqlRun = false TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) @@ -77,81 +78,91 @@ function RemoveOwnedProperty(name, owner) end -AddEventHandler('onMySQLReady', function () - - MySQL.Async.fetchAll('SELECT * FROM properties', {}, function(properties) - - for i=1, #properties, 1 do - - local entering = nil - local exit = nil - local inside = nil - local outside = nil - local isSingle = nil - local isRoom = nil - local isGateway = nil - local roomMenu = nil - - if properties[i].entering ~= nil then - entering = json.decode(properties[i].entering) - end - - if properties[i].exit ~= nil then - exit = json.decode(properties[i].exit) - end - - if properties[i].inside ~= nil then - inside = json.decode(properties[i].inside) - end - - if properties[i].outside ~= nil then - outside = json.decode(properties[i].outside) - end - - if properties[i].is_single == 0 then - isSingle = false - else - isSingle = true - end - - if properties[i].is_room == 0 then - isRoom = false - else - isRoom = true - end - - if properties[i].is_gateway == 0 then - isGateway = false - else - isGateway = true - end - - if properties[i].room_menu ~= nil then - roomMenu = json.decode(properties[i].room_menu) - end - - table.insert(Config.Properties, { - name = properties[i].name, - label = properties[i].label, - entering = entering, - exit = exit, - inside = inside, - outside = outside, - ipls = json.decode(properties[i].ipls), - gateway = properties[i].gateway, - isSingle = isSingle, - isRoom = isRoom, - isGateway = isGateway, - roomMenu = roomMenu, - price = properties[i].price - }) - - end - - end) - +AddEventHandler('onMySQLReady', function() + hasSqlRun = true + LoadSql() end) +-- extremely useful when restarting script mid-game +Citizen.CreateThread(function() + Citizen.Wait(20000) -- hopefully enough for connection to the SQL server + + if not hasSqlRun then + LoadSql() + hasSqlRun = true + end +end) + +function LoadSql() + MySQL.Async.fetchAll('SELECT * FROM properties', {}, function(properties) + for i=1, #properties, 1 do + + local entering = nil + local exit = nil + local inside = nil + local outside = nil + local isSingle = nil + local isRoom = nil + local isGateway = nil + local roomMenu = nil + + if properties[i].entering ~= nil then + entering = json.decode(properties[i].entering) + end + + if properties[i].exit ~= nil then + exit = json.decode(properties[i].exit) + end + + if properties[i].inside ~= nil then + inside = json.decode(properties[i].inside) + end + + if properties[i].outside ~= nil then + outside = json.decode(properties[i].outside) + end + + if properties[i].is_single == 0 then + isSingle = false + else + isSingle = true + end + + if properties[i].is_room == 0 then + isRoom = false + else + isRoom = true + end + + if properties[i].is_gateway == 0 then + isGateway = false + else + isGateway = true + end + + if properties[i].room_menu ~= nil then + roomMenu = json.decode(properties[i].room_menu) + end + + table.insert(Config.Properties, { + name = properties[i].name, + label = properties[i].label, + entering = entering, + exit = exit, + inside = inside, + outside = outside, + ipls = json.decode(properties[i].ipls), + gateway = properties[i].gateway, + isSingle = isSingle, + isRoom = isRoom, + isGateway = isGateway, + roomMenu = roomMenu, + price = properties[i].price + }) + end + end) +end + AddEventHandler('esx_ownedproperty:getOwnedProperties', function(cb) MySQL.Async.fetchAll( @@ -556,7 +567,7 @@ function PayRent(d, h, m) -- message player if connected if xPlayer ~= nil then - xPlayer.removeBank(result[i].price) + xPlayer.removeAccountMoney('bank', result[i].price) TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent', result[i].price)) else -- pay rent either way MySQL.Sync.execute( From fffde49c1c8c6c3aba99e3f039dd69cf3689728a Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 1 Jul 2018 14:57:10 +0200 Subject: [PATCH 63/99] Minor improvements --- client/main.lua | 60 ++++++++++++++++++++++++------------------------- server/main.lua | 2 +- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/client/main.lua b/client/main.lua index f4217902..7bd0d0d5 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1074,45 +1074,43 @@ end) -- Key controls Citizen.CreateThread(function() - while true do + while true do - Citizen.Wait(10) + Citizen.Wait(10) - 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 IsControlJustReleased(0, Keys['E']) then + if IsControlJustReleased(0, Keys['E']) then - if CurrentAction == 'property_menu' then - OpenPropertyMenu(CurrentActionData.property) - end + if CurrentAction == 'property_menu' then + OpenPropertyMenu(CurrentActionData.property) + end - if CurrentAction == 'gateway_menu' then + if CurrentAction == 'gateway_menu' then + if Config.EnablePlayerManagement then + OpenGatewayOwnedPropertiesMenu(CurrentActionData.property) + else + OpenGatewayMenu(CurrentActionData.property) + end + end - if Config.EnablePlayerManagement then - OpenGatewayOwnedPropertiesMenu(CurrentActionData.property) - else - OpenGatewayMenu(CurrentActionData.property) - end + if CurrentAction == 'room_menu' then + OpenRoomMenu(CurrentActionData.property, CurrentActionData.owner) + end - end + if CurrentAction == 'room_exit' then + TriggerEvent('instance:leave') + end - if CurrentAction == 'room_menu' then - OpenRoomMenu(CurrentActionData.property, CurrentActionData.owner) - end + CurrentAction = nil + end - if CurrentAction == 'room_exit' then - TriggerEvent('instance:leave') - end - - CurrentAction = nil - - end - - end - - end + else -- no current action, sleep mode + Citizen.Wait(500) + end + end end) diff --git a/server/main.lua b/server/main.lua index 816cd764..73de18a3 100644 --- a/server/main.lua +++ b/server/main.lua @@ -260,7 +260,7 @@ AddEventHandler('esx_property:deleteLastProperty', function() MySQL.Async.execute( 'UPDATE users SET last_property = NULL WHERE identifier = @identifier', { - ['@identifier'] = xPlayer.identifier + ['@identifier'] = xPlayer.identifier } ) end) From 148274cee526bdc41f00f7c2d7c01e9624d3b888 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 3 Jul 2018 00:40:18 +0200 Subject: [PATCH 64/99] Fixed restarting scripts no blips, closes #15 --- client/main.lua | 45 +++++++++++++++++++-------------------------- server/main.lua | 8 +++----- 2 files changed, 22 insertions(+), 31 deletions(-) diff --git a/client/main.lua b/client/main.lua index 7bd0d0d5..e676adb6 100644 --- a/client/main.lua +++ b/client/main.lua @@ -24,6 +24,25 @@ local CurrentActionData = {} local FirstSpawn = true local HasChest = false +Citizen.CreateThread(function() + while ESX == nil do + TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + Citizen.Wait(0) + end +end) + +RegisterNetEvent('esx_property:sendProperties') +AddEventHandler('esx_property:sendProperties', function(properties) + Config.Properties = properties + CreateBlips() + + ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties) + for i=1, #ownedProperties, 1 do + SetPropertyOwned(ownedProperties[i], true) + end + end) +end) + function DrawSub(text, time) ClearPrints() SetTextEntry_2('STRING') @@ -857,17 +876,6 @@ AddEventHandler('playerSpawned', function() end) -RegisterNetEvent('esx:playerLoaded') -AddEventHandler('esx:playerLoaded', function(xPlayer) - PlayerLoaded = true - - ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties) - for i=1, #ownedProperties, 1 do - SetPropertyOwned(ownedProperties[i], true) - end - end) -end) - AddEventHandler('esx_property:getProperties', function(cb) cb(GetProperties()) end) @@ -961,21 +969,6 @@ AddEventHandler('esx_property:hasExitedMarker', function(name, part) CurrentAction = nil end) --- Init -Citizen.CreateThread(function() - - while ESX == nil do - TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) - Citizen.Wait(0) - end - - ESX.TriggerServerCallback('esx_property:getProperties', function(properties) - Config.Properties = properties - CreateBlips() - end) - -end) - -- Display markers Citizen.CreateThread(function() while true do diff --git a/server/main.lua b/server/main.lua index 73de18a3..14a6ba1e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -159,7 +159,9 @@ function LoadSql() roomMenu = roomMenu, price = properties[i].price }) - end + end + + TriggerClientEvent('esx_property:broadcastProperties', -1, Config.Properties) end) end @@ -415,10 +417,6 @@ AddEventHandler('esx_property:putItem', function(owner, type, item, count) end) -ESX.RegisterServerCallback('esx_property:getProperties', function(source, cb) - cb(Config.Properties) -end) - ESX.RegisterServerCallback('esx_property:getOwnedProperties', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) From 177791d4720e96c418539d9641f12e507c1352b5 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 4 Jul 2018 18:14:44 +0200 Subject: [PATCH 65/99] Fixed broken script and last_property being empty instead of nil, closes #33 --- README.md | 2 +- __resource.lua | 6 +++++- client/main.lua | 47 ++++++++++++++++++++++++++++++----------------- server/main.lua | 10 +++++++--- 4 files changed, 43 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 6a08124e..37449fa6 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ git clone https://github.com/ESX-Org/esx_property [esx]/esx_property ## Installation - Import `esx_property.sql` in your database -- Import `esx_offices.sql` in your database if you want the offices to added in your server (The Arcadius Business Centre is not included because realstateagentjob) +- Import `esx_offices.sql` in your database if you want offices (The Arcadius Business Centre is not included because realstateagentjob) - Add this to your `server.cfg`: ``` diff --git a/__resource.lua b/__resource.lua index bbfc1bf1..1ace3383 100644 --- a/__resource.lua +++ b/__resource.lua @@ -33,5 +33,9 @@ client_scripts { dependencies { 'es_extended', - 'instance' + 'instance', + 'cron', + 'esx_addonaccount', + 'esx_addoninventory', + 'esx_datastore' } diff --git a/client/main.lua b/client/main.lua index e676adb6..850d24d0 100644 --- a/client/main.lua +++ b/client/main.lua @@ -31,6 +31,21 @@ Citizen.CreateThread(function() end end) +RegisterNetEvent('esx:playerLoaded') +AddEventHandler('esx:playerLoaded', function(xPlayer) + ESX.TriggerServerCallback('esx_property:getProperties', function(properties) + Config.Properties = properties + CreateBlips() + end) + + ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties) + for i=1, #ownedProperties, 1 do + SetPropertyOwned(ownedProperties[i], true) + end + end) +end) + +-- only used when script is restarting mid-session RegisterNetEvent('esx_property:sendProperties') AddEventHandler('esx_property:sendProperties', function(properties) Config.Properties = properties @@ -854,26 +869,25 @@ AddEventHandler('instance:loaded', function() end) AddEventHandler('playerSpawned', function() + if FirstSpawn then - if FirstSpawn then + Citizen.CreateThread(function() - Citizen.CreateThread(function() + while not ESX.IsPlayerLoaded() do + Citizen.Wait(0) + end - while not ESX.IsPlayerLoaded() do - Citizen.Wait(0) - end - - ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) - if propertyName ~= nil then - TriggerEvent('instance:create', 'property', {property = propertyName, owner = ESX.GetPlayerData().identifier}) - end - end) - - end) - - FirstSpawn = false - end + ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) + if propertyName ~= nil then + if propertyName ~= '' then + TriggerEvent('instance:create', 'property', {property = propertyName, owner = ESX.GetPlayerData().identifier}) + end + end + end) + end) + FirstSpawn = false + end end) AddEventHandler('esx_property:getProperties', function(cb) @@ -904,7 +918,6 @@ end) RegisterNetEvent('instance:onEnter') AddEventHandler('instance:onEnter', function(instance) - if instance.type == 'property' then local property = GetProperty(instance.data.property) diff --git a/server/main.lua b/server/main.lua index 14a6ba1e..6e2e136e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -159,12 +159,16 @@ function LoadSql() roomMenu = roomMenu, price = properties[i].price }) - end - - TriggerClientEvent('esx_property:broadcastProperties', -1, Config.Properties) + end + + TriggerClientEvent('esx_property:sendProperties', -1, Config.Properties) end) end +ESX.RegisterServerCallback('esx_property:getProperties', function(source, cb) + cb(Config.Properties) +end) + AddEventHandler('esx_ownedproperty:getOwnedProperties', function(cb) MySQL.Async.fetchAll( From 53f45db40113d6d28370c023c7e073fe22db435e Mon Sep 17 00:00:00 2001 From: deviljin112 <39461646+deviljin112@users.noreply.github.com> Date: Mon, 23 Jul 2018 22:47:40 +0100 Subject: [PATCH 66/99] Polish Translation --- __resource.lua | 2 + locales/pl.lua | 35 ++++++++++++ localization/pl_esx_property.sql | 94 ++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 locales/pl.lua create mode 100644 localization/pl_esx_property.sql diff --git a/__resource.lua b/__resource.lua index 1ace3383..a5b84ec4 100644 --- a/__resource.lua +++ b/__resource.lua @@ -14,6 +14,7 @@ server_scripts { 'locales/fr.lua', 'locales/es.lua', 'locales/sv.lua', + 'locales/pl.lua', 'config.lua', 'server/main.lua' } @@ -27,6 +28,7 @@ client_scripts { 'locales/fr.lua', 'locales/es.lua', 'locales/sv.lua', + 'locales/pl.lua', 'config.lua', 'client/main.lua' } diff --git a/locales/pl.lua b/locales/pl.lua new file mode 100644 index 00000000..e79f2ba2 --- /dev/null +++ b/locales/pl.lua @@ -0,0 +1,35 @@ +Locales['pl'] = { + ['have_withdrawn'] = 'wyciągnąłeś/aś ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'zdeponowałeś/aś ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'wolne mieszkanie', + ['property'] = 'mieszkanie', + ['enter'] = 'wejdz', + ['leave'] = 'sprzedzaj', + ['buy'] = 'kup', + ['rent'] = 'wynajmij', + ['visit'] = 'odwiedz', + ['press_to_menu'] = 'wciśnij ~INPUT_CONTEXT~ aby otworzyć menu', + ['owned_properties'] = 'twoje mieszkania', + ['available_properties'] = 'dostępne mieszkania', + ['invite_player'] = 'zaproś gracza', + ['you_invited'] = 'zaprosiłeś/aś ~y~%s~s~ do swojego mieszkania', + ['player_clothes'] = 'ubrania', + ['remove_cloth'] = 'usuń ubrania', + ['removed_cloth'] = 'te ubrania zostały usunięte z twojej garderoby!', + ['remove_object'] = 'usuń objekt', + ['deposit_object'] = 'deponuj objekt', + ['invite'] = 'zaproś', + ['dirty_money'] = 'brudne pieniądze $', + ['inventory'] = 'ekwipunek', + ['amount'] = 'suma?', + ['amount_invalid'] = 'nieprawidłowa suma', + ['press_to_exit'] = 'wciśnij ~INPUT_CONTEXT~ aby wyjść z mieszkania', + ['rented_for'] = 'wynająłeś/aś mieszkanie za $', + ['purchased_for'] = 'kupiłeś/aś mieszkanie za $', + ['made_property'] = 'stworzyłeś/aś mieszkanie', + ['not_enough'] = 'nie posiadasz wystarczająco pieniędzy', + ['invalid_quantity'] = 'nieprawidłowa ilość', + ['paid_rent'] = '~g~zapłaciłeś/aś~s~ za wynajem: ~g~$%s~s~', + ['not_enough_in_property'] = 'nie ma wystarczająco ~r~tego przedmiotu~s~ w mieszkaniu!', + ['player_cannot_hold'] = '~r~nie masz~s~ wystarczająco ~y~wolnego~s~ miejsca w ekwipunku!', +} \ No newline at end of file diff --git a/localization/pl_esx_property.sql b/localization/pl_esx_property.sql new file mode 100644 index 00000000..4ec2f594 --- /dev/null +++ b/localization/pl_esx_property.sql @@ -0,0 +1,94 @@ +USE `essentialmode`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Mieszkanie na sprzedaż',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Mieszkanie',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('property','Mieszkanie',0) +; + +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +); + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Basic apartment','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Modern Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Modern Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Modern Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Mody Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Mody Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Mody Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Vibrant Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Vibrant Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Vibrant Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Sharp Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Sharp Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Sharp Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Monochrome Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Monochrome Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Monochrome Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Seductive Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Seductive Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Seductive Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Regal Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Regal Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Regal Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Aqua Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Aqua Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Aqua Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + From 09584df6139225dd1a677ed77cdf5633aa9f7b9b Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Fri, 10 Aug 2018 00:55:11 -0400 Subject: [PATCH 67/99] Repo Update --- .editorconfig | 9 +++++++++ LICENSE.txt => LICENSE | 0 2 files changed, 9 insertions(+) create mode 100644 .editorconfig rename LICENSE.txt => LICENSE (100%) diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..9b425256 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_size = 4 +indent_style = tab +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 b59c57c4138d61bea38c352148c9917afe81892b Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 11 Aug 2018 12:44:10 +0200 Subject: [PATCH 68/99] Added tonumber() checks, locale improvements, inventory improvements --- client/main.lua | 235 ++++++++++++++++++++++-------------------------- locales/br.lua | 6 +- locales/de.lua | 6 +- locales/en.lua | 6 +- locales/es.lua | 6 +- locales/fi.lua | 6 +- locales/fr.lua | 6 +- locales/pl.lua | 6 +- locales/sv.lua | 10 +-- server/main.lua | 4 +- 10 files changed, 135 insertions(+), 156 deletions(-) diff --git a/client/main.lua b/client/main.lua index 850d24d0..ae6e2956 100644 --- a/client/main.lua +++ b/client/main.lua @@ -686,172 +686,157 @@ end function OpenRoomInventoryMenu(property, owner) - ESX.TriggerServerCallback('esx_property:getPropertyInventory', function(inventory) + ESX.TriggerServerCallback('esx_property:getPropertyInventory', function(inventory) - local elements = {} + local elements = {} - table.insert(elements, {label = _U('dirty_money') .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) + if inventory.blackMoney > 0 then + table.insert(elements, {label = _U('dirty_money', inventory.blackMoney), type = 'item_account', value = 'black_money'}) + end - 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 + for i=1, #inventory.weapons, 1 do + local weapon = inventory.weapons[i] + table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name) .. ' [' .. weapon.ammo .. ']', type = 'item_weapon', value = weapon.name, ammo = weapon.ammo}) + end - end + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room_inventory', + { + title = property.label .. ' - ' .. _U('inventory'), + align = 'top-left', + elements = elements, + }, function(data, menu) - for i=1, #inventory.weapons, 1 do - local weapon = inventory.weapons[i] - table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name) .. ' [' .. weapon.ammo .. ']', type = 'item_weapon', value = weapon.name, ammo = weapon.ammo}) - end + if data.current.type == 'item_weapon' then - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'room_inventory', - { - title = property.label .. ' - ' .. _U('inventory'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + menu.close() - if data.current.type == 'item_weapon' then + TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, data.current.ammo) - menu.close() + ESX.SetTimeout(300, function() + OpenRoomInventoryMenu(property, owner) + end) - TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, data.current.ammo) + else - ESX.SetTimeout(300, function() - OpenRoomInventoryMenu(property, owner) - end) + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'get_item_count', + { + title = _U('amount'), + }, function(data2, menu) - else + local quantity = tonumber(data2.value) - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'get_item_count', - { - title = _U('amount'), - }, - function(data2, menu) + if quantity == nil then + ESX.ShowNotification(_U('amount_invalid')) + else - local quantity = tonumber(data2.value) + menu.close() - if quantity == nil then - ESX.ShowNotification(_U('amount_invalid')) - else + TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, quantity) - menu.close() + ESX.SetTimeout(300, function() + OpenRoomInventoryMenu(property, owner) + end) - TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, quantity) + end - ESX.SetTimeout(300, function() - OpenRoomInventoryMenu(property, owner) - end) + end, function(data2,menu) + menu.close() + end) - end + end - end, - function(data2,menu) - menu.close() - end - ) + end, function(data, menu) + menu.close() + end) - end - - end, - function(data, menu) - menu.close() - end - ) - - end, owner) + end, owner) end function OpenPlayerInventoryMenu(property, owner) - ESX.TriggerServerCallback('esx_property:getPlayerInventory', function(inventory) + ESX.TriggerServerCallback('esx_property:getPlayerInventory', function(inventory) - local elements = {} + local elements = {} - table.insert(elements, {label = _U('dirty_money') .. inventory.blackMoney, type = 'item_account', value = 'black_money'}) + if inventory.blackMoney > 0 then + table.insert(elements, {label = _U('dirty_money', inventory.blackMoney), type = 'item_account', value = 'black_money'}) + end - for i=1, #inventory.items, 1 do + 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 + end - local item = inventory.items[i] + local playerPed = GetPlayerPed(-1) + local weaponList = ESX.GetWeaponList() - if item.count > 0 then - table.insert(elements, {label = item.label .. ' x' .. item.count, type = 'item_standard', value = item.name}) - end + 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 .. ' [' .. ammo .. ']', type = 'item_weapon', value = weaponList[i].name, ammo = ammo}) + end + end - end + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'player_inventory', + { + title = property.label .. ' - ' .. _U('inventory'), + align = 'top-left', + elements = elements, + }, function(data, menu) - local playerPed = GetPlayerPed(-1) - local weaponList = ESX.GetWeaponList() + if data.current.type == 'item_weapon' then - for i=1, #weaponList, 1 do + menu.close() - local weaponHash = GetHashKey(weaponList[i].name) + TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, data.current.ammo) - if HasPedGotWeapon(playerPed, weaponHash, false) and weaponList[i].name ~= 'WEAPON_UNARMED' then - local ammo = GetAmmoInPedWeapon(playerPed, weaponHash) - table.insert(elements, {label = weaponList[i].label .. ' [' .. ammo .. ']', type = 'item_weapon', value = weaponList[i].name, ammo = ammo}) - end + ESX.SetTimeout(300, function() + OpenPlayerInventoryMenu(property, owner) + end) - end + else - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'player_inventory', - { - title = property.label .. ' - ' .. _U('inventory'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'put_item_count', { + title = _U('amount'), + }, function(data2, menu2) - if data.current.type == 'item_weapon' then + local quantity = tonumber(data2.value) - menu.close() + if quantity == nil then + ESX.ShowNotification(_U('amount_invalid')) + else - TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, data.current.ammo) + menu2.close() - ESX.SetTimeout(300, function() - OpenPlayerInventoryMenu(property, owner) - end) + TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, tonumber(data2.value)) + ESX.SetTimeout(300, function() + OpenPlayerInventoryMenu(property, owner) + end) + end - else + end, function(data2, menu2) + menu2.close() + end) - ESX.UI.Menu.Open( - 'dialog', GetCurrentResourceName(), 'put_item_count', - { - title = _U('amount'), - }, - function(data2, menu) + end - menu.close() + end, function(data, menu) + menu.close() + end) - TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, tonumber(data2.value)) - - ESX.SetTimeout(300, function() - OpenPlayerInventoryMenu(property, owner) - end) - - end, - function(data2,menu) - menu.close() - end - ) - - end - - end, - function(data, menu) - menu.close() - end - ) - - end) + end) end @@ -1094,21 +1079,15 @@ Citizen.CreateThread(function() if CurrentAction == 'property_menu' then OpenPropertyMenu(CurrentActionData.property) - end - - if CurrentAction == 'gateway_menu' then + elseif CurrentAction == 'gateway_menu' then if Config.EnablePlayerManagement then OpenGatewayOwnedPropertiesMenu(CurrentActionData.property) else OpenGatewayMenu(CurrentActionData.property) end - end - - if CurrentAction == 'room_menu' then + elseif CurrentAction == 'room_menu' then OpenRoomMenu(CurrentActionData.property, CurrentActionData.owner) - end - - if CurrentAction == 'room_exit' then + elseif CurrentAction == 'room_exit' then TriggerEvent('instance:leave') end diff --git a/locales/br.lua b/locales/br.lua index f922826f..152bdacb 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -19,13 +19,13 @@ Locales['br'] = { ['remove_object'] = 'Remover objeto', ['deposit_object'] = 'Depositar objeto', ['invite'] = 'Convidar', - ['dirty_money'] = 'Dinheiro sujo $', + ['dirty_money'] = 'Dinheiro sujo: $%s', ['inventory'] = 'Inventário', ['amount'] = 'valor?', ['amount_invalid'] = 'quantidade inválida', ['press_to_exit'] = 'Pressione ~INPUT_CONTEXT~ para sair da propriedade', - ['rented_for'] = 'Você alugou uma propriedade por $', - ['purchased_for'] = 'Você comprou uma propriedade por $', + ['rented_for'] = 'Você alugou uma propriedade por ~g~$%s~s~', + ['purchased_for'] = 'Você comprou uma propriedade por ~g~$%s~s~', ['made_property'] = 'Você criou uma propriedade', ['not_enough'] = 'Você não tem dinheiro suficiente', ['invalid_quantity'] = 'Quantidade inválida', diff --git a/locales/de.lua b/locales/de.lua index f82f0567..cd4f3cb5 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -19,13 +19,13 @@ Locales['de'] = { ['remove_object'] = 'Objekt nehmen', ['deposit_object'] = 'Objekt deponieren', ['invite'] = 'Einladen', - ['dirty_money'] = 'Schwarzgeld $', + ['dirty_money'] = 'Schwarzgeld: $%s', ['inventory'] = 'Inventar', ['amount'] = 'Anzahlt?', ['amount_invalid'] = 'Ungültiger Wert', ['press_to_exit'] = 'Drücke ~INPUT_CONTEXT~ um die Immobilie zu verlassen', - ['rented_for'] = 'Du hast eine Immobilie gemietet $', - ['purchased_for'] = 'Du hast eine Immobilie gekauft $', + ['rented_for'] = 'Du hast eine Immobilie gemietet ~g~$%s~s~', + ['purchased_for'] = 'Du hast eine Immobilie gekauft ~g~$%s~s~', ['made_property'] = 'Du hast eine Immobilie gemacht', ['not_enough'] = 'du hast nicht genug Geld', ['invalid_quantity'] = 'Ungültiger Betrag', diff --git a/locales/en.lua b/locales/en.lua index 4ddf1a61..2fc5ce23 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -19,13 +19,13 @@ Locales['en'] = { ['remove_object'] = 'remove object', ['deposit_object'] = 'deposit object', ['invite'] = 'invite', - ['dirty_money'] = 'dirty money $', + ['dirty_money'] = 'dirty money: $%s', ['inventory'] = 'inventory', ['amount'] = 'amount?', ['amount_invalid'] = 'invalid amount', ['press_to_exit'] = 'press ~INPUT_CONTEXT~ to exit the property', - ['rented_for'] = 'you rented a property for $', - ['purchased_for'] = 'you purchased a property for $', + ['rented_for'] = 'you rented a property for ~g~$%s~s~', + ['purchased_for'] = 'you purchased a property for ~g~$%s~s~', ['made_property'] = 'you have made a property', ['not_enough'] = 'you do not have enough money', ['invalid_quantity'] = 'invalid quantity', diff --git a/locales/es.lua b/locales/es.lua index b1fb8d07..c2477884 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -19,13 +19,13 @@ Locales['es'] = { ['remove_object'] = 'Retirar objeto', ['deposit_object'] = 'Depositar objeto', ['invite'] = 'Invitar', - ['dirty_money'] = 'Dinero sucio €', + ['dirty_money'] = 'Dinero sucio: €%s', ['inventory'] = 'Inventario', ['amount'] = '¿Cantidad?', ['amount_invalid'] = 'Cantidad inválida', ['press_to_exit'] = 'Presione ~INPUT_CONTEXT~ para salir de la propiedad', - ['rented_for'] = 'Has alquilado una propiedad por €', - ['purchased_for'] = 'Has comprado una propiedad por €', + ['rented_for'] = 'Has alquilado una propiedad por ~g~€%s~s~', + ['purchased_for'] = 'Has comprado una propiedad por ~g~€%s~s~', ['made_property'] = 'Ha hecho una propiedad', ['not_enough'] = 'n\'No tiene suficiente d\'dinero', ['invalid_quantity'] = 'Cantidad inválida', diff --git a/locales/fi.lua b/locales/fi.lua index 65e2edf3..fd958a43 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -19,13 +19,13 @@ Locales['fi'] = { ['remove_object'] = 'poista esine', ['deposit_object'] = 'talleta esine', ['invite'] = 'kutsu', - ['dirty_money'] = 'likainen raha $', + ['dirty_money'] = 'likainen raha: $%s', ['inventory'] = 'reppu', ['amount'] = 'määrä?', ['amount_invalid'] = 'virheellinen määrä', ['press_to_exit'] = 'paina ~INPUT_CONTEXT~ poistuaksesi kiinteistöstä', - ['rented_for'] = 'sinä vuokrasit kiinteistön hintaan $', - ['purchased_for'] = 'sinä ostit kiinteistön hintaan $', + ['rented_for'] = 'sinä vuokrasit kiinteistön hintaan ~g~$%s~s~', + ['purchased_for'] = 'sinä ostit kiinteistön hintaan ~g~$%s~s~', ['made_property'] = 'sinä teit kiinteistön', ['not_enough'] = 'sinulla ei ole tarpeeksi rahaa', ['invalid_quantity'] = 'virheellinen määrä', diff --git a/locales/fr.lua b/locales/fr.lua index 61d06b82..4aa55cf7 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -19,13 +19,13 @@ Locales['fr'] = { ['remove_object'] = 'retirer objet', ['deposit_object'] = 'déposer objet', ['invite'] = 'inviter', - ['dirty_money'] = 'argent sale $', + ['dirty_money'] = 'argent sale: $%s', ['inventory'] = 'inventaire', ['amount'] = 'quantité ?', ['amount_invalid'] = 'montant invalide', ['press_to_exit'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir de la propriété', - ['rented_for'] = 'vous avez loué une propriété pour $', - ['purchased_for'] = 'vous avez acheté une propriété pour $', + ['rented_for'] = 'vous avez loué une propriété pour ~g~$%s~s~', + ['purchased_for'] = 'vous avez acheté une propriété pour ~g~$%s~s~', ['made_property'] = 'vous avez rendu une propriété', ['not_enough'] = 'vous n\'avez pas assez d\'argent', ['invalid_quantity'] = 'quantité invalide', diff --git a/locales/pl.lua b/locales/pl.lua index e79f2ba2..0c6fe04d 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -19,13 +19,13 @@ Locales['pl'] = { ['remove_object'] = 'usuń objekt', ['deposit_object'] = 'deponuj objekt', ['invite'] = 'zaproś', - ['dirty_money'] = 'brudne pieniądze $', + ['dirty_money'] = 'brudne pieniądze: $%s', ['inventory'] = 'ekwipunek', ['amount'] = 'suma?', ['amount_invalid'] = 'nieprawidłowa suma', ['press_to_exit'] = 'wciśnij ~INPUT_CONTEXT~ aby wyjść z mieszkania', - ['rented_for'] = 'wynająłeś/aś mieszkanie za $', - ['purchased_for'] = 'kupiłeś/aś mieszkanie za $', + ['rented_for'] = 'wynająłeś/aś mieszkanie za ~g~$%s~s~', + ['purchased_for'] = 'kupiłeś/aś mieszkanie za ~g~$%s~s~', ['made_property'] = 'stworzyłeś/aś mieszkanie', ['not_enough'] = 'nie posiadasz wystarczająco pieniędzy', ['invalid_quantity'] = 'nieprawidłowa ilość', diff --git a/locales/sv.lua b/locales/sv.lua index a4485173..0eacaf54 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -19,17 +19,17 @@ Locales['sv'] = { ['remove_object'] = 'ta ut objekt', ['deposit_object'] = 'lagra objekt', ['invite'] = 'bjud in', - ['dirty_money'] = 'Smutsiga pengar: $', + ['dirty_money'] = 'smutsiga pengar: %s SEK', ['inventory'] = 'inventory', ['amount'] = 'summa?', ['amount_invalid'] = 'ogiltlig summa', - ['press_to_exit'] = 'tryck ~INPUT_CONTEXT~ för att gå ur fastigheten', - ['rented_for'] = 'du hyrde en fastighet för: ~g~$', - ['purchased_for'] = 'du köpte en fastighet för: ~g~$', + ['press_to_exit'] = 'tryck ~INPUT_CONTEXT~ för att lämna fastigheten', + ['rented_for'] = 'du hyrde en fastighet för: ~g~%s SEK~s~', + ['purchased_for'] = 'du köpte en fastighet för: ~g~%s SEK~s~', ['made_property'] = 'you have made a property', ['not_enough'] = 'du har inte tillräckligt med pengar!', ['invalid_quantity'] = 'ogiltlig mängd', - ['paid_rent'] = 'du ~y~betalade~s~ din hyra: ~g~$%s~s~', + ['paid_rent'] = 'du ~y~betalade~s~ din hyra: ~g~%s SEK~s~', ['not_enough_in_property'] = 'det finns ~r~inte~s~ tillräckligt av ~r~det objektet~s~ i fastigheten!', ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt med ~y~utrymme~s~ för att hålla det!', } \ No newline at end of file diff --git a/server/main.lua b/server/main.lua index 6e2e136e..d88dca41 100644 --- a/server/main.lua +++ b/server/main.lua @@ -36,9 +36,9 @@ function SetPropertyOwned(name, price, rented, owner) TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true) if rented then - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for') .. price) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for', price)) else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for') .. price) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for', price)) end break From 16a3897a1d145f354dcced87879c03be96be6f42 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Thu, 20 Sep 2018 23:23:38 +0200 Subject: [PATCH 69/99] 4 tab indent update --- client/main.lua | 1136 ++++++++++++++++++++--------------------------- config.lua | 2 + server/main.lua | 543 +++++++++------------- 3 files changed, 696 insertions(+), 985 deletions(-) diff --git a/client/main.lua b/client/main.lua index ae6e2956..ff448bda 100644 --- a/client/main.lua +++ b/client/main.lua @@ -59,629 +59,499 @@ AddEventHandler('esx_property:sendProperties', function(properties) end) function DrawSub(text, time) - ClearPrints() - SetTextEntry_2('STRING') - AddTextComponentString(text) - DrawSubtitleTimed(time, 1) + ClearPrints() + SetTextEntry_2('STRING') + AddTextComponentString(text) + DrawSubtitleTimed(time, 1) end function CreateBlips() + for i=1, #Config.Properties, 1 do + local property = Config.Properties[i] - for i=1, #Config.Properties, 1 do + if property.entering ~= nil then + Blips[property.name] = AddBlipForCoord(property.entering.x, property.entering.y, property.entering.z) - local property = Config.Properties[i] - - if property.entering ~= nil then - - Blips[property.name] = AddBlipForCoord(property.entering.x, property.entering.y, property.entering.z) - - SetBlipSprite (Blips[property.name], 369) - SetBlipDisplay(Blips[property.name], 4) - SetBlipScale (Blips[property.name], 1.0) - SetBlipAsShortRange(Blips[property.name], true) - - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('free_prop')) - EndTextCommandSetBlipName(Blips[property.name]) - - end - end + SetBlipSprite (Blips[property.name], 369) + SetBlipDisplay(Blips[property.name], 4) + SetBlipScale (Blips[property.name], 1.0) + SetBlipAsShortRange(Blips[property.name], true) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(_U('free_prop')) + EndTextCommandSetBlipName(Blips[property.name]) + end + end end function GetProperties() - return Config.Properties + return Config.Properties end function GetProperty(name) - - for i=1, #Config.Properties, 1 do - if Config.Properties[i].name == name then - return Config.Properties[i] - end - end - + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name == name then + return Config.Properties[i] + end + end end function GetGateway(property) + for i=1, #Config.Properties, 1 do + local property2 = Config.Properties[i] - for i=1, #Config.Properties, 1 do - - local property2 = Config.Properties[i] - - if property2.isGateway and property2.name == property.gateway then - return property2 - end - - end - + if property2.isGateway and property2.name == property.gateway then + return property2 + end + end end function GetGatewayProperties(property) + local properties = {} - local properties = {} - - for i=1, #Config.Properties, 1 do - if Config.Properties[i].gateway == property.name then - table.insert(properties, Config.Properties[i]) - end - end - - return properties + for i=1, #Config.Properties, 1 do + if Config.Properties[i].gateway == property.name then + table.insert(properties, Config.Properties[i]) + end + end + return properties end function EnterProperty(name, owner) + local property = GetProperty(name) + local playerPed = PlayerPedId() + CurrentProperty = property + CurrentPropertyOwner = owner - local property = GetProperty(name) - local playerPed = GetPlayerPed(-1) - CurrentProperty = property - CurrentPropertyOwner = owner + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name ~= name then + Config.Properties[i].disabled = true + end + end - for i=1, #Config.Properties, 1 do - if Config.Properties[i].name ~= name then - Config.Properties[i].disabled = true - end - end + TriggerServerEvent('esx_property:saveLastProperty', name) - TriggerServerEvent('esx_property:saveLastProperty', name) + Citizen.CreateThread(function() + DoScreenFadeOut(800) - Citizen.CreateThread(function() + while not IsScreenFadedOut() do + Citizen.Wait(0) + end - DoScreenFadeOut(800) + for i=1, #property.ipls, 1 do + RequestIpl(property.ipls[i]) - while not IsScreenFadedOut() do - Citizen.Wait(0) - end + while not IsIplActive(property.ipls[i]) do + Citizen.Wait(0) + end + end - for i=1, #property.ipls, 1 do - - RequestIpl(property.ipls[i]) - - while not IsIplActive(property.ipls[i]) do - Citizen.Wait(0) - end - - end - - SetEntityCoords(playerPed, property.inside.x, property.inside.y, property.inside.z) - - DoScreenFadeIn(800) - - DrawSub(property.label, 5000) - end) + SetEntityCoords(playerPed, property.inside.x, property.inside.y, property.inside.z) + DoScreenFadeIn(800) + DrawSub(property.label, 5000) + end) end function ExitProperty(name) + local property = GetProperty(name) + local playerPed = PlayerPedId() + local outside = nil + CurrentProperty = nil - local property = GetProperty(name) - local playerPed = GetPlayerPed(-1) - local outside = nil - CurrentProperty = nil + if property.isSingle then + outside = property.outside + else + outside = GetGateway(property).outside + end - if property.isSingle then - outside = property.outside - else - outside = GetGateway(property).outside - end + TriggerServerEvent('esx_property:deleteLastProperty') - TriggerServerEvent('esx_property:deleteLastProperty') + Citizen.CreateThread(function() + DoScreenFadeOut(800) - Citizen.CreateThread(function() + while not IsScreenFadedOut() do + Citizen.Wait(0) + end - DoScreenFadeOut(800) + SetEntityCoords(playerPed, outside.x, outside.y, outside.z) - while not IsScreenFadedOut() do - Citizen.Wait(0) - end + for i=1, #property.ipls, 1 do + RemoveIpl(property.ipls[i]) + end - SetEntityCoords(playerPed, outside.x, outside.y, outside.z) - - for i=1, #property.ipls, 1 do - RemoveIpl(property.ipls[i]) - end - - for i=1, #Config.Properties, 1 do - Config.Properties[i].disabled = false - end - - DoScreenFadeIn(800) - - end) + for i=1, #Config.Properties, 1 do + Config.Properties[i].disabled = false + end + DoScreenFadeIn(800) + end) end function SetPropertyOwned(name, owned) + local property = GetProperty(name) + local entering = nil + local enteringName = nil - local property = GetProperty(name) - local entering = nil - local enteringName = nil + if property.isSingle then + entering = property.entering + enteringName = property.name + else + local gateway = GetGateway(property) + entering = gateway.entering + enteringName = gateway.name + end - if property.isSingle then - entering = property.entering - enteringName = property.name - else - local gateway = GetGateway(property) - entering = gateway.entering - enteringName = gateway.name - end + if owned then - if owned then + OwnedProperties[name] = true + RemoveBlip(Blips[enteringName]) - OwnedProperties[name] = true + Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) + SetBlipSprite(Blips[enteringName], 357) + SetBlipAsShortRange(Blips[enteringName], true) - RemoveBlip(Blips[enteringName]) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(_U('property')) + EndTextCommandSetBlipName(Blips[enteringName]) - Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) + else - SetBlipSprite(Blips[enteringName], 357) - SetBlipAsShortRange(Blips[enteringName], true) + OwnedProperties[name] = nil + local found = false - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('property')) - EndTextCommandSetBlipName(Blips[enteringName]) + for k,v in pairs(OwnedProperties) do + local _property = GetProperty(k) + local _gateway = GetGateway(_property) - else + if _gateway ~= nil then + if _gateway.name == enteringName then + found = true + break + end + end + end - OwnedProperties[name] = nil + if not found then + RemoveBlip(Blips[enteringName]) - local found = false + Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) + SetBlipSprite(Blips[enteringName], 369) + SetBlipAsShortRange(Blips[enteringName], true) - for k,v in pairs(OwnedProperties) do + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(_U('free_prop')) + EndTextCommandSetBlipName(Blips[enteringName]) + end - local _property = GetProperty(k) - local _gateway = GetGateway(_property) - - if _gateway ~= nil then - - if _gateway.name == enteringName then - found = true - break - end - end - - end - - if not found then - - RemoveBlip(Blips[enteringName]) - - Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) - - SetBlipSprite(Blips[enteringName], 369) - SetBlipAsShortRange(Blips[enteringName], true) - - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('free_prop')) - EndTextCommandSetBlipName(Blips[enteringName]) - - end - - end + end end function PropertyIsOwned(property) - return OwnedProperties[property.name] == true + return OwnedProperties[property.name] == true end function OpenPropertyMenu(property) + local elements = {} - local elements = {} + if PropertyIsOwned(property) then + table.insert(elements, {label = _U('enter'), value = 'enter'}) - if PropertyIsOwned(property) then + if not Config.EnablePlayerManagement then + table.insert(elements, {label = _U('leave'), value = 'leave'}) + end + else + if not Config.EnablePlayerManagement then + table.insert(elements, {label = _U('buy'), value = 'buy'}) + table.insert(elements, {label = _U('rent'), value = 'rent'}) + end - table.insert(elements, {label = _U('enter'), value = 'enter'}) + table.insert(elements, {label = _U('visit'), value = 'visit'}) + end - if not Config.EnablePlayerManagement then - table.insert(elements, {label = _U('leave'), value = 'leave'}) - end + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'property', + { + title = property.label, + align = 'top-left', + elements = elements, + }, function(data, menu) + menu.close() - else - - if not Config.EnablePlayerManagement then - table.insert(elements, {label = _U('buy'), value = 'buy'}) - table.insert(elements, {label = _U('rent'), value = 'rent'}) - end - - table.insert(elements, {label = _U('visit'), value = 'visit'}) - - end - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'property', - { - title = property.label, - align = 'top-left', - elements = elements, - }, - function(data2, menu) - - menu.close() - - if data2.current.value == 'enter' then - TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) - end - - if data2.current.value == 'leave' then - TriggerServerEvent('esx_property:removeOwnedProperty', property.name) - end - - if data2.current.value == 'buy' then - TriggerServerEvent('esx_property:buyProperty', property.name) - end - - if data2.current.value == 'rent' then - TriggerServerEvent('esx_property:rentProperty', property.name) - end - - if data2.current.value == 'visit' then - TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) - end - - end, - function(data, menu) - - menu.close() - - CurrentAction = 'property_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property} - end - ) + if data.current.value == 'enter' then + TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) + elseif data.current.value == 'leave' then + TriggerServerEvent('esx_property:removeOwnedProperty', property.name) + elseif data.current.value == 'buy' then + TriggerServerEvent('esx_property:buyProperty', property.name) + elseif data.current.value == 'rent' then + TriggerServerEvent('esx_property:rentProperty', property.name) + elseif data.current.value == 'visit' then + TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) + end + end, function(data, menu) + menu.close() + CurrentAction = 'property_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} + end) end function OpenGatewayMenu(property) + if Config.EnablePlayerManagement then + OpenGatewayOwnedPropertiesMenu(gatewayProperties) + else - if Config.EnablePlayerManagement then - OpenGatewayOwnedPropertiesMenu(gatewayProperties) - else + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway', + { + title = property.name, + align = 'top-left', + elements = { + {label = _U('owned_properties'), value = 'owned_properties'}, + {label = _U('available_properties'), value = 'available_properties'} + } + }, function(data, menu) + if data.current.value == 'owned_properties' then + OpenGatewayOwnedPropertiesMenu(property) + elseif data.current.value == 'available_properties' then + OpenGatewayAvailablePropertiesMenu(property) + end + end, function(data, menu) + menu.close() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'gateway', - { - title = property.name, - align = 'top-left', - elements = { - {label = _U('owned_properties'), value = 'owned_properties'}, - {label = _U('available_properties'), value = 'available_properties'}, - } - }, - function(data, menu) - - if data.current.value == 'owned_properties' then - OpenGatewayOwnedPropertiesMenu(property) - end - - if data.current.value == 'available_properties' then - OpenGatewayAvailablePropertiesMenu(property) - end - - end, - function(data, menu) - - menu.close() - - CurrentAction = 'gateway_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property} - - end - ) - - end + CurrentAction = 'gateway_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} + end) + end end function OpenGatewayOwnedPropertiesMenu(property) + local gatewayProperties = GetGatewayProperties(property) + local elements = {} - local gatewayProperties = GetGatewayProperties(property) - local elements = {} + for i=1, #gatewayProperties, 1 do + if PropertyIsOwned(gatewayProperties[i]) then + table.insert(elements, { + label = gatewayProperties[i].label, + value = gatewayProperties[i].name + }) + end + end - for i=1, #gatewayProperties, 1 do + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_owned_properties', + { + title = property.name .. ' - ' .. _U('owned_properties'), + align = 'top-left', + elements = elements + }, function(data, menu) + menu.close() - if PropertyIsOwned(gatewayProperties[i]) then - table.insert(elements, { - label = gatewayProperties[i].label, - value = gatewayProperties[i].name - }) - end + local elements = { + {label = _U('enter'), value = 'enter'} + } - end + if not Config.EnablePlayerManagement then + table.insert(elements, {label = _U('leave'), value = 'leave'}) + end - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'gateway_owned_properties', - { - title = property.name .. ' - ' .. _U('owned_properties'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_owned_properties_actions', + { + title = data.current.label, + align = 'top-left', + elements = elements + }, function(data2, menu2) + menu2.close() - menu.close() - - local elements = { - {label = _U('enter'), value = 'enter'} - } - - if not Config.EnablePlayerManagement then - table.insert(elements, {label = _U('leave'), value = 'leave'}) - end - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'gateway_owned_properties_actions', - { - title = data.current.label, - align = 'top-left', - elements = elements, - }, - function(data2, menu) - - menu.close() - - if data2.current.value == 'enter' then - TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) - end - - if data2.current.value == 'leave' then - TriggerServerEvent('esx_property:removeOwnedProperty', data.current.value) - end - - end, - function(data, menu) - menu.close() - end - ) - - end, - function(data, menu) - menu.close() - end - ) + if data2.current.value == 'enter' then + TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) + elseif data2.current.value == 'leave' then + TriggerServerEvent('esx_property:removeOwnedProperty', data.current.value) + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) end function OpenGatewayAvailablePropertiesMenu(property) + local gatewayProperties = GetGatewayProperties(property) + local elements = {} - local gatewayProperties = GetGatewayProperties(property) - local elements = {} + for i=1, #gatewayProperties, 1 do + if not PropertyIsOwned(gatewayProperties[i]) then + table.insert(elements, { + label = gatewayProperties[i].label .. ' $' .. gatewayProperties[i].price, + value = gatewayProperties[i].name, + price = gatewayProperties[i].price + }) + end + end - for i=1, #gatewayProperties, 1 do + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_available_properties', + { + title = property.name.. ' - ' .. _U('available_properties'), + align = 'top-left', + elements = elements + }, function(data, menu) - if not PropertyIsOwned(gatewayProperties[i]) then - table.insert(elements, { - label = gatewayProperties[i].label .. ' $' .. gatewayProperties[i].price, - value = gatewayProperties[i].name, - price = gatewayProperties[i].price - }) - end + menu.close() - end + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_available_properties_actions', + { + title = property.name, + align = 'top-left', + elements = { + {label = _U('buy'), value = 'buy'}, + {label = _U('rent'), value = 'rent'}, + {label = _U('visit'), value = 'visit'} + } + }, function(data2, menu2) + menu2.close() - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'gateway_available_properties', - { - title = property.name.. ' - ' .. _U('available_properties'), - align = 'top-left', - elements = elements, - }, - function(data, menu) - - menu.close() - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'gateway_available_properties_actions', - { - title = property.name, - align = 'top-left', - elements = { - {label = _U('buy'), value = 'buy'}, - {label = _U('rent'), value = 'rent'}, - {label = _U('visit'), value = 'visit'}, - }, - }, - function(data2, menu) - menu.close() - - if data2.current.value == 'buy' then - TriggerServerEvent('esx_property:buyProperty', data.current.value) - end - - if data2.current.value == 'rent' then - TriggerServerEvent('esx_property:rentProperty', data.current.value) - end - - if data2.current.value == 'visit' then - TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) - end - - end, - function(data, menu) - menu.close() - end - ) - - end, - function(data, menu) - menu.close() - end - ) + if data2.current.value == 'buy' then + TriggerServerEvent('esx_property:buyProperty', data.current.value) + elseif data2.current.value == 'rent' then + TriggerServerEvent('esx_property:rentProperty', data.current.value) + elseif data2.current.value == 'visit' then + TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) + end + end, function(data2, menu2) + menu2.close() + end) + end, function(data, menu) + menu.close() + end) end function OpenRoomMenu(property, owner) + local entering = nil + local elements = {} - local entering = nil - local elements = {} + if property.isSingle then + entering = property.entering + else + entering = GetGateway(property).entering + end - if property.isSingle then - entering = property.entering - else - entering = GetGateway(property).entering - end + table.insert(elements, {label = _U('invite_player'), value = 'invite_player'}) - table.insert(elements, {label = _U('invite_player'), value = 'invite_player'}) + if CurrentPropertyOwner == owner then + table.insert(elements, {label = _U('player_clothes'), value = 'player_dressing'}) + table.insert(elements, {label = _U('remove_cloth'), value = 'remove_cloth'}) + end - if CurrentPropertyOwner == owner then - table.insert(elements, {label = _U('player_clothes'), value = 'player_dressing'}) - table.insert(elements, {label = _U('remove_cloth'), value = 'remove_cloth'}) - end + table.insert(elements, {label = _U('remove_object'), value = 'room_inventory'}) + table.insert(elements, {label = _U('deposit_object'), value = 'player_inventory'}) - table.insert(elements, {label = _U('remove_object'), value = 'room_inventory'}) - table.insert(elements, {label = _U('deposit_object'), value = 'player_inventory'}) + ESX.UI.Menu.CloseAll() - ESX.UI.Menu.CloseAll() + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room', + { + title = property.label, + align = 'top-left', + elements = elements + }, function(data, menu) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'room', - { - title = property.label, - align = 'top-left', - elements = elements, - }, - function(data, menu) + if data.current.value == 'invite_player' then - if data.current.value == 'invite_player' then + local playersInArea = ESX.Game.GetPlayersInArea(entering, 10.0) + local elements = {} - local playersInArea = ESX.Game.GetPlayersInArea(entering, 10.0) - local elements = {} + for i=1, #playersInArea, 1 do + if playersInArea[i] ~= PlayerId() then + table.insert(elements, {label = GetPlayerName(playersInArea[i]), value = playersInArea[i]}) + end + end - for i=1, #playersInArea, 1 do - if playersInArea[i] ~= PlayerId() then - table.insert(elements, {label = GetPlayerName(playersInArea[i]), value = playersInArea[i]}) - end - end + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room_invite', + { + title = property.label .. ' - ' .. _U('invite'), + align = 'top-left', + elements = elements, + }, function(data2, menu2) + TriggerEvent('instance:invite', 'property', GetPlayerServerId(data2.current.value), {property = property.name, owner = owner}) + ESX.ShowNotification(_U('you_invited', GetPlayerName(data2.current.value))) + end, function(data2, menu2) + menu2.close() + end) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'room_invite', - { - title = property.label .. ' - ' .. _U('invite'), - align = 'top-left', - elements = elements, - }, - function(data, menu) - TriggerEvent('instance:invite', 'property', GetPlayerServerId(data.current.value), {property = property.name, owner = owner}) - ESX.ShowNotification(_U('you_invited', GetPlayerName(data.current.value))) - end, - function(data, menu) - menu.close() - end - ) + elseif data.current.value == 'player_dressing' then - end + ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) + local elements = {} - if data.current.value == 'player_dressing' then + for i=1, #dressing, 1 do + table.insert(elements, {label = dressing[i], value = i}) + end - ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'player_dressing', + { + title = property.label .. ' - ' .. _U('player_clothes'), + align = 'top-left', + elements = elements + }, function(data2, menu2) - local elements = {} + TriggerEvent('skinchanger:getSkin', function(skin) + ESX.TriggerServerCallback('esx_property:getPlayerOutfit', function(clothes) + TriggerEvent('skinchanger:loadClothes', skin, clothes) + TriggerEvent('esx_skin:setLastSkin', skin) - for i=1, #dressing, 1 do - table.insert(elements, {label = dressing[i], value = i}) - end + TriggerEvent('skinchanger:getSkin', function(skin) + TriggerServerEvent('esx_skin:save', skin) + end) + end, data2.current.value) + end) - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'player_dressing', - { - title = property.label .. ' - ' .. _U('player_clothes'), - align = 'top-left', - elements = elements, - }, - function(data, menu) + end, function(data2, menu2) + menu2.close() + end) + end) - TriggerEvent('skinchanger:getSkin', function(skin) + elseif data.current.value == 'remove_cloth' then - ESX.TriggerServerCallback('esx_property:getPlayerOutfit', function(clothes) + ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) + local elements = {} + + for i=1, #dressing, 1 do + table.insert(elements, {label = dressing[i].label, value = i}) + end + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'remove_cloth', + { + title = property.label .. ' - ' .. _U('remove_cloth'), + align = 'top-left', + elements = elements + }, function(data2, menu2) + menu2.close() + TriggerServerEvent('esx_property:removeOutfit', data2.current.value) + ESX.ShowNotification(_U('removed_cloth')) + end, + function(data2, menu2) + menu2.close() + end) + end) - TriggerEvent('skinchanger:loadClothes', skin, clothes) - TriggerEvent('esx_skin:setLastSkin', skin) + elseif data.current.value == 'room_inventory' then + OpenRoomInventoryMenu(property, owner) + elseif data.current.value == 'player_inventory' then + OpenPlayerInventoryMenu(property, owner) + end - TriggerEvent('skinchanger:getSkin', function(skin) - TriggerServerEvent('esx_skin:save', skin) - end) - - end, data.current.value) - - end) - - end, - function(data, menu) - menu.close() - end - ) - - end) - - end - - if data.current.value == 'remove_cloth' then - ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) - local elements = {} - - for i=1, #dressing, 1 do - table.insert(elements, {label = dressing[i].label, value = i}) - end - - ESX.UI.Menu.Open( - 'default', GetCurrentResourceName(), 'remove_cloth', - { - title = property.label .. ' - ' .. _U('remove_cloth'), - align = 'top-left', - elements = elements, - }, - function(data, menu) - menu.close() - TriggerServerEvent('esx_property:removeOutfit', data.current.value) - ESX.ShowNotification(_U('removed_cloth')) - end, - function(data, menu) - menu.close() - end - ) - end) - end - - if data.current.value == 'room_inventory' then - OpenRoomInventoryMenu(property, owner) - end - - if data.current.value == 'player_inventory' then - OpenPlayerInventoryMenu(property, owner) - end - - end, - function(data, menu) - - menu.close() - - CurrentAction = 'room_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property, owner = owner} - end - ) + end, function(data, menu) + menu.close() + CurrentAction = 'room_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property, owner = owner} + end) end function OpenRoomInventoryMenu(property, owner) @@ -711,7 +581,7 @@ function OpenRoomInventoryMenu(property, owner) { title = property.label .. ' - ' .. _U('inventory'), align = 'top-left', - elements = elements, + elements = elements }, function(data, menu) if data.current.type == 'item_weapon' then @@ -719,7 +589,6 @@ function OpenRoomInventoryMenu(property, owner) menu.close() TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, data.current.ammo) - ESX.SetTimeout(300, function() OpenRoomInventoryMenu(property, owner) end) @@ -732,19 +601,15 @@ function OpenRoomInventoryMenu(property, owner) }, function(data2, menu) local quantity = tonumber(data2.value) - if quantity == nil then ESX.ShowNotification(_U('amount_invalid')) else - menu.close() TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, quantity) - ESX.SetTimeout(300, function() OpenRoomInventoryMenu(property, owner) end) - end end, function(data2,menu) @@ -778,7 +643,7 @@ function OpenPlayerInventoryMenu(property, owner) end end - local playerPed = GetPlayerPed(-1) + local playerPed = PlayerPedId() local weaponList = ESX.GetWeaponList() for i=1, #weaponList, 1 do @@ -793,7 +658,7 @@ function OpenPlayerInventoryMenu(property, owner) { title = property.label .. ' - ' .. _U('inventory'), align = 'top-left', - elements = elements, + elements = elements }, function(data, menu) if data.current.type == 'item_weapon' then @@ -841,16 +706,11 @@ function OpenPlayerInventoryMenu(property, owner) end AddEventHandler('instance:loaded', function() - - TriggerEvent('instance:registerType', 'property', - function(instance) - EnterProperty(instance.data.property, instance.data.owner) - end, - function(instance) - ExitProperty(instance.data.property) - end - ) - + TriggerEvent('instance:registerType', 'property', function(instance) + EnterProperty(instance.data.property, instance.data.owner) + end, function(instance) + ExitProperty(instance.data.property) + end) end) AddEventHandler('playerSpawned', function() @@ -876,191 +736,171 @@ AddEventHandler('playerSpawned', function() end) AddEventHandler('esx_property:getProperties', function(cb) - cb(GetProperties()) + cb(GetProperties()) end) AddEventHandler('esx_property:getProperty', function(name, cb) - cb(GetProperty(name)) + cb(GetProperty(name)) end) AddEventHandler('esx_property:getGateway', function(property, cb) - cb(GetGateway(property)) + cb(GetGateway(property)) end) RegisterNetEvent('esx_property:setPropertyOwned') AddEventHandler('esx_property:setPropertyOwned', function(name, owned) - SetPropertyOwned(name, owned) + SetPropertyOwned(name, owned) end) RegisterNetEvent('instance:onCreate') AddEventHandler('instance:onCreate', function(instance) - - if instance.type == 'property' then - TriggerEvent('instance:enter', instance) - end - + if instance.type == 'property' then + TriggerEvent('instance:enter', instance) + end end) RegisterNetEvent('instance:onEnter') AddEventHandler('instance:onEnter', function(instance) - if instance.type == 'property' then + if instance.type == 'property' then + local property = GetProperty(instance.data.property) + local isHost = GetPlayerFromServerId(instance.host) == PlayerId() + local isOwned = false - local property = GetProperty(instance.data.property) - local isHost = GetPlayerFromServerId(instance.host) == PlayerId() - local isOwned = false - - if PropertyIsOwned(property) == true then - isOwned = true - end - - if(isOwned or not isHost) then - HasChest = true - else - HasChest = false - end - - end + if PropertyIsOwned(property) == true then + isOwned = true + end + if isOwned or not isHost then + HasChest = true + else + HasChest = false + end + end end) RegisterNetEvent('instance:onPlayerLeft') AddEventHandler('instance:onPlayerLeft', function(instance, player) - if player == instance.host then - TriggerEvent('instance:leave') - end + if player == instance.host then + TriggerEvent('instance:leave') + end end) AddEventHandler('esx_property:hasEnteredMarker', function(name, part) + local property = GetProperty(name) - local property = GetProperty(name) - - if part == 'entering' then - - if property.isSingle then - CurrentAction = 'property_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property} - else - CurrentAction = 'gateway_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property} - end - - end - - if part == 'exit' then - CurrentAction = 'room_exit' - CurrentActionMsg = _U('press_to_exit') - CurrentActionData = {propertyName = name} - end - - if part == 'roomMenu' then - CurrentAction = 'room_menu' - CurrentActionMsg = _U('press_to_menu') - CurrentActionData = {property = property, owner = CurrentPropertyOwner} - end - + if part == 'entering' then + if property.isSingle then + CurrentAction = 'property_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} + else + CurrentAction = 'gateway_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property} + end + elseif part == 'exit' then + CurrentAction = 'room_exit' + CurrentActionMsg = _U('press_to_exit') + CurrentActionData = {propertyName = name} + elseif part == 'roomMenu' then + CurrentAction = 'room_menu' + CurrentActionMsg = _U('press_to_menu') + CurrentActionData = {property = property, owner = CurrentPropertyOwner} + end end) AddEventHandler('esx_property:hasExitedMarker', function(name, part) - ESX.UI.Menu.CloseAll() - CurrentAction = nil + ESX.UI.Menu.CloseAll() + CurrentAction = nil end) -- Display markers Citizen.CreateThread(function() - while true do + while true do - Citizen.Wait(1) + Citizen.Wait(1) - local coords = GetEntityCoords(GetPlayerPed(-1)) + local coords = GetEntityCoords(PlayerPedId()) - for i=1, #Config.Properties, 1 do + for i=1, #Config.Properties, 1 do + local property = Config.Properties[i] + local isHost = false - local property = Config.Properties[i] - local isHost = false + if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.DrawDistance) then + DrawMarker(Config.MarkerType, property.entering.x, property.entering.y, property.entering.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 - if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.DrawDistance) then - DrawMarker(Config.MarkerType, property.entering.x, property.entering.y, property.entering.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 + if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.DrawDistance) then + DrawMarker(Config.MarkerType, property.exit.x, property.exit.y, property.exit.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 - if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.DrawDistance) then - DrawMarker(Config.MarkerType, property.exit.x, property.exit.y, property.exit.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 + if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.DrawDistance) then + DrawMarker(Config.MarkerType, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.RoomMenuMarkerColor.r, Config.RoomMenuMarkerColor.g, Config.RoomMenuMarkerColor.b, 100, false, true, 2, false, false, false, false) + end + end - if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.DrawDistance) then - DrawMarker(Config.MarkerType, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.RoomMenuMarkerColor.r, Config.RoomMenuMarkerColor.g, Config.RoomMenuMarkerColor.b, 100, false, true, 2, false, false, false, false) - end - - end - - end + end end) -- Enter / Exit marker events Citizen.CreateThread(function() - while true do + while true do - Citizen.Wait(1) + Citizen.Wait(1) - local coords = GetEntityCoords(GetPlayerPed(-1)) - local isInMarker = false - local currentProperty = nil - local currentPart = nil + local coords = GetEntityCoords(PlayerPedId()) + local isInMarker = false + local currentProperty = nil + local currentPart = nil - for i=1, #Config.Properties, 1 do + for i=1, #Config.Properties, 1 do + local property = Config.Properties[i] - local property = Config.Properties[i] + if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'entering' + end - if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'entering' - end + if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'exit' + end - if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'exit' - end + if(property.inside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.inside.x, property.inside.y, property.inside.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'inside' + end - if(property.inside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.inside.x, property.inside.y, property.inside.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'inside' - end + if(property.outside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.outside.x, property.outside.y, property.outside.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'outside' + end - if(property.outside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.outside.x, property.outside.y, property.outside.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'outside' - end + if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.MarkerSize.x) then + isInMarker = true + currentProperty = property.name + currentPart = 'roomMenu' + end + end - if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'roomMenu' - end + if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastProperty ~= currentProperty or LastPart ~= currentPart) ) then + HasAlreadyEnteredMarker = true + LastProperty = currentProperty + LastPart = currentPart - end + TriggerEvent('esx_property:hasEnteredMarker', currentProperty, currentPart) + end - if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastProperty ~= currentProperty or LastPart ~= currentPart) ) then + if not isInMarker and HasAlreadyEnteredMarker then + HasAlreadyEnteredMarker = false + TriggerEvent('esx_property:hasExitedMarker', LastProperty, LastPart) + end - HasAlreadyEnteredMarker = true - LastProperty = currentProperty - LastPart = currentPart - - TriggerEvent('esx_property:hasEnteredMarker', currentProperty, currentPart) - end - - if not isInMarker and HasAlreadyEnteredMarker then - - HasAlreadyEnteredMarker = false - - TriggerEvent('esx_property:hasExitedMarker', LastProperty, LastPart) - end - - end + end end) -- Key controls @@ -1071,9 +911,7 @@ Citizen.CreateThread(function() if CurrentAction ~= nil then - SetTextComponentFormat('STRING') - AddTextComponentString(CurrentActionMsg) - DisplayHelpTextFromStringLabel(0, 0, 1, -1) + ESX.ShowHelpNotification(CurrentActionMsg) if IsControlJustReleased(0, Keys['E']) then diff --git a/config.lua b/config.lua index fe9d76c1..2666d3c2 100644 --- a/config.lua +++ b/config.lua @@ -8,3 +8,5 @@ Config.Zones = {} Config.Properties = {} Config.EnablePlayerManagement = false -- If set to true you need esx_realestateagentjob Config.Locale = 'fr' + +Config.Properties = {} diff --git a/server/main.lua b/server/main.lua index d88dca41..a937936e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -4,78 +4,48 @@ local hasSqlRun = false TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) function GetProperty(name) - - for i=1, #Config.Properties, 1 do - if Config.Properties[i].name == name then - return Config.Properties[i] - end - end - + for i=1, #Config.Properties, 1 do + if Config.Properties[i].name == name then + return Config.Properties[i] + end + end end function SetPropertyOwned(name, price, rented, owner) + MySQL.Async.execute('INSERT INTO owned_properties (name, price, rented, owner) VALUES (@name, @price, @rented, @owner)', + { + ['@name'] = name, + ['@price'] = price, + ['@rented'] = (rented and 1 or 0), + ['@owner'] = owner + }, function(rowsChanged) + local xPlayer = ESX.GetPlayerFromIdentifier(owner) - MySQL.Async.execute( - 'INSERT INTO owned_properties (name, price, rented, owner) VALUES (@name, @price, @rented, @owner)', - { - ['@name'] = name, - ['@price'] = price, - ['@rented'] = (rented and 1 or 0), - ['@owner'] = owner - }, - function(rowsChanged) - - local xPlayers = ESX.GetPlayers() - - for i=1, #xPlayers, 1 do - - local xPlayer = ESX.GetPlayerFromId(xPlayers[i]) - - if xPlayer.identifier == owner then - - TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true) - - if rented then - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for', price)) - else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for', price)) - end - - break - end - end - - end - ) + if xPlayer then + TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true) + if rented then + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for', price)) + else + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for', price)) + end + end + end) end function RemoveOwnedProperty(name, owner) + MySQL.Async.execute('DELETE FROM owned_properties WHERE name = @name AND owner = @owner', + { + ['@name'] = name, + ['@owner'] = owner + }, function(rowsChanged) + local xPlayer = ESX.GetPlayerFromIdentifier(owner) - MySQL.Async.execute( - 'DELETE FROM owned_properties WHERE name = @name AND owner = @owner', - { - ['@name'] = name, - ['@owner'] = owner - }, - function(rowsChanged) - - local xPlayers = ESX.GetPlayers() - - for i=1, #xPlayers, 1 do - - local xPlayer = ESX.GetPlayerFromId(xPlayers[i]) - - if xPlayer.identifier == owner then - TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, false) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('made_property')) - break - end - end - - end - ) - + if xPlayer then + TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, false) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('made_property')) + end + end) end AddEventHandler('onMySQLReady', function() @@ -170,115 +140,90 @@ ESX.RegisterServerCallback('esx_property:getProperties', function(source, cb) end) AddEventHandler('esx_ownedproperty:getOwnedProperties', function(cb) + MySQL.Async.fetchAll('SELECT * FROM owned_properties', {}, function(result) + local properties = {} - MySQL.Async.fetchAll( - 'SELECT * FROM owned_properties', - {}, - function(result) - - local properties = {} - - for i=1, #result, 1 do - - table.insert(properties, { - id = result[i].id, - name = result[i].name, - price = result[i].price, - rented = (result[i].rented == 1 and true or false), - owner = result[i].owner, - }) - end - - cb(properties) - - end - ) + for i=1, #result, 1 do + table.insert(properties, { + id = result[i].id, + name = result[i].name, + price = result[i].price, + rented = (result[i].rented == 1 and true or false), + owner = result[i].owner + }) + end + cb(properties) + end) end) AddEventHandler('esx_property:setPropertyOwned', function(name, price, rented, owner) - SetPropertyOwned(name, price, rented, owner) + SetPropertyOwned(name, price, rented, owner) end) AddEventHandler('esx_property:removeOwnedProperty', function(name, owner) - RemoveOwnedProperty(name, owner) + RemoveOwnedProperty(name, owner) end) RegisterServerEvent('esx_property:rentProperty') AddEventHandler('esx_property:rentProperty', function(propertyName) + local xPlayer = ESX.GetPlayerFromId(source) + local property = GetProperty(propertyName) - local xPlayer = ESX.GetPlayerFromId(source) - local property = GetProperty(propertyName) - - SetPropertyOwned(propertyName, property.price / 200, true, xPlayer.identifier) - + SetPropertyOwned(propertyName, property.price / 200, true, xPlayer.identifier) end) RegisterServerEvent('esx_property:buyProperty') AddEventHandler('esx_property:buyProperty', function(propertyName) + local xPlayer = ESX.GetPlayerFromId(source) + local property = GetProperty(propertyName) - local xPlayer = ESX.GetPlayerFromId(source) - local property = GetProperty(propertyName) - - if property.price <= xPlayer.get('money') then - - xPlayer.removeMoney(property.price) - SetPropertyOwned(propertyName, property.price, false, xPlayer.identifier) - - else - TriggerClientEvent('esx:showNotification', source, _U('not_enough')) - end - + if property.price <= xPlayer.getMoney() then + xPlayer.removeMoney(property.price) + SetPropertyOwned(propertyName, property.price, false, xPlayer.identifier) + else + TriggerClientEvent('esx:showNotification', source, _U('not_enough')) + end end) RegisterServerEvent('esx_property:removeOwnedProperty') AddEventHandler('esx_property:removeOwnedProperty', function(propertyName) - - local xPlayer = ESX.GetPlayerFromId(source) - - RemoveOwnedProperty(propertyName, xPlayer.identifier) - + local xPlayer = ESX.GetPlayerFromId(source) + RemoveOwnedProperty(propertyName, xPlayer.identifier) end) AddEventHandler('esx_property:removeOwnedPropertyIdentifier', function(propertyName, identifier) - RemoveOwnedProperty(propertyName, identifier) + RemoveOwnedProperty(propertyName, identifier) end) RegisterServerEvent('esx_property:saveLastProperty') AddEventHandler('esx_property:saveLastProperty', function(property) + local xPlayer = ESX.GetPlayerFromId(source) - local xPlayer = ESX.GetPlayerFromId(source) - - MySQL.Async.execute( - 'UPDATE users SET last_property = @last_property WHERE identifier = @identifier', - { - ['@last_property'] = property, - ['@identifier'] = xPlayer.identifier - } - ) - + MySQL.Async.execute('UPDATE users SET last_property = @last_property WHERE identifier = @identifier', + { + ['@last_property'] = property, + ['@identifier'] = xPlayer.identifier + }) end) RegisterServerEvent('esx_property:deleteLastProperty') AddEventHandler('esx_property:deleteLastProperty', function() - local xPlayer = ESX.GetPlayerFromId(source) + local xPlayer = ESX.GetPlayerFromId(source) - MySQL.Async.execute( - 'UPDATE users SET last_property = NULL WHERE identifier = @identifier', - { - ['@identifier'] = xPlayer.identifier - } - ) + MySQL.Async.execute('UPDATE users SET last_property = NULL WHERE identifier = @identifier', { + ['@identifier'] = xPlayer.identifier + }) end) RegisterServerEvent('esx_property:getItem') AddEventHandler('esx_property:getItem', function(owner, type, item, count) - local _source = source local xPlayer = ESX.GetPlayerFromId(_source) local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) if type == 'item_standard' then + local sourceItem = xPlayer.getInventoryItem(item) TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) @@ -299,271 +244,198 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, count) TriggerClientEvent('esx:showNotification', _source, _U('not_enough_in_property')) end end) + + elseif type == 'item_account' then + + TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) + local roomAccountMoney = account.money + + if roomAccountMoney >= count then + account.removeMoney(count) + xPlayer.addAccountMoney(item, count) + else + TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) + end + end) + + elseif type == 'item_weapon' then + + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) + local storeWeapons = store.get('weapons') or {} + local weaponName = nil + local ammo = nil + + for i=1, #storeWeapons, 1 do + if storeWeapons[i].name == item then + weaponName = storeWeapons[i].name + ammo = storeWeapons[i].ammo + + table.remove(storeWeapons, i) + break + end + end + + store.set('weapons', storeWeapons) + xPlayer.addWeapon(weaponName, ammo) + end) + end - if type == 'item_account' then - - TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) - - local roomAccountMoney = account.money - - if roomAccountMoney >= count then - account.removeMoney(count) - xPlayer.addAccountMoney(item, count) - else - TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) - end - - end) - - end - - if type == 'item_weapon' then - - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) - - local storeWeapons = store.get('weapons') - - if storeWeapons == nil then - storeWeapons = {} - end - - local weaponName = nil - local ammo = nil - - for i=1, #storeWeapons, 1 do - if storeWeapons[i].name == item then - - weaponName = storeWeapons[i].name - ammo = storeWeapons[i].ammo - - table.remove(storeWeapons, i) - - break - end - end - - store.set('weapons', storeWeapons) - - xPlayer.addWeapon(weaponName, ammo) - - end) - - end - end) RegisterServerEvent('esx_property:putItem') AddEventHandler('esx_property:putItem', function(owner, type, item, count) + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) + if type == 'item_standard' then - if type == 'item_standard' then + local playerItemCount = xPlayer.getInventoryItem(item).count - local playerItemCount = xPlayer.getInventoryItem(item).count + if playerItemCount >= count and count > 0 then + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) + xPlayer.removeInventoryItem(item, count) + inventory.addItem(item, count) + TriggerClientEvent('esx:showNotification', _source, _U('have_deposited', count, inventory.getItem(item).label)) + end) + else + TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + end - if playerItemCount >= count and count > 0 then - - TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) - xPlayer.removeInventoryItem(item, count) - inventory.addItem(item, count) - TriggerClientEvent('esx:showNotification', _source, _U('have_deposited', count, inventory.getItem(item).label)) - end) - - else - TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) - end + elseif type == 'item_account' then - end + local playerAccountMoney = xPlayer.getAccount(item).money - if type == 'item_account' then + if playerAccountMoney >= count and count > 0 then + xPlayer.removeAccountMoney(item, count) - local playerAccountMoney = xPlayer.getAccount(item).money + TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) + account.addMoney(count) + end) + else + TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) + end - if playerAccountMoney >= count and count > 0 then + elseif type == 'item_weapon' then - xPlayer.removeAccountMoney(item, count) + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) + local storeWeapons = store.get('weapons') or {} - TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) - account.addMoney(count) - end) + table.insert(storeWeapons, { + name = item, + ammo = count + }) - else - TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) - end + store.set('weapons', storeWeapons) + xPlayer.removeWeapon(item) + end) - end - - if type == 'item_weapon' then - - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) - - local storeWeapons = store.get('weapons') - - if storeWeapons == nil then - storeWeapons = {} - end - - table.insert(storeWeapons, { - name = item, - ammo = count - }) - - store.set('weapons', storeWeapons) - - xPlayer.removeWeapon(item) - - end) - - end + end end) ESX.RegisterServerCallback('esx_property:getOwnedProperties', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) - local xPlayer = ESX.GetPlayerFromId(source) + MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE owner = @owner', { + ['@owner'] = xPlayer.identifier + }, function(ownedProperties) + local properties = {} - MySQL.Async.fetchAll( - 'SELECT * FROM owned_properties WHERE owner = @owner', - { - ['@owner'] = xPlayer.identifier - }, - function(ownedProperties) - - local properties = {} - - for i=1, #ownedProperties, 1 do - table.insert(properties, ownedProperties[i].name) - end - - cb(properties) - end - ) + for i=1, #ownedProperties, 1 do + table.insert(properties, ownedProperties[i].name) + end + cb(properties) + end) end) ESX.RegisterServerCallback('esx_property:getLastProperty', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) - local xPlayer = ESX.GetPlayerFromId(source) - - MySQL.Async.fetchAll( - 'SELECT * FROM users WHERE identifier = @identifier', - { - ['@identifier'] = xPlayer.identifier - }, - function(users) - cb(users[1].last_property) - end - ) - + MySQL.Async.fetchAll('SELECT * FROM users WHERE identifier = @identifier', { + ['@identifier'] = xPlayer.identifier + }, function(users) + cb(users[1].last_property) + end) end) ESX.RegisterServerCallback('esx_property:getPropertyInventory', function(source, cb, owner) + local xPlayer = ESX.GetPlayerFromIdentifier(owner) + local blackMoney = 0 + local items = {} + local weapons = {} - local xPlayer = ESX.GetPlayerFromIdentifier(owner) - local blackMoney = 0 - local items = {} - local weapons = {} + TriggerEvent('esx_addonaccount:getAccount', 'property_black_money', xPlayer.identifier, function(account) + blackMoney = account.money + end) - TriggerEvent('esx_addonaccount:getAccount', 'property_black_money', xPlayer.identifier, function(account) - blackMoney = account.money - end) + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayer.identifier, function(inventory) + items = inventory.items + end) - TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayer.identifier, function(inventory) - items = inventory.items - end) - - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - - local storeWeapons = store.get('weapons') - - if storeWeapons ~= nil then - weapons = storeWeapons - end - - end) - - cb({ - blackMoney = blackMoney, - items = items, - weapons = weapons - }) + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + local storeWeapons = store.get('weapons') or {} + end) + cb({ + blackMoney = blackMoney, + items = items, + weapons = weapons + }) end) ESX.RegisterServerCallback('esx_property:getPlayerInventory', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) + local blackMoney = xPlayer.getAccount('black_money').money + local items = xPlayer.inventory - local xPlayer = ESX.GetPlayerFromId(source) - local blackMoney = xPlayer.getAccount('black_money').money - local items = xPlayer.inventory - - cb({ - blackMoney = blackMoney, - items = items - }) - + cb({ + blackMoney = blackMoney, + items = items + }) end) ESX.RegisterServerCallback('esx_property:getPlayerDressing', function(source, cb) + local xPlayer = ESX.GetPlayerFromId(source) - local xPlayer = ESX.GetPlayerFromId(source) + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + local count = store.count('dressing') + local labels = {} - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - - local count = store.count('dressing') - local labels = {} - - for i=1, count, 1 do - local entry = store.get('dressing', i) - table.insert(labels, entry.label) - end - - cb(labels) - - end) + for i=1, count, 1 do + local entry = store.get('dressing', i) + table.insert(labels, entry.label) + end + cb(labels) + end) end) ESX.RegisterServerCallback('esx_property:getPlayerOutfit', function(source, cb, num) + local xPlayer = ESX.GetPlayerFromId(source) - local xPlayer = ESX.GetPlayerFromId(source) - - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - local outfit = store.get('dressing', num) - cb(outfit.skin) - end) - + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + local outfit = store.get('dressing', num) + cb(outfit.skin) + end) end) RegisterServerEvent('esx_property:removeOutfit') AddEventHandler('esx_property:removeOutfit', function(label) + local xPlayer = ESX.GetPlayerFromId(source) - local xPlayer = ESX.GetPlayerFromId(source) - - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - - local dressing = store.get('dressing') - - if dressing == nil then - dressing = {} - end - - label = label - - table.remove(dressing, label) - - store.set('dressing', dressing) - - end) + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) + local dressing = store.get('dressing') or {} + table.remove(dressing, label) + store.set('dressing', dressing) + end) end) function PayRent(d, h, m) - MySQL.Async.fetchAll( - 'SELECT * FROM owned_properties WHERE rented = 1', {}, - function (result) + MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE rented = 1', {}, function (result) for i=1, #result, 1 do local xPlayer = ESX.GetPlayerFromIdentifier(result[i].owner) @@ -572,8 +444,7 @@ function PayRent(d, h, m) xPlayer.removeAccountMoney('bank', result[i].price) TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent', result[i].price)) else -- pay rent either way - MySQL.Sync.execute( - 'UPDATE users SET bank = bank - @bank WHERE identifier = @identifier', + MySQL.Sync.execute('UPDATE users SET bank = bank - @bank WHERE identifier = @identifier', { ['@bank'] = result[i].price, ['@identifier'] = result[i].owner From c73f78210f281704f7b479ec55e0035ac6bf5c81 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 24 Sep 2018 17:29:55 +0200 Subject: [PATCH 70/99] mysql-async v3.0.1 support --- client/main.lua | 7 +++---- server/main.lua | 23 ++++------------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/client/main.lua b/client/main.lua index ff448bda..de8bcb65 100644 --- a/client/main.lua +++ b/client/main.lua @@ -147,7 +147,7 @@ function EnterProperty(name, owner) end end - SetEntityCoords(playerPed, property.inside.x, property.inside.y, property.inside.z) + SetEntityCoords(playerPed, property.inside.x, property.inside.y, property.inside.z) DoScreenFadeIn(800) DrawSub(property.label, 5000) end) @@ -265,7 +265,7 @@ function OpenPropertyMenu(property) else if not Config.EnablePlayerManagement then table.insert(elements, {label = _U('buy'), value = 'buy'}) - table.insert(elements, {label = _U('rent'), value = 'rent'}) + table.insert(elements, {label = _U('rent'), value = 'rent'}) end table.insert(elements, {label = _U('visit'), value = 'visit'}) @@ -595,8 +595,7 @@ function OpenRoomInventoryMenu(property, owner) else - ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'get_item_count', - { + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'get_item_count', { title = _U('amount'), }, function(data2, menu) diff --git a/server/main.lua b/server/main.lua index a937936e..27f53b8b 100644 --- a/server/main.lua +++ b/server/main.lua @@ -1,5 +1,4 @@ ESX = nil -local hasSqlRun = false TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) @@ -48,25 +47,10 @@ function RemoveOwnedProperty(name, owner) end) end -AddEventHandler('onMySQLReady', function() - hasSqlRun = true - LoadSql() -end) - --- extremely useful when restarting script mid-game -Citizen.CreateThread(function() - Citizen.Wait(20000) -- hopefully enough for connection to the SQL server - - if not hasSqlRun then - LoadSql() - hasSqlRun = true - end -end) - -function LoadSql() +MySQL.ready(function() MySQL.Async.fetchAll('SELECT * FROM properties', {}, function(properties) - for i=1, #properties, 1 do + for i=1, #properties, 1 do local entering = nil local exit = nil local inside = nil @@ -133,7 +117,8 @@ function LoadSql() TriggerClientEvent('esx_property:sendProperties', -1, Config.Properties) end) -end + +end) ESX.RegisterServerCallback('esx_property:getProperties', function(source, cb) cb(Config.Properties) From cd5f72e28d8833240241321fe82e5d3c590e5780 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Wed, 7 Nov 2018 21:30:56 +0100 Subject: [PATCH 71/99] Get property label too --- server/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/server/main.lua b/server/main.lua index 27f53b8b..f5acb377 100644 --- a/server/main.lua +++ b/server/main.lua @@ -132,6 +132,7 @@ AddEventHandler('esx_ownedproperty:getOwnedProperties', function(cb) table.insert(properties, { id = result[i].id, name = result[i].name, + label = GetProperty(result[i].name).label, price = result[i].price, rented = (result[i].rented == 1 and true or false), owner = result[i].owner From 9363881047c40b9f0c2bd46e940a3c2a75064474 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 10 Nov 2018 11:39:21 +0100 Subject: [PATCH 72/99] Group digits --- client/main.lua | 4 ++-- server/main.lua | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/client/main.lua b/client/main.lua index de8bcb65..7d9f3c9e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -275,7 +275,7 @@ function OpenPropertyMenu(property) { title = property.label, align = 'top-left', - elements = elements, + elements = elements }, function(data, menu) menu.close() @@ -387,7 +387,7 @@ function OpenGatewayAvailablePropertiesMenu(property) for i=1, #gatewayProperties, 1 do if not PropertyIsOwned(gatewayProperties[i]) then table.insert(elements, { - label = gatewayProperties[i].label .. ' $' .. gatewayProperties[i].price, + label = gatewayProperties[i].label .. ' $' .. ESX.Math.GroupDigits(gatewayProperties[i].price), value = gatewayProperties[i].name, price = gatewayProperties[i].price }) diff --git a/server/main.lua b/server/main.lua index f5acb377..8cb3fa8e 100644 --- a/server/main.lua +++ b/server/main.lua @@ -24,9 +24,9 @@ function SetPropertyOwned(name, price, rented, owner) TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true) if rented then - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for', price)) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for', ESX.Math.GroupDigits(price))) else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for', price)) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for', ESX.Math.GroupDigits(price))) end end end) @@ -155,8 +155,9 @@ RegisterServerEvent('esx_property:rentProperty') AddEventHandler('esx_property:rentProperty', function(propertyName) local xPlayer = ESX.GetPlayerFromId(source) local property = GetProperty(propertyName) + local rent = ESX.Math.Round(property.price / 200) - SetPropertyOwned(propertyName, property.price / 200, true, xPlayer.identifier) + SetPropertyOwned(propertyName, rent, true, xPlayer.identifier) end) RegisterServerEvent('esx_property:buyProperty') @@ -428,7 +429,7 @@ function PayRent(d, h, m) -- message player if connected if xPlayer ~= nil then xPlayer.removeAccountMoney('bank', result[i].price) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent', result[i].price)) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent', ESX.Math.GroupDigits(result[i].price))) else -- pay rent either way MySQL.Sync.execute('UPDATE users SET bank = bank - @bank WHERE identifier = @identifier', { From 1c6f57e22b5fb5cf35b57e0e591c3fef49434d8a Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 10 Nov 2018 11:59:35 +0100 Subject: [PATCH 73/99] Fixed #46, proper digit grouping --- client/main.lua | 48 +++++++++++++++++++++++++++++++++++++++--------- server/main.lua | 4 ++-- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/client/main.lua b/client/main.lua index 7d9f3c9e..4f975a71 100644 --- a/client/main.lua +++ b/client/main.lua @@ -368,6 +368,7 @@ function OpenGatewayOwnedPropertiesMenu(property) if data2.current.value == 'enter' then TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) + menu2.close() elseif data2.current.value == 'leave' then TriggerServerEvent('esx_property:removeOwnedProperty', data.current.value) end @@ -396,7 +397,7 @@ function OpenGatewayAvailablePropertiesMenu(property) ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_available_properties', { - title = property.name.. ' - ' .. _U('available_properties'), + title = property.name .. ' - ' .. _U('available_properties'), align = 'top-left', elements = elements }, function(data, menu) @@ -405,7 +406,7 @@ function OpenGatewayAvailablePropertiesMenu(property) ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_available_properties_actions', { - title = property.name, + title = property.label .. ' - ' .. _U('available_properties'), align = 'top-left', elements = { {label = _U('buy'), value = 'buy'}, @@ -561,20 +562,34 @@ function OpenRoomInventoryMenu(property, owner) local elements = {} if inventory.blackMoney > 0 then - table.insert(elements, {label = _U('dirty_money', inventory.blackMoney), type = 'item_account', value = 'black_money'}) + table.insert(elements, { + label = _U('dirty_money', ESX.Math.GroupDigits(inventory.blackMoney)), + type = 'item_account', + value = 'black_money' + }) end 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}) + table.insert(elements, { + label = item.label .. ' x' .. item.count, + type = 'item_standard', + value = item.name + }) end end for i=1, #inventory.weapons, 1 do local weapon = inventory.weapons[i] - table.insert(elements, {label = ESX.GetWeaponLabel(weapon.name) .. ' [' .. weapon.ammo .. ']', type = 'item_weapon', value = weapon.name, ammo = weapon.ammo}) + + table.insert(elements, { + label = ESX.GetWeaponLabel(weapon.name) .. ' [' .. weapon.ammo .. ']', + type = 'item_weapon', + value = weapon.name, + ammo = weapon.ammo + }) end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room_inventory', @@ -596,7 +611,7 @@ function OpenRoomInventoryMenu(property, owner) else ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'get_item_count', { - title = _U('amount'), + title = _U('amount') }, function(data2, menu) local quantity = tonumber(data2.value) @@ -632,13 +647,22 @@ function OpenPlayerInventoryMenu(property, owner) local elements = {} if inventory.blackMoney > 0 then - table.insert(elements, {label = _U('dirty_money', inventory.blackMoney), type = 'item_account', value = 'black_money'}) + table.insert(elements, { + label = _U('dirty_money', ESX.Math.GroupDigits(inventory.blackMoney)), + type = 'item_account', + value = 'black_money' + }) end 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}) + table.insert(elements, { + label = item.label .. ' x' .. item.count, + type = 'item_standard', + value = item.name + }) end end @@ -649,7 +673,13 @@ function OpenPlayerInventoryMenu(property, owner) 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 .. ' [' .. ammo .. ']', type = 'item_weapon', value = weaponList[i].name, ammo = ammo}) + + table.insert(elements, { + label = weaponList[i].label .. ' [' .. ammo .. ']', + type = 'item_weapon', + value = weaponList[i].name, + ammo = ammo + }) end end diff --git a/server/main.lua b/server/main.lua index 8cb3fa8e..c578dfb1 100644 --- a/server/main.lua +++ b/server/main.lua @@ -363,7 +363,7 @@ ESX.RegisterServerCallback('esx_property:getPropertyInventory', function(source, end) TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - local storeWeapons = store.get('weapons') or {} + weapons = store.get('weapons') or {} end) cb({ @@ -427,7 +427,7 @@ function PayRent(d, h, m) local xPlayer = ESX.GetPlayerFromIdentifier(result[i].owner) -- message player if connected - if xPlayer ~= nil then + if xPlayer then xPlayer.removeAccountMoney('bank', result[i].price) TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent', ESX.Math.GroupDigits(result[i].price))) else -- pay rent either way From 7b8329878f028f3f6fcb2f64fd15f648c7983014 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 10 Nov 2018 19:37:13 +0100 Subject: [PATCH 74/99] Fixed removing dressing label, close menu on enter and proper loadout fetch --- client/main.lua | 46 ++++++++++++++++++++++------------------------ server/main.lua | 11 ++++++----- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/client/main.lua b/client/main.lua index 4f975a71..0adecf7e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -368,7 +368,7 @@ function OpenGatewayOwnedPropertiesMenu(property) if data2.current.value == 'enter' then TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) - menu2.close() + ESX.UI.Menu.CloseAll() elseif data2.current.value == 'leave' then TriggerServerEvent('esx_property:removeOwnedProperty', data.current.value) end @@ -490,7 +490,10 @@ function OpenRoomMenu(property, owner) local elements = {} for i=1, #dressing, 1 do - table.insert(elements, {label = dressing[i], value = i}) + table.insert(elements, { + label = dressing[i], + value = i + }) end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'player_dressing', @@ -520,13 +523,15 @@ function OpenRoomMenu(property, owner) ESX.TriggerServerCallback('esx_property:getPlayerDressing', function(dressing) local elements = {} - + for i=1, #dressing, 1 do - table.insert(elements, {label = dressing[i].label, value = i}) + table.insert(elements, { + label = dressing[i], + value = i + }) end - - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'remove_cloth', - { + + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'remove_cloth', { title = property.label .. ' - ' .. _U('remove_cloth'), align = 'top-left', elements = elements @@ -534,8 +539,7 @@ function OpenRoomMenu(property, owner) menu2.close() TriggerServerEvent('esx_property:removeOutfit', data2.current.value) ESX.ShowNotification(_U('removed_cloth')) - end, - function(data2, menu2) + end, function(data2, menu2) menu2.close() end) end) @@ -656,7 +660,7 @@ function OpenPlayerInventoryMenu(property, owner) 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, @@ -666,21 +670,15 @@ function OpenPlayerInventoryMenu(property, owner) end end - local playerPed = PlayerPedId() - local weaponList = ESX.GetWeaponList() + for i=1, #inventory.weapons, 1 do + local weapon = inventory.weapons[i] - 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 .. ' [' .. ammo .. ']', - type = 'item_weapon', - value = weaponList[i].name, - ammo = ammo - }) - end + table.insert(elements, { + label = weapon.label .. ' [' .. weapon.ammo .. ']', + type = 'item_weapon', + value = weapon.name, + ammo = weapon.ammo + }) end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'player_inventory', diff --git a/server/main.lua b/server/main.lua index c578dfb1..2b8ad71f 100644 --- a/server/main.lua +++ b/server/main.lua @@ -212,10 +212,10 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, count) if type == 'item_standard' then local sourceItem = xPlayer.getInventoryItem(item) - + TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) local inventoryItem = inventory.getItem(item) - + -- is there enough in the property? if count > 0 and inventoryItem.count >= count then @@ -380,7 +380,8 @@ ESX.RegisterServerCallback('esx_property:getPlayerInventory', function(source, c cb({ blackMoney = blackMoney, - items = items + items = items, + weapons = xPlayer.getLoadout() }) end) @@ -388,8 +389,8 @@ ESX.RegisterServerCallback('esx_property:getPlayerDressing', function(source, cb local xPlayer = ESX.GetPlayerFromId(source) TriggerEvent('esx_datastore:getDataStore', 'property', xPlayer.identifier, function(store) - local count = store.count('dressing') - local labels = {} + local count = store.count('dressing') + local labels = {} for i=1, count, 1 do local entry = store.get('dressing', i) From d66981bf5aab1533af34d40451ad3732f60afdca Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 2 Dec 2018 17:42:33 +0100 Subject: [PATCH 75/99] Load property IPLs when spawning in property --- client/main.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/main.lua b/client/main.lua index 0adecf7e..3c8dcfe1 100644 --- a/client/main.lua +++ b/client/main.lua @@ -752,6 +752,16 @@ AddEventHandler('playerSpawned', function() ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) if propertyName ~= nil then if propertyName ~= '' then + local property = GetProperty(propertyName) + + for i=1, #property.ipls, 1 do + RequestIpl(property.ipls[i]) + + while not IsIplActive(property.ipls[i]) do + Citizen.Wait(0) + end + end + TriggerEvent('instance:create', 'property', {property = propertyName, owner = ESX.GetPlayerData().identifier}) end end From 25779b7ca70ff030714a9af1d35f288a4d127f18 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 8 Dec 2018 00:52:39 +0100 Subject: [PATCH 76/99] Improve performance --- client/main.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 3c8dcfe1..056e143e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -691,7 +691,6 @@ function OpenPlayerInventoryMenu(property, owner) if data.current.type == 'item_weapon' then menu.close() - TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, data.current.ammo) ESX.SetTimeout(300, function() @@ -701,7 +700,7 @@ function OpenPlayerInventoryMenu(property, owner) else ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'put_item_count', { - title = _U('amount'), + title = _U('amount') }, function(data2, menu2) local quantity = tonumber(data2.value) @@ -937,6 +936,9 @@ Citizen.CreateThread(function() TriggerEvent('esx_property:hasExitedMarker', LastProperty, LastPart) end + if not isInMarker and not HasAlreadyEnteredMarker then + Citizen.Wait(500) + end end end) From afb81fc22a04e9a06bb7ac57fb2cd0cc73175c33 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 10 Dec 2018 21:45:57 +0100 Subject: [PATCH 77/99] Don't select everything --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 2b8ad71f..f6476416 100644 --- a/server/main.lua +++ b/server/main.lua @@ -341,7 +341,7 @@ end) ESX.RegisterServerCallback('esx_property:getLastProperty', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) - MySQL.Async.fetchAll('SELECT * FROM users WHERE identifier = @identifier', { + MySQL.Async.fetchAll('SELECT last_property FROM users WHERE identifier = @identifier', { ['@identifier'] = xPlayer.identifier }, function(users) cb(users[1].last_property) From bfc39291368b903dff253adf8943f90fff913cc6 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 30 Dec 2018 21:55:41 +0100 Subject: [PATCH 78/99] Check IsControlJustReleased() every frame --- client/main.lua | 2 +- locales/en.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 056e143e..3e80968d 100644 --- a/client/main.lua +++ b/client/main.lua @@ -946,7 +946,7 @@ end) Citizen.CreateThread(function() while true do - Citizen.Wait(10) + Citizen.Wait(0) if CurrentAction ~= nil then diff --git a/locales/en.lua b/locales/en.lua index 2fc5ce23..b1f86229 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,7 +1,7 @@ Locales['en'] = { ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', - ['free_prop'] = 'free property', + ['free_prop'] = 'property For Sale', ['property'] = 'property', ['enter'] = 'enter', ['leave'] = 'sell', From bdb808583a0309cd16aa9c49e0b38ce4e856b820 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 15 Jan 2019 23:07:13 +0100 Subject: [PATCH 79/99] Improve performance by merging functions --- client/main.lua | 116 +++++++++++++++++++++--------------------------- 1 file changed, 51 insertions(+), 65 deletions(-) diff --git a/client/main.lua b/client/main.lua index 3e80968d..daa301ae 100644 --- a/client/main.lua +++ b/client/main.lua @@ -69,7 +69,7 @@ function CreateBlips() for i=1, #Config.Properties, 1 do local property = Config.Properties[i] - if property.entering ~= nil then + if property.entering then Blips[property.name] = AddBlipForCoord(property.entering.x, property.entering.y, property.entering.z) SetBlipSprite (Blips[property.name], 369) @@ -225,7 +225,7 @@ function SetPropertyOwned(name, owned) local _property = GetProperty(k) local _gateway = GetGateway(_property) - if _gateway ~= nil then + if _gateway then if _gateway.name == enteringName then found = true break @@ -749,7 +749,7 @@ AddEventHandler('playerSpawned', function() end ESX.TriggerServerCallback('esx_property:getLastProperty', function(propertyName) - if propertyName ~= nil then + if propertyName then if propertyName ~= '' then local property = GetProperty(propertyName) @@ -850,76 +850,64 @@ AddEventHandler('esx_property:hasExitedMarker', function(name, part) CurrentAction = nil end) --- Display markers +-- Enter / Exit marker events & Draw markers Citizen.CreateThread(function() while true do - - Citizen.Wait(1) + Citizen.Wait(0) local coords = GetEntityCoords(PlayerPedId()) - - for i=1, #Config.Properties, 1 do - local property = Config.Properties[i] - local isHost = false - - if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.DrawDistance) then - DrawMarker(Config.MarkerType, property.entering.x, property.entering.y, property.entering.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 - - if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.DrawDistance) then - DrawMarker(Config.MarkerType, property.exit.x, property.exit.y, property.exit.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 - - if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.DrawDistance) then - DrawMarker(Config.MarkerType, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.RoomMenuMarkerColor.r, Config.RoomMenuMarkerColor.g, Config.RoomMenuMarkerColor.b, 100, false, true, 2, false, false, false, false) - end - end - - end -end) - --- Enter / Exit marker events -Citizen.CreateThread(function() - while true do - - Citizen.Wait(1) - - local coords = GetEntityCoords(PlayerPedId()) - local isInMarker = false - local currentProperty = nil - local currentPart = nil + local isInMarker, letSleep = false, true + local currentProperty, currentPart for i=1, #Config.Properties, 1 do local property = Config.Properties[i] - if(property.entering ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'entering' + -- Entering + if property.entering and not property.disabled then + local distance = GetDistanceBetweenCoords(coords, property.entering.x, property.entering.y, property.entering.z, true) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType, property.entering.x, property.entering.y, property.entering.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, nil, nil, false) + letSleep = false + end + + if distance < Config.MarkerSize.x then + isInMarker = true + currentProperty = property.name + currentPart = 'entering' + end end - if(property.exit ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'exit' + -- Exit + if property.exit and not property.disabled then + local distance = GetDistanceBetweenCoords(coords, property.exit.x, property.exit.y, property.exit.z, true) + + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType, property.exit.x, property.exit.y, property.exit.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, nil, nil, false) + letSleep = false + end + + if distance < Config.MarkerSize.x then + isInMarker = true + currentProperty = property.name + currentPart = 'exit' + end end - if(property.inside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.inside.x, property.inside.y, property.inside.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'inside' - end + -- Room menu + if property.roomMenu and HasChest and not property.disabled then + local distance = GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) - if(property.outside ~= nil and not property.disabled and GetDistanceBetweenCoords(coords, property.outside.x, property.outside.y, property.outside.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'outside' - end + if distance < Config.DrawDistance then + DrawMarker(Config.MarkerType, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z, Config.RoomMenuMarkerColor.r, Config.RoomMenuMarkerColor.g, Config.RoomMenuMarkerColor.b, 100, false, true, 2, false, nil, nil, false) + letSleep = false + end - if(property.roomMenu ~= nil and HasChest and not property.disabled and GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) < Config.MarkerSize.x) then - isInMarker = true - currentProperty = property.name - currentPart = 'roomMenu' + if distance < Config.MarkerSize.x then + isInMarker = true + currentProperty = property.name + currentPart = 'roomMenu' + end end end @@ -936,7 +924,7 @@ Citizen.CreateThread(function() TriggerEvent('esx_property:hasExitedMarker', LastProperty, LastPart) end - if not isInMarker and not HasAlreadyEnteredMarker then + if letSleep then Citizen.Wait(500) end end @@ -945,11 +933,9 @@ 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']) then @@ -969,9 +955,9 @@ Citizen.CreateThread(function() end CurrentAction = nil - end - else -- no current action, sleep mode + end + else Citizen.Wait(500) end end From 067f0b9145861b9a1958169dd65e52ba7f99818f Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 1 Jun 2019 14:15:27 +0200 Subject: [PATCH 80/99] Minor cleanup --- client/main.lua | 141 ++++++++++++------------------------------------ server/main.lua | 17 ++---- 2 files changed, 39 insertions(+), 119 deletions(-) diff --git a/client/main.lua b/client/main.lua index daa301ae..90c5e60e 100644 --- a/client/main.lua +++ b/client/main.lua @@ -1,28 +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 -} - -ESX = nil -local OwnedProperties = {} -local Blips = {} -local CurrentProperty = nil -local CurrentPropertyOwner = nil -local LastProperty = nil -local LastPart = nil -local HasAlreadyEnteredMarker = false -local CurrentAction = nil -local CurrentActionMsg = '' -local CurrentActionData = {} -local FirstSpawn = true -local HasChest = false +local OwnedProperties, Blips, CurrentActionData = {}, {}, {} +local CurrentProperty, CurrentPropertyOwner, LastProperty, LastPart, CurrentAction, CurrentActionMsg +local firstSpawn, hasChest, hasAlreadyEnteredMarker = true, false, false +ESX = nil Citizen.CreateThread(function() while ESX == nil do @@ -60,9 +39,9 @@ end) function DrawSub(text, time) ClearPrints() - SetTextEntry_2('STRING') - AddTextComponentString(text) - DrawSubtitleTimed(time, 1) + BeginTextCommandPrint('STRING') + AddTextComponentSubstringPlayerName(text) + EndTextCommandPrint(time, 1) end function CreateBlips() @@ -78,7 +57,7 @@ function CreateBlips() SetBlipAsShortRange(Blips[property.name], true) BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('free_prop')) + AddTextComponentSubstringPlayerName(_U('free_prop')) EndTextCommandSetBlipName(Blips[property.name]) end end @@ -204,7 +183,6 @@ function SetPropertyOwned(name, owned) end if owned then - OwnedProperties[name] = true RemoveBlip(Blips[enteringName]) @@ -213,11 +191,9 @@ function SetPropertyOwned(name, owned) SetBlipAsShortRange(Blips[enteringName], true) BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('property')) + AddTextComponentSubstringPlayerName(_U('property')) EndTextCommandSetBlipName(Blips[enteringName]) - else - OwnedProperties[name] = nil local found = false @@ -241,12 +217,10 @@ function SetPropertyOwned(name, owned) SetBlipAsShortRange(Blips[enteringName], true) BeginTextCommandSetBlipName("STRING") - AddTextComponentString(_U('free_prop')) + AddTextComponentSubstringPlayerName(_U('free_prop')) EndTextCommandSetBlipName(Blips[enteringName]) end - end - end function PropertyIsOwned(property) @@ -271,8 +245,7 @@ function OpenPropertyMenu(property) table.insert(elements, {label = _U('visit'), value = 'visit'}) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'property', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'property', { title = property.label, align = 'top-left', elements = elements @@ -304,15 +277,13 @@ function OpenGatewayMenu(property) OpenGatewayOwnedPropertiesMenu(gatewayProperties) else - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway', { title = property.name, align = 'top-left', elements = { {label = _U('owned_properties'), value = 'owned_properties'}, {label = _U('available_properties'), value = 'available_properties'} - } - }, function(data, menu) + }}, function(data, menu) if data.current.value == 'owned_properties' then OpenGatewayOwnedPropertiesMenu(property) elseif data.current.value == 'available_properties' then @@ -325,7 +296,6 @@ function OpenGatewayMenu(property) CurrentActionMsg = _U('press_to_menu') CurrentActionData = {property = property} end) - end end @@ -342,8 +312,7 @@ function OpenGatewayOwnedPropertiesMenu(property) end end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_owned_properties', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_owned_properties', { title = property.name .. ' - ' .. _U('owned_properties'), align = 'top-left', elements = elements @@ -358,8 +327,7 @@ function OpenGatewayOwnedPropertiesMenu(property) table.insert(elements, {label = _U('leave'), value = 'leave'}) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_owned_properties_actions', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_owned_properties_actions', { title = data.current.label, align = 'top-left', elements = elements @@ -375,7 +343,6 @@ function OpenGatewayOwnedPropertiesMenu(property) end, function(data2, menu2) menu2.close() end) - end, function(data, menu) menu.close() end) @@ -395,25 +362,21 @@ function OpenGatewayAvailablePropertiesMenu(property) end end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_available_properties', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_available_properties', { title = property.name .. ' - ' .. _U('available_properties'), align = 'top-left', elements = elements }, function(data, menu) - menu.close() - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_available_properties_actions', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_available_properties_actions', { title = property.label .. ' - ' .. _U('available_properties'), align = 'top-left', elements = { {label = _U('buy'), value = 'buy'}, {label = _U('rent'), value = 'rent'}, {label = _U('visit'), value = 'visit'} - } - }, function(data2, menu2) + }}, function(data2, menu2) menu2.close() if data2.current.value == 'buy' then @@ -426,7 +389,6 @@ function OpenGatewayAvailablePropertiesMenu(property) end, function(data2, menu2) menu2.close() end) - end, function(data, menu) menu.close() end) @@ -434,7 +396,7 @@ end function OpenRoomMenu(property, owner) local entering = nil - local elements = {} + local elements = {{label = _U('invite_player'), value = 'invite_player'}} if property.isSingle then entering = property.entering @@ -442,8 +404,6 @@ function OpenRoomMenu(property, owner) entering = GetGateway(property).entering end - table.insert(elements, {label = _U('invite_player'), value = 'invite_player'}) - if CurrentPropertyOwner == owner then table.insert(elements, {label = _U('player_clothes'), value = 'player_dressing'}) table.insert(elements, {label = _U('remove_cloth'), value = 'remove_cloth'}) @@ -454,8 +414,7 @@ function OpenRoomMenu(property, owner) ESX.UI.Menu.CloseAll() - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room', { title = property.label, align = 'top-left', elements = elements @@ -472,8 +431,7 @@ function OpenRoomMenu(property, owner) end end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room_invite', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room_invite', { title = property.label .. ' - ' .. _U('invite'), align = 'top-left', elements = elements, @@ -496,13 +454,11 @@ function OpenRoomMenu(property, owner) }) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'player_dressing', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'player_dressing', { title = property.label .. ' - ' .. _U('player_clothes'), align = 'top-left', elements = elements }, function(data2, menu2) - TriggerEvent('skinchanger:getSkin', function(skin) ESX.TriggerServerCallback('esx_property:getPlayerOutfit', function(clothes) TriggerEvent('skinchanger:loadClothes', skin, clothes) @@ -513,7 +469,6 @@ function OpenRoomMenu(property, owner) end) end, data2.current.value) end) - end, function(data2, menu2) menu2.close() end) @@ -560,9 +515,7 @@ function OpenRoomMenu(property, owner) end function OpenRoomInventoryMenu(property, owner) - ESX.TriggerServerCallback('esx_property:getPropertyInventory', function(inventory) - local elements = {} if inventory.blackMoney > 0 then @@ -596,24 +549,20 @@ function OpenRoomInventoryMenu(property, owner) }) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room_inventory', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'room_inventory', { title = property.label .. ' - ' .. _U('inventory'), align = 'top-left', elements = elements }, function(data, menu) if data.current.type == 'item_weapon' then - menu.close() TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, data.current.ammo) ESX.SetTimeout(300, function() OpenRoomInventoryMenu(property, owner) end) - else - ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'get_item_count', { title = _U('amount') }, function(data2, menu) @@ -629,25 +578,18 @@ function OpenRoomInventoryMenu(property, owner) OpenRoomInventoryMenu(property, owner) end) end - end, function(data2,menu) menu.close() end) - end - end, function(data, menu) menu.close() end) - end, owner) - end function OpenPlayerInventoryMenu(property, owner) - ESX.TriggerServerCallback('esx_property:getPlayerInventory', function(inventory) - local elements = {} if inventory.blackMoney > 0 then @@ -681,34 +623,28 @@ function OpenPlayerInventoryMenu(property, owner) }) end - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'player_inventory', - { + ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'player_inventory', { title = property.label .. ' - ' .. _U('inventory'), align = 'top-left', elements = elements }, function(data, menu) if data.current.type == 'item_weapon' then - menu.close() TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, data.current.ammo) ESX.SetTimeout(300, function() OpenPlayerInventoryMenu(property, owner) end) - else - ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'put_item_count', { title = _U('amount') }, function(data2, menu2) - local quantity = tonumber(data2.value) if quantity == nil then ESX.ShowNotification(_U('amount_invalid')) else - menu2.close() TriggerServerEvent('esx_property:putItem', owner, data.current.type, data.current.value, tonumber(data2.value)) @@ -716,19 +652,14 @@ function OpenPlayerInventoryMenu(property, owner) OpenPlayerInventoryMenu(property, owner) end) end - end, function(data2, menu2) menu2.close() end) - end - end, function(data, menu) menu.close() end) - end) - end AddEventHandler('instance:loaded', function() @@ -740,10 +671,8 @@ AddEventHandler('instance:loaded', function() end) AddEventHandler('playerSpawned', function() - if FirstSpawn then - + if firstSpawn then Citizen.CreateThread(function() - while not ESX.IsPlayerLoaded() do Citizen.Wait(0) end @@ -767,7 +696,7 @@ AddEventHandler('playerSpawned', function() end) end) - FirstSpawn = false + firstSpawn = false end end) @@ -807,9 +736,9 @@ AddEventHandler('instance:onEnter', function(instance) end if isOwned or not isHost then - HasChest = true + hasChest = true else - HasChest = false + hasChest = false end end end) @@ -895,7 +824,7 @@ Citizen.CreateThread(function() end -- Room menu - if property.roomMenu and HasChest and not property.disabled then + if property.roomMenu and hasChest and not property.disabled then local distance = GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) if distance < Config.DrawDistance then @@ -911,16 +840,16 @@ Citizen.CreateThread(function() end end - if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastProperty ~= currentProperty or LastPart ~= currentPart) ) then - HasAlreadyEnteredMarker = true + if isInMarker and not hasAlreadyEnteredMarker or (isInMarker and (LastProperty ~= currentProperty or LastPart ~= currentPart) ) then + hasAlreadyEnteredMarker = true LastProperty = currentProperty LastPart = currentPart TriggerEvent('esx_property:hasEnteredMarker', currentProperty, currentPart) end - if not isInMarker and HasAlreadyEnteredMarker then - HasAlreadyEnteredMarker = false + if not isInMarker and hasAlreadyEnteredMarker then + hasAlreadyEnteredMarker = false TriggerEvent('esx_property:hasExitedMarker', LastProperty, LastPart) end @@ -938,8 +867,7 @@ Citizen.CreateThread(function() if CurrentAction then ESX.ShowHelpNotification(CurrentActionMsg) - if IsControlJustReleased(0, Keys['E']) then - + if IsControlJustReleased(0, 38) then if CurrentAction == 'property_menu' then OpenPropertyMenu(CurrentActionData.property) elseif CurrentAction == 'gateway_menu' then @@ -955,7 +883,6 @@ Citizen.CreateThread(function() end CurrentAction = nil - end else Citizen.Wait(500) diff --git a/server/main.lua b/server/main.lua index f6476416..1828aa3f 100644 --- a/server/main.lua +++ b/server/main.lua @@ -11,8 +11,7 @@ function GetProperty(name) end function SetPropertyOwned(name, price, rented, owner) - MySQL.Async.execute('INSERT INTO owned_properties (name, price, rented, owner) VALUES (@name, @price, @rented, @owner)', - { + MySQL.Async.execute('INSERT INTO owned_properties (name, price, rented, owner) VALUES (@name, @price, @rented, @owner)', { ['@name'] = name, ['@price'] = price, ['@rented'] = (rented and 1 or 0), @@ -33,8 +32,7 @@ function SetPropertyOwned(name, price, rented, owner) end function RemoveOwnedProperty(name, owner) - MySQL.Async.execute('DELETE FROM owned_properties WHERE name = @name AND owner = @owner', - { + MySQL.Async.execute('DELETE FROM owned_properties WHERE name = @name AND owner = @owner', { ['@name'] = name, ['@owner'] = owner }, function(rowsChanged) @@ -117,7 +115,6 @@ MySQL.ready(function() TriggerClientEvent('esx_property:sendProperties', -1, Config.Properties) end) - end) ESX.RegisterServerCallback('esx_property:getProperties', function(source, cb) @@ -187,8 +184,7 @@ RegisterServerEvent('esx_property:saveLastProperty') AddEventHandler('esx_property:saveLastProperty', function(property) local xPlayer = ESX.GetPlayerFromId(source) - MySQL.Async.execute('UPDATE users SET last_property = @last_property WHERE identifier = @identifier', - { + MySQL.Async.execute('UPDATE users SET last_property = @last_property WHERE identifier = @identifier', { ['@last_property'] = property, ['@identifier'] = xPlayer.identifier }) @@ -267,7 +263,6 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, count) end) end - end) RegisterServerEvent('esx_property:putItem') @@ -319,14 +314,13 @@ AddEventHandler('esx_property:putItem', function(owner, type, item, count) end) end - end) ESX.RegisterServerCallback('esx_property:getOwnedProperties', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE owner = @owner', { - ['@owner'] = xPlayer.identifier + ['@owner'] = xPlayer.identifier }, function(ownedProperties) local properties = {} @@ -432,8 +426,7 @@ function PayRent(d, h, m) xPlayer.removeAccountMoney('bank', result[i].price) TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent', ESX.Math.GroupDigits(result[i].price))) else -- pay rent either way - MySQL.Sync.execute('UPDATE users SET bank = bank - @bank WHERE identifier = @identifier', - { + MySQL.Sync.execute('UPDATE users SET bank = bank - @bank WHERE identifier = @identifier', { ['@bank'] = result[i].price, ['@identifier'] = result[i].owner }) From 591aba63250ee9e1158c9548c7e058906eff93b1 Mon Sep 17 00:00:00 2001 From: rex2630 Date: Tue, 12 Nov 2019 20:46:15 +0100 Subject: [PATCH 81/99] Add support for new ESX weight system (#75) * Support for new ESX * Fix --- server/main.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/server/main.lua b/server/main.lua index 1828aa3f..fd82be43 100644 --- a/server/main.lua +++ b/server/main.lua @@ -23,9 +23,9 @@ function SetPropertyOwned(name, price, rented, owner) TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true) if rented then - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('rented_for', ESX.Math.GroupDigits(price))) + xPlayer.showNotification(_U('rented_for', ESX.Math.GroupDigits(price))) else - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('purchased_for', ESX.Math.GroupDigits(price))) + xPlayer.showNotification(_U('purchased_for', ESX.Math.GroupDigits(price))) end end end) @@ -40,7 +40,7 @@ function RemoveOwnedProperty(name, owner) if xPlayer then TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, false) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('made_property')) + xPlayer.showNotification(_U('made_property')) end end) end @@ -166,7 +166,7 @@ AddEventHandler('esx_property:buyProperty', function(propertyName) xPlayer.removeMoney(property.price) SetPropertyOwned(propertyName, property.price, false, xPlayer.identifier) else - TriggerClientEvent('esx:showNotification', source, _U('not_enough')) + xPlayer.showNotification(_U('not_enough')) end end) @@ -216,15 +216,15 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, 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('player_cannot_hold')) - else + if xPlayer.canCarryItem(item, count) then inventory.removeItem(item, count) xPlayer.addInventoryItem(item, count) - TriggerClientEvent('esx:showNotification', _source, _U('have_withdrawn', count, inventoryItem.label)) + xPlayer.showNotification(_U('have_withdrawn', count, inventoryItem.label)) + else + xPlayer.showNotification(_U('player_cannot_hold')) end else - TriggerClientEvent('esx:showNotification', _source, _U('not_enough_in_property')) + xPlayer.showNotification(_U('not_enough_in_property')) end end) @@ -237,7 +237,7 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, count) account.removeMoney(count) xPlayer.addAccountMoney(item, count) else - TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) + xPlayer.showNotification(_U('amount_invalid')) end end) @@ -279,10 +279,10 @@ AddEventHandler('esx_property:putItem', function(owner, type, item, count) TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) xPlayer.removeInventoryItem(item, count) inventory.addItem(item, count) - TriggerClientEvent('esx:showNotification', _source, _U('have_deposited', count, inventory.getItem(item).label)) + xPlayer.showNotification(_U('have_deposited', count, inventory.getItem(item).label)) end) else - TriggerClientEvent('esx:showNotification', _source, _U('invalid_quantity')) + xPlayer.showNotification(_U('invalid_quantity')) end elseif type == 'item_account' then @@ -296,7 +296,7 @@ AddEventHandler('esx_property:putItem', function(owner, type, item, count) account.addMoney(count) end) else - TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid')) + xPlayer.showNotification(_U('amount_invalid')) end elseif type == 'item_weapon' then @@ -424,7 +424,7 @@ function PayRent(d, h, m) -- message player if connected if xPlayer then xPlayer.removeAccountMoney('bank', result[i].price) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_rent', ESX.Math.GroupDigits(result[i].price))) + xPlayer.showNotification(_U('paid_rent', ESX.Math.GroupDigits(result[i].price))) else -- pay rent either way MySQL.Sync.execute('UPDATE users SET bank = bank - @bank WHERE identifier = @identifier', { ['@bank'] = result[i].price, From 1b7721641c391145178670ea969508ef3dbab8b6 Mon Sep 17 00:00:00 2001 From: rex2630 Date: Tue, 12 Nov 2019 20:55:05 +0100 Subject: [PATCH 82/99] Removed letftover variable (#77) --- server/main.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index fd82be43..2e0a6e5a 100644 --- a/server/main.lua +++ b/server/main.lua @@ -207,7 +207,6 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, count) if type == 'item_standard' then - local sourceItem = xPlayer.getInventoryItem(item) TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) local inventoryItem = inventory.getItem(item) From ca79838b7701b6e25b88a8efafcc45439373c596 Mon Sep 17 00:00:00 2001 From: rex2630 Date: Sun, 19 Jan 2020 17:40:22 +0100 Subject: [PATCH 83/99] Replace __resource.lua with fxmanifest.lua --- __resource.lua => fxmanifest.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename __resource.lua => fxmanifest.lua (91%) diff --git a/__resource.lua b/fxmanifest.lua similarity index 91% rename from __resource.lua rename to fxmanifest.lua index a5b84ec4..53d33fb4 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 Property' From 71315bcd1756bf6ed39173003a73111215f5eab3 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 3 Feb 2020 11:12:55 +0100 Subject: [PATCH 84/99] Use async to limit paying rent --- README.md | 4 +++- config.lua | 6 ++---- fxmanifest.lua | 4 +++- server/main.lua | 40 ++++++++++++++++++++++++++-------------- 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 37449fa6..8c230af9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # esx_property ### Requirements + +- [async](https://github.com/ESX-Org/async) - [instance](https://github.com/ESX-Org/instance) - [cron](https://github.com/ESX-Org/cron) - [esx_addonaccount](https://github.com/ESX-Org/esx_addonaccount) @@ -37,7 +39,7 @@ start esx_property ### License esx_property - own a property! -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/config.lua b/config.lua index 2666d3c2..f71a9871 100644 --- a/config.lua +++ b/config.lua @@ -4,9 +4,7 @@ Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} Config.MarkerColor = {r = 102, g = 102, b = 204} Config.RoomMenuMarkerColor = {r = 102, g = 204, b = 102} Config.MarkerType = 1 -Config.Zones = {} -Config.Properties = {} -Config.EnablePlayerManagement = false -- If set to true you need esx_realestateagentjob -Config.Locale = 'fr' Config.Properties = {} +Config.EnablePlayerManagement = false -- If set to true you use esx_realestateagentjob +Config.Locale = 'fr' diff --git a/fxmanifest.lua b/fxmanifest.lua index 53d33fb4..1c060718 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -7,8 +7,9 @@ description 'ESX Property' version '1.0.4' server_scripts { - '@es_extended/locale.lua', + '@async/async.lua', '@mysql-async/lib/MySQL.lua', + '@es_extended/locale.lua', 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', @@ -36,6 +37,7 @@ client_scripts { } dependencies { + 'async', 'es_extended', 'instance', 'cron', diff --git a/server/main.lua b/server/main.lua index 2e0a6e5a..ef07a67a 100644 --- a/server/main.lua +++ b/server/main.lua @@ -416,25 +416,37 @@ AddEventHandler('esx_property:removeOutfit', function(label) end) function PayRent(d, h, m) - MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE rented = 1', {}, function (result) + local tasks, timeStart = {}, os.clock() + print('[esx_property] [^2INFO^7] Paying rent cron job started') + + MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE rented = 1', {}, function(result) for i=1, #result, 1 do - local xPlayer = ESX.GetPlayerFromIdentifier(result[i].owner) + table.insert(tasks, function(cb) + local xPlayer = ESX.GetPlayerFromIdentifier(result[i].owner) - -- message player if connected - if xPlayer then - xPlayer.removeAccountMoney('bank', result[i].price) - xPlayer.showNotification(_U('paid_rent', ESX.Math.GroupDigits(result[i].price))) - else -- pay rent either way - MySQL.Sync.execute('UPDATE users SET bank = bank - @bank WHERE identifier = @identifier', { - ['@bank'] = result[i].price, - ['@identifier'] = result[i].owner - }) - end + -- message player if connected + if xPlayer then + xPlayer.removeAccountMoney('bank', result[i].price) + xPlayer.showNotification(_U('paid_rent', ESX.Math.GroupDigits(result[i].price))) + else -- pay rent either way + MySQL.Sync.execute('UPDATE users SET bank = bank - @bank WHERE identifier = @identifier', { + ['@bank'] = result[i].price, + ['@identifier'] = result[i].owner + }) + end - TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) - account.addMoney(result[i].price) + TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) + account.addMoney(result[i].price) + end) + + cb() end) end + + Async.parallelLimit(tasks, 5, function(results) end) + + local elapsedTime = os.clock() - timeStart + print(('[esx_property] [^2INFO^7] Paying rent cron job took %s seconds'):format(elapsedTime)) end) end From 897d60bf1359bb52f19d02c92bf1df56aa212e30 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 3 Feb 2020 11:25:19 +0100 Subject: [PATCH 85/99] Fixed taking random weapon, added missing weapon checks --- server/main.lua | 84 ++++++++++++++++++------------------------------- 1 file changed, 31 insertions(+), 53 deletions(-) diff --git a/server/main.lua b/server/main.lua index ef07a67a..c4e3773f 100644 --- a/server/main.lua +++ b/server/main.lua @@ -58,19 +58,19 @@ MySQL.ready(function() local isGateway = nil local roomMenu = nil - if properties[i].entering ~= nil then + if properties[i].entering then entering = json.decode(properties[i].entering) end - if properties[i].exit ~= nil then + if properties[i].exit then exit = json.decode(properties[i].exit) end - if properties[i].inside ~= nil then + if properties[i].inside then inside = json.decode(properties[i].inside) end - if properties[i].outside ~= nil then + if properties[i].outside then outside = json.decode(properties[i].outside) end @@ -92,7 +92,7 @@ MySQL.ready(function() isGateway = true end - if properties[i].room_menu ~= nil then + if properties[i].room_menu then roomMenu = json.decode(properties[i].room_menu) end @@ -201,19 +201,15 @@ end) RegisterServerEvent('esx_property:getItem') AddEventHandler('esx_property:getItem', function(owner, type, item, count) - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) + local xPlayer = ESX.GetPlayerFromId(source) local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) if type == 'item_standard' then - - TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) local inventoryItem = inventory.getItem(item) -- is there enough in the property? if count > 0 and inventoryItem.count >= count then - -- can the player carry the said amount of x item? if xPlayer.canCarryItem(item, count) then inventory.removeItem(item, count) @@ -226,52 +222,38 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, count) xPlayer.showNotification(_U('not_enough_in_property')) end end) - elseif type == 'item_account' then - TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) - local roomAccountMoney = account.money - - if roomAccountMoney >= count then + if account.money >= count then account.removeMoney(count) xPlayer.addAccountMoney(item, count) else xPlayer.showNotification(_U('amount_invalid')) end end) - elseif type == 'item_weapon' then - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) local storeWeapons = store.get('weapons') or {} - local weaponName = nil - local ammo = nil + local weapon = storeWeapons[data.current.count] -- count is the index - for i=1, #storeWeapons, 1 do - if storeWeapons[i].name == item then - weaponName = storeWeapons[i].name - ammo = storeWeapons[i].ammo + if weapon then + if not xPlayer.hasWeapon(weaponName) then + table.remove(storeWeapons, data.current.count) + store.set('weapons', storeWeapons) - table.remove(storeWeapons, i) - break + xPlayer.addWeapon(weapon.name, weapon.ammo) end end - - store.set('weapons', storeWeapons) - xPlayer.addWeapon(weaponName, ammo) end) - end end) RegisterServerEvent('esx_property:putItem') AddEventHandler('esx_property:putItem', function(owner, type, item, count) - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) + local xPlayer = ESX.GetPlayerFromId(source) local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) if type == 'item_standard' then - local playerItemCount = xPlayer.getInventoryItem(item).count if playerItemCount >= count and count > 0 then @@ -283,12 +265,8 @@ AddEventHandler('esx_property:putItem', function(owner, type, item, count) else xPlayer.showNotification(_U('invalid_quantity')) end - elseif type == 'item_account' then - - local playerAccountMoney = xPlayer.getAccount(item).money - - if playerAccountMoney >= count and count > 0 then + if xPlayer.getAccount(item).money >= count and count > 0 then xPlayer.removeAccountMoney(item, count) TriggerEvent('esx_addonaccount:getAccount', 'property_' .. item, xPlayerOwner.identifier, function(account) @@ -297,34 +275,34 @@ AddEventHandler('esx_property:putItem', function(owner, type, item, count) else xPlayer.showNotification(_U('amount_invalid')) end - elseif type == 'item_weapon' then - - TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) - local storeWeapons = store.get('weapons') or {} - - table.insert(storeWeapons, { - name = item, - ammo = count - }) - - store.set('weapons', storeWeapons) + if xPlayer.hasWeapon(item) then xPlayer.removeWeapon(item) - end) + TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) + local storeWeapons = store.get('weapons') or {} + + table.insert(storeWeapons, { + name = item, + ammo = count + }) + + store.set('weapons', storeWeapons) + end) + end end end) ESX.RegisterServerCallback('esx_property:getOwnedProperties', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) - MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE owner = @owner', { + MySQL.Async.fetchAll('SELECT name FROM owned_properties WHERE owner = @owner', { ['@owner'] = xPlayer.identifier - }, function(ownedProperties) + }, function(result) local properties = {} - for i=1, #ownedProperties, 1 do - table.insert(properties, ownedProperties[i].name) + for i=1, #result, 1 do + table.insert(properties, result[i].name) end cb(properties) From 96c1ab491f924fc7e454f26eeeb45d07e475ded1 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 3 Feb 2020 13:19:55 +0100 Subject: [PATCH 86/99] Implemented pay when selling property, added prices to menu and more (desc) - Improved dialogs, differnet for owning / renting - Updated locale names - Get half money back when selling - Added configurable rent & sell prices in config --- client/main.lua | 80 +++++++++++++++++++++++++------------------------ config.lua | 21 ++++++++----- locales/br.lua | 17 ++++++----- locales/de.lua | 17 ++++++----- locales/en.lua | 21 ++++++------- locales/es.lua | 17 ++++++----- locales/fi.lua | 19 ++++++------ locales/fr.lua | 17 ++++++----- locales/pl.lua | 19 ++++++------ locales/sv.lua | 25 ++++++++-------- server/main.lua | 40 +++++++++++++++---------- 11 files changed, 159 insertions(+), 134 deletions(-) diff --git a/client/main.lua b/client/main.lua index 90c5e60e..29b19aa1 100644 --- a/client/main.lua +++ b/client/main.lua @@ -17,9 +17,9 @@ AddEventHandler('esx:playerLoaded', function(xPlayer) CreateBlips() end) - ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties) - for i=1, #ownedProperties, 1 do - SetPropertyOwned(ownedProperties[i], true) + ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(result) + for k,v in ipairs(result) do + SetPropertyOwned(v.name, true, v.rented) end end) end) @@ -30,9 +30,9 @@ AddEventHandler('esx_property:sendProperties', function(properties) Config.Properties = properties CreateBlips() - ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(ownedProperties) - for i=1, #ownedProperties, 1 do - SetPropertyOwned(ownedProperties[i], true) + ESX.TriggerServerCallback('esx_property:getOwnedProperties', function(result) + for k,v in ipairs(result) do + SetPropertyOwned(v.name, true, v.rented) end end) end) @@ -168,7 +168,7 @@ function ExitProperty(name) end) end -function SetPropertyOwned(name, owned) +function SetPropertyOwned(name, owned, rented) local property = GetProperty(name) local entering = nil local enteringName = nil @@ -183,7 +183,7 @@ function SetPropertyOwned(name, owned) end if owned then - OwnedProperties[name] = true + OwnedProperties[name] = rented RemoveBlip(Blips[enteringName]) Blips[enteringName] = AddBlipForCoord(entering.x, entering.y, entering.z) @@ -224,7 +224,7 @@ function SetPropertyOwned(name, owned) end function PropertyIsOwned(property) - return OwnedProperties[property.name] == true + return OwnedProperties[property.name] ~= nil end function OpenPropertyMenu(property) @@ -233,16 +233,24 @@ function OpenPropertyMenu(property) if PropertyIsOwned(property) then table.insert(elements, {label = _U('enter'), value = 'enter'}) + -- add move out if not Config.EnablePlayerManagement then - table.insert(elements, {label = _U('leave'), value = 'leave'}) + local leaveLabel = _U('move_out') + + if not OwnedProperties[property.name] then + leaveLabel = _U('move_out_sold', ESX.Math.GroupDigits(ESX.Math.Round(property.price / Config.SellModifier))) + end + + table.insert(elements, {label = leaveLabel, value = 'leave'}) end else if not Config.EnablePlayerManagement then - table.insert(elements, {label = _U('buy'), value = 'buy'}) - table.insert(elements, {label = _U('rent'), value = 'rent'}) - end + table.insert(elements, {label = _U('buy', ESX.Math.GroupDigits(property.price)), value = 'buy'}) - table.insert(elements, {label = _U('visit'), value = 'visit'}) + -- display rent price + local rent = ESX.Math.Round(property.price / Config.RentModifier) + table.insert(elements, {label = _U('rent', ESX.Math.GroupDigits(rent)), value = 'rent'}) + end end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'property', { @@ -260,8 +268,6 @@ function OpenPropertyMenu(property) TriggerServerEvent('esx_property:buyProperty', property.name) elseif data.current.value == 'rent' then TriggerServerEvent('esx_property:rentProperty', property.name) - elseif data.current.value == 'visit' then - TriggerEvent('instance:create', 'property', {property = property.name, owner = ESX.GetPlayerData().identifier}) end end, function(data, menu) menu.close() @@ -276,7 +282,6 @@ function OpenGatewayMenu(property) if Config.EnablePlayerManagement then OpenGatewayOwnedPropertiesMenu(gatewayProperties) else - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway', { title = property.name, align = 'top-left', @@ -301,7 +306,7 @@ end function OpenGatewayOwnedPropertiesMenu(property) local gatewayProperties = GetGatewayProperties(property) - local elements = {} + local elements = {} for i=1, #gatewayProperties, 1 do if PropertyIsOwned(gatewayProperties[i]) then @@ -318,10 +323,7 @@ function OpenGatewayOwnedPropertiesMenu(property) elements = elements }, function(data, menu) menu.close() - - local elements = { - {label = _U('enter'), value = 'enter'} - } + local elements = {{label = _U('enter'), value = 'enter'}} if not Config.EnablePlayerManagement then table.insert(elements, {label = _U('leave'), value = 'leave'}) @@ -350,14 +352,15 @@ end function OpenGatewayAvailablePropertiesMenu(property) local gatewayProperties = GetGatewayProperties(property) - local elements = {} + local elements = {} for i=1, #gatewayProperties, 1 do if not PropertyIsOwned(gatewayProperties[i]) then table.insert(elements, { - label = gatewayProperties[i].label .. ' $' .. ESX.Math.GroupDigits(gatewayProperties[i].price), + label = gatewayProperties[i].label, value = gatewayProperties[i].name, - price = gatewayProperties[i].price + buyPrice = gatewayProperties[i].price, + rentPrice = ESX.Math.Round(gatewayProperties[i].price / Config.RentModifier) }) end end @@ -367,24 +370,20 @@ function OpenGatewayAvailablePropertiesMenu(property) align = 'top-left', elements = elements }, function(data, menu) - menu.close() - ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'gateway_available_properties_actions', { title = property.label .. ' - ' .. _U('available_properties'), align = 'top-left', elements = { - {label = _U('buy'), value = 'buy'}, - {label = _U('rent'), value = 'rent'}, - {label = _U('visit'), value = 'visit'} + {label = _U('buy', ESX.Math.GroupDigits(data.current.buyPrice)), value = 'buy'}, + {label = _U('rent', ESX.Math.GroupDigits(data.current.rentPrice)), value = 'rent'} }}, function(data2, menu2) + menu.close() menu2.close() if data2.current.value == 'buy' then TriggerServerEvent('esx_property:buyProperty', data.current.value) elseif data2.current.value == 'rent' then TriggerServerEvent('esx_property:rentProperty', data.current.value) - elseif data2.current.value == 'visit' then - TriggerEvent('instance:create', 'property', {property = data.current.value, owner = ESX.GetPlayerData().identifier}) end end, function(data2, menu2) menu2.close() @@ -545,7 +544,7 @@ function OpenRoomInventoryMenu(property, owner) label = ESX.GetWeaponLabel(weapon.name) .. ' [' .. weapon.ammo .. ']', type = 'item_weapon', value = weapon.name, - ammo = weapon.ammo + index = i }) end @@ -558,7 +557,7 @@ function OpenRoomInventoryMenu(property, owner) if data.current.type == 'item_weapon' then menu.close() - TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, data.current.ammo) + TriggerServerEvent('esx_property:getItem', owner, data.current.type, data.current.value, data.current.index) ESX.SetTimeout(300, function() OpenRoomInventoryMenu(property, owner) end) @@ -684,7 +683,7 @@ AddEventHandler('playerSpawned', function() for i=1, #property.ipls, 1 do RequestIpl(property.ipls[i]) - + while not IsIplActive(property.ipls[i]) do Citizen.Wait(0) end @@ -713,8 +712,8 @@ AddEventHandler('esx_property:getGateway', function(property, cb) end) RegisterNetEvent('esx_property:setPropertyOwned') -AddEventHandler('esx_property:setPropertyOwned', function(name, owned) - SetPropertyOwned(name, owned) +AddEventHandler('esx_property:setPropertyOwned', function(name, owned, rented) + SetPropertyOwned(name, owned, rented) end) RegisterNetEvent('instance:onCreate') @@ -779,6 +778,8 @@ AddEventHandler('esx_property:hasExitedMarker', function(name, part) CurrentAction = nil end) +local index = 0 +RegisterCommand('s', function(a, b, c) -- Enter / Exit marker events & Draw markers Citizen.CreateThread(function() while true do @@ -797,6 +798,7 @@ Citizen.CreateThread(function() if distance < Config.DrawDistance then DrawMarker(Config.MarkerType, property.entering.x, property.entering.y, property.entering.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, nil, nil, false) + ESX.Game.Utils.DrawText3D(property.entering, property.name, 2) letSleep = false end @@ -824,7 +826,7 @@ Citizen.CreateThread(function() end -- Room menu - if property.roomMenu and hasChest and not property.disabled then + if property.roomMenu then local distance = GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) if distance < Config.DrawDistance then @@ -865,7 +867,7 @@ Citizen.CreateThread(function() Citizen.Wait(0) if CurrentAction then - ESX.ShowHelpNotification(CurrentActionMsg) + --ESX.ShowHelpNotification(CurrentActionMsg) if IsControlJustReleased(0, 38) then if CurrentAction == 'property_menu' then diff --git a/config.lua b/config.lua index f71a9871..d1888658 100644 --- a/config.lua +++ b/config.lua @@ -1,10 +1,15 @@ -Config = {} -Config.DrawDistance = 100 -Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} -Config.MarkerColor = {r = 102, g = 102, b = 204} -Config.RoomMenuMarkerColor = {r = 102, g = 204, b = 102} -Config.MarkerType = 1 +Config = {} + +Config.DrawDistance = 100 +Config.MarkerSize = {x = 1.5, y = 1.5, z = 1.0} +Config.MarkerColor = {r = 102, g = 102, b = 204} +Config.RoomMenuMarkerColor = {r = 102, g = 204, b = 102} +Config.MarkerType = 1 + +Config.RentModifier = 200 -- rent price: / (rounded) +Config.SellModifier = 2 -- sell price: / (rounded) + +Config.Properties = {} -Config.Properties = {} Config.EnablePlayerManagement = false -- If set to true you use esx_realestateagentjob -Config.Locale = 'fr' +Config.Locale = 'fr' diff --git a/locales/br.lua b/locales/br.lua index 152bdacb..98d5e412 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -4,10 +4,14 @@ Locales['br'] = { ['free_prop'] = 'Propriedade a Venda', ['property'] = 'Propriedade', ['enter'] = 'Entrar', - ['leave'] = 'Sair', - ['buy'] = 'Comprar', - ['rent'] = 'Alugar', - ['visit'] = 'Visitar', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'você comprou uma propriedade por ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'você alugou uma propriedade por ~g~$%s~s~', ['press_to_menu'] = 'Pressione ~INPUT_CONTEXT~ para acessar o menu', ['owned_properties'] = 'Propriedades adquiridas', ['available_properties'] = 'Propriedades disponíveis', @@ -19,14 +23,11 @@ Locales['br'] = { ['remove_object'] = 'Remover objeto', ['deposit_object'] = 'Depositar objeto', ['invite'] = 'Convidar', - ['dirty_money'] = 'Dinheiro sujo: $%s', + ['dirty_money'] = 'Dinheiro sujo: $%s', ['inventory'] = 'Inventário', ['amount'] = 'valor?', ['amount_invalid'] = 'quantidade inválida', ['press_to_exit'] = 'Pressione ~INPUT_CONTEXT~ para sair da propriedade', - ['rented_for'] = 'Você alugou uma propriedade por ~g~$%s~s~', - ['purchased_for'] = 'Você comprou uma propriedade por ~g~$%s~s~', - ['made_property'] = 'Você criou uma propriedade', ['not_enough'] = 'Você não tem dinheiro suficiente', ['invalid_quantity'] = 'Quantidade inválida', ['paid_rent'] = 'Você ~g~pagou~s~ seu aluguel: ~g~$%s~s~', diff --git a/locales/de.lua b/locales/de.lua index cd4f3cb5..9373025a 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -4,10 +4,14 @@ Locales['de'] = { ['free_prop'] = 'Kostenlose Immobilie', ['property'] = 'Immobilie', ['enter'] = 'Eintreten', - ['leave'] = 'Verlassen', - ['buy'] = 'Kaufen', - ['rent'] = 'Mieten', - ['visit'] = 'Ansehen', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'you purchased a property for ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'you rented a property for ~g~$%s~s~ / week, payment is automatic', ['press_to_menu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', ['owned_properties'] = 'Gekaufte Immobilien', ['available_properties'] = 'Verfügbare Immobilien', @@ -19,14 +23,13 @@ Locales['de'] = { ['remove_object'] = 'Objekt nehmen', ['deposit_object'] = 'Objekt deponieren', ['invite'] = 'Einladen', - ['dirty_money'] = 'Schwarzgeld: $%s', + ['dirty_money'] = 'Schwarzgeld: $%s', ['inventory'] = 'Inventar', ['amount'] = 'Anzahlt?', ['amount_invalid'] = 'Ungültiger Wert', ['press_to_exit'] = 'Drücke ~INPUT_CONTEXT~ um die Immobilie zu verlassen', - ['rented_for'] = 'Du hast eine Immobilie gemietet ~g~$%s~s~', + ['rent_for'] = 'Du hast eine Immobilie gemietet ~g~$%s~s~', ['purchased_for'] = 'Du hast eine Immobilie gekauft ~g~$%s~s~', - ['made_property'] = 'Du hast eine Immobilie gemacht', ['not_enough'] = 'du hast nicht genug Geld', ['invalid_quantity'] = 'Ungültiger Betrag', ['paid_rent'] = 'du ~g~bezahlst~s~ deine Miete: ~g~$%s~s~', diff --git a/locales/en.lua b/locales/en.lua index b1f86229..75d34bda 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -4,11 +4,15 @@ Locales['en'] = { ['free_prop'] = 'property For Sale', ['property'] = 'property', ['enter'] = 'enter', - ['leave'] = 'sell', - ['buy'] = 'buy', - ['rent'] = 'rent', - ['visit'] = 'visit', - ['press_to_menu'] = 'press ~INPUT_CONTEXT~ to access the menu', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'you purchased a property for ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'you rented a property for ~g~$%s~s~ / week, payment is automatic', + ['press_to_menu'] = 'press ~INPUT_CONTEXT~ to access the ~y~Property Menu~s~.', ['owned_properties'] = 'acquired properties', ['available_properties'] = 'available properties', ['invite_player'] = 'invite a player', @@ -19,17 +23,14 @@ Locales['en'] = { ['remove_object'] = 'remove object', ['deposit_object'] = 'deposit object', ['invite'] = 'invite', - ['dirty_money'] = 'dirty money: $%s', + ['dirty_money'] = 'dirty money: $%s', ['inventory'] = 'inventory', ['amount'] = 'amount?', ['amount_invalid'] = 'invalid amount', ['press_to_exit'] = 'press ~INPUT_CONTEXT~ to exit the property', - ['rented_for'] = 'you rented a property for ~g~$%s~s~', - ['purchased_for'] = 'you purchased a property for ~g~$%s~s~', - ['made_property'] = 'you have made a property', ['not_enough'] = 'you do not have enough money', ['invalid_quantity'] = 'invalid quantity', ['paid_rent'] = 'you ~g~paid~s~ your rent: ~g~$%s~s~', ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', -} \ No newline at end of file +} diff --git a/locales/es.lua b/locales/es.lua index c2477884..387ff6c0 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -4,10 +4,14 @@ Locales['es'] = { ['free_prop'] = 'Propiedad libre', ['property'] = 'Propiedad', ['enter'] = 'Entrar', - ['leave'] = 'Salir', - ['buy'] = 'Comprar', - ['rent'] = 'Alquilar', - ['visit'] = 'Visitar', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for €%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~€%s~s~', + ['buy'] = 'buy property for €%s', + ['buy_for'] = 'has comprado una propiedad por ~g~€%s~s~', + ['rent'] = 'rent property for €%s / week', + ['rent_for'] = 'has alquilado una propiedad por ~g~€%s~s~', ['press_to_menu'] = 'Presionar ~INPUT_CONTEXT~ para acceder al menú', ['owned_properties'] = 'Propiedad adquirida', ['available_properties'] = 'Propiedades disponibles', @@ -19,14 +23,11 @@ Locales['es'] = { ['remove_object'] = 'Retirar objeto', ['deposit_object'] = 'Depositar objeto', ['invite'] = 'Invitar', - ['dirty_money'] = 'Dinero sucio: €%s', + ['dirty_money'] = 'Dinero sucio: €%s', ['inventory'] = 'Inventario', ['amount'] = '¿Cantidad?', ['amount_invalid'] = 'Cantidad inválida', ['press_to_exit'] = 'Presione ~INPUT_CONTEXT~ para salir de la propiedad', - ['rented_for'] = 'Has alquilado una propiedad por ~g~€%s~s~', - ['purchased_for'] = 'Has comprado una propiedad por ~g~€%s~s~', - ['made_property'] = 'Ha hecho una propiedad', ['not_enough'] = 'n\'No tiene suficiente d\'dinero', ['invalid_quantity'] = 'Cantidad inválida', ['paid_rent'] = 'Has ~g~pagado~s~ por el alquiler: ~g~€%s~s~', diff --git a/locales/fi.lua b/locales/fi.lua index fd958a43..ffebd828 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -4,10 +4,14 @@ Locales['fi'] = { ['free_prop'] = 'vapaa kiinteistö', ['property'] = 'asunto', ['enter'] = 'sisään', - ['leave'] = 'myy', - ['buy'] = 'osta', - ['rent'] = 'vuokraa', - ['visit'] = 'vieraile', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'sinä ostit kiinteistön hintaan ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'sinä vuokrasit kiinteistön hintaan ~g~$%s~s~', ['press_to_menu'] = 'paina ~INPUT_CONTEXT~ avataksesi talon valikko', ['owned_properties'] = 'omistuksessa olevat asunnot', ['available_properties'] = 'vapaat asunnot', @@ -19,17 +23,14 @@ Locales['fi'] = { ['remove_object'] = 'poista esine', ['deposit_object'] = 'talleta esine', ['invite'] = 'kutsu', - ['dirty_money'] = 'likainen raha: $%s', + ['dirty_money'] = 'likainen raha: $%s', ['inventory'] = 'reppu', ['amount'] = 'määrä?', ['amount_invalid'] = 'virheellinen määrä', ['press_to_exit'] = 'paina ~INPUT_CONTEXT~ poistuaksesi kiinteistöstä', - ['rented_for'] = 'sinä vuokrasit kiinteistön hintaan ~g~$%s~s~', - ['purchased_for'] = 'sinä ostit kiinteistön hintaan ~g~$%s~s~', - ['made_property'] = 'sinä teit kiinteistön', ['not_enough'] = 'sinulla ei ole tarpeeksi rahaa', ['invalid_quantity'] = 'virheellinen määrä', ['paid_rent'] = 'sinä ~g~maksoit~s~ vuokraasi: ~g~$%s~s~', ['not_enough_in_property'] = 'täällä ei ole enempää ~r~tätä itemiä~s~ tässä kiinteistössä!', ['player_cannot_hold'] = 'sinulla ~r~ei ole~s~ tarpeeksi ~y~vapaata tilaa~s~ repussasi!', -} \ No newline at end of file +} diff --git a/locales/fr.lua b/locales/fr.lua index 4aa55cf7..ad663e14 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -4,10 +4,14 @@ Locales['fr'] = { ['free_prop'] = 'propriété libre', ['property'] = 'propriété', ['enter'] = 'entrer', - ['leave'] = 'rendre', - ['buy'] = 'acheter', - ['rent'] = 'louer', - ['visit'] = 'visiter', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'vous avez acheté une propriété pour ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'vous avez loué une propriété pour ~g~$%s~s~', ['press_to_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour accéder au menu', ['owned_properties'] = 'propriétés acquises', ['available_properties'] = 'propriétés disponibles', @@ -19,14 +23,11 @@ Locales['fr'] = { ['remove_object'] = 'retirer objet', ['deposit_object'] = 'déposer objet', ['invite'] = 'inviter', - ['dirty_money'] = 'argent sale: $%s', + ['dirty_money'] = 'argent sale: $%s', ['inventory'] = 'inventaire', ['amount'] = 'quantité ?', ['amount_invalid'] = 'montant invalide', ['press_to_exit'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir de la propriété', - ['rented_for'] = 'vous avez loué une propriété pour ~g~$%s~s~', - ['purchased_for'] = 'vous avez acheté une propriété pour ~g~$%s~s~', - ['made_property'] = 'vous avez rendu une propriété', ['not_enough'] = 'vous n\'avez pas assez d\'argent', ['invalid_quantity'] = 'quantité invalide', ['paid_rent'] = 'vous avez ~g~payé~s~ votre loyer: ~g~$%s~s~', diff --git a/locales/pl.lua b/locales/pl.lua index 0c6fe04d..985fcb2f 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -4,10 +4,14 @@ Locales['pl'] = { ['free_prop'] = 'wolne mieszkanie', ['property'] = 'mieszkanie', ['enter'] = 'wejdz', - ['leave'] = 'sprzedzaj', - ['buy'] = 'kup', - ['rent'] = 'wynajmij', - ['visit'] = 'odwiedz', + ['move_out'] = 'move out from property', + ['move_out_sold'] = 'sell property for $%s', + ['moved_out'] = 'you moved out and do no longer rent the property.', + ['moved_out_sold'] = 'you have sold the property for ~g~$%s~s~', + ['buy'] = 'buy property for $%s', + ['buy_for'] = 'kupiłeś/aś mieszkanie za ~g~$%s~s~', + ['rent'] = 'rent property for $%s / week', + ['rent_for'] = 'wynająłeś/aś mieszkanie za ~g~$%s~s~', ['press_to_menu'] = 'wciśnij ~INPUT_CONTEXT~ aby otworzyć menu', ['owned_properties'] = 'twoje mieszkania', ['available_properties'] = 'dostępne mieszkania', @@ -19,17 +23,14 @@ Locales['pl'] = { ['remove_object'] = 'usuń objekt', ['deposit_object'] = 'deponuj objekt', ['invite'] = 'zaproś', - ['dirty_money'] = 'brudne pieniądze: $%s', + ['dirty_money'] = 'brudne pieniądze: $%s', ['inventory'] = 'ekwipunek', ['amount'] = 'suma?', ['amount_invalid'] = 'nieprawidłowa suma', ['press_to_exit'] = 'wciśnij ~INPUT_CONTEXT~ aby wyjść z mieszkania', - ['rented_for'] = 'wynająłeś/aś mieszkanie za ~g~$%s~s~', - ['purchased_for'] = 'kupiłeś/aś mieszkanie za ~g~$%s~s~', - ['made_property'] = 'stworzyłeś/aś mieszkanie', ['not_enough'] = 'nie posiadasz wystarczająco pieniędzy', ['invalid_quantity'] = 'nieprawidłowa ilość', ['paid_rent'] = '~g~zapłaciłeś/aś~s~ za wynajem: ~g~$%s~s~', ['not_enough_in_property'] = 'nie ma wystarczająco ~r~tego przedmiotu~s~ w mieszkaniu!', ['player_cannot_hold'] = '~r~nie masz~s~ wystarczająco ~y~wolnego~s~ miejsca w ekwipunku!', -} \ No newline at end of file +} diff --git a/locales/sv.lua b/locales/sv.lua index 0eacaf54..bf3a6d07 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -4,14 +4,18 @@ Locales['sv'] = { ['free_prop'] = 'ledig fastighet', ['property'] = 'fastighet', ['enter'] = 'gå in', - ['leave'] = 'sälj', - ['buy'] = 'köp', - ['rent'] = 'hyr', - ['visit'] = 'besök', + ['move_out'] = 'flytta ut', + ['move_out_sold'] = 'sälj fastighet för %s SEK', + ['moved_out'] = 'du har flyttat ut och hyr inte fastigheten längre', + ['moved_out_sold'] = 'du har sålt fastigheten för ~g~%s SEK~s~', + ['buy'] = 'köp fastighet för %s SEK', + ['buy_for'] = 'du hyrde en fastighet för ~g~%s SEK~s~ / vecka, betalning sker automatiskt', + ['rent'] = 'hyr fastighet för %s SEK / vecka', + ['rent_for'] = 'du köpte en fastighet för ~g~%s SEK~s~', ['press_to_menu'] = 'tryck ~INPUT_CONTEXT~ för att komma åt menyn', - ['owned_properties'] = 'upptagna fastigheter', - ['available_properties'] = 'lediga fastigheter', - ['invite_player'] = 'bjud in granne', + ['owned_properties'] = 'ägda fastigheter', + ['available_properties'] = 'fastigheter till salu', + ['invite_player'] = 'bjud in spelare', ['you_invited'] = 'du bjöd in ~y~%s~s~ till din fastighet', ['player_clothes'] = 'Kläder', ['remove_cloth'] = 'ta bort klädstil', @@ -19,17 +23,14 @@ Locales['sv'] = { ['remove_object'] = 'ta ut objekt', ['deposit_object'] = 'lagra objekt', ['invite'] = 'bjud in', - ['dirty_money'] = 'smutsiga pengar: %s SEK', + ['dirty_money'] = 'smutsiga pengar: %s SEK', ['inventory'] = 'inventory', ['amount'] = 'summa?', ['amount_invalid'] = 'ogiltlig summa', ['press_to_exit'] = 'tryck ~INPUT_CONTEXT~ för att lämna fastigheten', - ['rented_for'] = 'du hyrde en fastighet för: ~g~%s SEK~s~', - ['purchased_for'] = 'du köpte en fastighet för: ~g~%s SEK~s~', - ['made_property'] = 'you have made a property', ['not_enough'] = 'du har inte tillräckligt med pengar!', ['invalid_quantity'] = 'ogiltlig mängd', ['paid_rent'] = 'du ~y~betalade~s~ din hyra: ~g~%s SEK~s~', ['not_enough_in_property'] = 'det finns ~r~inte~s~ tillräckligt av ~r~det objektet~s~ i fastigheten!', ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt med ~y~utrymme~s~ för att hålla det!', -} \ No newline at end of file +} diff --git a/server/main.lua b/server/main.lua index c4e3773f..1ef54c8d 100644 --- a/server/main.lua +++ b/server/main.lua @@ -20,7 +20,7 @@ function SetPropertyOwned(name, price, rented, owner) local xPlayer = ESX.GetPlayerFromIdentifier(owner) if xPlayer then - TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true) + TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true, rented) if rented then xPlayer.showNotification(_U('rented_for', ESX.Math.GroupDigits(price))) @@ -32,15 +32,29 @@ function SetPropertyOwned(name, price, rented, owner) end function RemoveOwnedProperty(name, owner) - MySQL.Async.execute('DELETE FROM owned_properties WHERE name = @name AND owner = @owner', { + MySQL.Async.fetchAll('SELECT id, rented, price FROM owned_properties WHERE name = @name AND owner = @owner', { ['@name'] = name, ['@owner'] = owner - }, function(rowsChanged) - local xPlayer = ESX.GetPlayerFromIdentifier(owner) + }, function(result) + if result[1] then + MySQL.Async.execute('DELETE FROM owned_properties WHERE id = @id', { + ['@id'] = result[1].id + }, function(rowsChanged) + local xPlayer = ESX.GetPlayerFromIdentifier(owner) - if xPlayer then - TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, false) - xPlayer.showNotification(_U('made_property')) + if xPlayer then + xPlayer.triggerEvent('esx_property:setPropertyOwned', name, false) + + if result[1].rented == 1 then + xPlayer.showNotification(_U('moved_out')) + else + local sellPrice = ESX.Math.Round(result[1].price / Config.SellModifier) + + xPlayer.showNotification(_U('moved_out_sold', ESX.Math.GroupDigits(sellPrice))) + xPlayer.addAccountMoney('bank', sellPrice) + end + end + end) end end) end @@ -152,7 +166,7 @@ RegisterServerEvent('esx_property:rentProperty') AddEventHandler('esx_property:rentProperty', function(propertyName) local xPlayer = ESX.GetPlayerFromId(source) local property = GetProperty(propertyName) - local rent = ESX.Math.Round(property.price / 200) + local rent = ESX.Math.Round(property.price / Config.RentModifier) SetPropertyOwned(propertyName, rent, true, xPlayer.identifier) end) @@ -296,16 +310,10 @@ end) ESX.RegisterServerCallback('esx_property:getOwnedProperties', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) - MySQL.Async.fetchAll('SELECT name FROM owned_properties WHERE owner = @owner', { + MySQL.Async.fetchAll('SELECT name, rented FROM owned_properties WHERE owner = @owner', { ['@owner'] = xPlayer.identifier }, function(result) - local properties = {} - - for i=1, #result, 1 do - table.insert(properties, result[i].name) - end - - cb(properties) + cb(result) end) end) From 108cad0a6db90f1dddaebe9eb1f6d2f2a9dbcf31 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 3 Feb 2020 13:28:25 +0100 Subject: [PATCH 87/99] Correct locale strings --- server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index 1ef54c8d..980850e8 100644 --- a/server/main.lua +++ b/server/main.lua @@ -23,9 +23,9 @@ function SetPropertyOwned(name, price, rented, owner) TriggerClientEvent('esx_property:setPropertyOwned', xPlayer.source, name, true, rented) if rented then - xPlayer.showNotification(_U('rented_for', ESX.Math.GroupDigits(price))) + xPlayer.showNotification(_U('rent_for', ESX.Math.GroupDigits(price))) else - xPlayer.showNotification(_U('purchased_for', ESX.Math.GroupDigits(price))) + xPlayer.showNotification(_U('buy_for', ESX.Math.GroupDigits(price))) end end end) From 65abc5b490c56ab62052d715ebbdc8e102bb0790 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 4 Feb 2020 20:58:03 +0100 Subject: [PATCH 88/99] Reverted accedental dev code --- client/main.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/main.lua b/client/main.lua index 29b19aa1..9420831a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -778,8 +778,6 @@ AddEventHandler('esx_property:hasExitedMarker', function(name, part) CurrentAction = nil end) -local index = 0 -RegisterCommand('s', function(a, b, c) -- Enter / Exit marker events & Draw markers Citizen.CreateThread(function() while true do @@ -826,7 +824,7 @@ Citizen.CreateThread(function() end -- Room menu - if property.roomMenu then + if property.roomMenu and hasChest and not property.disabled then local distance = GetDistanceBetweenCoords(coords, property.roomMenu.x, property.roomMenu.y, property.roomMenu.z, true) if distance < Config.DrawDistance then @@ -867,7 +865,7 @@ Citizen.CreateThread(function() Citizen.Wait(0) if CurrentAction then - --ESX.ShowHelpNotification(CurrentActionMsg) + ESX.ShowHelpNotification(CurrentActionMsg) if IsControlJustReleased(0, 38) then if CurrentAction == 'property_menu' then From 29cbe642987623683a8fd760ba5f8d6ed8f16981 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 22 Mar 2020 11:09:43 +0100 Subject: [PATCH 89/99] Fixed paying rent with latest ESX and added evict --- locales/br.lua | 3 +- locales/de.lua | 5 ++-- locales/en.lua | 3 +- locales/es.lua | 3 +- locales/fi.lua | 3 +- locales/fr.lua | 3 +- locales/pl.lua | 3 +- locales/sv.lua | 3 +- server/main.lua | 80 ++++++++++++++++++++++++++++++++----------------- 9 files changed, 68 insertions(+), 38 deletions(-) diff --git a/locales/br.lua b/locales/br.lua index 98d5e412..0ff61d99 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -30,7 +30,8 @@ Locales['br'] = { ['press_to_exit'] = 'Pressione ~INPUT_CONTEXT~ para sair da propriedade', ['not_enough'] = 'Você não tem dinheiro suficiente', ['invalid_quantity'] = 'Quantidade inválida', - ['paid_rent'] = 'Você ~g~pagou~s~ seu aluguel: ~g~$%s~s~', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', ['not_enough_in_property'] = 'não há o suficiente de que esse item esteja na propriedade!', ['player_cannot_hold'] = 'você não tem espaço suficiente em seu inventário!', } diff --git a/locales/de.lua b/locales/de.lua index 9373025a..c50ebd84 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -28,11 +28,10 @@ Locales['de'] = { ['amount'] = 'Anzahlt?', ['amount_invalid'] = 'Ungültiger Wert', ['press_to_exit'] = 'Drücke ~INPUT_CONTEXT~ um die Immobilie zu verlassen', - ['rent_for'] = 'Du hast eine Immobilie gemietet ~g~$%s~s~', - ['purchased_for'] = 'Du hast eine Immobilie gekauft ~g~$%s~s~', ['not_enough'] = 'du hast nicht genug Geld', ['invalid_quantity'] = 'Ungültiger Betrag', - ['paid_rent'] = 'du ~g~bezahlst~s~ deine Miete: ~g~$%s~s~', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', } diff --git a/locales/en.lua b/locales/en.lua index 75d34bda..61296a87 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -30,7 +30,8 @@ Locales['en'] = { ['press_to_exit'] = 'press ~INPUT_CONTEXT~ to exit the property', ['not_enough'] = 'you do not have enough money', ['invalid_quantity'] = 'invalid quantity', - ['paid_rent'] = 'you ~g~paid~s~ your rent: ~g~$%s~s~', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', } diff --git a/locales/es.lua b/locales/es.lua index 387ff6c0..98966c72 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -30,7 +30,8 @@ Locales['es'] = { ['press_to_exit'] = 'Presione ~INPUT_CONTEXT~ para salir de la propiedad', ['not_enough'] = 'n\'No tiene suficiente d\'dinero', ['invalid_quantity'] = 'Cantidad inválida', - ['paid_rent'] = 'Has ~g~pagado~s~ por el alquiler: ~g~€%s~s~', + ['paid_rent'] = 'you paid your rent at ~g~€%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~€%s~s~', ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', } diff --git a/locales/fi.lua b/locales/fi.lua index ffebd828..e52417be 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -30,7 +30,8 @@ Locales['fi'] = { ['press_to_exit'] = 'paina ~INPUT_CONTEXT~ poistuaksesi kiinteistöstä', ['not_enough'] = 'sinulla ei ole tarpeeksi rahaa', ['invalid_quantity'] = 'virheellinen määrä', - ['paid_rent'] = 'sinä ~g~maksoit~s~ vuokraasi: ~g~$%s~s~', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', ['not_enough_in_property'] = 'täällä ei ole enempää ~r~tätä itemiä~s~ tässä kiinteistössä!', ['player_cannot_hold'] = 'sinulla ~r~ei ole~s~ tarpeeksi ~y~vapaata tilaa~s~ repussasi!', } diff --git a/locales/fr.lua b/locales/fr.lua index ad663e14..ed734e23 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -30,7 +30,8 @@ Locales['fr'] = { ['press_to_exit'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir de la propriété', ['not_enough'] = 'vous n\'avez pas assez d\'argent', ['invalid_quantity'] = 'quantité invalide', - ['paid_rent'] = 'vous avez ~g~payé~s~ votre loyer: ~g~$%s~s~', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', ['not_enough_in_property'] = 'il n\'a pas assez de ~r~cet objet~s~ dans votre coffre!', ['player_cannot_hold'] = 'vous n\'avez pas assez ~y~de place~s~ dans votre inventaire!', } diff --git a/locales/pl.lua b/locales/pl.lua index 985fcb2f..eb9428cb 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -30,7 +30,8 @@ Locales['pl'] = { ['press_to_exit'] = 'wciśnij ~INPUT_CONTEXT~ aby wyjść z mieszkania', ['not_enough'] = 'nie posiadasz wystarczająco pieniędzy', ['invalid_quantity'] = 'nieprawidłowa ilość', - ['paid_rent'] = '~g~zapłaciłeś/aś~s~ za wynajem: ~g~$%s~s~', + ['paid_rent'] = 'you paid your rent at ~g~$%s~s~ for ~y~%s~s~', + ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~$%s~s~', ['not_enough_in_property'] = 'nie ma wystarczająco ~r~tego przedmiotu~s~ w mieszkaniu!', ['player_cannot_hold'] = '~r~nie masz~s~ wystarczająco ~y~wolnego~s~ miejsca w ekwipunku!', } diff --git a/locales/sv.lua b/locales/sv.lua index bf3a6d07..84ee01a2 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -30,7 +30,8 @@ Locales['sv'] = { ['press_to_exit'] = 'tryck ~INPUT_CONTEXT~ för att lämna fastigheten', ['not_enough'] = 'du har inte tillräckligt med pengar!', ['invalid_quantity'] = 'ogiltlig mängd', - ['paid_rent'] = 'du ~y~betalade~s~ din hyra: ~g~%s SEK~s~', + ['paid_rent'] = 'du betalade din hyra på ~g~%s SEK~s~ för ~y~%s~s~', + ['paid_rent_evicted'] = 'du blev ~o~vräkt~s~ från ~y~%s~s~ för att du inte har råd för att betala hyran på ~g~%s SEK~s~', ['not_enough_in_property'] = 'det finns ~r~inte~s~ tillräckligt av ~r~det objektet~s~ i fastigheten!', ['player_cannot_hold'] = 'du har ~r~inte~s~ tillräckligt med ~y~utrymme~s~ för att hålla det!', } diff --git a/server/main.lua b/server/main.lua index 980850e8..c8cd8cff 100644 --- a/server/main.lua +++ b/server/main.lua @@ -31,7 +31,7 @@ function SetPropertyOwned(name, price, rented, owner) end) end -function RemoveOwnedProperty(name, owner) +function RemoveOwnedProperty(name, owner, noPay) MySQL.Async.fetchAll('SELECT id, rented, price FROM owned_properties WHERE name = @name AND owner = @owner', { ['@name'] = name, ['@owner'] = owner @@ -45,13 +45,15 @@ function RemoveOwnedProperty(name, owner) if xPlayer then xPlayer.triggerEvent('esx_property:setPropertyOwned', name, false) - if result[1].rented == 1 then - xPlayer.showNotification(_U('moved_out')) - else - local sellPrice = ESX.Math.Round(result[1].price / Config.SellModifier) + if not noPay then + if result[1].rented == 1 then + xPlayer.showNotification(_U('moved_out')) + else + local sellPrice = ESX.Math.Round(result[1].price / Config.SellModifier) - xPlayer.showNotification(_U('moved_out_sold', ESX.Math.GroupDigits(sellPrice))) - xPlayer.addAccountMoney('bank', sellPrice) + xPlayer.showNotification(_U('moved_out_sold', ESX.Math.GroupDigits(sellPrice))) + xPlayer.addAccountMoney('bank', sellPrice) + end end end end) @@ -60,6 +62,8 @@ function RemoveOwnedProperty(name, owner) end MySQL.ready(function() + Citizen.Wait(1500) + MySQL.Async.fetchAll('SELECT * FROM properties', {}, function(properties) for i=1, #properties, 1 do @@ -162,7 +166,7 @@ AddEventHandler('esx_property:removeOwnedProperty', function(name, owner) RemoveOwnedProperty(name, owner) end) -RegisterServerEvent('esx_property:rentProperty') +RegisterNetEvent('esx_property:rentProperty') AddEventHandler('esx_property:rentProperty', function(propertyName) local xPlayer = ESX.GetPlayerFromId(source) local property = GetProperty(propertyName) @@ -171,7 +175,7 @@ AddEventHandler('esx_property:rentProperty', function(propertyName) SetPropertyOwned(propertyName, rent, true, xPlayer.identifier) end) -RegisterServerEvent('esx_property:buyProperty') +RegisterNetEvent('esx_property:buyProperty') AddEventHandler('esx_property:buyProperty', function(propertyName) local xPlayer = ESX.GetPlayerFromId(source) local property = GetProperty(propertyName) @@ -184,7 +188,7 @@ AddEventHandler('esx_property:buyProperty', function(propertyName) end end) -RegisterServerEvent('esx_property:removeOwnedProperty') +RegisterNetEvent('esx_property:removeOwnedProperty') AddEventHandler('esx_property:removeOwnedProperty', function(propertyName) local xPlayer = ESX.GetPlayerFromId(source) RemoveOwnedProperty(propertyName, xPlayer.identifier) @@ -194,7 +198,7 @@ AddEventHandler('esx_property:removeOwnedPropertyIdentifier', function(propertyN RemoveOwnedProperty(propertyName, identifier) end) -RegisterServerEvent('esx_property:saveLastProperty') +RegisterNetEvent('esx_property:saveLastProperty') AddEventHandler('esx_property:saveLastProperty', function(property) local xPlayer = ESX.GetPlayerFromId(source) @@ -204,7 +208,7 @@ AddEventHandler('esx_property:saveLastProperty', function(property) }) end) -RegisterServerEvent('esx_property:deleteLastProperty') +RegisterNetEvent('esx_property:deleteLastProperty') AddEventHandler('esx_property:deleteLastProperty', function() local xPlayer = ESX.GetPlayerFromId(source) @@ -213,7 +217,7 @@ AddEventHandler('esx_property:deleteLastProperty', function() }) end) -RegisterServerEvent('esx_property:getItem') +RegisterNetEvent('esx_property:getItem') AddEventHandler('esx_property:getItem', function(owner, type, item, count) local xPlayer = ESX.GetPlayerFromId(source) local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) @@ -262,7 +266,7 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, count) end end) -RegisterServerEvent('esx_property:putItem') +RegisterNetEvent('esx_property:putItem') AddEventHandler('esx_property:putItem', function(owner, type, item, count) local xPlayer = ESX.GetPlayerFromId(source) local xPlayerOwner = ESX.GetPlayerFromIdentifier(owner) @@ -389,7 +393,7 @@ ESX.RegisterServerCallback('esx_property:getPlayerOutfit', function(source, cb, end) end) -RegisterServerEvent('esx_property:removeOutfit') +RegisterNetEvent('esx_property:removeOutfit') AddEventHandler('esx_property:removeOutfit', function(label) local xPlayer = ESX.GetPlayerFromId(source) @@ -401,28 +405,48 @@ AddEventHandler('esx_property:removeOutfit', function(label) end) end) -function PayRent(d, h, m) +function payRent(d, h, m) local tasks, timeStart = {}, os.clock() print('[esx_property] [^2INFO^7] Paying rent cron job started') MySQL.Async.fetchAll('SELECT * FROM owned_properties WHERE rented = 1', {}, function(result) - for i=1, #result, 1 do + for k,v in ipairs(result) do table.insert(tasks, function(cb) - local xPlayer = ESX.GetPlayerFromIdentifier(result[i].owner) + local xPlayer = ESX.GetPlayerFromIdentifier(v.owner) - -- message player if connected if xPlayer then - xPlayer.removeAccountMoney('bank', result[i].price) - xPlayer.showNotification(_U('paid_rent', ESX.Math.GroupDigits(result[i].price))) - else -- pay rent either way - MySQL.Sync.execute('UPDATE users SET bank = bank - @bank WHERE identifier = @identifier', { - ['@bank'] = result[i].price, - ['@identifier'] = result[i].owner - }) + if xPlayer.getAccount('bank').money >= v.price then + xPlayer.removeAccountMoney('bank', v.price) + xPlayer.showNotification(_U('paid_rent', ESX.Math.GroupDigits(v.price), GetProperty(v.name).label)) + else + xPlayer.showNotification(_U('paid_rent_evicted', GetProperty(v.name).label, ESX.Math.GroupDigits(v.price))) + RemoveOwnedProperty(v.name, v.owner, true) + end + else + MySQL.Async.fetchScalar('SELECT accounts FROM users WHERE identifier = @identifier', { + ['@identifier'] = v.owner + }, function(accounts) + if accounts then + local playerAccounts = json.decode(accounts) + + if playerAccounts and playerAccounts.bank then + if playerAccounts.bank >= v.price then + playerAccounts.bank = playerAccounts.bank - v.price + + MySQL.Async.execute('UPDATE users SET accounts = @accounts WHERE identifier = @identifier', { + ['@identifier'] = v.owner, + ['@accounts'] = json.encode(playerAccounts) + }) + else + RemoveOwnedProperty(v.name, v.owner, true) + end + end + end + end) end TriggerEvent('esx_addonaccount:getSharedAccount', 'society_realestateagent', function(account) - account.addMoney(result[i].price) + account.addMoney(v.price) end) cb() @@ -436,4 +460,4 @@ function PayRent(d, h, m) end) end -TriggerEvent('cron:runAt', 22, 0, PayRent) +TriggerEvent('cron:runAt', 22, 0, payRent) From d96cf29e5a80fe265dab9acf88dcad42980d534f Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Tue, 14 Apr 2020 16:51:46 +0200 Subject: [PATCH 90/99] Latest ESX code --- client/main.lua | 2 +- esx_property.sql | 2 +- localization/de_esx_property.sql | 2 +- localization/en_esx_property.sql | 2 +- localization/fi_esx_property.sql | 2 +- localization/pl_esx_property.sql | 2 +- offices.sql | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/main.lua b/client/main.lua index 9420831a..715611bf 100644 --- a/client/main.lua +++ b/client/main.lua @@ -669,7 +669,7 @@ AddEventHandler('instance:loaded', function() end) end) -AddEventHandler('playerSpawned', function() +AddEventHandler('esx:onPlayerSpawn', function() if firstSpawn then Citizen.CreateThread(function() while not ESX.IsPlayerLoaded() do diff --git a/esx_property.sql b/esx_property.sql index a2e2439f..bc39b25d 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; ALTER TABLE `users` ADD COLUMN `last_property` VARCHAR(255) NULL diff --git a/localization/de_esx_property.sql b/localization/de_esx_property.sql index 900472cd..ea2748d4 100644 --- a/localization/de_esx_property.sql +++ b/localization/de_esx_property.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; ALTER TABLE `users` ADD COLUMN `last_property` VARCHAR(255) NULL diff --git a/localization/en_esx_property.sql b/localization/en_esx_property.sql index f01bb700..40b7859f 100644 --- a/localization/en_esx_property.sql +++ b/localization/en_esx_property.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; ALTER TABLE `users` ADD COLUMN `last_property` VARCHAR(255) NULL diff --git a/localization/fi_esx_property.sql b/localization/fi_esx_property.sql index 42f670a3..7bf0e492 100644 --- a/localization/fi_esx_property.sql +++ b/localization/fi_esx_property.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; ALTER TABLE `users` ADD COLUMN `last_property` VARCHAR(255) NULL diff --git a/localization/pl_esx_property.sql b/localization/pl_esx_property.sql index 4ec2f594..e41e36a4 100644 --- a/localization/pl_esx_property.sql +++ b/localization/pl_esx_property.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; ALTER TABLE `users` ADD COLUMN `last_property` VARCHAR(255) NULL diff --git a/offices.sql b/offices.sql index be9544eb..3c7ec94f 100644 --- a/offices.sql +++ b/offices.sql @@ -1,4 +1,4 @@ -USE `essentialmode`; +USE `es_extended`; INSERT INTO `properties` VALUES (43, 'MazeBankBuilding', 'Maze Bank Building', '{\"x\":-79.18,\"y\":-795.92,\"z\":43.35}', NULL, NULL, '{\"x\":-72.50,\"y\":-786.92,\"z\":43.40}', '[]', NULL, 0, 0, 1, NULL, 0), From b7e439ccad5fb4692da6f1bade7aedfbb96381dc Mon Sep 17 00:00:00 2001 From: Vincent <41262675+Virrefirre@users.noreply.github.com> Date: Sun, 19 Jul 2020 13:03:54 +0200 Subject: [PATCH 91/99] Update Swedish Language (#102) Update Swedish Language --- locales/sv.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locales/sv.lua b/locales/sv.lua index 84ee01a2..aa609bb1 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -9,9 +9,9 @@ Locales['sv'] = { ['moved_out'] = 'du har flyttat ut och hyr inte fastigheten längre', ['moved_out_sold'] = 'du har sålt fastigheten för ~g~%s SEK~s~', ['buy'] = 'köp fastighet för %s SEK', - ['buy_for'] = 'du hyrde en fastighet för ~g~%s SEK~s~ / vecka, betalning sker automatiskt', + ['buy_for'] = 'du köpte en fastighet för ~g~%s SEK~s~', ['rent'] = 'hyr fastighet för %s SEK / vecka', - ['rent_for'] = 'du köpte en fastighet för ~g~%s SEK~s~', + ['rent_for'] = 'du hyrde en fastighet för ~g~%s SEK~s~ / vecka, betalning sker automatiskt', ['press_to_menu'] = 'tryck ~INPUT_CONTEXT~ för att komma åt menyn', ['owned_properties'] = 'ägda fastigheter', ['available_properties'] = 'fastigheter till salu', From 07250e25b0e4de65b1b9844036d59dd4b00a8476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulkadir=20AKTA=C5=9E?= Date: Sun, 19 Jul 2020 14:05:52 +0300 Subject: [PATCH 92/99] added tr lang. from Abdulkadir (#103) * added tr version from Abdulkadir * added tr lang. --- fxmanifest.lua | 2 ++ locales/tr.lua | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 locales/tr.lua diff --git a/fxmanifest.lua b/fxmanifest.lua index 1c060718..e97611c2 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -10,6 +10,7 @@ server_scripts { '@async/async.lua', '@mysql-async/lib/MySQL.lua', '@es_extended/locale.lua', + 'locales/tr.lua', 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', @@ -24,6 +25,7 @@ server_scripts { client_scripts { '@es_extended/locale.lua', + 'locales/tr.lua', 'locales/de.lua', 'locales/br.lua', 'locales/en.lua', diff --git a/locales/tr.lua b/locales/tr.lua new file mode 100644 index 00000000..2651cc9b --- /dev/null +++ b/locales/tr.lua @@ -0,0 +1,35 @@ +Locales['tr'] = { + ['have_withdrawn'] = 'Depodan çıkarıldı ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'Depoya eklendi ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'Satılık Ev', + ['property'] = 'Ev', + ['enter'] = 'Gir', + ['leave'] = 'Sat', + ['buy'] = 'Satın Al', + ['rent'] = 'Kirala', + ['visit'] = 'Ziyaret Et', + ['press_to_menu'] = '~INPUT_CONTEXT~ tuşuna basarak menüyü açabilirsin.', + ['owned_properties'] = 'Sahip olunan evler', + ['available_properties'] = 'Kullanılabilir evler', + ['invite_player'] = 'Oyuncuyu Davet Et', + ['you_invited'] = '~y~%s~s~ kişisini evine davet ettin.', + ['player_clothes'] = 'Kıyafetler', + ['remove_cloth'] = 'Kıyafetleri Çıkar', + ['removed_cloth'] = 'Kıyafeti çöpe attınız.', + ['remove_object'] = 'Öğeyi çöpe at', + ['deposit_object'] = 'Öğeyi depoya ekle', + ['invite'] = 'Davet', + ['dirty_money'] = 'Kirli Para: $%s', + ['inventory'] = 'Envanter', + ['amount'] = 'adet?', + ['amount_invalid'] = 'Geçersiz adet.', + ['press_to_exit'] = '~INPUT_CONTEXT~ tuşuna basarak evinizden çıkabilirsiniz.', + ['rented_for'] = '~g~$%s~s~ ücret karşılığında evi kiraladın.', + ['purchased_for'] = '~g~$%s~s~ ücret karşılığında evi satın aldın.', + ['made_property'] = 'Sahip olduğun evi sattın.', + ['not_enough'] = 'Yeterli paran yok.', + ['invalid_quantity'] = 'Geçersiz miktar.', + ['paid_rent'] = 'Kira ücreti olarak ~g~$%s~s~ için ~g~paid~s~ ödedin.', + ['not_enough_in_property'] = 'Bu eşyadan evin içerisinde yeteri kadar bulunmuyor.', + ['player_cannot_hold'] = 'Envanterinde yeterli boş alan yok.', +} From 5b7e926fcc0a6bb27c701131710f3d76cde44574 Mon Sep 17 00:00:00 2001 From: Jougito - Kheros Date: Sun, 19 Jul 2020 13:06:20 +0200 Subject: [PATCH 93/99] Spanish translation implemented (#118) * Create es_esx_property.sql * Finished Spanish translation --- locales/es.lua | 40 +++++++------- localization/es_esx_property.sql | 94 ++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 20 deletions(-) create mode 100644 localization/es_esx_property.sql diff --git a/locales/es.lua b/locales/es.lua index 98966c72..0ff5d49c 100644 --- a/locales/es.lua +++ b/locales/es.lua @@ -1,37 +1,37 @@ Locales['es'] = { - ['have_withdrawn'] = 'you have withdrawn ~y~x%s~s~ ~b~%s~s~', - ['have_deposited'] = 'you have deposited ~y~x%s~s~ ~b~%s~s~', + ['have_withdrawn'] = 'Has sacado ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'Has depositado ~y~x%s~s~ ~b~%s~s~', ['free_prop'] = 'Propiedad libre', ['property'] = 'Propiedad', ['enter'] = 'Entrar', - ['move_out'] = 'move out from property', - ['move_out_sold'] = 'sell property for €%s', - ['moved_out'] = 'you moved out and do no longer rent the property.', - ['moved_out_sold'] = 'you have sold the property for ~g~€%s~s~', - ['buy'] = 'buy property for €%s', - ['buy_for'] = 'has comprado una propiedad por ~g~€%s~s~', - ['rent'] = 'rent property for €%s / week', - ['rent_for'] = 'has alquilado una propiedad por ~g~€%s~s~', - ['press_to_menu'] = 'Presionar ~INPUT_CONTEXT~ para acceder al menú', + ['move_out'] = 'Mudarse de propiedad', + ['move_out_sold'] = 'Vender propiedad por %s$', + ['moved_out'] = 'Te has mudado y no puedes alquilar esa propiedad', + ['moved_out_sold'] = 'Has vendido la propiedad por ~g~%s$~s~', + ['buy'] = 'Comprar propiedad por %s$', + ['buy_for'] = 'Has comprado una propiedad por ~g~%s$~s~', + ['rent'] = 'Alquilar propiedad por %s$ / semana', + ['rent_for'] = 'Has alquilado una propiedad por ~g~%s$~s~', + ['press_to_menu'] = 'Pulsa ~INPUT_CONTEXT~ para acceder al menú', ['owned_properties'] = 'Propiedad adquirida', ['available_properties'] = 'Propiedades disponibles', ['invite_player'] = 'Invitar a un jugador', ['you_invited'] = 'Has invitado a %s', ['player_clothes'] = 'Ropa', - ['remove_cloth'] = 'remove clothing', - ['removed_cloth'] = 'the outfit has been removed from your wardrobe!', + ['remove_cloth'] = 'Eliminar ropa', + ['removed_cloth'] = '¡El conjunto ha sido eliminado del armario!', ['remove_object'] = 'Retirar objeto', ['deposit_object'] = 'Depositar objeto', ['invite'] = 'Invitar', - ['dirty_money'] = 'Dinero sucio: €%s', + ['dirty_money'] = 'Dinero sucio: %s$', ['inventory'] = 'Inventario', ['amount'] = '¿Cantidad?', ['amount_invalid'] = 'Cantidad inválida', - ['press_to_exit'] = 'Presione ~INPUT_CONTEXT~ para salir de la propiedad', - ['not_enough'] = 'n\'No tiene suficiente d\'dinero', + ['press_to_exit'] = 'Pulsa ~INPUT_CONTEXT~ para salir de la propiedad', + ['not_enough'] = 'No tienes suficiente dinero', ['invalid_quantity'] = 'Cantidad inválida', - ['paid_rent'] = 'you paid your rent at ~g~€%s~s~ for ~y~%s~s~', - ['paid_rent_evicted'] = 'you have been ~o~evicted~s~ from ~y~%s~s~ for not affording rent at ~g~€%s~s~', - ['not_enough_in_property'] = 'there\'s not enough of ~r~that item~s~ in the property!', - ['player_cannot_hold'] = 'you do ~r~not~s~ have enough ~y~free space~s~ in your inventory!', + ['paid_rent'] = 'Pagaste tu alquiler de ~g~%s$~s~ en ~y~%s~s~', + ['paid_rent_evicted'] = 'Has sido ~o~desahuciado~s~ de ~y~%s~s~ por no pagar el alquiler de ~g~%s$~s~', + ['not_enough_in_property'] = '¡No hay suficiente cantidad de ~r~ese objeto~s~ en la propiedad!', + ['player_cannot_hold'] = '¡~r~No tienes~s~ suficiente ~y~espacio libre~s~ en tu inventario!', } diff --git a/localization/es_esx_property.sql b/localization/es_esx_property.sql new file mode 100644 index 00000000..910ce1e5 --- /dev/null +++ b/localization/es_esx_property.sql @@ -0,0 +1,94 @@ +USE `es_extended`; + +ALTER TABLE `users` + ADD COLUMN `last_property` VARCHAR(255) NULL +; + +INSERT INTO `addon_account` (name, label, shared) VALUES + ('property_black_money','Propiedad de venta de dinero',0) +; + +INSERT INTO `addon_inventory` (name, label, shared) VALUES + ('property','Propiedad',0) +; + +INSERT INTO `datastore` (name, label, shared) VALUES + ('property','Propiedad',0) +; + +CREATE TABLE `owned_properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `price` double NOT NULL, + `rented` int(11) NOT NULL, + `owner` varchar(60) NOT NULL, + + PRIMARY KEY (`id`) +); + +CREATE TABLE `properties` ( + + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `entering` varchar(255) DEFAULT NULL, + `exit` varchar(255) DEFAULT NULL, + `inside` varchar(255) DEFAULT NULL, + `outside` varchar(255) DEFAULT NULL, + `ipls` varchar(255) DEFAULT '[]', + `gateway` varchar(255) DEFAULT NULL, + `is_single` int(11) DEFAULT NULL, + `is_room` int(11) DEFAULT NULL, + `is_gateway` int(11) DEFAULT NULL, + `room_menu` varchar(255) DEFAULT NULL, + `price` int(11) NOT NULL, + + PRIMARY KEY (`id`) +); + +INSERT INTO `properties` VALUES + (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), + (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), + (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), + (6,'HillcrestAvenue2862','2862 Hillcrest Avenue','{\"y\":596.58,\"z\":142.641,\"x\":-686.554}','{\"y\":591.988,\"z\":144.392,\"x\":-681.728}','{\"y\":590.608,\"z\":144.392,\"x\":-680.124}','{\"y\":599.019,\"z\":142.059,\"x\":-689.492}','[]',NULL,1,1,0,'{\"x\":-680.46,\"y\":588.6,\"z\":136.769}',1500000), + (7,'LowEndApartment','Basic apartment','{\"y\":-1078.735,\"z\":28.4031,\"x\":292.528}','{\"y\":-1007.152,\"z\":-102.002,\"x\":265.845}','{\"y\":-1002.802,\"z\":-100.008,\"x\":265.307}','{\"y\":-1078.669,\"z\":28.401,\"x\":296.738}','[]',NULL,1,1,0,'{\"x\":265.916,\"y\":-999.38,\"z\":-100.008}',562500), + (8,'MadWayneThunder','2113 Mad Wayne Thunder','{\"y\":454.955,\"z\":96.462,\"x\":-1294.433}','{"x":-1289.917,"y":449.541,"z":96.902}','{\"y\":446.322,\"z\":96.899,\"x\":-1289.642}','{\"y\":455.453,\"z\":96.517,\"x\":-1298.851}','[]',NULL,1,1,0,'{\"x\":-1287.306,\"y\":455.901,\"z\":89.294}',1500000), + (9,'HillcrestAvenue2874','2874 Hillcrest Avenue','{\"x\":-853.346,\"y\":696.678,\"z\":147.782}','{\"y\":690.875,\"z\":151.86,\"x\":-859.961}','{\"y\":688.361,\"z\":151.857,\"x\":-859.395}','{\"y\":701.628,\"z\":147.773,\"x\":-855.007}','[]',NULL,1,1,0,'{\"x\":-858.543,\"y\":697.514,\"z\":144.253}',1500000), + (10,'HillcrestAvenue2868','2868 Hillcrest Avenue','{\"y\":620.494,\"z\":141.588,\"x\":-752.82}','{\"y\":618.62,\"z\":143.153,\"x\":-759.317}','{\"y\":617.629,\"z\":143.153,\"x\":-760.789}','{\"y\":621.281,\"z\":141.254,\"x\":-750.919}','[]',NULL,1,1,0,'{\"x\":-762.504,\"y\":618.992,\"z\":135.53}',1500000), + (11,'TinselTowersApt12','Tinsel Towers, Apt 42','{\"y\":37.025,\"z\":42.58,\"x\":-618.299}','{\"y\":58.898,\"z\":97.2,\"x\":-603.301}','{\"y\":58.941,\"z\":97.2,\"x\":-608.741}','{\"y\":30.603,\"z\":42.524,\"x\":-620.017}','[]',NULL,1,1,0,'{\"x\":-622.173,\"y\":54.585,\"z\":96.599}',1700000), + (12,'MiltonDrive','Milton Drive','{\"x\":-775.17,\"y\":312.01,\"z\":84.658}',NULL,NULL,'{\"x\":-775.346,\"y\":306.776,\"z\":84.7}','[]',NULL,0,0,1,NULL,0), + (13,'Modern1Apartment','Modern Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_01_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.661,\"y\":327.672,\"z\":210.396}',1300000), + (14,'Modern2Apartment','Modern Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_01_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.735,\"y\":326.757,\"z\":186.313}',1300000), + (15,'Modern3Apartment','Modern Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_01_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.386,\"y\":330.782,\"z\":195.08}',1300000), + (16,'Mody1Apartment','Mody Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_02_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.615,\"y\":327.878,\"z\":210.396}',1300000), + (17,'Mody2Apartment','Mody Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_02_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.297,\"y\":327.092,\"z\":186.313}',1300000), + (18,'Mody3Apartment','Mody Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_02_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.303,\"y\":330.932,\"z\":195.085}',1300000), + (19,'Vibrant1Apartment','Vibrant Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_03_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.885,\"y\":327.641,\"z\":210.396}',1300000), + (20,'Vibrant2Apartment','Vibrant Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_03_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.607,\"y\":327.344,\"z\":186.313}',1300000), + (21,'Vibrant3Apartment','Vibrant Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_03_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.525,\"y\":330.851,\"z\":195.085}',1300000), + (22,'Sharp1Apartment','Sharp Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_04_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.527,\"y\":327.89,\"z\":210.396}',1300000), + (23,'Sharp2Apartment','Sharp Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_04_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.642,\"y\":326.497,\"z\":186.313}',1300000), + (24,'Sharp3Apartment','Sharp Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_04_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.503,\"y\":331.318,\"z\":195.085}',1300000), + (25,'Monochrome1Apartment','Monochrome Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_05_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.289,\"y\":328.086,\"z\":210.396}',1300000), + (26,'Monochrome2Apartment','Monochrome Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_05_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.692,\"y\":326.762,\"z\":186.313}',1300000), + (27,'Monochrome3Apartment','Monochrome Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_05_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.094,\"y\":330.976,\"z\":195.085}',1300000), + (28,'Seductive1Apartment','Seductive Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_06_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.263,\"y\":328.104,\"z\":210.396}',1300000), + (29,'Seductive2Apartment','Seductive Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_06_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.655,\"y\":326.611,\"z\":186.313}',1300000), + (30,'Seductive3Apartment','Seductive Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_06_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.3,\"y\":331.414,\"z\":195.085}',1300000), + (31,'Regal1Apartment','Regal Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_07_a\"]','MiltonDrive',0,1,0,'{\"x\":-765.956,\"y\":328.257,\"z\":210.396}',1300000), + (32,'Regal2Apartment','Regal Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_07_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.545,\"y\":326.659,\"z\":186.313}',1300000), + (33,'Regal3Apartment','Regal Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_07_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.087,\"y\":331.429,\"z\":195.123}',1300000), + (34,'Aqua1Apartment','Aqua Apartment 1',NULL,'{\"x\":-784.194,\"y\":323.636,\"z\":210.997}','{\"x\":-779.751,\"y\":323.385,\"z\":210.997}',NULL,'[\"apa_v_mp_h_08_a\"]','MiltonDrive',0,1,0,'{\"x\":-766.187,\"y\":328.47,\"z\":210.396}',1300000), + (35,'Aqua2Apartment','Aqua Apartment 2',NULL,'{\"x\":-786.8663,\"y\":315.764,\"z\":186.913}','{\"x\":-781.808,\"y\":315.866,\"z\":186.913}',NULL,'[\"apa_v_mp_h_08_c\"]','MiltonDrive',0,1,0,'{\"x\":-795.658,\"y\":326.563,\"z\":186.313}',1300000), + (36,'Aqua3Apartment','Aqua Apartment 3',NULL,'{\"x\":-774.012,\"y\":342.042,\"z\":195.686}','{\"x\":-779.057,\"y\":342.063,\"z\":195.686}',NULL,'[\"apa_v_mp_h_08_b\"]','MiltonDrive',0,1,0,'{\"x\":-765.287,\"y\":331.084,\"z\":195.086}',1300000), + (37,'IntegrityWay','4 Integrity Way','{\"x\":-47.804,\"y\":-585.867,\"z\":36.956}',NULL,NULL,'{\"x\":-54.178,\"y\":-583.762,\"z\":35.798}','[]',NULL,0,0,1,NULL,0), + (38,'IntegrityWay28','4 Integrity Way - Apt 28',NULL,'{\"x\":-31.409,\"y\":-594.927,\"z\":79.03}','{\"x\":-26.098,\"y\":-596.909,\"z\":79.03}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-11.923,\"y\":-597.083,\"z\":78.43}',1700000), + (39,'IntegrityWay30','4 Integrity Way - Apt 30',NULL,'{\"x\":-17.702,\"y\":-588.524,\"z\":89.114}','{\"x\":-16.21,\"y\":-582.569,\"z\":89.114}',NULL,'[]','IntegrityWay',0,1,0,'{\"x\":-26.327,\"y\":-588.384,\"z\":89.123}',1700000), + (40,'DellPerroHeights','Dell Perro Heights','{\"x\":-1447.06,\"y\":-538.28,\"z\":33.74}',NULL,NULL,'{\"x\":-1440.022,\"y\":-548.696,\"z\":33.74}','[]',NULL,0,0,1,NULL,0), + (41,'DellPerroHeightst4','Dell Perro Heights - Apt 28',NULL,'{\"x\":-1452.125,\"y\":-540.591,\"z\":73.044}','{\"x\":-1455.435,\"y\":-535.79,\"z\":73.044}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1467.058,\"y\":-527.571,\"z\":72.443}',1700000), + (42,'DellPerroHeightst7','Dell Perro Heights - Apt 30',NULL,'{\"x\":-1451.562,\"y\":-523.535,\"z\":55.928}','{\"x\":-1456.02,\"y\":-519.209,\"z\":55.929}',NULL,'[]','DellPerroHeights',0,1,0,'{\"x\":-1457.026,\"y\":-530.219,\"z\":55.937}',1700000) +; + From 76e04fb9c32df4deac92d12fe9e06618d2ad989d Mon Sep 17 00:00:00 2001 From: Matias Salas <42161973+Dislaik@users.noreply.github.com> Date: Mon, 20 Jul 2020 10:03:43 -0400 Subject: [PATCH 94/99] Fixed getItem, item_weapon (#112) The player not able to withdraw weapons --- server/main.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/server/main.lua b/server/main.lua index c8cd8cff..97ba7e23 100644 --- a/server/main.lua +++ b/server/main.lua @@ -252,16 +252,21 @@ AddEventHandler('esx_property:getItem', function(owner, type, item, count) elseif type == 'item_weapon' then TriggerEvent('esx_datastore:getDataStore', 'property', xPlayerOwner.identifier, function(store) local storeWeapons = store.get('weapons') or {} - local weapon = storeWeapons[data.current.count] -- count is the index + local weaponName = nil + local ammo = nil - if weapon then - if not xPlayer.hasWeapon(weaponName) then - table.remove(storeWeapons, data.current.count) - store.set('weapons', storeWeapons) + for i=1, #storeWeapons, 1 do + if storeWeapons[i].name == item then + weaponName = storeWeapons[i].name + ammo = storeWeapons[i].ammo - xPlayer.addWeapon(weapon.name, weapon.ammo) + table.remove(storeWeapons, i) + break end end + + store.set('weapons', storeWeapons) + xPlayer.addWeapon(weaponName, ammo) end) end end) From 777f27317e62ee15944ae1779d7ebfa80221d6aa Mon Sep 17 00:00:00 2001 From: BrakingESX247 <67766145+BrakingESX247@users.noreply.github.com> Date: Mon, 20 Jul 2020 15:09:15 +0100 Subject: [PATCH 95/99] Create Portuguese Credits go to @sergio-atilano Co-Authored-By: atilano --- locales/pt.lua | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 locales/pt.lua diff --git a/locales/pt.lua b/locales/pt.lua new file mode 100644 index 00000000..c0eba25a --- /dev/null +++ b/locales/pt.lua @@ -0,0 +1,37 @@ +Locales['pt'] = { + ['have_withdrawn'] = 'Depositaste ~y~x%s~s~ ~b~%s~s~', + ['have_deposited'] = 'Depositaste ~y~x%s~s~ ~b~%s~s~', + ['free_prop'] = 'Propriedade à Venda', + ['property'] = 'Propriedade', + ['enter'] = 'Entrar', + ['move_out'] = 'Sair da Propriedade', + ['move_out_sold'] = 'Vender a Propriedade por %s€', + ['moved_out'] = 'Tu saiste da casa e já não és o arrendatário.', + ['moved_out_sold'] = 'Tu vendeste a propriedade por ~g~%s€~s~', + ['buy'] = 'Comprar a Propriedade por %s€', + ['buy_for'] = 'Compraste uma Propriedade por ~g~%s€~s~', + ['rent'] = 'Arrendar a Propriedade por %s€ / semana', + ['rent_for'] = 'Arrendaste uma Propriedade por ~g~%s€~s~', + ['press_to_menu'] = 'Pressiona ~INPUT_CONTEXT~ para abrir o menu', + ['owned_properties'] = 'Propriedades Adquiridas', + ['available_properties'] = 'Propriedades Disponíveis', + ['invite_player'] = 'Convidar um jogador', + ['you_invited'] = 'Tu convidaste ~y~%s~s~ para a tua Propriedade', + ['player_clothes'] = 'Roupas', + ['remove_cloth'] = 'Tira a roupa do guarda-roupa', + ['removed_cloth'] = 'A roupa foi removida do teu guarda-roupa!', + ['remove_object'] = 'Retirar objeto', + ['deposit_object'] = 'Depositar objeto', + ['invite'] = 'Convidar', + ['dirty_money'] = 'Dinheiro sujo: %s€', + ['inventory'] = 'Inventário', + ['amount'] = 'Valor?', + ['amount_invalid'] = 'Quantidade Inválida', + ['press_to_exit'] = 'Pressiona ~INPUT_CONTEXT~ para sair da propriedade', + ['not_enough'] = 'Não tens dinheiro suficiente', + ['invalid_quantity'] = 'Quantidade inválida', + ['paid_rent'] = 'Tu pagaste a tua renda de ~g~%s€~s~ por ~y~%s~s~', + ['paid_rent_evicted'] = 'Tu foste ~o~despejado~s~ da ~y~%s~s~ por não teres dinheiro para pagar a renda de ~g~%s€~s~', + ['not_enough_in_property'] = 'Não tens itens desses suficientes na Propriedade!', + ['player_cannot_hold'] = 'Não tens espaço suficiente no Inventário!', +} \ No newline at end of file From 8834fb369e398d2de8aef3494fd142cd94b2b164 Mon Sep 17 00:00:00 2001 From: Joe Szymkowicz Date: Sun, 6 Sep 2020 09:22:38 -0500 Subject: [PATCH 96/99] Added Marker Text display to config --- client/main.lua | 4 +++- config.lua | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 715611bf..04e00eb6 100644 --- a/client/main.lua +++ b/client/main.lua @@ -796,7 +796,9 @@ Citizen.CreateThread(function() if distance < Config.DrawDistance then DrawMarker(Config.MarkerType, property.entering.x, property.entering.y, property.entering.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, nil, nil, false) - ESX.Game.Utils.DrawText3D(property.entering, property.name, 2) + if Config.MarkerText == true then + ESX.Game.Utils.DrawText3D(property.entering, property.name, 2) + end letSleep = false end diff --git a/config.lua b/config.lua index d1888658..8321b924 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 = 102, g = 102, b = 204} Config.RoomMenuMarkerColor = {r = 102, g = 204, b = 102} Config.MarkerType = 1 +Config.MarkerText = true Config.RentModifier = 200 -- rent price: / (rounded) Config.SellModifier = 2 -- sell price: / (rounded) From edf6f8aa91576c54ce619bfbfa504a3087a8591e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rychl=C3=BD?= Date: Wed, 16 Sep 2020 17:28:12 +0200 Subject: [PATCH 97/99] Fix of typo in "NorthConkerAvenue2045" coords --- esx_property.sql | 2 +- localization/de_esx_property.sql | 2 +- localization/en_esx_property.sql | 2 +- localization/es_esx_property.sql | 2 +- localization/fi_esx_property.sql | 2 +- localization/pl_esx_property.sql | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/esx_property.sql b/esx_property.sql index bc39b25d..5cb27c06 100644 --- a/esx_property.sql +++ b/esx_property.sql @@ -49,7 +49,7 @@ CREATE TABLE `properties` ( INSERT INTO `properties` VALUES (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), diff --git a/localization/de_esx_property.sql b/localization/de_esx_property.sql index ea2748d4..87ae0e3c 100644 --- a/localization/de_esx_property.sql +++ b/localization/de_esx_property.sql @@ -49,7 +49,7 @@ CREATE TABLE `properties` ( INSERT INTO `properties` VALUES (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), diff --git a/localization/en_esx_property.sql b/localization/en_esx_property.sql index 40b7859f..668c39e3 100644 --- a/localization/en_esx_property.sql +++ b/localization/en_esx_property.sql @@ -49,7 +49,7 @@ CREATE TABLE `properties` ( INSERT INTO `properties` VALUES (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), diff --git a/localization/es_esx_property.sql b/localization/es_esx_property.sql index 910ce1e5..d24cb0c6 100644 --- a/localization/es_esx_property.sql +++ b/localization/es_esx_property.sql @@ -49,7 +49,7 @@ CREATE TABLE `properties` ( INSERT INTO `properties` VALUES (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), diff --git a/localization/fi_esx_property.sql b/localization/fi_esx_property.sql index 7bf0e492..e7b65a62 100644 --- a/localization/fi_esx_property.sql +++ b/localization/fi_esx_property.sql @@ -49,7 +49,7 @@ CREATE TABLE `properties` ( INSERT INTO `properties` VALUES (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), diff --git a/localization/pl_esx_property.sql b/localization/pl_esx_property.sql index e41e36a4..3df008e1 100644 --- a/localization/pl_esx_property.sql +++ b/localization/pl_esx_property.sql @@ -49,7 +49,7 @@ CREATE TABLE `properties` ( INSERT INTO `properties` VALUES (1,'WhispymoundDrive','2677 Whispymound Drive','{\"y\":564.89,\"z\":182.959,\"x\":119.384}','{\"x\":117.347,\"y\":559.506,\"z\":183.304}','{\"y\":557.032,\"z\":183.301,\"x\":118.037}','{\"y\":567.798,\"z\":182.131,\"x\":119.249}','[]',NULL,1,1,0,'{\"x\":118.748,\"y\":566.573,\"z\":175.697}',1500000), - (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907},','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), + (2,'NorthConkerAvenue2045','2045 North Conker Avenue','{\"x\":372.796,\"y\":428.327,\"z\":144.685}','{\"x\":373.548,\"y\":422.982,\"z\":144.907}','{\"y\":420.075,\"z\":145.904,\"x\":372.161}','{\"x\":372.454,\"y\":432.886,\"z\":143.443}','[]',NULL,1,1,0,'{\"x\":377.349,\"y\":429.422,\"z\":137.3}',1500000), (3,'RichardMajesticApt2','Richard Majestic, Apt 2','{\"y\":-379.165,\"z\":37.961,\"x\":-936.363}','{\"y\":-365.476,\"z\":113.274,\"x\":-913.097}','{\"y\":-367.637,\"z\":113.274,\"x\":-918.022}','{\"y\":-382.023,\"z\":37.961,\"x\":-943.626}','[]',NULL,1,1,0,'{\"x\":-927.554,\"y\":-377.744,\"z\":112.674}',1700000), (4,'NorthConkerAvenue2044','2044 North Conker Avenue','{\"y\":440.8,\"z\":146.702,\"x\":346.964}','{\"y\":437.456,\"z\":148.394,\"x\":341.683}','{\"y\":435.626,\"z\":148.394,\"x\":339.595}','{\"x\":350.535,\"y\":443.329,\"z\":145.764}','[]',NULL,1,1,0,'{\"x\":337.726,\"y\":436.985,\"z\":140.77}',1500000), (5,'WildOatsDrive','3655 Wild Oats Drive','{\"y\":502.696,\"z\":136.421,\"x\":-176.003}','{\"y\":497.817,\"z\":136.653,\"x\":-174.349}','{\"y\":495.069,\"z\":136.666,\"x\":-173.331}','{\"y\":506.412,\"z\":135.0664,\"x\":-177.927}','[]',NULL,1,1,0,'{\"x\":-174.725,\"y\":493.095,\"z\":129.043}',1500000), From 8f1f5ff920ddf4f76985a43cddc66df94e1ba89d Mon Sep 17 00:00:00 2001 From: Stephen York Date: Tue, 13 Oct 2020 03:12:22 +1100 Subject: [PATCH 98/99] Escaped table name. Without the backticks escaping the name 0 records are being returned. This is possibly a paltform difference between MySql and MariaDb --- server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.lua b/server/main.lua index 97ba7e23..ab9e1b00 100644 --- a/server/main.lua +++ b/server/main.lua @@ -64,7 +64,7 @@ end MySQL.ready(function() Citizen.Wait(1500) - MySQL.Async.fetchAll('SELECT * FROM properties', {}, function(properties) + MySQL.Async.fetchAll('SELECT * FROM `properties`', {}, function(properties) for i=1, #properties, 1 do local entering = nil From 7b36c43af3f6ae7315831d1ba4a9408c8939a5aa Mon Sep 17 00:00:00 2001 From: HypeLevels <61633775+HypeLevels@users.noreply.github.com> Date: Tue, 1 Dec 2020 21:40:27 +0000 Subject: [PATCH 99/99] Update config.lua Changed default language to english as its the universal language --- config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.lua b/config.lua index d1888658..42ca7cbb 100644 --- a/config.lua +++ b/config.lua @@ -12,4 +12,4 @@ Config.SellModifier = 2 -- sell price: / (rou Config.Properties = {} Config.EnablePlayerManagement = false -- If set to true you use esx_realestateagentjob -Config.Locale = 'fr' +Config.Locale = 'en'