VehicleClient

attachVehicleToCargobob

ATTACH_VEHICLE_TO_CARGOBOB0x4127F1D84E347769

The GTA V native ATTACH_VEHICLE_TO_CARGOBOB of the VEHICLE namespace, as LS:MP client scripts call it: the global function attachVehicleToCargobob, in JavaScript and in Lua.

SignatureJavaScript
attachVehicleToCargobob(
  cargobob: Vehicle,
  vehicle: Vehicle,
  p2: number,
  x: number,
  y: number,
  z: number
): void
SignatureLua
attachVehicleToCargobob(
  cargobob: Vehicle,
  vehicle: Vehicle,
  p2: integer,
  x: number,
  y: number,
  z: number
)

Usage

JavaScript
attachVehicleToCargobob(cargobob, vehicle, p2, x, y, z);
Lua
attachVehicleToCargobob(cargobob, vehicle, p2, x, y, z)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
attachVehicleToCargobob(cargobob, vehicle, p2, pos);
Lua · with vectors
attachVehicleToCargobob(cargobob, vehicle, p2, pos)

Parameters

ParameterTypeJavaScriptLua
cargobobVehiclenumberinteger
vehicleVehiclenumberinteger
p2intnumberinteger
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber

Returns

Nothing. In JavaScript the call evaluates to undefined.

Reference

Namespace
Vehicle VEHICLE
In the game
void ATTACH_VEHICLE_TO_CARGOBOB(Vehicle cargobob, Vehicle vehicle, int p2, float x, float y, float z)
Hash
0x4127F1D84E347769

Open in the interactive natives reference