- Версия MoonLoader
- .026-beta
Lua:
require "lib.moonloader"
local ev = require "lib.samp.events"
local se = require "lib.samp.events"
local vkeys = require "vkeys"
actions = 0
function main()
while true do
wait(0)
if isKeyJustPressed(0x69) then
actions = 1
sampSendChat("/invex")
end
if isKeyJustPressed(0x68) then
actions = 2
sampSendChat("/invex")
end
if isKeyJustPressed(0x67) then
actions = 3
sampSendChat("/invex")
end
if isKeyJustPressed(0x60) then
actions = 4
sampSendChat("/invex")
end
if isKeyJustPressed(0x61) then
actions = 5
sampSendChat("/pot")
end
if isKeyJustPressed(0x62) then
actions = 6
sampSendChat("/pot")
end
if isKeyJustPressed(0x63) then
actions = 7
sampSendChat("/pot")
end
if isKeyJustPressed(0x64) then
actions = 8
sampSendChat("/pot")
end
if isKeyJustPressed(0x65) then
actions = 9
sampSendChat("/pot")
end
function ev.onShowDialog(id, st, tit, b1, b2, tx)
lua_thread.create(function()
count = 0
if actions == 1 then
for line in tx:gmatch("[^\n\r]+") do
if line:find("Пакет минеральных удобрений") then
wait(1000)
sampSendDialogResponse(1000, 1, count, "")
wait(1000)
sampSendDialogResponse(1001, 1, 5, "")
wait(1000)
sampCloseCurrentDialogWithButton(0)
actions = 0
end
count = count + 1
end
end
count = 0
if actions == 2 then
for line in tx:gmatch("[^\n\r]+") do
if line:find("Тяпка") then
wait(1000)
sampSendDialogResponse(1000, 1, count, "")
wait(1000)
sampSendDialogResponse(1001, 1, 5, "")
wait(1000)
sampCloseCurrentDialogWithButton(0)
actions = 0
end
count = count + 1
end
end
count = 0
if actions == 3 then
for line in tx:gmatch("[^\n\r]+") do
if line:find("Ведро с водой") then
wait(1000)
sampSendDialogResponse(1000, 1, count, "")
wait(1000)
sampSendDialogResponse(1001, 1, 5, "")
wait(1000)
sampCloseCurrentDialogWithButton(0)
actions = 0
end
count = count + 1
end
end
count = 0
if actions == 4 then
for line in tx:gmatch("[^\n\r]+") do
if line:find("Пакетик семян") then
wait(1000)
sampSendDialogResponse(1000, 1, count, "")
wait(1000)
sampSendDialogResponse(1001, 1, 5, "")
wait(1000)
sampCloseCurrentDialogWithButton(0)
actions = 0
end
count = count + 1
end
end
end)
end
function se.onShowTextDraw(id, data)
if actions == 5 then
sampSendClickTextdraw(164)
sampSendClickTextdraw(169)
actions = 0
end
if actions == 6 then
sampSendClickTextdraw(165)
sampSendClickTextdraw(169)
actions = 0
end
if actions == 7 then
sampSendClickTextdraw(166)
sampSendClickTextdraw(169)
actions = 0
end
if actions == 8 then
sampSendClickTextdraw(167)
sampSendClickTextdraw(169)
actions = 0
end
if actions == 9 then
sampSendClickTextdraw(168)
sampSendClickTextdraw(169)
actions = 0
end
end
end
end