⚙️
TMC v2 Core
DiscordWebsite
  • Get Started
  • TMC Core Object
    • Client Functions
      • Vehicle Functions
      • Interaction Ped Functions
      • Interaction Object Functions
      • Interaction Prompts
      • Polyzones
    • Client Menus
    • Events
      • Client
      • Server
    • Server Functions
      • General Functions
      • Commands
      • Player Functions
    • Common Functions
    • 🚘Vehicle Names
  • Object Models
    • Job
  • 📄Other Resources
    • ✨Status Effects
    • 📤Dispatch
    • 🫂Parties
    • 💶Banking
    • 🔍Evidence
Powered by GitBook
On this page
  • SpawnVehicle
  • GetVehiclesInArea
  • IsSpawnPointClear
  • GetClosestVehicle
  • GetClosestVehicle
  • GetVehicles
  1. TMC Core Object
  2. Client Functions

Vehicle Functions

SpawnVehicle

Spawns vehicle at specified location

Parameter
Required
Type
Description

model

hash or string

Model or hash of the vehicle

coords

vector4

Coords to spawn vehicle at, defaults to ped current location

isNetworked

Boolean

Should the vehicle be networked

TMC.Functions.SpawnVehicle(model, coords, isNetworked)

GetVehiclesInArea

Returns an array of vehicle entity handles in the radius of the specified coords

Parameter
Required
Type
Description

coords

vector3

The coords to check at

area

Number

The radius size to check for at the specified coords

local vehicles = TMC.Functions.GetVehiclesInArea()

IsSpawnPointClear

Returns a bool indicating if there are any vehicles a the specified coords and radius

Parameter
Required
Type
Description

coords

vector3

The coords to check at

maxDistance

Number

The radius size to check for at the specified coords

if TMC.Functions.IsSpawnPointClear() then
    --
else
    --
end

GetClosestVehicle

Returns the closest vehicle entity handle

Parameter
Required
Type
Description

coords

vector3

The coords at which to find the closest ped. If not passed through it'll use your ped's coords

local closestVehicle = TMC.Functions.GetClosestVehicle()

GetClosestVehicle

Returns the closest vehicle entity handle

Parameter
Required
Type
Description

coords

vector3

The coords at which to find the closest ped. If not passed through it'll use your ped's coords

local closestVehicle = TMC.Functions.GetClosestVehicle()

GetVehicles

Returns an array containing entity handles for each entity in the ped game pool

-- GetGamePool("CVehicle")
local vehicles = TMC.Functions.GetVehicles()
for k,v in ipairs(vehicles) do
    -- v = entity
end
PreviousClient FunctionsNextInteraction Ped Functions

Last updated 8 months ago