local gate={
-- var
object=createObject(969, 1544.70,-1630.85,12.51,0,0,90),
marker=createMarker(1544.29,-1626.99,13.38-1, "cylinder", 9, 0, 0, 0, 0),
close=true,
animation=false,
}
gate.open=function()
if gate.animation or not gate.close then return end
gate.animation=true
moveObject(gate.object, 5000, 1544.70,-1630.85,9.01,0,0,0, "OutQuad")
setTimer(function()
gate.animation=false; gate.close=false
end, 6000, 1)
end
gate.close=function()
if gate.animation or gate.close then return end
gate.animation=true
moveObject(gate.object, 2000, 1544.70,-1630.85,12.51,0,0,0, "OutQuad")
setTimer(function()
gate.animation=false; gate.close=true
end, 6000, 1)
end
--------------------------------------------------------------------------------------------
local gate1={
-- var
object=createObject(969, 1584.75,-1637.87,12.54),
marker1=createMarker(1589.04,-1637.47,13.44-1, "cylinder", 9, 0, 0, 0, 0)
close1=true,
animation1=false,
}
gate1.open=function()
if gate1.animation1 or not gate1.close1 then return end
gate1.animation1=true
moveObject(gate1.object, 5000, 1584.75,-1637.87,8.54, "OutQuad")
setTimer(function()
gate1.animation1=false; gate1.close1=false
end, 6000, 1)
end
gate1.close=function()
if gate1.animation1 or gate1.close1 then return end
gate1.animation1=true
moveObject(gate1.object, 2000,1584.75,-1637.87,12.54, "OutQuad")
setTimer(function()
gate1.animation1=false; gate1.close1=true
end, 6000, 1)
end
-----------------------------------------------------------------------------------------------------------------------------
gate.toggle=function(el)
if not el then return end
if getElementData(el, 'player:duty')=='SAPD' then
if gate.animation then
outputChatBox('* Odczekaj chwile...', el, 255, 0, 0)
return
end
if gate.close then
gate.open()
setTimer(function()
gate.close()
end, 8000, 1)
end
else
outputChatBox("* Nie jeste? na s?u?bie, lub nie pracujesz w policji.", el, 255, 0, 0)
end
end
addEventHandler("onMarkerHit", gate.marker, function(el,md)
gate.toggle(el)
end)
--------------------------------------------------------------------------------------------------------------------
gate1.toggle1=function(el)
if not el then return end
if getElementData(el, 'player:duty')=='SAPD' then
if gate1.animation1 then
outputChatBox('* Odczekaj chwile...', el, 255, 0, 0)
return
end
if gate1.close then
gate1.open()
setTimer(function()
gate1.close()
end, 8000, 1)
end
else
outputChatBox("* Nie jeste? na s?u?bie, lub nie pracujesz w policji.", el, 255, 0, 0)
end
end
addEventHandler("onMarkerHit", gate1.marker1, function(el,md)
gate1.toggle1(el)
end)
s_gate.lua:36: '}' expected ( to close '{' at line 32) near 'close1'
marker1=createMarker(1589.04,-1637.47,13.44-1, "cylinder", 9, 0, 0, 0, 0)
tu przecinka na ko?cu brakuje, ale poczekaj chwile bo wydaje mi si?, ?e jeszcze b??dy b?d?
[ Dodano: 2019-01-03, 22:42 ]
local gate={
-- var
object=createObject(969, 1544.70,-1630.85,12.51,0,0,90),
marker=createMarker(1544.29,-1626.99,13.38-1, "cylinder", 9, 0, 0, 0, 0),
close=true,
animation=false,
}
gate.open=function()
if gate.animation or not gate.close then return end
gate.animation=true
moveObject(gate.object, 5000, 1544.70,-1630.85,9.01,0,0,0, "OutQuad")
setTimer(function()
gate.animation=false; gate.close=false
end, 6000, 1)
end
gate.fclose=function()
if gate.animation or gate.close then return end
gate.animation=true
moveObject(gate.object, 2000, 1544.70,-1630.85,12.51,0,0,0, "OutQuad")
setTimer(function()
gate.animation=false; gate.close=true
end, 6000, 1)
end
--------------------------------------------------------------------------------------------
local gate1={
-- var
object=createObject(969, 1584.75,-1637.87,12.54),
marker1=createMarker(1589.04,-1637.47,13.44-1, "cylinder", 9, 0, 0, 0, 0),
close1=true,
animation1=false
}
gate1.open=function()
if gate1.animation1 or not gate1.close1 then return end
gate1.animation1=true
moveObject(gate1.object, 5000, 1584.75,-1637.87,8.54,0,0,0, "OutQuad")
setTimer(function()
gate1.animation1=false; gate1.close1=false
end, 6000, 1)
end
gate1.close=function()
if gate1.animation1 or gate1.close1 then return end
gate1.animation1=true
moveObject(gate1.object, 2000,1584.75,-1637.87,12.54,0,0,0, "OutQuad")
setTimer(function()
gate1.animation1=false; gate1.close1=true
end, 6000, 1)
end
-----------------------------------------------------------------------------------------------------------------------------
gate.toggle=function(el)
if not el then return end
if getElementData(el, 'player:duty')=='SAPD' then
if gate.animation then
outputChatBox('* Odczekaj chwile...', el, 255, 0, 0)
return
end
if gate.close then
gate.open()
setTimer(function()
gate.fclose()
end, 8000, 1)
end
else
outputChatBox("* Nie jeste? na s?u?bie, lub nie pracujesz w policji.", el, 255, 0, 0)
end
end
addEventHandler("onMarkerHit", gate.marker, function(el,md)
gate.toggle(el)
end)
--------------------------------------------------------------------------------------------------------------------
gate1.toggle1=function(el)
if not el then return end
if getElementData(el, 'player:duty')=='SAPD' then
if gate1.animation1 then
outputChatBox('* Odczekaj chwile...', el, 255, 0, 0)
return
end
if gate1.close then
gate1.open()
setTimer(function()
gate1.close()
end, 8000, 1)
end
else
outputChatBox("* Nie jeste? na s?u?bie, lub nie pracujesz w policji.", el, 255, 0, 0)
end
end
addEventHandler("onMarkerHit", gate1.marker1, function(el,md)
gate1.toggle1(el)
end)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach