require "lib.moonloader"
local on = require "lib.samp.events"
sms = sampAddChatMessage
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do wait(0)
end
end
function on.onShowDialog(did, style, title, b1, b2, text)
lua_thread.create(function()
if title:find('Магазин 24/7') and did == 16 and text:find('Номер телефона(.+)[$(%d+)]') then
tet = text:gsub('Номер телефона(%c+)%[$(%d+)%]\n','')
sampShowDialog(17, title, tet, b1, b2, style)
while sampIsDialogActive(17) do wait(100) end
local result, button, list, input = sampHasDialogRespond(17)
if list == 1 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 2,nil) end
if list == 2 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 3,nil) end
if list == 3 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 4,nil) end
if list == 4 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 5,nil) end
if list == 5 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 6,nil) end
if list == 6 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 7,nil) end
if list == 7 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 8,nil) end
if list == 8 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 9,nil) end
if list == 9 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 10,nil) end
if list == 10 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 11,nil) end
if list == 11 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 12,nil) end
if list == 12 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 13,nil) end
if list == 13 and button == 1 then setGameKeyState(15, 64) sampSendDialogResponse(16,1, 14,nil) end
end
end)
if title:find('Магазин 24/7') and did == 16 then
return false
end
end