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