Skip to content

Add licenseplate resource - #734

Open
DateFTP wants to merge 1 commit into
multitheftauto:masterfrom
DateFTP:feature/licenseplate-resource
Open

Add licenseplate resource#734
DateFTP wants to merge 1 commit into
multitheftauto:masterfrom
DateFTP:feature/licenseplate-resource

Conversation

@DateFTP

@DateFTP DateFTP commented Aug 4, 2026

Copy link
Copy Markdown

Type: New resource

Summary
Adds a new [gameplay]/licenseplate resource that lets players set a custom license plate on the vehicle they are currently driving through a small in-game GUI window.

What the resource does

  • Client (client.lua)
    • Creates a small GUI window ("License plate") with a text field, a "Set the number" button and a "Cancel" button.
    • Opens the window with the commands /setplate and its alias /license.
    • Validates the input on the client side:
      • rejects an empty plate with a chat message;
      • rejects plates longer than 8 characters (matching the vanilla plate limit);
      • an optional letter/number/space-only check is provided but commented out.
    • Checks that the player is actually inside a vehicle before continuing.
    • Triggers the server-side event LicensePlate:set with the vehicle and the plate, then hides the window.
  • Server (server.lua)
    • Listens for the LicensePlate:set event.
    • Validates the player, the vehicle and that the player is still inside that vehicle.
    • Enforces the 8-character limit again server-side (trusted check).
    • Applies the plate with setVehiclePlateText and confirms with a chat message.

Files

  • client.lua - GUI creation, input validation, commands and event triggering.
  • server.lua - validation and applying the plate via setVehiclePlateText.
  • meta.xml - resource definition, registers the client and server scripts.

Tested

  • Opening/closing the window via both commands.
  • Empty input, oversized input and a valid plate.
  • Setting a plate while not in a vehicle.

New resource that allows players to set a custom license plate
on the vehicle they are driving via an in-game GUI.

Commands:
- /setplate - open the license plate editor window
- /license - alias for /setplate

The client validates the plate length (max 8 characters) and sends
the new value to the server, which applies it with
setVehiclePlateText.
@DateFTP

DateFTP commented Aug 4, 2026

Copy link
Copy Markdown
Author
image

@DateFTP

DateFTP commented Aug 4, 2026

Copy link
Copy Markdown
Author
image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant