GetVehicleNumberPlateText returns an 8-character string instead of 7 characters
stukebtw opened this issue ยท 5 comments
What happened?
The native event GetVehicleNumberPlateText consistently returns an 8-character string, even though vehicle license plates are only 7 characters long. This results in an extra space at the end of the string.
Expected result
The function should return a string that matches the exact length of the license plate (7 characters) without any trailing spaces.
Reproduction steps
- Use the native function GetVehicleNumberPlateText on any vehicle.
- Retrieve the returned string and print its length using # in Lua or similar string length functionality in another language.
- Observe that the string length is 8 characters instead of 7.
- Manually inspect or trim the trailing space to confirm itโs an unnecessary padding issue.
Importancy
Unknown
Area(s)
FiveM, Natives
Specific version(s)
FiveM b3095, Server 11775 linux
Additional information
This issue adds complexity to scripts relying on GetVehicleNumberPlateText, as they must account for and trim the extra character in order to match expected plate data. Addressing this would improve script reliability and prevent unexpected behavior.
Same problem
Plates are 8 characters long, it doesn't matter what you want to set them to; changing that would cause major compatibility issues.
Where did you see a plate with 7 characters? I'm just curious.?
Ah okay, my mistake. In default GTA there are 8 letters. With esx there are only 7 letters.
Ah okay, my mistake. In default GTA there are 8 letters. With esx there are only 7 letters.
You can change this in the ESX config, also for having compatibility with any custom plate system, you must always trim the plate obtained with the native for that reason (some people want to have a car with the plate B00BS ๐คฃ)