engineGetSurfaceProperties | Multi Theft Auto: Wiki Skip to content

engineGetSurfaceProperties

Client-side
Server-side
Shared

Pair: engineSetSurfaceProperties

This function retrieves the value of a surface property.

Syntax

​var|false engineGetSurfaceProperties ( ​int surfaceID, ​string property )
Required Arguments

Returns

  • var|false: property value

Returns the current property value, false if invalid arguments passed.

Code Examples

client

In this example, we retrieve the surface property value for a material with ID 5 and the property name audio. If successful, it displays the value; otherwise, it indicates an invalid input.

local surfaceID = 5 -- the material ID
local property = "audio" -- the property name
local propertyValue = engineGetSurfaceProperties(surfaceID, property)
if propertyValue then
outputChatBox("Surface property '" .. property .. "' value: " .. tostring(propertyValue))
-- returns : Surface property 'audio' value: concrete
else
outputChatBox("Invalid surface ID or property name.")
end

See Also

Engine Functions