- Статус
- Оффлайн
- Регистрация
- 23 Янв 2019
- Сообщения
- 250
- Реакции
- 29
Таааак, чуть разобравшись, я ее сделал, но..... мышка захватывает по всему экрану объект, помогите и в любом элементе меню оно хватается
JavaScript:
local drag = false
local offsetX = 0
local offsetY = 0
local width = 0
if client.key_state(0x01) then
local mouse_x, mouse_y = ui.mouse_position()
if not drag then
if ui.mouse_position(mouse_x, mouse_y, 954, 690, 270, 5, 139) then
drag = true
offsetX = mouse_x - x
offsetY = mouse_y - y
end
else
x = mouse_x - offsetX
y = mouse_y - offsetY
ui.set(Zx, x)
ui.set(Zy, y)
end
else
drag = false
end
function clientmouseposition(mouse_x, mouse_y, rect_x, rect_y, rect_w, rect_h)
return mouse_x >= rect_x and mouse_x <= rect_x + rect_w and mouse_y >= rect_y and mouse_y <= rect_y + rect_h
end