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: GetVehicleClass server export #566

Merged
merged 4 commits into from
Sep 17, 2024
Merged

Conversation

Manason
Copy link
Member

@Manason Manason commented Sep 13, 2024

Adds a new server export GetVehicleClass. This is a way of imitating the native of the same name on the client. It accomplishes this by calling back to a random client to cache all the vehicle models to vehicle class mapping. Knowing a vehicle class on the server side is useful for vehiclekeys, to configure certain properties applied to all vehicles of a certain class. This may be useful in other scripts, which is why I'm adding it to core.

The major drawback of this approach is that the data may not be available as no client may have connected yet. However, the implementation could later be changed to cache this data in the database to avoid a case where no data is available. Using the database is preferable over using vehicles.lua so that users need not manually maintain a cache.

@Manason Manason changed the title Draft: feat: GetVehicleModel export feat: GetVehicleModel export Sep 13, 2024
@Manason Manason changed the title feat: GetVehicleModel export feat: GetVehicleClass server export Sep 13, 2024
@solareon solareon merged commit bd4ed96 into main Sep 17, 2024
4 checks passed
@solareon solareon deleted the get-vehicle-models-export branch September 17, 2024 09:16
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