не работает скрипт

egorglebov

Участник
Автор темы
50
4
Версия MoonLoader
.026-beta
Вот код, помогите плз
LUA:
script_name('Podgruz')
script_author('Dont state')
script_version('1.0')

local main_color = "{00FFFF}"
local white_color = "{FFFFFF}"
local dark_color = "{000000}"
local gray_color = "{808080}"
local silver_color = "{C0C0C0}"   
local fuchsia_color = "{FF00FF}"   
local purple_color = "{800080}"   
local red_color = "{FF0000}"   
local maroon_color = "{800000}"   
local yellow_color = "{FFFF00}"   
local olive_color =    "{808000}"   
local lime_color =    "{00FF00}"   
local green_color =    "{008000}"       
local teal_color =     "{008080}"   
local blue_color =     "{0000FF}"
local navy_color =    "{000080}"
local sampev = require 'lib.samp.events'

function main()
    repeat wait(0) until isSampAvailable()
        sampAddChatMessage('Âåðñèÿ' ..script_version.. 'Àâòîð:' ..script_author.. 'Èìÿ Ñêðèïòà' ..script_name.. , -1)
        sampRegisterChatCommand('potok', potok)
        sampRegisterChatCommand('clear.asi', asi)
        tq = lua_thread.create_suspended(thread_function)
        while true do
            wait(0)
        end
    end

    function potok()
        tq:run()
    end

    function thread_function()
        sampAddChatMessage('Ñêðèïò ðàáîòàåò 10-40 ñåêóíä', white_color)
        sampAddChatMessage('Íà÷èíóþ îáõîä...', main_color)
        wait(5324)
        sampAddChatMessage('Îáõîä ÐÏÑ è îáõîä Ïàêåòîâ', main_color)
        wait(3432)
        sampAddChatMessage('Îïêîä Äåéñòâóåò', main_color)
        wait(12534)
        sampAddChatMessage('Íà÷èíàþ âõîä â Ñïåêòàòîð', main_color)
        wait(4521)
        sampAddChatMessage('Îáõîä íå óäàëñÿ, ïîïðîáóé åùå ðàç. Åñëè ó òåáÿ íåò Clear.Asi, ñêðèïò íå áóäåò ðàáîòàòü.', red_color)
    end

    function asi()
        spec = not spec
        if spec then
            sampAddChatMessage('Ñïåêòàòîð Âêäþ÷åí', main_color)
        end
        if not spec then
            sampAddChatMessage('Ñïåêòàòîð Âûêëþ÷åí', white_color)
        end

        function sampev.onSendPlayerSync(data)
            if spec then 
                local sync = samp_create_sync_data('spectator')
                sync.position = data.position
                sync.send()
                return false
            end
 

qdIbp

Автор темы
Проверенный
1,435
1,175
Вот код, помогите плз
LUA:
script_name('Podgruz')
script_author('Dont state')
script_version('1.0')

local main_color = "{00FFFF}"
local white_color = "{FFFFFF}"
local dark_color = "{000000}"
local gray_color = "{808080}"
local silver_color = "{C0C0C0}" 
local fuchsia_color = "{FF00FF}" 
local purple_color = "{800080}" 
local red_color = "{FF0000}" 
local maroon_color = "{800000}" 
local yellow_color = "{FFFF00}" 
local olive_color =    "{808000}" 
local lime_color =    "{00FF00}" 
local green_color =    "{008000}"     
local teal_color =     "{008080}" 
local blue_color =     "{0000FF}"
local navy_color =    "{000080}"
local sampev = require 'lib.samp.events'

function main()
    repeat wait(0) until isSampAvailable()
        sampAddChatMessage('Âåðñèÿ' ..script_version.. 'Àâòîð:' ..script_author.. 'Èìÿ Ñêðèïòà' ..script_name.. , -1)
        sampRegisterChatCommand('potok', potok)
        sampRegisterChatCommand('clear.asi', asi)
        tq = lua_thread.create_suspended(thread_function)
        while true do
            wait(0)
        end
    end

    function potok()
        tq:run()
    end

    function thread_function()
        sampAddChatMessage('Ñêðèïò ðàáîòàåò 10-40 ñåêóíä', white_color)
        sampAddChatMessage('Íà÷èíóþ îáõîä...', main_color)
        wait(5324)
        sampAddChatMessage('Îáõîä ÐÏÑ è îáõîä Ïàêåòîâ', main_color)
        wait(3432)
        sampAddChatMessage('Îïêîä Äåéñòâóåò', main_color)
        wait(12534)
        sampAddChatMessage('Íà÷èíàþ âõîä â Ñïåêòàòîð', main_color)
        wait(4521)
        sampAddChatMessage('Îáõîä íå óäàëñÿ, ïîïðîáóé åùå ðàç. Åñëè ó òåáÿ íåò Clear.Asi, ñêðèïò íå áóäåò ðàáîòàòü.', red_color)
    end

    function asi()
        spec = not spec
        if spec then
            sampAddChatMessage('Ñïåêòàòîð Âêäþ÷åí', main_color)
        end
        if not spec then
            sampAddChatMessage('Ñïåêòàòîð Âûêëþ÷åí', white_color)
        end

        function sampev.onSendPlayerSync(data)
            if spec then
                local sync = samp_create_sync_data('spectator')
                sync.position = data.position
                sync.send()
                return false
            end
Ну функция в функции + отсутствует 2 end в конце

Или на 59 строке и в конце end
 

Tenkara

Потрачен
380
172
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Вот код, помогите плз
LUA:
script_name('Podgruz')
script_author('Dont state')
script_version('1.0')

local main_color = "{00FFFF}"
local white_color = "{FFFFFF}"
local dark_color = "{000000}"
local gray_color = "{808080}"
local silver_color = "{C0C0C0}"  
local fuchsia_color = "{FF00FF}"  
local purple_color = "{800080}"  
local red_color = "{FF0000}"  
local maroon_color = "{800000}"  
local yellow_color = "{FFFF00}"  
local olive_color =    "{808000}"  
local lime_color =    "{00FF00}"  
local green_color =    "{008000}"      
local teal_color =     "{008080}"  
local blue_color =     "{0000FF}"
local navy_color =    "{000080}"
local sampev = require 'lib.samp.events'

function main()
    repeat wait(0) until isSampAvailable()
        sampAddChatMessage('Âåðñèÿ' ..script_version.. 'Àâòîð:' ..script_author.. 'Èìÿ Ñêðèïòà' ..script_name.. , -1)
        sampRegisterChatCommand('potok', potok)
        sampRegisterChatCommand('clear.asi', asi)
        tq = lua_thread.create_suspended(thread_function)
        while true do
            wait(0)
        end
    end

    function potok()
        tq:run()
    end

    function thread_function()
        sampAddChatMessage('Ñêðèïò ðàáîòàåò 10-40 ñåêóíä', white_color)
        sampAddChatMessage('Íà÷èíóþ îáõîä...', main_color)
        wait(5324)
        sampAddChatMessage('Îáõîä ÐÏÑ è îáõîä Ïàêåòîâ', main_color)
        wait(3432)
        sampAddChatMessage('Îïêîä Äåéñòâóåò', main_color)
        wait(12534)
        sampAddChatMessage('Íà÷èíàþ âõîä â Ñïåêòàòîð', main_color)
        wait(4521)
        sampAddChatMessage('Îáõîä íå óäàëñÿ, ïîïðîáóé åùå ðàç. Åñëè ó òåáÿ íåò Clear.Asi, ñêðèïò íå áóäåò ðàáîòàòü.', red_color)
    end

    function asi()
        spec = not spec
        if spec then
            sampAddChatMessage('Ñïåêòàòîð Âêäþ÷åí', main_color)
        end
        if not spec then
            sampAddChatMessage('Ñïåêòàòîð Âûêëþ÷åí', white_color)
        end

        function sampev.onSendPlayerSync(data)
            if spec then
                local sync = samp_create_sync_data('spectator')
                sync.position = data.position
                sync.send()
                return false
            end
А че с кодировкой? Или так надо?