Repository navigation
A3D_GetVehiclePositionOffset
imshooter edited this page Oct 17, 2026
·
1 revision
Find where a point of the world lies relative to a vehicle, such as whether a player stands behind it.
native bool:A3D_GetVehiclePositionOffset(
vehicleid,
Float:x,
Float:y,
Float:z,
&Float:offsetX,
&Float:offsetY,
&Float:offsetZ
);| Parameter | Description |
|---|---|
vehicleid |
Vehicle to measure from. |
Float:x |
Point in the world on the X axis. |
Float:y |
Point on the Y axis. |
Float:z |
Point on the Z axis. |
&Float:offsetX |
Offset along the X axis of the vehicle, positive to its right. |
&Float:offsetY |
Offset along its Y axis, positive to its front. |
&Float:offsetZ |
Offset along its Z axis, positive up. |
-
truewhen the offset was written. -
falsewhen there is no such vehicle.
The reverse of A3D_GetVehicleOffsetPosition. The sign of each part tells the side: a negative Y lies behind the centre and a negative X to the left.
Tells whether a player stands behind a vehicle, close to it.
stock bool:IsBehindVehicle(playerid, vehicleid) {
new
Float:x,
Float:y,
Float:z,
Float:offsetX,
Float:offsetY,
Float:offsetZ,
Float:sizeX,
Float:sizeY,
Float:sizeZ
;
GetPlayerPos(playerid, x, y, z);
if (!A3D_GetVehiclePositionOffset(vehicleid, x, y, z, offsetX, offsetY, offsetZ)) {
return false;
}
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, sizeX, sizeY, sizeZ);
return offsetY < -sizeY / 2.0 && offsetY > -sizeY / 2.0 - 1.5 && floatabs(offsetX) < sizeX / 2.0;
}- A3D_GetVehicleOffsetPosition: Find where a point given relative to a vehicle lies in the world, as the vehicle stands and leans now.
-
A3D_GetPositionOffset: Find where a point of the world lies relative to an object, the reverse of
A3D_GetOffsetPosition.
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