local gate={
-- var
object=createObject(2990, 2237, -2218.1999511719, 16.5, 0, 0, 313.74981689453),
marker=createMarker(2235.72, -2219.71, 13.55, "cylinder", 9, 0, 255, 0, 0),
closed=true,
animation=false,
}
gate.open=function()
if gate.animation or not gate.closed then return end
gate.animation=true
moveObject(gate.object, 5000, 2237, -2218.1999511719, 16.5, 0, 0, 0, "OutQuad")
setTimer(function()
gate.animation=false; gate.closed=false
end, 6000, 1)
end
gate.close=function()
if gate.animation or gate.closed then return end
gate.animation=true
moveObject(gate.object, 5000, 2237, -2218.1999511719, 7.5, 0, 0, 0, "OutQuad")
setTimer(function()
gate.animation=false; gate.closed=true
end, 6000, 1)
end
gate.toggle=function(el)
if not el then return end
if getElementData(el, 'player:duty')=='LSSD' then
if gate.animation then
outputChatBox('* Odczekaj chwile...', el, 255, 0, 0)
return
end
if gate.closed then
gate.open()
setTimer(function()
gate.close()
end, 3000, 1)
end
else
outputChatBox("* Nie jeste? na s?u?bie, lub nie pracujesz w LSSD.", el, 255, 0, 0)
end
end
addEventHandler("onMarkerHit", gate.marker, function(el,md)
gate.toggle(el)
end)