Skip to content

Functions

imshooter edited this page Oct 23, 2026 · 4 revisions

Every native, stock and callback of 3DAndreas.inc, by subject.

Creating objects

Function Description
A3D_CreateObject Create a moving physics object shaped like the collision of a model, or as models.json describes the model.
A3D_CreateSphere Create a moving physics object shaped like a sphere.
A3D_CreateBox Create a moving physics object shaped like a box.
A3D_CreateStaticObject Create a physics object that never moves, shaped like the collision of a model.
A3D_CreateStaticBox Create an invisible box that never moves, such as a wall or a floor.
A3D_CreateStaticCylinder Create an invisible upright cylinder that never moves, such as a pillar.
A3D_CreateZone Create a box shaped zone that reports moving physics objects entering and leaving it.
A3D_CreateZoneSphere Create a sphere shaped zone that reports moving physics objects entering and leaving it.
A3D_CreateArea Create four walls around a rectangle on the ground.
A3D_DestroyObject Destroy a physics object, a static object or a zone, and the global object that shows it.
A3D_IsValidObject Whether a physics object, a static object or a zone exists.

Motion

Function Description
A3D_SetVelocity Set the velocity of a moving physics object and wake it up.
A3D_GetVelocity The velocity of a moving physics object.
A3D_GetSpeed The speed of a moving physics object.
A3D_GetMoveAngle The direction a moving physics object travels on the ground, as a facing angle.
A3D_ApplyImpulse Push a moving physics object through its centre of mass.
A3D_SetAcceleration Push a moving physics object with a constant acceleration until it is set to zero.
A3D_SetGravity Set how strongly a moving physics object falls.
A3D_SetRollingFriction Slow a moving physics object down by a constant amount, as a ball rolling on cloth.
A3D_SetPlanar Keep a moving physics object at its height, so it only moves along the ground.
A3D_IsMoving Whether a moving physics object is awake.

Placement

Function Description
A3D_SetPosition Move a physics object to a new place at once.
A3D_GetPosition The position of a physics object.
A3D_SetRotation Turn a physics object to a new rotation at once.
A3D_GetRotation The rotation of a physics object, as an object rotation.
A3D_SetWorld Move a physics object, a static object or a zone to another virtual world.
A3D_GetWorld The virtual world of a physics object.

Behaviour

Function Description
A3D_SetFriction Set how much a physics object grips what it touches.
A3D_SetBounce Set how much a physics object bounces.
A3D_SetDamping Set how fast a moving physics object loses speed and spin on its own.
A3D_SetBuoyancy Make a moving physics object float in the water of the map.
A3D_SetCollisions Choose what a moving physics object collides with.
A3D_GetCollisions What a moving physics object collides with.
A3D_SetCollisionSpeed Set the slowest impact of a moving physics object that calls A3D_OnCollided.
A3D_SetSyncError Set how far the object players see may stray from the body before a new move is sent.

Display and data

Function Description
A3D_GetObjectID The global object that shows a physics object.
A3D_AttachDynamicObject Show a moving physics object with a streamer object instead of a global object.
A3D_SetExtra Keep a number on a physics object, such as the item it stands for.
A3D_GetExtra Read a number kept on a physics object with A3D_SetExtra.
A3D_GetStats What the component has done since the server started.

Rays

Function Description
A3D_RayCast Find the first thing a segment between two points hits.
A3D_RayCastNormal Find the first thing a segment hits, and the direction its surface faces there.
A3D_RayCastAll Find everything a segment hits, nearest first.
A3D_IsLineOfSight Whether nothing stands between two points.
A3D_FindGround Find the ground under a point.

Shapes

Function Description
A3D_SweepSphere Move a sphere along a segment and find where it first touches something.
A3D_OverlapSphere Find everything a sphere overlaps.
A3D_OverlapBox Find everything a box overlaps, such as the room a vehicle or an object needs.
A3D_OverlapModel Find everything a model would overlap at a position, such as before placing an object.
A3D_IsModelColliding Whether a model would touch anything at a position.
A3D_CreateExplosion Push the moving physics objects around a point away from it.

Players, vehicles and actors

Function Description
A3D_GetPlayersInSphere Find the players within a distance of a point, nearest first.
A3D_GetPlayersInCone Find the players inside a cone, such as the view of a guard or the spread of a shotgun, nearest first.
A3D_GetVehiclesInSphere Find the vehicles within a distance of a point, nearest first.
A3D_GetActorsInSphere Find the actors within a distance of a point, nearest first.
A3D_GetActorsInCone Find the actors inside a cone, such as the view of a guard, nearest first.
A3D_GetPlayerTarget Find what a player looks at, from their camera.

Map probes

Function Description
A3D_IsPointInsideMap Whether a point lies inside the collision of the map, such as a player who fell under the ground or into a closed model.
A3D_FindRandomPoint Find a random spot on the ground around a point where something fits, such as a spawn or a dropped item.
A3D_PredictTrajectory Follow something thrown, such as a grenade, and find where it first lands.

Screen

Function Description
A3D_WorldToScreen Find where a point of the world shows on the screen of a player.
A3D_ScreenToWorld Find the direction a point of the screen of a player looks into, from the position of their camera.
A3D_GetScreenTarget Find what a point of the screen of a player shows, such as the place they clicked on a grid of text draws.
A3D_IsPointOnScreen Whether a point shows on the screen of a player.
A3D_GetPlayersOnScreen Find the players on the screen of a player, nearest first, in the same virtual world and interior.
A3D_GetVehiclesOnScreen Find the vehicles on the screen of a player, nearest first, in the same virtual world and interior, leaving out the one they are in.
A3D_GetActorsOnScreen Find the actors on the screen of a player, nearest first, in the same virtual world.

Map objects

Function Description
A3D_RemoveBuilding Remove the map objects of a model around a point, as RemoveBuildingForPlayer does for what players see.
A3D_RestoreBuilding Bring back map objects removed by A3D_RemoveBuilding.

Water

Function Description
A3D_GetWaterLevel Find the height of the water at a point of the map.
A3D_IsPointInWater Whether a point lies in the water of the map.

Models and surfaces

Function Description
A3D_GetModelBoundingBox Find the box that holds a model, around its position.
A3D_GetModelBoundingSphere Find the sphere that holds a model, around its position.
A3D_GetModelPhysics Find how the game moves a model that can be knocked over, such as a bin or a crate, in the values the natives of this include take.
A3D_GetMaterialName Find the name the game gives a surface, such as TARMAC or GRASS_SHORT_LUSH.
A3D_GetMaterialFlags Find what the game says of a surface, such as whether bullets pass through it or it is sand, glass or stairs.

Rotations and offsets

Function Description
A3D_EulerToQuaternion Turn the rotation of an object into a quaternion, in the order of GetVehicleRotationQuat.
A3D_QuaternionToEuler Turn a quaternion, such as one from GetVehicleRotationQuat, into the rotation of an object.
A3D_GetSurfaceRotation Find the rotation that stands an object on a surface, such as a crate on a slope.
A3D_GetReflection Find the direction something takes after bouncing off a surface, such as a bullet that ricochets.
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.
A3D_GetPositionOffset Find where a point of the world lies relative to an object, the reverse of A3D_GetOffsetPosition.
A3D_GetOffsetRotation Find the rotation in the world of something turned relative to an object, such as an object attached to another.
A3D_GetLookRotation Find the rotation that turns the front of an object, its Y axis, to a point, such as a camera or a turret.

Vehicles

Function Description
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.
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.

Routes

Function Description
A3D_FindRoute Find the best route between two points along the paths of the game.
A3D_DestroyRoute Destroy a route, and hide it from the players it is shown to.
A3D_IsValidRoute Whether a route exists.
A3D_GetRouteLength Length of a route, in metres.
A3D_GetRouteTime Time a route takes, in seconds.
A3D_GetRoutePointCount Number of points of a route, from its start to its end.
A3D_GetRoutePoint Read a point of a route.
A3D_GetRoutePoints Copy points of a route into three arrays.
A3D_GetRouteTurnCount Number of turns of a route.
A3D_GetRouteTurn Read a turn of a route, at a junction where more than two ways meet.
A3D_GetRouteProgress Find where a point is along a route: the distance left, the distance from the route and the next turn.
A3D_MeasureRoute Measure the best route between two points without keeping it, which is faster than finding it.
A3D_FindNearestByRoute Find which of several points the best route from a point reaches first, such as the nearest hospital by road rather than in a straight line.
A3D_GetNearestPathPoint Find the nearest point of a path a route can use, and the direction of the path there.

Route display

Function Description
A3D_ShowRouteForPlayer Show a route on the radar and the map of a player as a line, which moves on as they go.
A3D_HideRouteForPlayer Hide the route shown to a player.
A3D_GetPlayerRoute The route shown to a player.

Walking

Function Description
A3D_IsWalkMeshLoaded Whether the navigation mesh was read. A call made while the server starts waits for it.
A3D_GetNearestWalkPoint Find the nearest point of the navigation mesh, where a pedestrian can stand.
A3D_GetRandomWalkPoint Find a random point of the navigation mesh within a radius, which can be walked to from the centre, such as where an actor wanders next.
A3D_WalkRayCast Find where a straight walk between two points is stopped by a wall, a building, a ledge or the water.

Callbacks

Function Description
A3D_OnCollided A moving physics object hit something faster than its collision speed.
A3D_OnStopped A moving physics object came to rest, or fell below 3dandreas.floor and was stopped there.
A3D_OnEntered A moving physics object entered a zone.
A3D_OnLeft A moving physics object left a zone.
A3D_OnRouteArrived A player reached the end of the route shown to them. The route stays on the map until it is hidden or destroyed.
A3D_OnRouteLeft A player strayed from the route shown to them.
A3D_OnRouteAdvanced A player moved along the route shown to them: the next turn or the distance to it changed.

Home

Guides

Reference

Functions

Creating objects
Motion
Placement
Behaviour
Display and data
Rays
Shapes
Players, vehicles and actors
Map probes
Screen
Map objects
Water
Models and surfaces
Rotations and offsets
Vehicles
Routes
Route display
Walking
Callbacks

Clone this wiki locally