From fffde49c1c8c6c3aba99e3f039dd69cf3689728a Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 1 Jul 2018 14:57:10 +0200 Subject: [PATCH] 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)