Repository navigation
A3D_GetMaterialName
imshooter edited this page Oct 17, 2026
·
1 revision
Find the name the game gives a surface, such as TARMAC or GRASS_SHORT_LUSH.
native bool:A3D_GetMaterialName(material, name[], size = sizeof (name));| Parameter | Description | Default |
|---|---|---|
material |
Surface, as the natives that hit something give it. | |
name[] |
The name. | |
size |
Room in name. |
sizeof (name) |
-
truewhen the name was written. -
falsewhen there is no such surface, or the database has no surfaces.
The names are those of surfinfo.dat, such as TARMAC, GRASS_SHORT_LUSH or WOOD_SOLID. Surfaces lists all 179. Players carry PED and vehicles CAR.
A ColAndreas database has no surfaces, and the native returns false.
Tells a player what they stand on.
stock TellGround(playerid) {
new
Float:x,
Float:y,
Float:z,
Float:hitX,
Float:hitY,
Float:hitZ,
A3D_HIT:type,
hitid,
material,
name[32],
message[64]
;
GetPlayerPos(playerid, x, y, z);
if (!A3D_RayCast(x, y, z, x, y, z - 3.0, hitX, hitY, hitZ, type, hitid, material, .flags = A3D_COLLIDE_MAP)) {
return;
}
if (!A3D_GetMaterialName(material, name)) {
return;
}
format(message, sizeof (message), "You stand on %s.", name);
SendClientMessage(playerid, -1, message);
}- A3D_GetMaterialFlags: Find what the game says of a surface, such as whether bullets pass through it or it is sand, glass or stairs.
- A3D_RayCast: Find the first thing a segment between two points hits.
3DAndreas 0.7.0 · 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