local movingGates = {}
function addFractionGate(tbl1,tbl2,time,colsize)
local model, x, y, z, xr,yr,zr = unpack(tbl1)
local gate = createObject( model,x,y,z,0,0,zr or 0)
local tx, ty, tz,txr,tyr,tzr = unpack(tbl2)
local col = createColSphere( x, y, z, colsize )
setElementInterior(gate,tbl1[8] or 0)
setObjectScale(gate,1.03)
addEventHandler("onColShapeHit",col,function (hit)
if not movingGates[gate] then
if hit and getElementType(hit)=="player" then
if getElementData(hit,"maFrakcje") == "PSP" then
movingGates[gate] = true
if tzr then
moveObject( gate, time,tx,ty,tz,(txr-xr),(tyr-yr),(tzr-zr) or 0)
else
moveObject( gate, time,tx,ty,tz,0,0,0)
end
setTimer(function ()
if not tzr then
moveObject( gate, time,x,y,z,0,0,0)
else
moveObject( gate, time,x,y,z,-(txr-xr),-(tyr-yr),-(tzr-zr))
end
setTimer(function ()
movingGates[gate] = nil
end,time,1)
end,time+2500,1)
end
end
end
end,false)
end
addFractionGate({3089,1718.7,-1756.9,13.9,0,0,0},{1718.7-0.8,-1756.9,13.9,0,0,0},3000,2)-- Kolo recepcji
addFractionGate({3089,1721.7,-1756.9,13.9,0,0,180},{1721.7+0.8,-1756.9,13.9,0,0,180},3000,2)-- Kolo recepcji
setOcclusionsEnabled( false )
bm21 = createMarker(-2281.71997, -168.18771, 35.37031-0.9, "cylinder", 1, 255, 255, 255, 30) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d21 = createObject (5856, -2280.6999511719-0.05,-164.69999694824,35.700000762939+0.5,0,0,0 ) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function od ( thePlayer)
if isElementWithinMarker(thePlayer, bm21) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d21,5000 ,-2280.6999511719,-164.69999694824,41.200000762939 ) -- Koordy otwartych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
function zd ( thePlayer)
if isElementWithinMarker(thePlayer, bm21) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d21, 5000 ,-2280.6999511719-0.05,-164.69999694824,35.700000762939+0.5) -- koordy zamknietych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
addCommandHandler("o", od ) -- haslo otwartych drzwi
addCommandHandler("z", zd ) -- haslo zamknietych drzwi
bm25 = createMarker(-2281.90918, -159.78741, 35.37031-0.9, "cylinder", 1, 255, 255, 255, 30) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d25 = createObject (5856, -2280.7001953125-0.05,-156.599609375,35.700000762939+0.5,0,0,0 ) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function od ( thePlayer)
if isElementWithinMarker(thePlayer, bm25) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d25,5000 ,-2280.7001953125,-156.599609375,41.200000762939 ) -- Koordy otwartych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
function zd ( thePlayer)
if isElementWithinMarker(thePlayer, bm25) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d25, 5000 ,-2280.7001953125-0.05,-156.599609375,35.700000762939+0.5) -- koordy zamknietych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
addCommandHandler("o", od ) -- haslo otwartych drzwi
addCommandHandler("z", zd ) -- haslo zamknietych drzwi
bm49 = createMarker(-2282.25854, -151.58841, 35.37031-0.9, "cylinder", 1, 255, 255, 255, 30) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d49 = createObject (5856, -2280.7001953125-0.05,-148.5,35.700000762939+0.5,0,0,0 ) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function od ( thePlayer)
if isElementWithinMarker(thePlayer, bm49) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d49,5000 ,-2280.7001953125,-148.5,41.200000762939 ) -- Koordy otwartych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
function zd ( thePlayer)
if isElementWithinMarker(thePlayer, bm49) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d49, 5000 ,-2280.7001953125-0.05,-148.5,35.700000762939+0.5) -- koordy zamknietych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
addCommandHandler("o", od ) -- haslo otwartych drzwi
addCommandHandler("z", zd ) -- haslo zamknietych drzwi
bm51 = createMarker(-2281.95142, -143.38803, 35.37031-0.9, "cylinder", 1, 255, 255, 255, 30) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d51 = createObject (5856, -2280.7001953125-0.05,-140.400390625,35.700000762939+0.5,0,0,0 ) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function od ( thePlayer)
if isElementWithinMarker(thePlayer, bm51) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d51,5000 ,-2280.7001953125,-140.400390625,41.200000762939 ) -- Koordy otwartych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
function zd ( thePlayer)
if isElementWithinMarker(thePlayer, bm51) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d51, 5000 ,-2280.7001953125-0.05,-140.400390625,35.700000762939+0.5) -- koordy zamknietych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
addCommandHandler("o", od ) -- haslo otwartych drzwi
addCommandHandler("z", zd ) -- haslo zamknietych drzwi
bm59 = createMarker(-2281.87329, -135.85744, 35.37031-0.9, "cylinder", 1, 255, 255, 255, 30) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d59 = createObject (5856, -2280.7001953125-0.05,-132.400390625,35.700000762939+0.5,0,0,0 ) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function od ( thePlayer)
if isElementWithinMarker(thePlayer, bm59) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d59,5000 ,-2280.7001953125,-132.400390625,41.200000762939 ) -- Koordy otwartych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
function zd ( thePlayer)
if isElementWithinMarker(thePlayer, bm59) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d59, 5000 ,-2280.7001953125-0.05,-132.400390625,35.700000762939+0.5) -- koordy zamknietych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
addCommandHandler("o", od ) -- haslo otwartych drzwi
addCommandHandler("z", zd ) -- haslo zamknietych drzwi
bm91 = createMarker(-2282.06396, -127.67061, 35.37031-0.9, "cylinder", 1, 255, 255, 255, 30) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d91 = createObject (5856, -2280.7001953125-0.05,-124.400390625,35.700000762939+0.5,0,0,0 ) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function od ( thePlayer)
if isElementWithinMarker(thePlayer, bm91) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d91,5000 ,-2280.7001953125,-124.400390625,41.200000762939 ) -- Koordy otwartych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
function zd ( thePlayer)
if isElementWithinMarker(thePlayer, bm91) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d91, 5000 ,-2280.7001953125-0.05,-124.400390625,35.700000762939+0.5) -- koordy zamknietych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
addCommandHandler("o", od ) -- haslo otwartych drzwi
addCommandHandler("z", zd ) -- haslo zamknietych drzwi
bm92 = createMarker(-2298.16113, -179.45503, 35.37031-0.9, "cylinder", 1, 255, 255, 255, 30) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d92 = createObject (5856, -2294.8994140625-0.05,-180.5,35.700000762939+0.5,0,0,90 ) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function od ( thePlayer)
if isElementWithinMarker(thePlayer, bm92) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d92,5000 ,-2294.8994140625,-180.5,41.200000762939 ) -- Koordy otwartych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
function zd ( thePlayer)
if isElementWithinMarker(thePlayer, bm92) then
if getElementData(thePlayer,"player:duty")=="PSP" then
moveObject ( d92, 5000 ,-2294.8994140625-0.05,-180.5,35.700000762939+0.5) -- koordy zamknietych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
addCommandHandler("o", od ) -- haslo otwartych drzwi
addCommandHandler("z", zd ) -- haslo zamknietych drzwi