Skip to main content

Overview

The Zyrix API provides comprehensive vehicle spawning functions that allow staff members to create vehicles with custom properties, colors, and modifications.

SpawnVehicle

Spawn a vehicle at specified coordinates with optional customization.

Syntax

Parameters

  • staffId (number) - Server ID of the staff member spawning the vehicle
  • model (string|number) - Vehicle model name or hash
  • coords (vector4) - Spawn coordinates with heading
  • customization (table, optional) - Vehicle customization options

Customization Options

Returns

  • success (boolean) - Whether the vehicle was spawned successfully
  • status (string) - Status code: 'success', 'no_permission', 'invalid_model', 'invalid_coords'
  • vehicleNetId (number) - Network ID of the spawned vehicle

Example

Advanced Examples

Vehicle Preset System

Random Vehicle Spawner

Vehicle Fleet Management

Error Handling

Use vehicle presets and fleet management systems to streamline common spawning tasks and maintain consistency in your server events.