Вот так?
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if dialogId == 15111 then
local nick = text:match('%{ffff00%} (%w+_%w+)')
sampSendDialogResponse(dialogId, 1, 0, nick)
sampAddChatMessage('Отправили: ' .. nick, -1)
return...