Tessék.
local pos = {1418.9699707031, -1841.4000244141, 15.300000190735}
local objGateg = createObject(980, pos[1], pos[2], pos[3], 0, 0, 270)
local open = false
function usePDFrontGarageGate(playerSource)
local x, y, z = getElementPosition(playerSource)
local distance = getDistanceBetweenPoints3D(pos[1], pos[2], pos[3], x, y, z)
if (distance<=10) and (open==false) then
local factionID = getElementData ( playerSource, \"faction\" ) or 24
if ( factionID == 24 ) or (exports.global:isPlayerAdmin(playerSource) ) then
open = true
outputChatBox(\"Kapu nyitva!\", playerSource, 0, 255, 0)
moveObject(objGateg, 980, pos[1], pos[2], pos[3]-4, 0, 0, 0)
setTimer(function()
moveObject(objGateg, 980, pos[1], pos[2], pos[3], 0, 0, 0)
setTimer(function()
open = false
end, 1000, 1)
end, 5000, 1)
else
outputChatBox(\"Nem vagy önkormányzatban!\", playerSource, 255, 0, 0)
end
end
end
addCommandHandler(\"gate\", usePDFrontGarageGate)
addCommandHandler(\"kapu\", usePDFrontGarageGate)