04.01.2011, 22:46
0.3c brings new function - AttachObjectToVehicle. This is a powerful and handy function. With this you can do stuff like:
![](http://mathpudding.com/topsecretsamp/DFT%20ramps.jpg)
or
![](http://mathpudding.com/topsecretsamp/lioncage.jpg)
But getting coordinates for this based on car origin is difficult.
BUT to make this easier, gtab the sa map editor here: https://sampforum.blast.hk/showthread.php?tid=139409
Then the procedure is simple:
- Add a vehicle ide number to the map
- Place it at coordinates 0,0,0 with no rotation
- Move camera to it (use views tab - point camera here option)
- Remove the piece of ground that is in the way there
- Now add objects as you would want them on the car, click show code option and you get this - examples:
You can now use the coordinates and angles exported directly for AttachObjectToVehicle.
![](http://mathpudding.com/topsecretsamp/DFT%20ramps.jpg)
or
![](http://mathpudding.com/topsecretsamp/lioncage.jpg)
But getting coordinates for this based on car origin is difficult.
BUT to make this easier, gtab the sa map editor here: https://sampforum.blast.hk/showthread.php?tid=139409
Then the procedure is simple:
- Add a vehicle ide number to the map
- Place it at coordinates 0,0,0 with no rotation
- Move camera to it (use views tab - point camera here option)
- Remove the piece of ground that is in the way there
- Now add objects as you would want them on the car, click show code option and you get this - examples:
Код:
DFT examples: // side ramps option: CreateObject(3078, -1.48, -1.68, 0.71, -90.00, -90.00, 0.00); CreateObject(3078, 1.50, -1.72, 0.71, -90.00, -90.00, 0.00); // blue open cargo crate (you can also use the other 3 cargo container ids - 2932, 2934, 2935) CreateObject(3043, -0.01, -2.06, 1.20, 0.00, 0.00, 0.00); // lion cage option CreateObject(2909, -1.37, -1.75, 0.95, 0.00, 0.00, 0.00); CreateObject(2909, 1.43, -1.75, 0.95, 0.00, 0.00, 0.00); CreateObject(2909, 0.02, -1.77, 2.19, 0.00, -90.00, 0.00); CreateObject(2904, 0.02, -5.62, 0.98, 0.00, 90.00, 0.00);