Exports & Events

All exports and events available to integrate this resource into others.

Suggestions?

If you wish to have any exports or events added, please head over to our Discord and create a suggestion post. We are happy to allow for easier integration within other resources.

#Client Sided Exports

#Get Terrain Sink Debug Data

Returns the current terrain state, including active offsets, penalty factors, speed scaling, visual state, and per-wheel samples. This is intended for diagnostics and custom inspection interfaces; internal fields may expand as the terrain system evolves.

Example:

lua
---@param vehicle? integer
---@return table
local terrain = exports["zyke_vehicleterrain"]:GetTerrainSinkDebugData(vehicle)

#Get Terrain Sink Base Handling

Returns the unmodified handling baseline that Vehicle Terrain uses when composing its penalties. The table contains drive force, maximum flat velocity, drive inertia, traction curve values, low-speed traction loss, traction loss, and drag coefficient.

Example:

lua
---@param vehicle? integer
---@return table | nil
local handling = exports["zyke_vehicleterrain"]:GetTerrainSinkBaseHandling(vehicle)

#Open Terrain Wheel Type Menu

Opens the debug wheel-type menu for the vehicle currently being driven. Debugging and the configured command permission are required.

Example:

lua
---@param vehicle? integer
---@return boolean
local opened = exports["zyke_vehicleterrain"]:OpenTerrainWheelTypeMenu(vehicle)

#Restore Terrain Handling

Restores the vehicle's terrain handling baseline and rebuilds its current terrain state. Use this after another resource intentionally resets or replaces vehicle handling.

Example:

lua
---@param vehicle? integer
exports["zyke_vehicleterrain"]:RestoreTerrainHandling(vehicle)

#Client Sided Events

#Restore Handling

Restores the vehicle's terrain handling baseline and rebuilds its current terrain state. This event provides the same behavior as the RestoreTerrainHandling export.

Example:

lua
TriggerEvent("zyke_vehicleterrain:RestoreHandling", vehicle)