- Версия MoonLoader
- .027.0-preview
На окне 9469 зависает, не вписывает туда текст из переменной ' promocode ' , без return false работает но не останавливается. Не знаю в чем причина
Lua:
local vkeys = require 'vkeys'
local hook = require 'lib.samp.events'
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do
wait(0)
if isKeyDown(vkeys.VK_Q) and isKeyJustPressed(vkeys.VK_R) and not sampIsChatInputActive() then
sampSendChat('/mm')
servername = sampGetCurrentServerName()
if string.match(servername, 'Scottdale') then
promocode = 'Steve'
-- print(promocode)
-- wait(1000)
end
end
end
end
function hook.onShowDialog(id, style, title, button1, button2, text)
if string.match(text, 'Не использован') then
if id == 722 then
sampSendDialogResponse(722, 1, 11, '')
return false
end
if id == 9469 then
sampSendDialogResponse(9469, 1, 0, promocode)
return false
end
if id == 9476 then
sampSendDialogResponse(9476, 1, 0, '')
return false
end
end
end