I have a problem creating a zone in a different position and here is the code:
function createZone(posX, posY, posZ, interior, dimension, id)
local markerElement = createColCuboid (posX, posY, posZ, 197.5, 92, 30 )
local areasElement = createRadarArea( posX, posY, 300, 200, 255, 255, 255, 90 )
print("test2")
setElementInterior(markerElement, interior or 0)
setElementDimension(markerElement, dimension or 0)
setElementData(markerElement, "id", id or (#zone)+1 )
setElementData(markerElement, "zones", true)
--table.insert(zone, {marker = markerElement} )
table.insert(zone, {marker = markerElement} )
end
addCommandHandler ( "stworzzone",
function (source)
local x, y, z = getElementPosition( source )
createZone(z, y+1, z+5, 0, 0)
print("test")
end)
Problem solved
addCommandHandler ( "stworzzone",
function (source)
local x, y, z = getElementPosition( source )
createZone(z, y+1, z+5, 0, 0) --<-- HERE Z xD
print("test")
end)