What I use:
- Production branch of FiveM
- FXServer 7257
Bug:
When using the GetModSlotName
native (ref) to get the vehicle mod type translation, some values are missing, returned raw or just doesn’t exist.
Even if the game language is changed, the text is always returned in english.
How to reproduce:
Here is an example in C#:
I use the values from 0 to 49, as in the eVehicleModType
enum (ref).
int pedId = PlayerPedId();
int pedVehicle = GetVehiclePedIsUsing(pedId);
for (int i = 0; i <= 49; i++)
{
string slot = GetModSlotName(pedVehicle, i);
Debug.WriteLine($"{i} : {slot}");
}
Console output:
0 : Spoiler
1 : Front Bumper
2 : Rear Bumper
3 : Skirt
4 : Exhaust
5 : TOP_CAGE
6 : TOP_HL_CV
7 : Bonnet
8 : Left Wing
9 : Right Wing
10 : Roof
11 :
12 :
13 :
14 :
15 :
16 :
17 :
18 :
19 :
20 :
21 :
22 :
23 :
24 :
25 :
26 :
27 :
28 :
29 :
30 :
31 :
32 :
33 :
34 :
35 :
36 :
37 :
38 :
39 :
40 :
41 :
42 : TOP_FOGL
43 : TOP_CATCH
44 : TOP_TRUNK
45 : TOP_MUD
46 :
47 : TOP_MIR
48 :
49 :
GET_MOD_SLOT_NAME
only returns values for mod IDs that are lower than VMT_RENDERABLE
. All “stat” mods like VMT_ENGINE
and similar are above the VMT_RENDERABLE
enum index and will return NULL. This also includes other visual mods like tyre smoke or xenon lights (mainly everything except body and interior mods). Sorting of those mod IDs is different than in the native docs of SET_VEHICLE_MOD
(eVehicleModType), as there is a “mismatch” between mod IDs that scripts expect and actual internal mod IDs in the engine code (conversion is done at native invocation).
Additionally, display names of mods like VMT_PLTHOLDER
(which are below the VMT_RENDERABLE
index) are just empty strings for whatever reason + Every mod kit can also include their own slot name overrides which seem to not be present on every mod-kit (only non-default?).
Just using the GET_MOD_SLOT_NAME
native to get the display names of all vehicle mods won’t work, and in GTA base game scripts there are hundreds of overwrites and edge cases where display names get manually overwritten/converted/whatever (carmod_shop_core
).
So, not a bug.
Do you know if there is a workaround to continue using native localization for missing GetModSlotName translations? Maybe an alternative native?