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(extra-natives-five): GET/SET_VEHICLE_WHEEL_HEIGHT #3172

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

n0bodysec
Copy link

@n0bodysec n0bodysec commented Feb 19, 2025

Goal of this PR

Add the ability to get and set vehicles' wheels height.

How is this PR achieving the goal

Adding the required natives to be able to modify these values by memory patching.

This PR applies to the following area(s)

FiveM, Natives.

Successfully tested on

I didn't test it on FiveM itself, but I tested it using a debugger on single player. Since this is a simple code, this should work without any issues.

Game builds: All of them?

Platforms: Windows, Linux

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

N/A

@github-actions github-actions bot added triage Needs a preliminary assessment to determine the urgency and required action invalid Requires changes before it's considered valid and can be (re)triaged and removed triage Needs a preliminary assessment to determine the urgency and required action labels Feb 19, 2025
@DaniGP17
Copy link
Contributor

Should be good to have the native docs.
I've tested the SET_VEHICLE_WHEEL_HEIGHT and it changes the wheel height correctly, but when the car moves a little bit its height returns to the original. What could be the use case for this native?

@n0bodysec
Copy link
Author

n0bodysec commented Feb 19, 2025

Hey @DaniGP17, I completely forgot about the docs! I'll write them.
This native should be called very often, not necessarily every tick. The game resets this info after you move with the car.

EDIT: Done. I think the added docs are good enough.

@prikolium-cfx
Copy link
Collaborator

Thanks for your contribution, but could you please provide some use cases for that?

@n0bodysec
Copy link
Author

Hello, @prikolium-cfx. You're welcome!

There's a single player mod that allows you to modify some aspects of your vehicle's wheels. For instance, it allows you to change the wheel's camber (SET_VEHICLE_WHEEL_Y_ROTATION in CFX), the distance to the axle (SET_VEHICLE_WHEEL_X_OFFSET in CFX) and the wheel's height (this PR).

In real life, while doing vehicle tuning, is common to see people lowering vehicle's front suspension instead of both front and rear suspension. So this commit makes that possible.

There's also a FiveM port of "VStancer" (the single player mod), that implements all the original features, except wheel height (since it's not currently possible in FiveM).

For instance, in Roleplay, Drift or Racing gamemodes (where players want to modify every aspect of their vehicle, such as mods, xenon lights, etc.) they also like to modify such thing as suspension and wheel camber.

I hope this is a reasonable use case for you!

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants