SA:MP Помогите почему не работает скрипт!

Dimon7724

Участник
Автор темы
80
8
Вот скрипт! Призначен для поедания чипсов! Но он не работает. Скажите пожалуйста почему?




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
 
  • Клоун
Реакции: kitsad

Dimon7724

Участник
Автор темы
80
8
что в консоль пишет?
ни чего он даже не отображается в тектовом блокноте мунлоадера, может и за того что я сделал название скрипта на русском? Просто скрипт назавал Чипсы.
 

fsrxvdd

Активный
151
37
у тебя хуйня какая то а не скрипт:
во первых откуда взялась переменная NachatKushat и почему ты ее не объявил.
во вторых, у тебя какого то хера 2 while true do.
в третьих, не надо писать "while (переменная) == then", лучше пиши if (переменная) == then
в четвертых proveritSitost это что за переменная и почему ты ее не объявил как и в первом случае