Repository navigation
feat(extra-natives/five): add-on vehicle number plate styles - #4396
Open
RaeLightwen wants to merge 2 commits into
Open
RaeLightwen wants to merge 2 commits into
RaeLightwen wants to merge 2 commits into
Conversation
RaeLightwen
force-pushed
the
feat/addon-license-plates
branch
from
November 12, 2026 03:50
dda1de1 to
c18d860
Compare
Add a VEHICLE_PLATES_FILE data file type that appends plate styles to the game's VehiclePlates texture array, with textures from a streamed .ytd, and GET_VEHICLE_NUMBER_PLATE_TEXT_INDEX_BY_NAME to look plate indices up by name. gta-streaming-five gains streaming::RegisterDataFileHandler so other components can add custom data file types. Signed-off-by: RaeLightwen <nikashatv@gmail.com>
…d order Plate indices are synced as plain numbers, so clients must agree on them. Plates without an Index now get the free indices after the vanilla plates in order of their TextureSetName, so every client running the same resources assigns the same indices, including players who join after a plate resource was restarted. Vehicles using a plate that moves to another index are switched to its new index. Signed-off-by: RaeLightwen <nikashatv@gmail.com>
RaeLightwen
force-pushed
the
feat/addon-license-plates
branch
from
November 12, 2026 20:05
c18d860 to
41b73f0
Compare
RaeLightwen
marked this pull request as ready for review
November 12, 2026 20:08
Author
|
Check fail looks to be an issue with the runners, not with my branch. Hope this can get resolved soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal of this PR
Let servers stream their own license plate styles, and let scripts use plate indices beyond the 13 vanilla ones.
How is this PR achieving the goal
The game's only limit on plate indices is
index < VehiclePlates.Textures.count(carcols). The natives, the getter and network sync (32-bit) all pass larger values through, so this PR adds real entries to that array. It doesn't override any natives.New
VEHICLE_PLATES_FILEdata file type. Same format as theVehiclePlatesnode incarcols.ymt, plus:TextureDictionary(required): the streamed.ytdwith the plate textures.Index(optional): a fixed index.Font settings and
NormalMapNameare optional and default to the game's default plate.Index assignment doesn't depend on load order. Indices are synced as plain numbers, so every client must agree on them. Plates without an
Indexget the free indices after the vanilla plates in order of theirTextureSetName, so clients running the same resources get the same indices whatever order they loaded them in. This includes players who join after a plate resource was restarted. When starting or stopping a plate resource moves a plate to a new index, vehicles using it switch to the new index; the owner's change syncs to everyone else. Vehicles on a removed plate go back to the default plate.The plate array is replaced, not patched in place.
Textures come from the add-on
.ytd.SetLicensePlateTextureonly looks textures up invehshare. A hook calls the original and then, for add-on indices, sets the diffuse and normal textures from the add-on.ytd. The dictionary is ref-counted while the plate is registered.New native
GET_VEHICLE_NUMBER_PLATE_TEXT_INDEX_BY_NAME(client) returns a plate index byTextureSetName. It works for vanilla plates too.streaming::RegisterDataFileHandler(gta-streaming-five) lets a component register load and unload handlers for a custom data file type.Offsets come from byte patterns inside the hooked function. Every pattern is unique on b3889.
Invalid entries are logged and skipped. This covers duplicate names or indices, out-of-range indices, missing fields, a missing
.ytdor texture, malformed XML and a missing file.Known limitations:
Indexcan move when other plate resources start or stop, so servers that store plate indices (for example in a database) should set anIndexor look plates up by name.0xff82c1). On that path, indices above 127 keep the previous plate or fall back to no plate style. It doesn't seem to be reached in FiveM multiplayer, but I haven't identified the feature it belongs to.This PR applies to the following area(s)
FiveM Client, Natives
...
Successfully tested on
Game builds: 3407
Platforms: Windows
Checklist
Fixes issues
Resolves #4383