Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling walking + fixed some issue for people with older qb garage/JDEV qb garage #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,20 @@ function OpenPhone()
if HasPhone then
PhoneData.PlayerData = QBCore.Functions.GetPlayerData()
SetNuiFocus(true, true)
-- SetNuiFocusKeepInput(true)
SendNUIMessage({
event = 'z-phone',
isOpen = true,
})
PhoneData.isOpen = true

if Config.AllowWalking then
SetNuiFocusKeepInput(true)
Copy link
Owner

@alfaben12 alfaben12 Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if you open your phone and press the A/W/S/D keyboard? will the character move too?

don't forget to add your profile in readme.md as a contributor

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whe you press A/W/S/D only your character move, and you can still moving the cursor on the phone

CreateThread(function()
while PhoneData.isOpen do
DisableDisplayControlActions()
DisableLookAroundActions() -- only disable looking around
Wait(1)
end
end)
end

if not PhoneData.CallData.InCall then
DoPhoneAnimation('cellphone_text_in')
Expand Down Expand Up @@ -152,4 +153,4 @@ RegisterNUICallback('close', function(_, cb)
PhoneData.isOpen = false
end)
cb('ok')
end)
end)
3 changes: 2 additions & 1 deletion config/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Config.Debug = false
Config.OpenPhone = 'M'
Config.RepeatTimeout = 3000
Config.CallRepeats = 5
Config.AllowWalking = true

Config.App = {
InetMax = {
Expand Down Expand Up @@ -79,4 +80,4 @@ Config.Signal = {
ChanceSignal = 0.75
}
}
}
}
21 changes: 11 additions & 10 deletions server/garages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ lib.callback.register('z-phone:server:GetVehicles', function(source, body)
local Player = QBCore.Functions.GetPlayer(source)
if Player ~= nil then
local citizenid = Player.PlayerData.citizenid

-- Adjusted SQL query: Removed `created_at`
local query = [[
select
pv.vehicle,
pv.plate,
pv.garage,
pv.fuel,
pv.engine,
pv.body,
pv.state,
DATE_FORMAT(pv.created_at, '%d %b %Y %H:%i') as created_at
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make as default instead of remove this

from player_vehicles pv WHERE pv.citizenid = ? order by plate asc
vehicle,
plate,
garage,
fuel,
engine,
body,
state
from player_vehicles WHERE citizenid = ? order by plate asc
]]

local result = MySQL.query.await(query, {
Expand All @@ -29,4 +30,4 @@ lib.callback.register('z-phone:server:GetVehicles', function(source, body)
end

return {}
end)
end)