Repository navigation
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.
Parts come from the size of the model and the places the game gives for its seats, wheels and petrol cap. Bumpers lie at the ends of the box at the height the game gives them, doors on its sides at the height of the seats, and the driver sits on the left.
native bool:A3D_GetVehiclePartPosition(vehicleid, A3D_PART:part, &Float:x, &Float:y, &Float:z);| Parameter | Description |
|---|---|
vehicleid |
Vehicle to read. |
A3D_PART:part |
Part to find. |
&Float:x |
Position of the part on the X axis. |
&Float:y |
Position on the Y axis. |
&Float:z |
Position on the Z axis. |
-
truewhen the position was written. -
falsewhen there is no such vehicle, or its model lacks the part.
The places come from the data the game gives each model: its size, the places of the front and rear seats, of the wheels and of the petrol cap, and the heights of the bumpers. Vehicle parts tells how each part is placed.
A model without the part returns false, such as a vehicle with no rear seats, no middle wheels or no petrol cap.
Lets a player refuel only next to the petrol cap.
stock bool:IsAtPetrolCap(playerid, vehicleid) {
new
Float:x,
Float:y,
Float:z
;
if (!A3D_GetVehiclePartPosition(vehicleid, A3D_PART_PETROL_CAP, x, y, z)) {
return false;
}
return GetPlayerDistanceFromPoint(playerid, x, y, z) < 1.5;
}- A3D_GetVehicleOffsetPosition: Find where a point given relative to a vehicle lies in the world, as the vehicle stands and leans now.
- A3D_GetVehiclePositionOffset: Find where a point of the world lies relative to a vehicle, such as whether a player stands behind it.
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