Что тут я такого не делаю?? Помогите пожалуйста новичка :)

Статус
В этой теме нельзя размещать новые ответы.

VAPchik

Новичок
Автор темы
8
2
Что делать если скрипт не работает и выдает ошибку
[20:52:08.202709] (system) Loading script 'E:\Games\GTA San Andreas\moonloader\Ghetto Life.lua'...
[20:52:08.202709] (debug) New script: 0195F60C
[20:52:08.202709] (error) Ghetto Life.lua: E:\Games\GTA San Andreas\moonloader\Ghetto Life.lua:15: 'then' expected near 'dia'
[20:52:08.202709] (error) Ghetto Life.lua: Script died due to an error. (0195F60C)








script_name("Ghetto Life")
script_author("VAP4ik")
script_version("v1")
script_description("3")
script_dependencies("SAMPFUNCS")

require "lib.moonloader"

function main()
print("Ghetto Loaded")
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while true do
wait(1000)
if isKeyDown(VK_RBUTTON)
dia = sampShowDialog(17, string.format("{FE0000}Ghetto Life by {7C07A9}VAP4ik", name, id), string.format("/n1. {00AA6E}юзать 15 грамм \n2.{FF7400}для ломки 1 \n3 {5C0DAC}купить 150грамм \n4. {FF1300}/anim 0 \n5. {00BD39}чекать онлайн \n6. {1B1BB3}Warehouse \n7. {000000}Clist 0 \n8. {C30084}/materials get,put \n9. {6e6057}/healme /n10. {F2FF00}Get Guns 500 \n11.{FF0090}Capture , "вперед", "назад", 2)
sampSetCurrentDialogListItem(0)
repeat
wait(1000)
re, button, list, input = sampHasDialogRespond(17)
until re
_, id = sampGetPlayerIdByCharHandle(playerPed)
if button == 0 then
_ = sampCloseCurrentDialogWithButton()
else
if list == 1 then
sampSendChat("/usedrugs 15")
wait(1000)

if list == 2 then
sampSendChat("/usedrugs 1")
wait(1000)

if list == 3 then
sampSendChat("/get drugs 150")
wait(1000)
end
if list == 4 then
sampSendChat("/anim 0")
wait(1000)
end
if list == 5 then
sampSendChat("/members")
wait(1000)
end
if list == 6 then
sampSendChat("/warehouse")
wait(1000)
end
if list == 7 then
sampSendChat("/clist 0")
wait(1000)
end
if list == 8 then
sampSendChat("/materials get")
wait(6000)
sampSendChat("/materials put")
end
if list == 9 then
sampSendChat("/healme")
end
if list == 10 then
sampSendChat("/get guns 500")
end
if list == 11 then
sampSendChat("/capture")
wait(500)
repeat
end
end
 

Вложения

  • Ghetto Life.lua
    1.7 KB · Просмотры: 2
Решение
Lua:
script_name("Ghetto Life")
script_author("VAP4ik")
script_version("v1")
script_description("3")
script_dependencies("SAMPFUNCS")

require "lib.moonloader"

function main()
print("Ghetto Loaded")
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while true do
wait(1000)
if isKeyDown(VK_RBUTTON) then -- Не спорю, довольно тяжело дописать then
dia = sampShowDialog(17, string.format("{FE0000}Ghetto Life by {7C07A9}VAP4ik", name, id), string.format("/n1. {00AA6E}юзать 15 грамм \n2.{FF7400}для ломки 1 \n3 {5C0DAC}купить 150грамм \n4. {FF1300}/anim 0 \n5. {00BD39}чекать онлайн \n6. {1B1BB3}Warehouse \n7. {000000}Clist 0 \n8. {C30084}/materials get,put \n9. {6e6057}/healme /n10. {F2FF00}Get Guns 500 \n11.{FF0090}Capture ...

VAPchik

Новичок
Автор темы
8
2
Бро я конечно понимаю что ты шаришь в луа на изи, но я не понял куда вставить then (
15-я строка, не хватает "then":
Lua:
if isKeyDown(VK_RBUTTON) then
Код лучше оформлять через соответствующий инструмент для удобства при чтении и редактировании.
 

DolgorukovGTA

Известный
Проверенный
652
345
  • Нравится
Реакции: VAPchik

VAPchik

Новичок
Автор темы
8
2
У тебя было так:
Lua:
if isKeyDown(VK_RBUTTON)
Нужно вот так:
Lua:
if isKeyDown(VK_RBUTTON) then
спасибо бро
но всё же не получилось
[ML] (error) Ghetto Life.lua: E:\Games\GTA San Andreas\moonloader\Ghetto Life.lua:15: ')' expected near 'âïåðåä'
[ML] (error) Ghetto Life.lua: Script died due to an error. (01C29E94)

У тебя было так:
Lua:
if isKeyDown(VK_RBUTTON)
Нужно вот так:
Lua:
if isKeyDown(VK_RBUTTON) then
[22:07:51.012318] (error) Ghetto Life.lua: E:\Games\GTA San Andreas\moonloader\Ghetto Life.lua:15: ')' expected near 'вперед'
[22:07:51.012318] (error) Ghetto Life.lua: Script died due to an error. (01C29E94)

🤬🤬😡😡😡😡😡
Устраните пожалуйста все ошибки и дайте обратно этот скрипт пожалуйста, Спасибо)
 
Последнее редактирование:
  • Нравится
Реакции: DolgorukovGTA

Fabregoo

Известный
656
128
Lua:
script_name("Ghetto Life")
script_author("VAP4ik")
script_version("v1")
script_description("3")
script_dependencies("SAMPFUNCS")

require "lib.moonloader"

function main()
print("Ghetto Loaded")
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while true do
wait(1000)
if isKeyDown(VK_RBUTTON) then -- Не спорю, довольно тяжело дописать then
dia = sampShowDialog(17, string.format("{FE0000}Ghetto Life by {7C07A9}VAP4ik", name, id), string.format("/n1. {00AA6E}юзать 15 грамм \n2.{FF7400}для ломки 1 \n3 {5C0DAC}купить 150грамм \n4. {FF1300}/anim 0 \n5. {00BD39}чекать онлайн \n6. {1B1BB3}Warehouse \n7. {000000}Clist 0 \n8. {C30084}/materials get,put \n9. {6e6057}/healme /n10. {F2FF00}Get Guns 500 \n11.{FF0090}Capture , "вперед", "назад", 2)
sampSetCurrentDialogListItem(0)

wait(1000)
re, button, list, input = sampHasDialogRespond(17)
until re
_, id = sampGetPlayerIdByCharHandle(playerPed)
if button == 0 then
_ = sampCloseCurrentDialogWithButton()
else
if list == 1 then
sampSendChat("/usedrugs 15")
wait(1000)

if list == 2 then
sampSendChat("/usedrugs 1")
wait(1000)

if list == 3 then
sampSendChat("/get drugs 150")
wait(1000)
end
if list == 4 then
sampSendChat("/anim 0")
wait(1000)
end
if list == 5 then
sampSendChat("/members")
wait(1000)
end
if list == 6 then
sampSendChat("/warehouse")
wait(1000)
end
if list == 7 then
sampSendChat("/clist 0")
wait(1000)
end
if list == 8 then
sampSendChat("/materials get")
wait(6000)
sampSendChat("/materials put")
end
if list == 9 then
sampSendChat("/healme")
end
if list == 10 then
sampSendChat("/get guns 500")
end
if list == 11 then
sampSendChat("/capture")
wait(500)
repeat
end
end
 
  • Нравится
Реакции: VAPchik
Статус
В этой теме нельзя размещать новые ответы.