bramapolicji = createObject ( 980, -1571.90002, 662.5, 9, 0, 0, 90 )
bramapolicji2 = createObject ( 980, -1701.7998, 685.59961, 26.7, 0, 0, 90 )
function bramapoli_Close ( thePlayer)
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policja" ) ) then
local x, y, z = getElementPosition (thePlayer)
cx, cy, cz = getElementPosition(bramapolicji or bramapolicji2)
local dist = getDistanceBetweenPoints3D(x, y, z, cx, cy, cz)
if dist <= 20 then
moveObject ( bramapolicji, 1000, -1571.90002, 662.5, 9 )
else
moveObject ( bramapolicji2, 1000, -1701.7998, 685.59961, 26.7 )
outputChatBox ("Trwa zamykanie bramy policji", thePlayer, 219, 78, 1, false )
end
end
end
addCommandHandler("closepoli", bramapoli_Close )
function bramapoli_Open ( thePlayer)
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policja" ) ) then
local x, y, z = getElementPosition (thePlayer)
cx, cy, cz = getElementPosition(bramapolicji or bramapolicji)
local dist = getDistanceBetweenPoints3D(x, y, z, cx, cy, cz)
if dist <= 20 then
moveObject ( bramapolicji, 1000, 1571.90002, 662.5, 4 )
else
moveObject ( bramapolicji2, 1000, -1701.7998, 685.59961, 20)
outputChatBox ("Trwa otwieranie bramy policji", thePlayer, 219, 78, 1, false )
end
end
end
addCommandHandler("openpoli", bramapoli_Open )