citizenfx / fivem

The source code for the Cfx.re modification frameworks, such as FiveM, RedM and LibertyM, as well as FXServer.
https://cfx.re/
3.52k stars 2.07k forks source link

feat(extra-natives/five): implement [GET/SET]_GLOBAL_PASSENGER_MASS_MULTIPLIER #2796

Closed Explooosion-code closed 3 days ago

Explooosion-code commented 2 weeks ago

Goal of this PR

Adding a getter and setter to control the mass of passengers. I.E if you have a racing server you might want to have passengers not decrease performance of vehicle and you might want to

 SetGlobalPassengerMassMultiplier(0.0)

...

How is this PR achieving the goal

By setting/getting the value that GTA is using for decreasing performance of vehicle depending on passenger count

...

This PR applies to the following area(s)

Fivem, Extra Natives

...

Successfully tested on

Game builds: 1604, 2060, 2189, 3095, 3258

Platforms: Windows

Checklist

qalle-git commented 2 weeks ago

yes, please

prikolium-cfx commented 2 weeks ago

Hi. Can you please rename natives to SET/GET_GLOBAL_PASSENGER_MASS_MULTIPLIER and also you need to reset it on disconnect from the server in OnKillNetwork to its default value. You can check how our custom natives work now.

prikolium-cfx commented 3 days ago

Rebased and merged.