- 38
- 7
- Версия MoonLoader
- .027.0-preview
Я пытаюсь отловить текст в одном диалоге, при этом через onShowDialog() проходят все диалоги вообще в игре. Помогите исправить
lua:
require('lib.sampfuncs')
local SE = require('samp.events')
function main()
repeat wait(0) until isSampAvailable()
while true do wait(0)
if isKeyJustPressed(0x4C) and not sampIsChatInputActive() and not sampIsDialogActive() then carload() end
end
end
function carload()
status = false
sampSendChat("/cars")
sampSendDialogResponse(162,1,0,nil)
function SE.onShowDialog(dialogid, style, title, button1, button2, text)
sampAddChatMessage(text,-1)
if text:find("Загрузить") then sampSendDialogResponse(163,1,0,nil) status = true end
if text:find("Закрыть") or text:find("Открыть") then sampSendDialogResponse(163,1,11,nil) status = false end
return false
end
if status then sampAddChatMessage("{6FA8DC}[CarLoad] {FFFFFF}Авто загружено в мир!",-1)
else sampAddChatMessage("{6FA8DC}[CarLoad] {FFFFFF}Авто выгружено!",-1) end
end