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

feat(server)!: Vehicle Spawning Overhaul #71

Merged
merged 9 commits into from
May 28, 2023

Conversation

Manason
Copy link
Member

@Manason Manason commented May 20, 2023

Description

  • deprecating QB callbacks for creating/spawning vehicle in favor of new ox_lib callbacks
  • deprecating vehicle creation functions/callbacks on the server which use CreateVehicle native rather than CreateVehicleServerSetter. Existing functions/callbacks are now wrappers.
  • BREAKING CHANGE: 'QBCore:Server:CreateVehicle' server callback will now return nil rather than 0 if the server artifact is below 5904. This brings the behavior in-line with the function version.
  • server events/functions which spawn vehicle refactored to call the server to spawn the vehicle
  • BREAKING CHANGE: QBCore.Functions.CreateVehicle server function now returning the netId instead of the entityId. I'm too sure about whether this is a good change or not, but it seemed odd that the original callback returned the netId and the function returned the entityId, so I picked one and went with it.

Unrelated: I don't understand why the createVehicle function is spawning and deleting a temp vehicle.
Unrelated: Seems like the callback for spawning vehicles should live right next to the server function for spawning vehicles rather than have it in the 'events' file.

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My code fits the style guidelines.
  • My PR fits the contribution guidelines.

@Manason Manason requested a review from FjamZoo May 20, 2023 18:35
@Manason Manason changed the title feat(server)!: deprecating certain vehicle spawning callbacks/functions feat(server)!: Vehicle Spawning Overhaul May 20, 2023
client/events.lua Outdated Show resolved Hide resolved
client/events.lua Outdated Show resolved Hide resolved
server/functions.lua Outdated Show resolved Hide resolved
Manason and others added 3 commits May 21, 2023 13:07
Co-authored-by: FjamZoo <34508112+FjamZoo@users.noreply.github.com>
Co-authored-by: FjamZoo <34508112+FjamZoo@users.noreply.github.com>
Co-authored-by: FjamZoo <34508112+FjamZoo@users.noreply.github.com>
@Manason Manason requested a review from FjamZoo May 21, 2023 20:07
@ChatDisabled ChatDisabled merged commit 28df4fe into main May 28, 2023
0 of 3 checks passed
@ChatDisabled ChatDisabled deleted the vehicle-spawning-deprecation branch May 28, 2023 21:49
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.

None yet

3 participants