getElementByType http://development.mtasa.com/index.php? ... entsByType
ex:
for k,v in ipairs(getElementsByType ( "cylinder" )) do
markerGrav[k] = {}
markerGrav[k].red = getElementData ( v, "red" )
markerGrav[k].green = getElementData ( v, "green" )
markerGrav[k].blue = getElementData ( v, "blue" )
markerGrav[k].cylinder = {}
for i,j in ipairs(getChildren ( v, "cylinder" )) do
markerGrav[k].cylinder[i] = {}
markerGrav[k].cylinder[i].size = getElementData( j, "size" )
markerGrav[k].cylinder[i].alpha = getElementData( j, "alpha" )
markerGrav[k].cylinder[i].grav = getElementData( j, "grav" )
-- markerGrav[k].cylinder[i].chat = getElementData( j, "chat" )
end
--position
markerGrav[k].position = {}
for i,j in ipairs(getChildren ( v, "position" )) do
markerGrav[k].position[i] = {}
markerGrav[k].position[i].posX = getElementData ( j, "posX" )
markerGrav[k].position[i].posY = getElementData ( j, "posY" )
markerGrav[k].position[i].posZ = getElementData ( j, "posZ" )
local marker = createMarker ( markerGrav[k].position[i].posX, markerGrav[k].position[i].posY, markerGrav[k].position[i].posZ, "cylinder", markerGrav[k].cylinder[i].size, markerGrav[k].red, markerGrav[k].green, markerGrav[k].blue, markerGrav[k].cylinder[i].alpha )
and in my map file:
These are the children --->
These are the children --->