-- В бесконечном цикле main:
if getActiveInterior() ~= 0 then
if opengate_timer == nil or (os.clock() - opengate_timer) >= 0.5 then
local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
for id = 0, 2047 do
if sampIs3dTextDefined(id) then
local text, _, x, y, z, _, _, _, _ = sampGet3dTextInfoById(id)
if string.match(text, "^{%x+}Открыть\n\n{%x+}H$") then
if getDistanceBetweenCoords2d(pX, pY, x, y) <= 1 then
sampSendChat("/opengate")
opengate_timer = os.clock()
end
end
end
end
end
end