Search In
• More options...
Find results that contain...
Find results in...

# [DOC] ATTACH_CAR_TO_CAR

## Recommended Posts

I guess it's far enough so i can share and it can be useful..

Haven't found the explanation on Wiki, so somebody with permission should update it a little..

`Function.Call<void>("ATTACH_CAR_TO_CAR", Vehicle child, Vehicle parent, bool true/false, float off.X, float off.Y, float off.Z, float rot.X, float rot.Y, float rot.Z);`

As far as i've tested it.. and it works perfectly!.. This is how it goes..

Vehicle child, parent - self explanatory..

the boolean value for offset and rotation... hence putting TRUE sets the function to take relative (relative in relation to parent) values for Position offset and rotation, and probably putting FALSE takes in Absolute (world coord) values for Position and Rotation of Child.

NOTE! : values for Rotation are put in in radians... so multiply your Vector with (*3.14159F/180) - Vehicle.Rotation is in degrees.

That's it... simple as pie

Ow yeah.. i mustn't forget :

`Function.Call<void>("DETACH_CAR", Vehicle child, bool true/false);`

I don't really know what that boolean does... maybe now you can help me test it a bit further

And another thing... The heading of the Child doesn't get saved, so when detaching the vehicle will jerk violently in the direction in wich it was attached if you don't put

the right new heading to the Child before Detaching it.. and also... don't forget to put it to your Room also b4 detaching... or it will explode when attached in one Room and Detached in another...

Uf.. i believe that's all..

That's all for now.. greetz!

Edited by speesy

##### Share on other sites

Good job! But in the future, you can add them to this topic (a few posts below this one)

http://www.gtaforums.com/index.php?showtopic=387783

which is our catch-all for native related stuff.

Also, anyone with a GTAForums account can edit the wiki, so feel free!

##### Share on other sites

I'm sorry... i should've seen that..

Thanks for the info on Wiki.. and in the future i'll put it in the right Topic

##### Share on other sites

I updated the Wiki for ya

##### Share on other sites

Tnx m8!

Saved me a bit of trouble..

I'm getting gray now on trying to figure out the ATTACH_CAR_TO_CAR_PHYSICALLY... damn

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×