LogoLogo
SupportServer Hosting
  • Sonoran CAD
  • 📱Download The App
    • Steam Browser - Workaround
    • Web Browser - Clear Cache
    • Desktop App - Clear Cache
    • GTA RP Tablet - Clear Cache
    • Steam Browser - Clear Cache
  • Why Choose Sonoran CAD?
    • 🏆Why Choose Sonoran CAD?
  • Other Products
    • 🖥️FiveM Hosting
    • 📝Sonoran CMS
    • 📡Sonoran Radio
  • Tutorials
    • Getting Started
      • Registering Your Account
      • Registering Your Community
      • Inviting Users to Your CAD
      • Granting Account Permissions
      • View Your Limits
      • Community ID and API Keys
      • Troubleshooting
    • Customization
      • Custom Domain & Login Page
      • Customizing Your Layout
      • Community Branding and Settings
      • Creating Custom Record and Report Types
      • Sharing Custom Records
      • Custom Search Types
      • Geographical Settings
      • Penal Codes
      • 10-Codes
      • Addresses and Street Names
      • Unit Status Codes
      • Tone Board
      • Custom Audio Notifications
      • Custom Emails
      • Quick Links
      • Custom Page Colors
      • User Account Restrictions
      • Configuring Multiple Servers
      • Advanced Query Strings
    • Dispatching
      • Creating a Call
      • Self Dispatch
      • Timers
      • Command Line Interface (CLI)
    • Records Management
      • Record Lookups
      • Adding a Record
      • PDF Records
      • Scene Diagram Builder
    • Administration
      • System Logs
      • Remove User Account
      • Deleting or Transferring your CAD
    • Other Features
      • Configurable Hotkeys
      • Voice Commands
      • Volume and Language
  • Integration Capabilities
    • 🗃️Paid Integration Resources
      • Mobile Command Center
      • ATM Robbery
      • In-Vehicle Radar
      • Evidence Camera
      • Power Grid
      • Speed Cameras
      • Shot Spotter
    • 🛠️Integrated Vendors
    • 📺Twitch Bodycam, Bot, & Lighting Integration
    • Database Sync and Merge
      • Database Sync Credentials
      • QB Core Mapping Tutorial
      • Troubleshooting
    • Discord Bot Integration
    • Discord Rich Presence
    • Discord Webhooks
    • TeamSpeak 3 Integration
    • Stream Deck Integration
    • 🎮FiveM
      • FiveM Installation
        • Submodule Configuration
          • Submodule Troubleshooting
          • Submodule Configuration Updates
        • FiveM Submodules
          • Body Camera
          • Call Commands
          • Check API ID
          • Civilian Integration
          • Dispatch Notify
          • Emergency Response Simulator (ERS)
          • Framework Support (ESX/QBCore) and Auto Fines
          • FivePD
          • ForceReg
          • Kick
          • Locations
          • Live Map
          • Lookups
          • Postals
          • Smart Signs
          • Sonoran Radio (sonrad)
          • Station Alert
          • Tablet & Mini-CAD
          • TeamSpeak 3
          • Traffic Stop
          • Unit Status
          • VehReg
          • WraithV2
      • FiveM Development Documentation
        • Client Functions
        • Shared Functions
        • Server Functions
        • Server Events
        • HTTP Request Handling
      • Error Codes
    • 🎮Roblox ER:LC
  • Developer API Documentation
    • 📖API Integration
      • Getting Started
        • Retrieving Your Credentials
        • Integration API ID
        • Account Secret ID
      • Push Events
        • Event Restrictions
        • Record Events
          • Record Added
          • Record Edited
          • Record Removed
        • Unit Events
          • Unit Panic
          • Unit Login
          • Unit Logoff
          • Unit Status Update
          • Unit Group Name Change
          • Unit Group Add
          • Unit Group Remove
        • Dispatch Events
          • New Dispatch
          • Modified Dispatch
          • Closed Dispatch
          • Dispatch Note
          • Attach Unit
          • Detach Unit
          • Toggle Bodycam
        • Event 911
        • Remove 911
        • Sign Updated
        • Tone Played
        • Civilian
          • Character Selected
        • ERS
          • New Callout
        • Station Alert
          • New Station Alert
      • API Endpoints
        • API Restrictions
        • Emergency
          • Identifiers
            • Get Identifiers
            • Modify Identifier
            • Set Identifier
            • Unit Panic
            • Kick Unit
            • Unit Status
            • Get Active Units
            • Update Unit Location
          • Dispatch and Emergency Calls
            • Get Calls
            • New Dispatch
            • Attach Unit
            • Detach Unit
            • Update Call Postal
            • Add Call Note
            • Update Call Primary
            • Close Dispatch
            • New 911 Call
            • Remove 911
          • Custom Blips
            • Get Map Blips
            • Add Blip
            • Modify Blip
            • Remove Blip
          • Street Signs
            • Set Street Sign Config
            • Update Street Sign
          • ERS
            • Set Available Callouts
          • Station Alert
            • Set Stations
        • Civilian
          • Set Character
          • Get Characters
          • New Character
          • Edit Character
          • Remove Character
          • DB Sync: Get Character Links
          • DB Sync: Link Character
        • General
          • Get Servers
          • Set Servers
          • Get Version
          • Set Penal Codes
          • Set API IDs
          • Custom Records
            • API Options for Adding and Modifying Records
            • Get Record Templates
            • New Record
            • Edit Record
            • Remove Record
          • Lookup By Value
          • Lookup Name or Plate
          • Get Account
          • Get Accounts
          • Check API ID
          • Apply Permission Key
          • Modify Account Permissions
          • Kick or Ban User
          • Verify Secret
          • Auth Street Signs
          • Set Postal Config
          • Set Clock Time
          • Send Photo
          • Leave Community
          • Join Community
        • Local Endpoints
          • Smart Lighting
        • Internal
          • FiveM Download
      • API Examples
        • Emergency
          • LUA Examples
            • Dispatch and Emergency Calls
              • New 911 Call
              • Remove 911
              • Add Call Note
              • Set Call Postal
            • Custom Blips
              • Add Blip
              • Add Blips
              • Add Temp Blip
              • Get Map Blips
              • Remove Blip
              • Remove Blip With Subtype
            • General
              • Lookup Name or Plate
          • JavaScript Examples
            • Dispatch and Emergency Calls
              • New 911 Call
              • Remove 911
              • Add Call Note
              • Set Call Postal
            • Custom Blips
              • Add Blip
              • Add Blips
              • Add Temp Blip
              • Get Map Blips
              • Remove Blip
              • Remove Blip With Subtype
            • General
              • Lookup Name or Plate
      • Development Branch
    • 💵Developer Bounties
    • 🌎Translation Support
  • Pricing
    • Pricing FAQ
      • Military and First Responder Discount
      • Expert Installation
      • Accessing the Payment Center
      • Create and Manage a Subscription
      • Request Discord Role
    • View and Compare Plans
  • Roadmap
    • 📋Changelog
  • Other
    • AI QA
    • Contact Us
    • Policy
      • Rocket CAD Closure
      • Terms of Service
      • Privacy Policy
      • Refund and Purchase Policy
      • Discord Bot
    • Archive
      • Fire Siren
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Integration Capabilities
  2. FiveM
  3. FiveM Development Documentation

Server Events

This page will explain all server events from the SonoranCAD Core that can be used on the server side

PreviousServer FunctionsNextHTTP Request Handling

Last updated 4 months ago

Was this helpful?

sonorancad::registerVeh

This event will register the vehicle the player is in, to their most recent CAD civilian character. This event requires the to be enabled

TriggerServerEvent('sonorancad::registerVeh', primary, plate, class, realName)
Name
Type
Description

primary

string

The primary color of the vehicle

plate

string

The vehicle's license plate

class

string

The vehicles class. Please see for how to get the class to a string

realName

string

The display name of the vehicle.

            local colorNames = {
                ["0"] = "Metallic Black",
                ["1"] = "Metallic Graphite Black",
                ["2"] = "Metallic Black Steal",
                ["3"] = "Metallic Dark Silver",
                ["4"] = "Metallic Silver",
                ["5"] = "Metallic Blue Silver",
                ["6"] = "Metallic Steel Gray",
                ["7"] = "Metallic Shadow Silver",
                ["8"] = "Metallic Stone Silver",
                ["9"] = "Metallic Midnight Silver",
                ["10"] = "Metallic Gun Metal",
                ["11"] = "Metallic Anthracite Grey",
                ["12"] = "Matte Black",
                ["13"] = "Matte Gray",
                ["14"] = "Matte Light Grey",
                ["15"] = "Util Black",
                ["16"] = "Util Black Poly",
                ["17"] = "Util Dark silver",
                ["18"] = "Util Silver",
                ["19"] = "Util Gun Metal",
                ["20"] = "Util Shadow Silver",
                ["21"] = "Worn Black",
                ["22"] = "Worn Graphite",
                ["23"] = "Worn Silver Grey",
                ["24"] = "Worn Silver",
                ["25"] = "Worn Blue Silver",
                ["26"] = "Worn Shadow Silver",
                ["27"] = "Metallic Red",
                ["28"] = "Metallic Torino Red",
                ["29"] = "Metallic Formula Red",
                ["30"] = "Metallic Blaze Red",
                ["31"] = "Metallic Graceful Red",
                ["32"] = "Metallic Garnet Red",
                ["33"] = "Metallic Desert Red",
                ["34"] = "Metallic Cabernet Red",
                ["35"] = "Metallic Candy Red",
                ["36"] = "Metallic Sunrise Orange",
                ["37"] = "Metallic Classic Gold",
                ["38"] = "Metallic Orange",
                ["39"] = "Matte Red",
                ["40"] = "Matte Dark Red",
                ["41"] = "Matte Orange",
                ["42"] = "Matte Yellow",
                ["43"] = "Util Red",
                ["44"] = "Util Bright Red",
                ["45"] = "Util Garnet Red",
                ["46"] = "Worn Red",
                ["47"] = "Worn Golden Red",
                ["48"] = "Worn Dark Red",
                ["49"] = "Metallic Dark Green",
                ["50"] = "Metallic Racing Green",
                ["51"] = "Metallic Sea Green",
                ["52"] = "Metallic Olive Green",
                ["53"] = "Metallic Green",
                ["54"] = "Metallic Gasoline Blue Green",
                ["55"] = "Matte Lime Green",
                ["56"] = "Util Dark Green",
                ["57"] = "Util Green",
                ["58"] = "Worn Dark Green",
                ["59"] = "Worn Green",
                ["60"] = "Worn Sea Wash",
                ["61"] = "Metallic Midnight Blue",
                ["62"] = "Metallic Dark Blue",
                ["63"] = "Metallic Saxony Blue",
                ["64"] = "Metallic Blue",
                ["65"] = "Metallic Mariner Blue",
                ["66"] = "Metallic Harbor Blue",
                ["67"] = "Metallic Diamond Blue",
                ["68"] = "Metallic Surf Blue",
                ["69"] = "Metallic Nautical Blue",
                ["70"] = "Metallic Bright Blue",
                ["71"] = "Metallic Purple Blue",
                ["72"] = "Metallic Spinnaker Blue",
                ["73"] = "Metallic Ultra Blue",
                ["74"] = "Metallic Bright Blue",
                ["75"] = "Util Dark Blue",
                ["76"] = "Util Midnight Blue",
                ["77"] = "Util Blue",
                ["78"] = "Util Sea Foam Blue",
                ["79"] = "Uil Lightning blue",
                ["80"] = "Util Maui Blue Poly",
                ["81"] = "Util Bright Blue",
                ["82"] = "Matte Dark Blue",
                ["83"] = "Matte Blue",
                ["84"] = "Matte Midnight Blue",
                ["85"] = "Worn Dark blue",
                ["86"] = "Worn Blue",
                ["87"] = "Worn Light blue",
                ["88"] = "Metallic Taxi Yellow",
                ["89"] = "Metallic Race Yellow",
                ["90"] = "Metallic Bronze",
                ["91"] = "Metallic Yellow Bird",
                ["92"] = "Metallic Lime",
                ["93"] = "Metallic Champagne",
                ["94"] = "Metallic Pueblo Beige",
                ["95"] = "Metallic Dark Ivory",
                ["96"] = "Metallic Choco Brown",
                ["97"] = "Metallic Golden Brown",
                ["98"] = "Metallic Light Brown",
                ["99"] = "Metallic Straw Beige",
                ["100"] = "Metallic Moss Brown",
                ["101"] = "Metallic Biston Brown",
                ["102"] = "Metallic Beechwood",
                ["103"] = "Metallic Dark Beechwood",
                ["104"] = "Metallic Choco Orange",
                ["105"] = "Metallic Beach Sand",
                ["106"] = "Metallic Sun Bleeched Sand",
                ["107"] = "Metallic Cream",
                ["108"] = "Util Brown",
                ["109"] = "Util Medium Brown",
                ["110"] = "Util Light Brown",
                ["111"] = "Metallic White",
                ["112"] = "Metallic Frost White",
                ["113"] = "Worn Honey Beige",
                ["114"] = "Worn Brown",
                ["115"] = "Worn Dark Brown",
                ["116"] = "Worn straw beige",
                ["117"] = "Brushed Steel",
                ["118"] = "Brushed Black steel",
                ["119"] = "Brushed Aluminium",
                ["120"] = "Chrome",
                ["121"] = "Worn Off White",
                ["122"] = "Util Off White",
                ["123"] = "Worn Orange",
                ["124"] = "Worn Light Orange",
                ["125"] = "Metallic Securicor Green",
                ["126"] = "Worn Taxi Yellow",
                ["127"] = "police car blue",
                ["128"] = "Matte Green",
                ["129"] = "Matte Brown",
                ["130"] = "Worn Orange",
                ["131"] = "Matte White",
                ["132"] = "Worn White",
                ["133"] = "Worn Olive Army Green",
                ["134"] = "Pure White",
                ["135"] = "Hot Pink",
                ["136"] = "Salmon pink",
                ["137"] = "Metallic Vermillion Pink",
                ["138"] = "Orange",
                ["139"] = "Green",
                ["140"] = "Blue",
                ["141"] = "Mettalic Black Blue",
                ["142"] = "Metallic Black Purple",
                ["143"] = "Metallic Black Red",
                ["144"] = "hunter green",
                ["145"] = "Metallic Purple",
                ["146"] = "Metaillic V Dark Blue",
                ["147"] = "MODSHOP BLACK1",
                ["148"] = "Matte Purple",
                ["149"] = "Matte Dark Purple",
                ["150"] = "Metallic Lava Red",
                ["151"] = "Matte Forest Green",
                ["152"] = "Matte Olive Drab",
                ["153"] = "Matte Desert Brown",
                ["154"] = "Matte Desert Tan",
                ["155"] = "Matte Foilage Green",
                ["156"] = "DEFAULT ALLOY COLOR",
                ["157"] = "Epsilon Blue"
            }
            local classes = {
                ["0"] = "Compacts",
                ["1"] = "Sedans",
                ["2"] = "SUVs",
                ["3"] = "Coupes",
                ["4"] = "Muscle",
                ["5"] = "Sports Classics",
                ["6"] = "Sports",
                ["7"] = "Super",
                ["8"] = "Motorcycles",
                ["9"] = "Off-road",
                ["10"] = "Industrial",
                ["11"] = "Utility",
                ["12"] = "Vans",
                ["13"] = "Cycles",
                ["14"] = "Boats",
                ["15"] = "Helicopters",
                ["16"] = "Planes",
                ["17"] = "Service",
                ["18"] = "Emergency",
                ["19"] = "Military",
                ["20"] = "Commercial",
                ["21"] = "Trains"
            }
            RegisterCommand('registerCar', function()
                local ped = GetPlayerPed(-1);
                local veh = GetVehiclePedIsIn(ped, false);
                if veh == 0 then
                    TriggerEvent('chat:addMessage', {
                        color = {255, 0, 0},
                        multiline = true,
                        args = {
                            '[CAD - ERROR] ', 'You are not in a vehicle!'
                        }
                    })
                    return;
                else
                    local plate = GetVehicleNumberPlateText(veh)
                    local primary, secondary = GetVehicleColours(veh)
                    local class = GetVehicleClass(veh)
                    local model = GetEntityModel(veh)
                    local realName = GetDisplayNameFromVehicleModel(model)
                    realName = GetLabelText(realName)
                    primary = colorNames[tostring(primary)]
                    class = classes[tostring(class)]
                    TriggerServerEvent(GetCurrentResourceName() ..
                                           "::registerVeh", primary, plate,
                                       class, realName)
                end
            end)
            

🎮
VehReg submodule
Example Usage