require('lib.samp.events').onShowDialog = function(dialogId, style, title, button1, button2, text)
if text:find('your text') or dialogId == -1 then -- \\ replace -1 to your dialog id, replace "or" to "and" if you wish search by dialogue and id together
-- \\ some code
end
-- \\ you can also enable the display of dialog id in the sampfuncs console:
-- \\ print(dialogId)
end