Tommy's Scripts
  • Information
    • FiveM Escrow System
  • Paid Scripts
    • Tommy's ELS
    • Tommy's Radar Detector
    • Tommy's POV
    • Tommy's Radio
    • Tommy's HUD (Legacy V1)
    • Custom Unit Number
    • GTA:O Loading Screen
  • Free Scripts
    • Tommy's Lights Sync
    • Tommy's Discord API
    • Priority Status
Powered by GitBook
On this page
  • Usage
  • Upcoming Features
  • Configuration
  1. Paid Scripts

Custom Unit Number

Configuration guide, common issues & solutions, code snippets, and more.

Last updated 9 months ago

|

Escrow Encrypted: Yes

Requirements: None

Usage

  1. Place both the uNumberProps and uNumber resources into your server.

  2. Edit your server.cfg file to start the resources:

    start uNumberProps
    start uNumber
  3. Configure the offsets and rotations for each possible digit place that can be shown on the vehicle in the config.lua file.

  4. Restart the uNumber resource as needed to apply the configuration changes.

  5. When in a configured vehicle, use the following commands to set your unit number:

    • /unitnum <number> <color>: Sets the unit number with the specified color (black or white).

    • /unitnum clear: Clears the unit number from the vehicle.

Upcoming Features

  • Exports for developers to integrate with.

  • Ability to change the scale of the unit numbers.

  • Possible menu to easily configure the placement of the unit numbers.

Configuration

The config.lua file contains the following configuration options:

--[[
_   _      _ _
| | | |_ _ (_) |_
| |_| | ' \| |  _|
\___/|_||_|_|\__|
| \| |_  _ _ __ | |__  ___ _ _
| .` | || | '  \| '_ \/ -_) '_|
|_|\_|\_,_|_|_|_|_.__/\___|_|

--]]
-- Developed by https://github.com/tommy141x

-- Command Used To Change Unit Number
commandName = "unitnum"

-- Vehicle Configuration
uNumberVehicles = {
  {
    vehicle = "valor2rb", -- Spawn Code
    boneName = "chassis", -- Bone Name the Numbers are attached to (https://docs.fivem.net/natives/?_0xFB71170B7E76ACBA)
    numPos = {            -- Offset Values (from chassis bone) for the 3 number slots
      {
        posX = -0.4,      -- X Position (left & right)
        posY = -0.75,     -- Y Position (forward & back)
        posZ = 0.76,      -- Z Position (up & down)
        rotX = 6.0,       -- X Rotation (Roll Left & Right)
        rotY = -4.0,      -- Y Rotation (Roll Forward & Back)
        rotZ = 0.0        -- Z Rotation (Spin)
      },
      {
        posX = 0.0,
        posY = -0.75,
        posZ = 0.775,
        rotX = 6.0,
        rotY = 0.0,
        rotZ = 0.0
      },
      {
        posX = 0.4,
        posY = -0.75,
        posZ = 0.76,
        rotX = 6.0,
        rotY = 4.0,
        rotZ = 0.0
      }
    }
  },
  {
    vehicle = "valor5rb",
    boneName = "chassis",
    numPos = {
      {
        posX = -0.4,
        posY = -0.75,
        posZ = 0.86,
        rotX = 3.0,
        rotY = -4.0,
        rotZ = 0.0
      },
      {
        posX = 0.0,
        posY = -0.75,
        posZ = 0.88,
        rotX = 3.0,
        rotY = 0.0,
        rotZ = 0.0
      },
      {
        posX = 0.4,
        posY = -0.75,
        posZ = 0.86,
        rotX = 3.0,
        rotY = 4.0,
        rotZ = 0.0
      }
    }
  }
}
  • commandName: The command used to change the unit number. Example: "unitnum". Players can use this command followed by a number and color to set their unit number.

  • uNumberVehicles: A table that contains the vehicle configurations. Each entry represents a vehicle that can display unit numbers and contains the following properties:

    • vehicle: The spawn code of the vehicle. Example: "valor2rb".

    • numPos: An array of offset values for the three number slots. Each entry represents a digit place and contains the following properties:

      • posX: The X position (left & right).

      • posY: The Y position (forward & back).

      • posZ: The Z position (up & down).

      • rotX: The X rotation (Roll left & right).

      • rotY: The Y rotation (Roll forward & back).

      • rotZ: The Z rotation (Spin).

Note: The documentation provided here is intended to help you understand and configure the Custom Unit Number script effectively.

boneName: The bone name to which the numbers are attached. Reference: .

FiveM Natives Documentation
FiveM Post
Store Page
GIF by angrymaximus
Page cover image