AttachObjectToVehicle

AttachObjectToVehicle

Description:
Function AttachObjectToVehicle attach an object to a vehicle.
Function AttachObjectToVehicle was added in 0.3c and will not work in earlier versions!
The object must be created first.
When the vehicle is destroyed or respawned, the attached objects won't be destroyed with it; they will remain stationary at the position the vehicle disappeared and be reattached to the next vehicle to claim the vehicle ID that the objects were attached to.


Parameters:
(objectid, vehicleid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:RotX, Float:RotY, Float:RotZ)
int objectid The ID of the object to attach to the vehicle. Note that this is an object ID, not a model ID. The object must be CreateObject created first.
int vehicleid The ID of the vehicle to attach the object to.
float OffsetX The X axis offset from the vehicle to attach the object to.
float OffsetY The Y axis offset from the vehicle to attach the object to.
float OffsetZ The Z axis offset from the vehicle to attach the object to.
float RotX The X rotation offset for the object.
float RotY The Y rotation offset for the object.
float RotZ The Z rotation offset for the object.


Return Values:
This function does not return any specific values.


Examples:
new objectid = CreateObject(...);
new vehicleid = GetPlayerVehicleID(playerid);
AttachObjectToVehicle(objectid, vehicleid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);


Related Functions
The following functions may be useful, as they are related to this function in one way or another.