local objGateg = createObject(980, 1953.5999755859, -790.29998779297, 143.30000305176, 0, 0, 107.99011230469)exports.pool:allocateElement(objGateg) local open = false-- Gate codefunction kinyit(thePlayer)local x, y, z = getElementPosition(thePlayer)local distance = getDistanceBetweenPoints3D(1953.5999755859, -790.29998779297, 143.30000305176, x, y, z) if (exports.global:hasItem(thePlayer, 4, 2002)) thenif (distance<=7) and (open==false) then open = true exports.global:sendLocalMeAction(thePlayer, \"kinyit egy közelben lévő kaput.\") moveObject(objGateg, 500, 1953.5999755859, -790.29998779297, 137.30000305176, 0, 0, 0) elseif (exports.global:hasItem(thePlayer, 4, 2002)) then if (distance<=7) and (open==true) then moveObject(objGateg, 500, 1953.5999755859, -790.29998779297, 143.30000305176, 0, 0, 0) open = false exports.global:sendLocalMeAction(thePlayer, \"bezár egy közelben lévő kaput.\") end end endendendaddCommandHandler(\"birtokgate\", kinyit)
local objGateg = createObject(980, 1245.5999755859, -767.29998779297, 93.800003051758, 0, 0, 0)exports.pool:allocateElement(objGateg) local open = false-- Gate codefunction kinyit(thePlayer)local x, y, z = getElementPosition(thePlayer)local distance = getDistanceBetweenPoints3D(1245.5999755859, -767.29998779297, 93.800003051758, x, y, z) if (exports.global:hasItem(thePlayer, 4, 2002)) thenif (distance<=7) and (open==false) then open = true exports.global:sendLocalMeAction(thePlayer, \"kinyit egy közelben lévő kaput.\") moveObject(objGateg, 500, 1245.5999755859, -767.29998779297, 87.800003051758, 0, 0, 0) elseif (exports.global:hasItem(thePlayer, 4, 2002)) then if (distance<=7) and (open==true) then moveObject(objGateg, 500, 1245.5999755859, -767.29998779297, 93.800003051758, 0, 0, 0) open = false exports.global:sendLocalMeAction(thePlayer, \"bezár egy közelben lévő kaput.\") end end endendendaddCommandHandler(\"gate\", kinyit)
function kinyit(thePlayer)
local objGateg = createObject(980, 1245.5999755859, -767.29998779297, 93.800003051758, 0, 0, 0)exports.pool:allocateElement(objGateg) local open = false-- Gate codefunction kinyit(thePlayer) local x, y, z = getElementPosition(thePlayer) local distance = getDistanceBetweenPoints3D(1245.5999755859, -767.29998779297, 93.800003051758, x, y, z) if (exports.global:hasItem(thePlayer, 4, 2002)) then if (distance<=7) and (open==false) then open = true exports.global:sendLocalMeAction(thePlayer, \"kinyit egy közelben lévő kaput.\") moveObject(objGateg, 500, 1245.5999755859, -767.29998779297, 87.800003051758, 0, 0, 0) elseif (distance<=7) and (open==true) then moveObject(objGateg, 500, 1245.5999755859, -767.29998779297, 93.800003051758, 0, 0, 0) open = false exports.global:sendLocalMeAction(thePlayer, \"bezár egy közelben lévő kaput.\") endend endendaddCommandHandler(\"gate\", kinyit)