попросить помощи, Вопрос о textdraw

harrygua

Новичок
Автор темы
9
0
Версия MoonLoader
Другое
Как игрок может ходить автоматический собираюсь textdraw
(взаимодействие текст в игре)

Спасибо..
 

MLycoris

Режим чтения
Проверенный
1,823
1,863
надеюсь, правильно понял -_-
Lua:
local sampev = require('lib.samp.events')
function sampev.onShowTextDraw(id,data)
    -- you can search for a textdraw by id
    if id == 123 and data.selectable then -- data.selectable checks whether this textdraw responds to a click
        sampSendClickTextdraw(id) -- pressing the textdraw
    end
    -- or you can search for the desired button by its name, but it does not always work
    if data.text:find('needButton') and data.selectable then
        sampSendClickTextdraw(id) -- pressing the textdraw
    end
end

to find out the ID of the button, you can use this function
Lua:
function sampev.onSendClickTextDraw(textdrawId)
    sampAddChatMessage(textdrawId,-1)
end
 

harrygua

Новичок
Автор темы
9
0
надеюсь, правильно понял -_-
Lua:
local sampev = require('lib.samp.events')
function sampev.onShowTextDraw(id,data)
    -- you can search for a textdraw by id
    if id == 123 and data.selectable then -- data.selectable checks whether this textdraw responds to a click
        sampSendClickTextdraw(id) -- pressing the textdraw
    end
    -- or you can search for the desired button by its name, but it does not always work
    if data.text:find('needButton') and data.selectable then
        sampSendClickTextdraw(id) -- pressing the textdraw
    end
end

to find out the ID of the button, you can use this function
Lua:
function sampev.onSendClickTextDraw(textdrawId)
    sampAddChatMessage(textdrawId,-1)
end
Я попробую, спасибо..