Вот скрипт! Призначен для поедания чипсов! Но он не работает. Скажите пожалуйста почему?
local AvtoChipsi = true
local Sitost = 100
function main()
while not isSampAvailable() do wait(1000)
end
sampRegisterChatCommand("chipsi", function()
AvtoChipsi = not AvtoChipsi
sampAddChatMessage("Поедание чипсов "
.. (AvtoChipsi and '{00FF00}включено' or '{FF0000}выключено') , -1)
end)
while (not (tostring(select(2, pcall(sampGetGamestate))) == '3')) do
wait(1000)
end
lua_thread.create(function()
while true do
wait(1000)
if AvtoChipsi then
wait((NachatKushat and 8000 or 15000))
proveritSitost = true
while proveritSitost do
wait(2000)
sampSendChat("/satiety")
end
end
end
end)
while true do
wait(1000)
if AvtoChipsi then
if (Sitost < 30) then
NachatKushat = true
end
if NachatKushat then
if (Sitost < 95) then
sampSendChat("/cheeps")
wait(5000)
else
NachatKushat = false
end
end
end
end
end
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if proveritSitost then
if text:find('Пополнить сытость можно в любой закусочной штата%.') then
local proverka = text:match('Ваша сытость: {.-}(%d+%.?%d*)/%d+%.%d+.{.-}')
if proverka then
Sitost = proverka
end
proveritSitost = false
sampSendDialogResponse(dialogId, 0, 0, '')
return false
end
end
end
local AvtoChipsi = true
local Sitost = 100
function main()
while not isSampAvailable() do wait(1000)
end
sampRegisterChatCommand("chipsi", function()
AvtoChipsi = not AvtoChipsi
sampAddChatMessage("Поедание чипсов "
.. (AvtoChipsi and '{00FF00}включено' or '{FF0000}выключено') , -1)
end)
while (not (tostring(select(2, pcall(sampGetGamestate))) == '3')) do
wait(1000)
end
lua_thread.create(function()
while true do
wait(1000)
if AvtoChipsi then
wait((NachatKushat and 8000 or 15000))
proveritSitost = true
while proveritSitost do
wait(2000)
sampSendChat("/satiety")
end
end
end
end)
while true do
wait(1000)
if AvtoChipsi then
if (Sitost < 30) then
NachatKushat = true
end
if NachatKushat then
if (Sitost < 95) then
sampSendChat("/cheeps")
wait(5000)
else
NachatKushat = false
end
end
end
end
end
function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
if proveritSitost then
if text:find('Пополнить сытость можно в любой закусочной штата%.') then
local proverka = text:match('Ваша сытость: {.-}(%d+%.?%d*)/%d+%.%d+.{.-}')
if proverka then
Sitost = proverka
end
proveritSitost = false
sampSendDialogResponse(dialogId, 0, 0, '')
return false
end
end
end