В чём проблема не работает луа скрипт

Delevor

Участник
Автор темы
29
3
Версия MoonLoader
.025-beta
Анимка должна быть вот таких наручников по команде в чат /cuffed они надеваются прописываем еще раз /cuffed они снимаются но у меня не работает скрипт
Screenshot_3.png

Сам код

script_name('cuff')

local event = require('lib.samp.events')

function main()
repeat wait(0) until isSampAvailable()
wait(2000)
sampRegisterChatCommand('cuffed', cuffed)
sampAddChatMessage('{FF0000}[Наручники] {00FF00} загружены!', -1)
while true do
wait(0)
end
end

function cuffed()
if state then
state = false
int action = SetPlayerSpecialAction (0) ;
sampAddChatMessage('{FF0000}[Наручники] {FFF00} браслеты сняты', -1)
else

state = true
int action = SetPlayerSpecialAction (23) ;
sampAddChatMessage('{FF0000}[Наручники] {00FF00} браслеты надеты', -1)

end

end
 
Решение
Lua:
script_name('cuff')

local event = require('lib.samp.events')

function main()
    repeat wait(0) until isSampAvailable() wait(2000)
        sampRegisterChatCommand('cuffed', cuffed)
        sampAddChatMessage('{FF0000}[Наручники] {00FF00} загружены!', -1)
    while true do wait(0)
    end
end

function cuffed()
    if state then
        state = false
        sampSetSpecialAction(0)
        sampAddChatMessage('{FF0000}[Наручники] {00FF00} браслеты сняты', -1)
    else
        state = true
        sampSetSpecialAction(24)
        sampAddChatMessage('{FF0000}[Наручники] {00FF00} браслеты надеты', -1)
    end
end
=======================================================================================================
...

qdIbp

Автор темы
Проверенный
1,383
1,139
Lua:
script_name('cuff')

local event = require('lib.samp.events')

function main()
    repeat wait(0) until isSampAvailable() wait(2000)
        sampRegisterChatCommand('cuffed', cuffed)
        sampAddChatMessage('{FF0000}[Наручники] {00FF00} загружены!', -1)
    while true do wait(0)
    end
end

function cuffed()
    if state then
        state = false
        sampSetSpecialAction(0)
        sampAddChatMessage('{FF0000}[Наручники] {00FF00} браслеты сняты', -1)
    else
        state = true
        sampSetSpecialAction(24)
        sampAddChatMessage('{FF0000}[Наручники] {00FF00} браслеты надеты', -1)
    end
end
=======================================================================================================

script_name('cuff')

local event = require('lib.samp.events')

function main()
repeat wait(0) until isSampAvailable()
wait(2000)
sampRegisterChatCommand('cuffed', cuffed)
sampAddChatMessage('{FF0000}[Наручники] {00FF00} загружены!', -1)
while true do
wait(0)
end
end

function cuffed()
if state then
state = false
int action = SetPlayerSpecialAction (0) ;
sampAddChatMessage('{FF0000}[Наручники] {FFF00} браслеты сняты', -1)
else

state = true
int action = SetPlayerSpecialAction (23) ;
sampAddChatMessage('{FF0000}[Наручники] {00FF00} браслеты надеты', -1)

end

end
И тут есть

Снимок экрана (346).png


будь добр в следующий раз им воспользоваться а не спойлером, не то не приятно на такое смотреть
 
  • Нравится
Реакции: IlyaHL2

Delevor

Участник
Автор темы
29
3
Lua:
script_name('cuff')

local event = require('lib.samp.events')

function main()
    repeat wait(0) until isSampAvailable() wait(2000)
        sampRegisterChatCommand('cuffed', cuffed)
        sampAddChatMessage('{FF0000}[Наручники] {00FF00} загружены!', -1)
    while true do wait(0)
    end
end

function cuffed()
    if state then
        state = false
        sampSetSpecialAction(0)
        sampAddChatMessage('{FF0000}[Наручники] {00FF00} браслеты сняты', -1)
    else
        state = true
        sampSetSpecialAction(24)
        sampAddChatMessage('{FF0000}[Наручники] {00FF00} браслеты надеты', -1)
    end
end
=======================================================================================================


И тут есть

Посмотреть вложение 127124

будь добр в следующий раз им воспользоваться а не спойлером, не то не приятно на такое смотреть
Спасибо большое