Dont select item from the list, just open the dialog.
sampRegisterChatCommand('buyy', function()
sampSendChat('/buy')
opened_dialog = true
end)
function sampev.onShowDialog(dialogid, style, title, button1, button2, text)
if opened_dialog then
local count = 0
for line...