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

Fix GiveKeys when vehicle is spawned by admin menu. #70

Merged
merged 4 commits into from
Sep 29, 2024

Conversation

Swellington-Soares
Copy link
Contributor

Description

Fix GiveKeys when vehicle is spawned by admin menu, change wrong parameter plate to vehicle entity.

Checklist

  • [ x ] I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • [ x ] My pull request fits the contribution guidelines & code conventions.

.editorconfig Outdated Show resolved Hide resolved
server/main.lua Outdated
local plate = qbx.getVehiclePlate(NetworkGetEntityFromNetworkId(netId))

exports.qbx_vehiclekeys:GiveKeys(source, plate)
exports.qbx_vehiclekeys:GiveKeys(source, NetworkGetEntityFromNetworkId(netId))
Copy link
Member

Choose a reason for hiding this comment

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

This is unneeded, I believe, as the spawnVehicle function returns both the entity and the netId if I remember correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I'm reviewing the code, a lot of it is still using old functions, I'm readapting it here. I just saw that a function is called to add a key to the client, but it wasn't working for some reason, the admin script itself is using a lot of functions internally (qb-*).

Copy link
Contributor

@solareon solareon Sep 29, 2024

Choose a reason for hiding this comment

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

What he is referring to is that at line 292 that function returns both the netid and the entity number so you just need to take it from that function and pass it directly to the export.

@solareon solareon merged commit 5e255b9 into Qbox-project:main Sep 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants