altv-issues icon indicating copy to clipboard operation
altv-issues copied to clipboard

Misunderstandable use of SetVehicleExtra (serverside)

Open Doxoh opened this issue 2 years ago • 2 comments

Description of the problem

currently by using extras for vehicle JS: veh.setExtra/C#: veh.ToggleExtra the second parameter state is wrong to understand.

If you set state = true, you expect the extra to be set, but it is not. You have to set state = false.

The native for that has disable as second parameter and here its seem state works as "disable"

Reproduction steps

Spawn vehicle "buccaneer2"

As JS: Execute server-side method veh.setExtra(2, false)

As C# Execute server-side method veh.ToggleExtra(2, false)

The roof will be removed.

Expected behaviour

Spawn vehicle "buccaneer2"

As JS: Execute server-side method veh.setExtra(2, true)

As C# Execute server-side method veh.ToggleExtra(2, true)

set True to remove the roof.

Additional context

No response

Operating system

Windows 11

Version

12.10 (release)

Doxoh avatar Aug 13 '22 15:08 Doxoh

I can confirm this behaviour but changing it should be should be released as a breaking change because it would break a lot of scripts.

vanlueckn avatar Aug 13 '22 16:08 vanlueckn

yeah understandable a other way can by rename the paramter to disable on cpp-sdk and then rename it on the modules

Doxoh avatar Aug 13 '22 16:08 Doxoh