Repository navigation
A3D_GetStats
imshooter edited this page Oct 17, 2026
·
1 revision
What the component has done since the server started.
native bool:A3D_GetStats(&active, &updates, &Float:milliseconds);| Parameter | Description |
|---|---|
&active |
Bodies awake now: moving physics objects, zones, and the players, vehicles and actors in motion. |
&updates |
Object updates sent to players. |
&Float:milliseconds |
Time spent simulating and sending updates. |
-
truewhen the numbers were written.
updates counts the object changes sent since the server started, one for each move, stop or placement of an object, whatever the number of players who receive it.
milliseconds is the time spent simulating and working out the updates, without the callbacks the component calls. Read it twice and divide the difference by the seconds between the reads to get the cost per second. See Performance.
Prints what the component spent in the last minute.
static
gLastUpdates,
Float:gLastMilliseconds
;
forward @Stats_Print();
public @Stats_Print() {
new
active,
updates,
Float:milliseconds
;
A3D_GetStats(active, updates, milliseconds);
printf("3DAndreas: %i bodies awake, %i updates and %.1f ms in the last minute", active, updates - gLastUpdates, milliseconds - gLastMilliseconds);
gLastUpdates = updates;
gLastMilliseconds = milliseconds;
return 1;
}
public OnGameModeInit() {
SetTimer("@Stats_Print", 60000, true);
return 1;
}- A3D_SetSyncError: Set how far the object players see may stray from the body before a new move is sent.
- A3D_IsMoving: Whether a moving physics object is awake.
3DAndreas 0.6.3 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Physics objects
- Model settings
- World queries
- The screen
- Map database
- Coming from ColAndreas
- Performance
Reference
Functions