Repository navigation
A3D_CreateZone
Create a box shaped zone that reports moving physics objects entering and leaving it.
A zone stops nothing. A3D_OnEntered and A3D_OnLeft are called in the script that created it. An object that comes to rest inside the zone stays inside it until it moves out.
native Physic:A3D_CreateZone(
Float:sizeX,
Float:sizeY,
Float:sizeZ,
Float:x,
Float:y,
Float:z,
Float:rx = 0.0,
Float:ry = 0.0,
Float:rz = 0.0,
worldid = -1
);| Parameter | Description | Default |
|---|---|---|
Float:sizeX |
Size on the X axis. | |
Float:sizeY |
Size on the Y axis. | |
Float:sizeZ |
Size on the Z axis. | |
Float:x |
Position on the X axis. | |
Float:y |
Position on the Y axis. | |
Float:z |
Position on the Z axis. | |
Float:rx |
Rotation on the X axis. | 0.0 |
Float:ry |
Rotation on the Y axis. | 0.0 |
Float:rz |
Rotation on the Z axis. | 0.0 |
worldid |
Virtual world it watches, or -1 for every world. |
-1 |
- The zone.
-
INVALID_PHYSIC_IDwhen a size is not positive, or the world is full.
A zone stops nothing and no query finds it. It only reports moving physics objects. Players, vehicles, actors and static objects never enter it.
A3D_OnEntered is called when an object starts to overlap the zone and A3D_OnLeft when it stops. An object that comes to rest inside a zone stays inside it, and its next move calls nothing until it leaves. A zone created over an object already inside calls A3D_OnEntered at the next step. The calls come after the step that saw the change, in the script that created the zone. The collision flags of the object do not matter, a zone sees every moving object of its world.
Use zones for goals, pockets, baskets and the edges of a play area.
Counts the goals of a ball game.
static
Physic:gGoal,
gGoals
;
public OnGameModeInit() {
gGoal = A3D_CreateZone(1.0, 7.3, 2.4, 1750.0, -2500.0, 13.75);
return 1;
}
public A3D_OnEntered(Physic:zoneid, Physic:physicid) {
if (zoneid != gGoal) {
return 1;
}
new message[32];
format(message, sizeof (message), "Goal number %i!", ++gGoals);
SendClientMessageToAll(-1, message);
return 1;
}- A3D_CreateZoneSphere: Create a sphere shaped zone that reports moving physics objects entering and leaving it.
- A3D_OnEntered: A moving physics object entered a zone.
- A3D_OnLeft: A moving physics object left a zone.
- A3D_DestroyObject: Destroy a physics object, a static object or a zone, and the global object that shows 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