Repository navigation
A3D_SetExtra
imshooter edited this page Oct 17, 2026
·
1 revision
Keep a number on a physics object, such as the item it stands for.
native bool:A3D_SetExtra(Physic:physicid, slot, value);| Parameter | Description |
|---|---|
Physic:physicid |
Physics object to change. |
slot |
Slot of the number, from 0 to 7. |
value |
Number to keep. |
-
truewhen the number was kept. -
falsewhenphysicidis not a physics object, orslotis out of range.
Every physics object holds eight numbers, from slot 0 to 7, which start at 0 and are cleared when the object is destroyed. They let a callback find what an object stands for without a search, such as the item it is, the player who threw it or a streamer object.
A tagged value is kept with _: and read back with its tag.
Gives a thrown item back to its owner when it stops.
#define THROWN_ITEM 0
#define THROWN_BY 1
stock Physic:ThrowItem(playerid, itemid, Float:x, Float:y, Float:z) {
new Physic:item = A3D_CreateBox(1271, 0.7, 0.8, 0.7, x, y, z, 0.0, 0.0, 0.0, 10.0);
A3D_SetExtra(item, THROWN_ITEM, itemid);
A3D_SetExtra(item, THROWN_BY, playerid);
return item;
}
public A3D_OnStopped(Physic:physicid, Float:x, Float:y, Float:z) {
new message[64];
format(message, sizeof (message), "Your item %i landed.", A3D_GetExtra(physicid, THROWN_ITEM));
SendClientMessage(A3D_GetExtra(physicid, THROWN_BY), -1, message);
return 1;
}-
A3D_GetExtra: Read a number kept on a physics object with
A3D_SetExtra. - 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.floorand was stopped there.
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