-
Notifications
You must be signed in to change notification settings - Fork 44
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
Vehicle owner loses access to keys after sever restart(vehicles generated by other script) #154
Comments
Shouldn't the persistent vehicles carry over entity state? Right now qbx_vehiclekeys makes the assumption of owner state bag being set. This does require other scripts to set vehicleid state bag if spawning a vehicle as vehicleid change handler will set the owner. If we don't make this assumption, it requires always calling back to the server and doing a database lookup to determine if the vehicle is owned. While we have added support in other resources for vehicleid being optional, we do want to move towards a world where it is required. I'm not sure we want to make things worse for servers that handle this to help servers that do not. |
I completely agree that the best approach would be for the vehicle spawning script to set the state bag. However, considering that this will become a mandatory requirement, all vehicles that don’t set the state bag would fail to work. So, we can call this a secondary check. If no owner is found on the first query, a backup initialization query can be made. When creating this issue, I had also thought about this consideration—it seems it’s just a matter of whether compatibility is needed, and the decision is up to you. |
I don't think we need to maintain backwards compatibility in this regard. In general for non qbx_core resources we don't maintain backwards compatibility as we want to move towards better approaches and not have to be stuck in the past. |
Summary
After the server restarts, vehicle owners no longer have keys to their vehicles
Reproduction
Expected behavior
After a server restart, the vehicle owner should retain access to the vehicle keys, allowing them to unlock and use their vehicle as expected.
Actual behavior
Following a server restart, the player who originally purchased the vehicle is unable to unlock it, despite being the owner. This issue arises because the vehicle regeneration by another script does not retain the owner status correctly.
Additional context
It would be beneficial to improve the logic for detecting the vehicle owner within this plugin, rather than relying solely on qbx_vehicles to set the owner state. This enhancement would help ensure consistent access for the vehicle owner, even if the owner state is not correctly set by external plugins during vehicle regeneration.
Current Version
v1.0.1
Custom Resources
AdvancedParking
The text was updated successfully, but these errors were encountered: