Repository navigation
A3D_GetVehicleOffsetPosition
imshooter edited this page Oct 17, 2026
·
1 revision
Find where a point given relative to a vehicle lies in the world, as the vehicle stands and leans now.
X points to the right of the vehicle, Y to its front and Z up.
native bool:A3D_GetVehicleOffsetPosition(
vehicleid,
Float:offsetX,
Float:offsetY,
Float:offsetZ,
&Float:x,
&Float:y,
&Float:z
);| Parameter | Description |
|---|---|
vehicleid |
Vehicle the offset belongs to. |
Float:offsetX |
Offset along the X axis of the vehicle. |
Float:offsetY |
Offset along its Y axis. |
Float:offsetZ |
Offset along its Z axis. |
&Float:x |
The point in the world on the X axis. |
&Float:y |
The point on the Y axis. |
&Float:z |
The point on the Z axis. |
-
truewhen the point was written. -
falsewhen there is no such vehicle.
The vehicle is taken where the server knows it now, with its whole rotation, so the offset follows the vehicle up slopes and when it rolls over. X points to the right of the vehicle, Y to its front and Z up, from the centre of the model.
Drops a crate half a metre behind the boot of a vehicle.
stock DropBehind(vehicleid) {
new
Float:sizeX,
Float:sizeY,
Float:sizeZ,
Float:x,
Float:y,
Float:z
;
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, sizeX, sizeY, sizeZ);
if (!A3D_GetVehicleOffsetPosition(vehicleid, 0.0, -sizeY / 2.0 - 0.5, 0.0, x, y, z)) {
return;
}
A3D_CreateObject(1271, x, y, z, 0.0, 0.0, 0.0, 20.0);
}- A3D_GetVehiclePositionOffset: Find where a point of the world lies relative to a vehicle, such as whether a player stands behind it.
- A3D_GetVehiclePartPosition: Find where a part of a vehicle lies in the world, such as the boot for a player to open it or the petrol cap to refuel.
- A3D_GetOffsetPosition: Find where a point given relative to an object lies in the world, such as a spot on a table or the end of a ramp.
3DAndreas 0.7.1 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Physics objects
- Model settings
- World queries
- The screen
- Routes
- Navigation mesh
- Map database
- Coming from ColAndreas
- Performance
Reference
Functions