Closed nzkfc closed 2 years ago
Thanks for the report. I suspect this is due to how the heading is added when creating the garage.
I believe a fix you could try is adjusting this section: https://github.com/qbcore-framework/qb-houses/blob/main/client/main.lua#L1068
From this:
h = heading,
To this:
w = heading,
That would be my first guess, but I would have to test it out.
Gave it a go, no change.
Before: https://i.imgur.com/in2YaNZ.jpeg
After: https://i.imgur.com/Pfzdclo.jpeg
https://i.imgur.com/OylCgp0.png
DP for new garage with the change saves to the houseloacations table as {"z":4.22972536087036,"x":4513.35302734375,"h":21.25695037841797,"y":-4522.89453125}
Yeah, so I still think the "h" key for heading is the issue. Suprised that made no difference. How are you testing this? I will do some testing, following your steps.
Only thing I can think of, is that the DB table is h: and not w: but i'm not 100% sure if that matters, if it does I assume you gotta change the DB to w:
On Sat, 29 Oct 2022, 10:46 pm Stan, @.***> wrote:
Yeah, so I still think the "h" key for heading is the issue. Suprised that made no difference. How are you testing this? I will do some testing, following your steps.
— Reply to this email directly, view it on GitHub https://github.com/qbcore-framework/qb-garages/issues/261#issuecomment-1295787152, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGHUHJCNKDM6PUQ7M567ATWFTXAPANCNFSM6AAAAAARPZCLQE . You are receiving this because you authored the thread.Message ID: @.***>
@nzkfc Thanks, I have done some testing and the fix is as follows:
Head over to qb-garages / client / main.lua
Find this section, which starts at line 96
elseif type == 'hmarker' then
size = 20
coords = vector3(garage.takeVehicle.x, garage.takeVehicle.y, garage.takeVehicle.z)
heading = 0
minz = coords.z - 4.0
maxz = coords.z + 2.0
elseif type == 'house' then
size = 2
coords = vector3(garage.takeVehicle.x, garage.takeVehicle.y, garage.takeVehicle.z)
heading = 0
minz = coords.z - 1.0
maxz = coords.z + 2.0
end
Add in the heading = garage.takeVehicle.h
position as follows:
elseif type == 'hmarker' then
size = 20
coords = vector3(garage.takeVehicle.x, garage.takeVehicle.y, garage.takeVehicle.z)
heading = garage.takeVehicle.h
minz = coords.z - 4.0
maxz = coords.z + 2.0
elseif type == 'house' then
size = 2
coords = vector3(garage.takeVehicle.x, garage.takeVehicle.y, garage.takeVehicle.z)
heading = garage.takeVehicle.h
minz = coords.z - 1.0
maxz = coords.z + 2.0
end
Restart server and existing garages should be facing the right way.
If you had changed h = heading
to w = heading
from my previous suggestion. You can revert that back in the code. Also, check your database for any garages that were created with 'w' for the heading, and edit those back to 'h'
Test it out and let me know. Thanks
Hmm doesn't seem to work still: https://i.imgur.com/e8PlyTh.png
also a second one I tested, so I made the house/garage, restarted the server, joined as another character and purchased the house, did the car into garage and it's facing 0.0 lol
Not sure why, it defintely fixed it for m. Might be worth jumping in a discord call together at sopme point to discuss it.
@tom-osborne Making a Pull Req?
@tom-osborne Making a Pull Req?
Hi @amantu-qbit yes. I will make the PR's - We also need one in qb-housing to handle backward compatibility, which I will work on later
@tom-osborne Making a Pull Req?
Hi @amantu-qbit yes. I will make the PR's - We also need one in qb-housing to handle backward compatibility, which I will work on later
Thanks, can confirm this is working 100%! Tested in dev and prod.
Describe the bug Cars that spawn out of housing garages have a fixed heading of north, ignoring the heading when using /addgarage
To Reproduce Steps to reproduce the behavior:
Expected behavior Car should spawn as per the heading on the houselocations table in the garage column in the DB.
Screenshots Here is a video where I recreate the issue on the latest versions of all qb scripts as at 27/10/22 https://youtu.be/uoXYCx9-LGY
Questions (please complete the following information):
qb-
to something custom? NoAdditional context Issue occured in a recent update I believe, in the last 4-5 weeks
When I compare code from when it was working and the fresh pull, it looks like RegisterNetEvent('qb-garages:client:takeOutGarage', function(data) used to use local heading and also set heading SetEntityHeading(veh, heading) after getting vehicles properties.