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

Unable to Grant Key to Locally Spawned Vehicle #153

Open
Jerrys-C opened this issue Nov 1, 2024 · 4 comments
Open

Unable to Grant Key to Locally Spawned Vehicle #153

Jerrys-C opened this issue Nov 1, 2024 · 4 comments
Labels
bug Something isn't working need repro This bug report needs confirmation

Comments

@Jerrys-C
Copy link

Jerrys-C commented Nov 1, 2024

Summary

Unable to Grant Key to Locally Spawned Vehicle

Reproduction

In a test drive scenario, attempting to use TriggerEvent('vehiclekeys:client:SetOwner', GetVehicleNumberPlateText(vehicle_entity)) to provide keys results in the client receiving a notification that the key was obtained; however, the vehicle remains locked and cannot be unlocked. This issue only occurs during the test drive stage (non-global vehicle). When purchasing a vehicle, using the same event allows the key to function normally.

Expected behavior

Can drive vehicle

Actual behavior

Can not driver vehicle

Additional context

No response

Current Version

1.0.1

Custom Resources

ZSX_Dealership

@Jerrys-C Jerrys-C added bug Something isn't working need repro This bug report needs confirmation labels Nov 1, 2024
@qbox-duck qbox-duck bot added this to Issues Nov 1, 2024
@github-project-automation github-project-automation bot moved this to Todo in Issues Nov 1, 2024
@Manason
Copy link
Member

Manason commented Nov 1, 2024

Does the vehicle spawn in a different bucket?

@Jerrys-C
Copy link
Author

Jerrys-C commented Nov 1, 2024

Does the vehicle spawn in a different bucket?

I think that's the case

@Manason
Copy link
Member

Manason commented Nov 1, 2024

My guess without testing it is that it searches for a vehicle to give you keys in the same bucket as the player. This is a slight behavior change from qb-vehiclekeys which actually associates keys to a plate. In Qbox vehicle keys we look up the vehicles using plate on the server. I'll have to double check if this is the case. If you don't want to wait for a fix, you could switch the call to use the GiveKeys exports.

@Jerrys-C
Copy link
Author

Jerrys-C commented Nov 2, 2024

My guess without testing it is that it searches for a vehicle to give you keys in the same bucket as the player. This is a slight behavior change from qb-vehiclekeys which actually associates keys to a plate. In Qbox vehicle keys we look up the vehicles using plate on the server. I'll have to double check if this is the case. If you don't want to wait for a fix, you could switch the call to use the GiveKeys exports.

While attempting to call the export function GiveKeys from the resource qbx_vehiclekeys, the following error occurred:

14:20:20 [script:ZSX_Dealership] SCRIPT ERROR: @ZSX_Dealership/server/functions/sv_editable.lua:226: 
14:20:20 [script:ZSX_Dealership] An error occurred while calling export `GiveKeys` in resource `qbx_vehiclekeys`:
14:20:20 [script:ZSX_Dealership]   nil
14:20:20 [script:ZSX_Dealership] --- 
14:20:20 [script:ZSX_Dealership] Gave player 1 the keys to vehicle 1231106.
14:20:20 [    c-scripting-core] InvokeNative: execution failed: Tried to access invalid entity: 1231106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need repro This bug report needs confirmation
Projects
Status: Todo
Development

No branches or pull requests

2 participants