Ошибка когда в свой админ тулс добавил AirBreak

thebestsupreme

Участник
Автор темы
170
12
Версия MoonLoader
Другое
Всем привет!
Я делаю свой Admin Tools и взял AirBreak из собейта от covera
И после этого вылеза маленькая ошибка в консоле игры

[ML] (error) ATools+.lua: C:\GTA by Conor\moonloader\ATools+.lua:624: '<eof>' expected near 'end'
[ML] (error) ATools+.lua: Script died due to an error. (16DC7B84)

Подскажите как исправить

код от 608 до 624

код:
        if result then -- если диалог открыт
            if button == 1 then -- если нажата первая кнопка (Выбрать)
                if list == 0 then
                    sampAddChatMessage("В диалоге с ID 15 выбран пункт {FFFFFF}" .. list, color_dialog)
                elseif list == 1 then
                    sampAddChatMessage("В диалоге с ID 15 выбран пункт {FFFFFF}" .. list, color_dialog)
                elseif list == 2 then
                    sampAddChatMessage("В диалоге с ID 15 выбран пункт {FFFFFF}" .. list, color_dialog)
                elseif list == 3 then
                    sampAddChatMessage("В диалоге с ID 15 выбран пункт {FFFFFF}" .. list, color_dialog)
                end
            else -- если нажата вторая кнопка (Закрыть)
                sampAddChatMessage("Вы закрыли диалог с ID 15", color_dialog)
            end
        end
    end
end

Добавлял airbreak из этого файла lua


Убираю две последних end

Новая ошибка -

[ML] (error) ATools+.lua: C:\GTA by Conor\moonloader\ATools+.lua:919: 'end' expected (to close 'while' at line 480) near '<eof>'
[ML] (error) ATools+.lua: Script died due to an error. (16DC7874)

Код:
blue()
 

Вложения

  • fucking_airbrake.lua
    5.2 KB · Просмотры: 12
Последнее редактирование:

k1zn

О КУ)))
Всефорумный модератор
2,404
2,052
Всем привет!
Я делаю свой Admin Tools и взял AirBreak из собейта от covera
И после этого вылеза маленькая ошибка в консоле игры

[ML] (error) ATools+.lua: C:\GTA by Conor\moonloader\ATools+.lua:624: '<eof>' expected near 'end'
[ML] (error) ATools+.lua: Script died due to an error. (16DC7B84)

Подскажите как исправить

код от 608 до 624

код:
        if result then -- если диалог открыт
            if button == 1 then -- если нажата первая кнопка (Выбрать)
                if list == 0 then
                    sampAddChatMessage("В диалоге с ID 15 выбран пункт {FFFFFF}" .. list, color_dialog)
                elseif list == 1 then
                    sampAddChatMessage("В диалоге с ID 15 выбран пункт {FFFFFF}" .. list, color_dialog)
                elseif list == 2 then
                    sampAddChatMessage("В диалоге с ID 15 выбран пункт {FFFFFF}" .. list, color_dialog)
                elseif list == 3 then
                    sampAddChatMessage("В диалоге с ID 15 выбран пункт {FFFFFF}" .. list, color_dialog)
                end
            else -- если нажата вторая кнопка (Закрыть)
                sampAddChatMessage("Вы закрыли диалог с ID 15", color_dialog)
            end
        end
    end
end

Добавлял airbreak из этого файла lua


Убираю две последних end

Новая ошибка -

[ML] (error) ATools+.lua: C:\GTA by Conor\moonloader\ATools+.lua:919: 'end' expected (to close 'while' at line 480) near '<eof>'
[ML] (error) ATools+.lua: Script died due to an error. (16DC7874)

Код:
blue()
нужно удалить один энд, а не два
 

thebestsupreme

Участник
Автор темы
170
12
[ML] (error) ATools+: C:\GTA by Conor\moonloader\ATools+.lua:477: attempt to yield across C-call boundary
stack traceback:
[C]: in function 'wait'
C:\GTA by Conor\moonloader\ATools+.lua:477: in main chunk
[ML] (error) ATools+: Script died due to an error. (16DC7874)
[ML] (system) Loading script 'C:\GTA by Conor\moonloader\AutoReboot.lua'...


убрал две а не одну


от 476 до 477:
    wait(1)
    sampAddChatMessage(tag .. "Скрипт успешно загружен.Автор {00fab3}Christopher_Kot", -1) -- сообщение в чат при заходе
 

k1zn

О КУ)))
Всефорумный модератор
2,404
2,052
[ML] (error) ATools+: C:\GTA by Conor\moonloader\ATools+.lua:477: attempt to yield across C-call boundary
stack traceback:
[C]: in function 'wait'
C:\GTA by Conor\moonloader\ATools+.lua:477: in main chunk
[ML] (error) ATools+: Script died due to an error. (16DC7874)
[ML] (system) Loading script 'C:\GTA by Conor\moonloader\AutoReboot.lua'...


убрал две а не одну


от 476 до 477:
    wait(1)
    sampAddChatMessage(tag .. "Скрипт успешно загружен.Автор {00fab3}Christopher_Kot", -1) -- сообщение в чат при заходе
дай 460-480 строки
 

thebestsupreme

Участник
Автор темы
170
12
код:
function sampev.onSendPlayerSync(data)
    local speed = data.moveSpeed
    actualSpeed = math.sqrt( speed.x ^ 2 + speed.y ^ 2 + speed.z ^ 2 ) * 140
    if activation then
        data.moveSpeed.x = 10 / 140
        data.moveSpeed.y = 0
        data.moveSpeed.z = -1
        end
    end
end


    sampRegisterChatCommand("mzr", cmd_mzr)
    sampRegisterChatCommand("mzd", cmd_mzd)
    sampRegisterChatCommand("mzda", cmd_mzd)
    sampRegisterChatCommand("update", cmd_update)
    sampRegisterChatCommand("pozdr", cmd_pozdr)

    wait(1)
    sampAddChatMessage(tag .. "Скрипт успешно загружен.Автор {00fab3}Christopher_Kot", -1) -- сообщение в чат при заходе

    while true do
 

k1zn

О КУ)))
Всефорумный модератор
2,404
2,052
код:
function sampev.onSendPlayerSync(data)
    local speed = data.moveSpeed
    actualSpeed = math.sqrt( speed.x ^ 2 + speed.y ^ 2 + speed.z ^ 2 ) * 140
    if activation then
        data.moveSpeed.x = 10 / 140
        data.moveSpeed.y = 0
        data.moveSpeed.z = -1
        end
    end
end


    sampRegisterChatCommand("mzr", cmd_mzr)
    sampRegisterChatCommand("mzd", cmd_mzd)
    sampRegisterChatCommand("mzda", cmd_mzd)
    sampRegisterChatCommand("update", cmd_update)
    sampRegisterChatCommand("pozdr", cmd_pozdr)

    wait(1)
    sampAddChatMessage(tag .. "Скрипт успешно загружен.Автор {00fab3}Christopher_Kot", -1) -- сообщение в чат при заходе

    while true do
это што? все действия регистрации команд и сообщения в чат должны быть в function main()
 
  • Нравится
Реакции: thebestsupreme

thebestsupreme

Участник
Автор темы
170
12
то что я добавлял в код

код:
function main_funcs()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
        if activation then
            local camCoordX, camCoordY, camCoordZ = getActiveCameraCoordinates()
            local targetCamX, targetCamY, targetCamZ = getActiveCameraPointAt()
            local angle = getHeadingFromVector2d(targetCamX - camCoordX, targetCamY - camCoordY)
            local heading = getCharHeading(playerPed)
            setCharCoordinates(playerPed, airbreak_coords[1], airbreak_coords[2], airbreak_coords[3] - 1)
            if isKeyDown(VK_W) then
                airbreak_coords[1] = airbreak_coords[1] + speed * math.sin(-math.rad(angle))
                airbreak_coords[2] = airbreak_coords[2] + speed * math.cos(-math.rad(angle))
                setCharHeading(playerPed, angle)
            elseif isKeyDown(VK_S) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading))
            end
          
            if isKeyDown(VK_A) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading - 90))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading - 90))
            elseif isKeyDown(VK_D) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading + 90))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading + 90))
            end
          
            if isKeyDown(VK_UP) then airbreak_coords[3] = airbreak_coords[3] + speed / 2.0 end
            if isKeyDown(VK_DOWN) and airbreak_coords[3] > -95.0 then airbreak_coords[3] = airbreak_coords[3] - speed / 2.0 end
        end
      
        if isKeyJustPressed(VK_RSHIFT) and isCharOnFoot(playerPed) then
            activation = not activation
            local posX, posY, posZ = getCharCoordinates(playerPed)
            airbreak_coords = {posX, posY, posZ, getCharHeading(playerPed)}
        end

        if isKeyJustPressed(0x6B) then
            speed = speed + 0.1
            printStringNow("speed~r~ "..speed, 1337)
        end

        if isKeyJustPressed(0x6D) then
            speed = speed - 0.1
            printStringNow("speed~r~ "..speed, 1337)
        end
    end
end
    
function sampev.onSendPlayerSync(data)
    local speed = data.moveSpeed
    actualSpeed = math.sqrt( speed.x ^ 2 + speed.y ^ 2 + speed.z ^ 2 ) * 140
    if activation then
        data.moveSpeed.x = 10 / 140
        data.moveSpeed.y = 0
        data.moveSpeed.z = -1
        end
    end
end


local Matrix3X3 = require 'matrix3x3'
local Vector3D = require 'vector3d'
local mem = require "memory"
Ошибка

[ML] (error) ATools+.lua: C:\GTA by Conor\moonloader\ATools+.lua:912: 'end' expected (to close 'while' at line 33) near '<eof>'
[ML] (error) ATools+.lua: Script died due to an error. (16DC79FC)


Код:
function main()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
    _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    name = sampGetPlayerNickname(id)
    if name ~= "Christopher_Kot" then
        sampAddChatMessage("Ваш {C90303}[ATools+]{FFFFFF} не активирован : {5A90CE}vk.com/atoolsmaze", -1)
        thisScript():unload()
    end
    if activation then
    local camCoordX, camCoordY, camCoordZ = getActiveCameraCoordinates()
    local targetCamX, targetCamY, targetCamZ = getActiveCameraPointAt()
    local angle = getHeadingFromVector2d(targetCamX - camCoordX, targetCamY - camCoordY)
    local heading = getCharHeading(playerPed)
    setCharCoordinates(playerPed, airbreak_coords[1], airbreak_coords[2], airbreak_coords[3] - 1)
    if isKeyDown(VK_W) then
        airbreak_coords[1] = airbreak_coords[1] + speed * math.sin(-math.rad(angle))
        airbreak_coords[2] = airbreak_coords[2] + speed * math.cos(-math.rad(angle))
        setCharHeading(playerPed, angle)
    elseif isKeyDown(VK_S) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading))
    end
  
    if isKeyDown(VK_A) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading - 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading - 90))
    elseif isKeyDown(VK_D) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading + 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading + 90))
    end
  
    if isKeyDown(VK_UP) then airbreak_coords[3] = airbreak_coords[3] + speed / 2.0 end
    if isKeyDown(VK_DOWN) and airbreak_coords[3] > -95.0 then airbreak_coords[3] = airbreak_coords[3] - speed / 2.0 end
    end

    if isKeyJustPressed(VK_RSHIFT) and isCharOnFoot(playerPed) then
        activation = not activation
        local posX, posY, posZ = getCharCoordinates(playerPed)
        airbreak_coords = {posX, posY, posZ, getCharHeading(playerPed)}
    end

    if isKeyJustPressed(0x6B) then
        speed = speed + 0.1
        printStringNow("speed~r~ "..speed, 1337)
    end

    if isKeyJustPressed(0x6D) then
        speed = speed - 0.1
        printStringNow("speed~r~ "..speed, 1337)
    end
это што? все действия регистрации команд и сообщения в чат должны быть в function main()
Обновил проверь
 
Последнее редактирование:

k1zn

О КУ)))
Всефорумный модератор
2,404
2,052
то что я добавлял в код

код:
function main_funcs()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
        if activation then
            local camCoordX, camCoordY, camCoordZ = getActiveCameraCoordinates()
            local targetCamX, targetCamY, targetCamZ = getActiveCameraPointAt()
            local angle = getHeadingFromVector2d(targetCamX - camCoordX, targetCamY - camCoordY)
            local heading = getCharHeading(playerPed)
            setCharCoordinates(playerPed, airbreak_coords[1], airbreak_coords[2], airbreak_coords[3] - 1)
            if isKeyDown(VK_W) then
                airbreak_coords[1] = airbreak_coords[1] + speed * math.sin(-math.rad(angle))
                airbreak_coords[2] = airbreak_coords[2] + speed * math.cos(-math.rad(angle))
                setCharHeading(playerPed, angle)
            elseif isKeyDown(VK_S) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading))
            end
         
            if isKeyDown(VK_A) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading - 90))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading - 90))
            elseif isKeyDown(VK_D) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading + 90))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading + 90))
            end
         
            if isKeyDown(VK_UP) then airbreak_coords[3] = airbreak_coords[3] + speed / 2.0 end
            if isKeyDown(VK_DOWN) and airbreak_coords[3] > -95.0 then airbreak_coords[3] = airbreak_coords[3] - speed / 2.0 end
        end
     
        if isKeyJustPressed(VK_RSHIFT) and isCharOnFoot(playerPed) then
            activation = not activation
            local posX, posY, posZ = getCharCoordinates(playerPed)
            airbreak_coords = {posX, posY, posZ, getCharHeading(playerPed)}
        end

        if isKeyJustPressed(0x6B) then
            speed = speed + 0.1
            printStringNow("speed~r~ "..speed, 1337)
        end

        if isKeyJustPressed(0x6D) then
            speed = speed - 0.1
            printStringNow("speed~r~ "..speed, 1337)
        end
    end
end
   
function sampev.onSendPlayerSync(data)
    local speed = data.moveSpeed
    actualSpeed = math.sqrt( speed.x ^ 2 + speed.y ^ 2 + speed.z ^ 2 ) * 140
    if activation then
        data.moveSpeed.x = 10 / 140
        data.moveSpeed.y = 0
        data.moveSpeed.z = -1
        end
    end
end


local Matrix3X3 = require 'matrix3x3'
local Vector3D = require 'vector3d'
local mem = require "memory"
Ошибка

[ML] (error) ATools+.lua: C:\GTA by Conor\moonloader\ATools+.lua:912: 'end' expected (to close 'while' at line 33) near '<eof>'
[ML] (error) ATools+.lua: Script died due to an error. (16DC79FC)


Код:
function main()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
    _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    name = sampGetPlayerNickname(id)
    if name ~= "Christopher_Kot" then
        sampAddChatMessage("Ваш {C90303}[ATools+]{FFFFFF} не активирован : {5A90CE}vk.com/atoolsmaze", -1)
        thisScript():unload()
    end
    if activation then
    local camCoordX, camCoordY, camCoordZ = getActiveCameraCoordinates()
    local targetCamX, targetCamY, targetCamZ = getActiveCameraPointAt()
    local angle = getHeadingFromVector2d(targetCamX - camCoordX, targetCamY - camCoordY)
    local heading = getCharHeading(playerPed)
    setCharCoordinates(playerPed, airbreak_coords[1], airbreak_coords[2], airbreak_coords[3] - 1)
    if isKeyDown(VK_W) then
        airbreak_coords[1] = airbreak_coords[1] + speed * math.sin(-math.rad(angle))
        airbreak_coords[2] = airbreak_coords[2] + speed * math.cos(-math.rad(angle))
        setCharHeading(playerPed, angle)
    elseif isKeyDown(VK_S) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading))
    end
 
    if isKeyDown(VK_A) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading - 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading - 90))
    elseif isKeyDown(VK_D) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading + 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading + 90))
    end
 
    if isKeyDown(VK_UP) then airbreak_coords[3] = airbreak_coords[3] + speed / 2.0 end
    if isKeyDown(VK_DOWN) and airbreak_coords[3] > -95.0 then airbreak_coords[3] = airbreak_coords[3] - speed / 2.0 end
    end

    if isKeyJustPressed(VK_RSHIFT) and isCharOnFoot(playerPed) then
        activation = not activation
        local posX, posY, posZ = getCharCoordinates(playerPed)
        airbreak_coords = {posX, posY, posZ, getCharHeading(playerPed)}
    end

    if isKeyJustPressed(0x6B) then
        speed = speed + 0.1
        printStringNow("speed~r~ "..speed, 1337)
    end

    if isKeyJustPressed(0x6D) then
        speed = speed - 0.1
        printStringNow("speed~r~ "..speed, 1337)
    end

Обновил проверь
while true do wait(0) потерял перед тем что вставил
 

thebestsupreme

Участник
Автор темы
170
12
Все равно

Код:
function main()
    while not  isSampAvailable() do wait(100) end
    _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    name = sampGetPlayerNickname(id)
    while true do wait(0)
     if activation then
            local camCoordX, camCoordY, camCoordZ = getActiveCameraCoordinates()
            local targetCamX, targetCamY, targetCamZ = getActiveCameraPointAt()
            local angle = getHeadingFromVector2d(targetCamX - camCoordX, targetCamY - camCoordY)
            local heading = getCharHeading(playerPed)
            setCharCoordinates(playerPed, airbreak_coords[1], airbreak_coords[2], airbreak_coords[3] - 1)
            if isKeyDown(VK_W) then
                airbreak_coords[1] = airbreak_coords[1] + speed * math.sin(-math.rad(angle))
                airbreak_coords[2] = airbreak_coords[2] + speed * math.cos(-math.rad(angle))
                setCharHeading(playerPed, angle)
            elseif isKeyDown(VK_S) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading))
            end
          
            if isKeyDown(VK_A) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading - 90))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading - 90))
            elseif isKeyDown(VK_D) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading + 90))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading + 90))
            end
          
            if isKeyDown(VK_UP) then airbreak_coords[3] = airbreak_coords[3] + speed / 2.0 end
            if isKeyDown(VK_DOWN) and airbreak_coords[3] > -95.0 then airbreak_coords[3] = airbreak_coords[3] - speed / 2.0 end
        end
      
        if isKeyJustPressed(VK_RSHIFT) and isCharOnFoot(playerPed) then
            activation = not activation
            local posX, posY, posZ = getCharCoordinates(playerPed)
            airbreak_coords = {posX, posY, posZ, getCharHeading(playerPed)}
        end

        if isKeyJustPressed(0x6B) then
            speed = speed + 0.1
            printStringNow("speed~r~ "..speed, 1337)
        end

        if isKeyJustPressed(0x6D) then
            speed = speed - 0.1
            printStringNow("speed~r~ "..speed, 1337)
        end
[ML] (error) ATools+.lua: C:\GTA by Conor\moonloader\ATools+.lua:914: 'end' expected (to close 'function' at line 31) near '<eof>'
[ML] (error) ATools+.lua: Script died due to an error. (01D271DC)
 

k1zn

О КУ)))
Всефорумный модератор
2,404
2,052
то что я добавлял в код

код:
function main_funcs()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
        if activation then
            local camCoordX, camCoordY, camCoordZ = getActiveCameraCoordinates()
            local targetCamX, targetCamY, targetCamZ = getActiveCameraPointAt()
            local angle = getHeadingFromVector2d(targetCamX - camCoordX, targetCamY - camCoordY)
            local heading = getCharHeading(playerPed)
            setCharCoordinates(playerPed, airbreak_coords[1], airbreak_coords[2], airbreak_coords[3] - 1)
            if isKeyDown(VK_W) then
                airbreak_coords[1] = airbreak_coords[1] + speed * math.sin(-math.rad(angle))
                airbreak_coords[2] = airbreak_coords[2] + speed * math.cos(-math.rad(angle))
                setCharHeading(playerPed, angle)
            elseif isKeyDown(VK_S) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading))
            end
       
            if isKeyDown(VK_A) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading - 90))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading - 90))
            elseif isKeyDown(VK_D) then
                airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading + 90))
                airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading + 90))
            end
       
            if isKeyDown(VK_UP) then airbreak_coords[3] = airbreak_coords[3] + speed / 2.0 end
            if isKeyDown(VK_DOWN) and airbreak_coords[3] > -95.0 then airbreak_coords[3] = airbreak_coords[3] - speed / 2.0 end
        end
   
        if isKeyJustPressed(VK_RSHIFT) and isCharOnFoot(playerPed) then
            activation = not activation
            local posX, posY, posZ = getCharCoordinates(playerPed)
            airbreak_coords = {posX, posY, posZ, getCharHeading(playerPed)}
        end

        if isKeyJustPressed(0x6B) then
            speed = speed + 0.1
            printStringNow("speed~r~ "..speed, 1337)
        end

        if isKeyJustPressed(0x6D) then
            speed = speed - 0.1
            printStringNow("speed~r~ "..speed, 1337)
        end
    end
end
 
function sampev.onSendPlayerSync(data)
    local speed = data.moveSpeed
    actualSpeed = math.sqrt( speed.x ^ 2 + speed.y ^ 2 + speed.z ^ 2 ) * 140
    if activation then
        data.moveSpeed.x = 10 / 140
        data.moveSpeed.y = 0
        data.moveSpeed.z = -1
        end
    end
end


local Matrix3X3 = require 'matrix3x3'
local Vector3D = require 'vector3d'
local mem = require "memory"
Ошибка

[ML] (error) ATools+.lua: C:\GTA by Conor\moonloader\ATools+.lua:912: 'end' expected (to close 'while' at line 33) near '<eof>'
[ML] (error) ATools+.lua: Script died due to an error. (16DC79FC)


Код:
function main()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
    _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    name = sampGetPlayerNickname(id)
    if name ~= "Christopher_Kot" then
        sampAddChatMessage("Ваш {C90303}[ATools+]{FFFFFF} не активирован : {5A90CE}vk.com/atoolsmaze", -1)
        thisScript():unload()
    end
    if activation then
    local camCoordX, camCoordY, camCoordZ = getActiveCameraCoordinates()
    local targetCamX, targetCamY, targetCamZ = getActiveCameraPointAt()
    local angle = getHeadingFromVector2d(targetCamX - camCoordX, targetCamY - camCoordY)
    local heading = getCharHeading(playerPed)
    setCharCoordinates(playerPed, airbreak_coords[1], airbreak_coords[2], airbreak_coords[3] - 1)
    if isKeyDown(VK_W) then
        airbreak_coords[1] = airbreak_coords[1] + speed * math.sin(-math.rad(angle))
        airbreak_coords[2] = airbreak_coords[2] + speed * math.cos(-math.rad(angle))
        setCharHeading(playerPed, angle)
    elseif isKeyDown(VK_S) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading))
    end

    if isKeyDown(VK_A) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading - 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading - 90))
    elseif isKeyDown(VK_D) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading + 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading + 90))
    end

    if isKeyDown(VK_UP) then airbreak_coords[3] = airbreak_coords[3] + speed / 2.0 end
    if isKeyDown(VK_DOWN) and airbreak_coords[3] > -95.0 then airbreak_coords[3] = airbreak_coords[3] - speed / 2.0 end
    end

    if isKeyJustPressed(VK_RSHIFT) and isCharOnFoot(playerPed) then
        activation = not activation
        local posX, posY, posZ = getCharCoordinates(playerPed)
        airbreak_coords = {posX, posY, posZ, getCharHeading(playerPed)}
    end

    if isKeyJustPressed(0x6B) then
        speed = speed + 0.1
        printStringNow("speed~r~ "..speed, 1337)
    end

    if isKeyJustPressed(0x6D) then
        speed = speed - 0.1
        printStringNow("speed~r~ "..speed, 1337)
    end

Обновил проверь
Lua:
function main()
    while not isSampAvailable() do wait(0) end
    _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    name = sampGetPlayerNickname(id)
    if name ~= "Christopher_Kot" then
        sampAddChatMessage("Ваш {C90303}[ATools+]{FFFFFF} не активирован : {5A90CE}vk.com/atoolsmaze", -1)
        thisScript():unload()
    end
    while true do
        wait(0)
    if activation then
    local camCoordX, camCoordY, camCoordZ = getActiveCameraCoordinates()
    local targetCamX, targetCamY, targetCamZ = getActiveCameraPointAt()
    local angle = getHeadingFromVector2d(targetCamX - camCoordX, targetCamY - camCoordY)
    local heading = getCharHeading(playerPed)
    setCharCoordinates(playerPed, airbreak_coords[1], airbreak_coords[2], airbreak_coords[3] - 1)
    if isKeyDown(VK_W) then
        airbreak_coords[1] = airbreak_coords[1] + speed * math.sin(-math.rad(angle))
        airbreak_coords[2] = airbreak_coords[2] + speed * math.cos(-math.rad(angle))
        setCharHeading(playerPed, angle)
    elseif isKeyDown(VK_S) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading))
    end

    if isKeyDown(VK_A) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading - 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading - 90))
    elseif isKeyDown(VK_D) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading + 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading + 90))
    end

    if isKeyDown(VK_UP) then airbreak_coords[3] = airbreak_coords[3] + speed / 2.0 end
    if isKeyDown(VK_DOWN) and airbreak_coords[3] > -95.0 then airbreak_coords[3] = airbreak_coords[3] - speed / 2.0 end
    end

    if isKeyJustPressed(VK_RSHIFT) and isCharOnFoot(playerPed) then
        activation = not activation
        local posX, posY, posZ = getCharCoordinates(playerPed)
        airbreak_coords = {posX, posY, posZ, getCharHeading(playerPed)}
    end

    if isKeyJustPressed(0x6B) then
        speed = speed + 0.1
        printStringNow("speed~r~ "..speed, 1337)
    end

    if isKeyJustPressed(0x6D) then
        speed = speed - 0.1
        printStringNow("speed~r~ "..speed, 1337)
        end
    end
end
end
На будущее: если пишет "номер строчки": <eof> expected near end это значит что в этой строчке лишний энд, его нужно удалить
 
  • Нравится
Реакции: Gorskin

thebestsupreme

Участник
Автор темы
170
12
ошибка

[ML] (error) ATools+: C:\GTA by Conor\moonloader\ATools+.lua:475: attempt to yield across C-call boundary
stack traceback:
[C]: in function 'wait'
C:\GTA by Conor\moonloader\ATools+.lua:475: in main chunk
[ML] (error) ATools+: Script died due to an error. (01D27364)


Код:
function main()
    while not isSampAvailable() do wait(0) end
    _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    name = sampGetPlayerNickname(id)
    if name ~= "Christopher_Kot" then
        sampAddChatMessage("Ваш {C90303}[ATools+]{FFFFFF} не активирован : {5A90CE}vk.com/atoolsmaze", -1)
        thisScript():unload()
    end
    while true do
        wait(0)
    if activation then
    local camCoordX, camCoordY, camCoordZ = getActiveCameraCoordinates()
    local targetCamX, targetCamY, targetCamZ = getActiveCameraPointAt()
    local angle = getHeadingFromVector2d(targetCamX - camCoordX, targetCamY - camCoordY)
    local heading = getCharHeading(playerPed)
    setCharCoordinates(playerPed, airbreak_coords[1], airbreak_coords[2], airbreak_coords[3] - 1)
    if isKeyDown(VK_W) then
        airbreak_coords[1] = airbreak_coords[1] + speed * math.sin(-math.rad(angle))
        airbreak_coords[2] = airbreak_coords[2] + speed * math.cos(-math.rad(angle))
        setCharHeading(playerPed, angle)
    elseif isKeyDown(VK_S) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading))
    end
 
    if isKeyDown(VK_A) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading - 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading - 90))
    elseif isKeyDown(VK_D) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading + 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading + 90))
    end
    if isKeyDown(VK_UP) then airbreak_coords[3] = airbreak_coords[3] + speed / 2.0 end
    if isKeyDown(VK_DOWN) and airbreak_coords[3] > -95.0 then airbreak_coords[3] = airbreak_coords[3] - speed / 2.0 end
    end

    if isKeyJustPressed(VK_RSHIFT) and isCharOnFoot(playerPed) then
        activation = not activation
        local posX, posY, posZ = getCharCoordinates(playerPed)
        airbreak_coords = {posX, posY, posZ, getCharHeading(playerPed)}
    end

    if isKeyJustPressed(0x6B) then
        speed = speed + 0.1
        printStringNow("speed~r~ "..speed, 1337)
    end
    if isKeyJustPressed(0x6D) then
        speed = speed - 0.1
        printStringNow("speed~r~ "..speed, 1337)
        end
    end   
    if name ~= "Christopher_Kot" then
        sampAddChatMessage("Ваш {C90303}[ATools+]{FFFFFF} не активирован : {5A90CE}vk.com/atoolsmaze", -1)
        thisScript():unload()
    end
    sampRegisterChatCommand("atools", function()
        sampAddChatMessage(tag .. "{5A90CE}Для появления курсора нажмите *U*", -1)
        MainWind.v = not MainWind.v
    end)
    sampRegisterChatCommand('pr', function(id)
        lua_thread.create(function()
        sampSendChat(string.format('/pm %s Уважаемый игрок, передал ваш Report администратору!', id))
        wait(1000)
        sampShowDialog(19, "Репорт", "Введите репорт который надо передать!", "Передать", "Отмена", 1)
    end)
end)   
    sampRegisterChatCommand('sn', function(id)
        lua_thread.create(function()
        sampSendChat(string.format('/pm %s Уважаемый игрок, слежу за нарушителем!', id))
        wait(1000)
        sampShowDialog(51, "Авто-Слежка", "Введите ID нарушителя", "Следить", "Отмена", 1)
    end)
end)
    sampRegisterChatCommand('pmch', function(id)
        lua_thread.create(function()
        sampSendChat(string.format('/pm %s Уважаемый игрок, сейчас попытаюсь вам помочь!', id))
        wait(1150)
        sampSendChat(string.format('/re %s', id))
    end)
end)
    sampRegisterChatCommand('of', function(id)
        sampSendChat(string.format('/pm %s Уважаемый игрок, пожалуйста прекратите оффтопить! 1/2', id))
    end)
    sampRegisterChatCommand('of2', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/pm %s Уважаемый игрок, пожалуйста, в следующий раз не оффтопьте! 2/2', id))
            wait(1200)
            sampSendChat(string.format('/mute %s 5 offtop', id))
        end)
    end)
    sampRegisterChatCommand('tb', function(id)
        sampSendChat(string.format('/pm %s Уважаемый игрок, ожидайте обзвона, вас оповестят в чате, без обзвона лидерку не выдаем!', id))
    end)
    sampRegisterChatCommand('npa', function(id)
    sampSendChat(string.format('/awarn %s Нарушение Правил Администрации', id))
    end)
    sampRegisterChatCommand('rput', function(id)
        sampSendChat(string.format('/pm %s Уважаемый игрок, сделайте это РП путем! Администратор не может вмешиваться в РП процесс!', id))
    end)
    sampRegisterChatCommand('nv', function(id)
        sampSendChat(string.format('/pm %s Уважаемый игрок, не выдаем!', id))
    end)
    sampRegisterChatCommand('cheat', function(id)
        sampSendChat(string.format('/warn %s Использование Чит-Программ', id))
    end)
    sampRegisterChatCommand('vcheat', function(id)
        sampSendChat(string.format('/ban %s 7 Вред.Читы', id))
    end)
    sampRegisterChatCommand('caps', function(id)
        sampSendChat(string.format('/mute %s 5 Caps Lock', id))
    end)
    sampRegisterChatCommand('osk', function(id)
        sampSendChat(string.format('/mute %s 10 Оск. Адм./Игроков', id))
    end)
    sampRegisterChatCommand('mq', function(id)
        sampSendChat(string.format('/ban %s 7 Упом. Родни', id))
    end)
    sampRegisterChatCommand('3', function(id)
        sampSendChat(string.format('/banan %s Слив/Реклама', id))
    end)
    sampRegisterChatCommand('flood', function(id)
        sampSendChat(string.format('/mute %s 5 flood', id))
    end)
    sampRegisterChatCommand('relog', function(id)
        sampSendChat(string.format('/sban %s relog', id))
    end)
    sampRegisterChatCommand('k', function(id)
        sampSendChat(string.format('/vadgo %s ', id))
    end)
    sampRegisterChatCommand('kk', function(id)
        sampSendChat(string.format('/evad %s relog', id))
    end)
    sampRegisterChatCommand('cop', function(id)
        sampSendChat(string.format('/prison %s 5 Cop in Ghetto', id))
    end)
    sampRegisterChatCommand('afjb', function(id)
        sampSendChat(string.format('/awarn %s 5 Жалоба на Форуме', id))
    end)
    sampRegisterChatCommand('kfjb', function(id)
        sampSendChat(string.format('/kban %s 10 Жалоба на Форуме', id))
    end)
    sampRegisterChatCommand('dm', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/prison %s 10 DeathMatch', id))
            wait(1200)
            sampSendChat(string.format('/pm %s DM - Death Match, убийство игрока без причины. Вы были наказаны за DM.', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Если Вы не согласны с наказанием, пишите жалобу на: forum.maze-rp.ru!', id))
        end)
    end)
    sampRegisterChatCommand('kb', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/kban %s 5 Некк. | Ложный ответ', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Вы получили бан команд за ложный/неккоректный ответ на репорт.', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Если Вы не согласны с наказанием, пишите жалобу на: forum.maze-rp.ru!', id))
        end)
    end)
    sampRegisterChatCommand('aa', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/pm %s Здравствуйте. Вы получили наказание за жалобу на форуме.', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Если Вы не согласны с нарушением, оставьте аппеляцию на модератора в разделе:', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Жалобы на Администрацию/Игроков/Лидеров > Отправить апелляцию на решение модератора: forum.maze-rp.ru!', id))
        end)
    end)
    sampRegisterChatCommand('eva', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/kban %s 5 /evad | /vadgo', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Вы получили бан команд за ошибки/мг, которые вы пропустили в /vad.', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Если Вы не согласны с наказанием, пишите жалобу на: forum.maze-rp.ru!', id))
        end)
    end)
    sampRegisterChatCommand('db', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/prison %s 10 DriveBy', id))
            wait(1200)
            sampSendChat(string.format('/pm %s DriveBy - убийство игрока автомобилем. Вы были наказаны за DB.', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Если Вы не согласны с наказанием, пишите жалобу на: forum.maze-rp.ru!', id))
        end)
    end)
    sampRegisterChatCommand('tk', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/prison %s 10 Team Kill', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Team Kill - убийство игрока своей же фракции. Вы были наказаны за TK.', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Если Вы не согласны с наказанием, пишите жалобу на: forum.maze-rp.ru!', id))
        end)
    end)
    sampRegisterChatCommand('forum', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/gethere %s', id))
            wait(2000)
            sampSendChat(string.format('/freeze %s', id))
            wait(1000)
            sampSendChat(string.format('Здравствуйте. Я Администратор Kenshi_San.', id))
            wait(1200)
            sampSendChat(string.format('Я обращаюсь к Вам по той причине, что на Вас поступила жалоба.', id))
            wait(1200)
            sampSendChat(string.format('Данная жалоба находиться в разделе: ', id))
            wait(1200)
            sampSendChat(string.format('Жалобы на Администрацию/Игроков/Лидеров > Отправить жалобу на Администратора ', id))
            wait(1200)
            sampSendChat(string.format('У Вас имеются доказательства на нарушения игрока? ', id))
            wait(1200)
            sampShowDialog(20, "Ожидайте ответа от игрока", "У игрока имеются доказательства?", "Имеются", "Не имеются", 0)
        end)
    end)
    sampRegisterChatCommand('sk', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/prison %s 10 Spawn Kill', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Spawn Kill - убийство игроков на точке спавна. Вы были наказаны за SK.', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Если Вы не согласны с наказанием, пишите жалобу на: forum.maze-rp.ru!', id))
        end)
    end)
    sampRegisterChatCommand('mg', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/mute %s 1 MetaGaming', id))
            wait(1200)
            sampSendChat(string.format('/pm %s MetaGaming - Использование OOC ин-ции в IC чат. Вы были наказаны за MG.', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Если Вы не согласны с наказанием, пишите жалобу на: forum.maze-rp.ru!', id))
        end)
    end)
    sampRegisterChatCommand('bb', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/makeadmin %s 1', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Поздравляю Вас. Вы получили права администратора 1 уровня.', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Для того, чтобы авторизироваться в админке, введите /alogin и пароль!', id))
            wait(1000)
            sampSendChat(string.format('/pm %s Ваш ADM пароль будет сообщен через пару секунд. Приятного дня!', id))
        end)
    end)
    sampRegisterChatCommand('pmg', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/pm %s Ув.Игрок, я Вам помог. Надеюсь Вы остались довольны. Приятного дня!', id))
        end)
    end)
    sampRegisterChatCommand('afk', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/pm %s Ув.Игрок, Вы подозреваетесь в AFK без ESC.', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Если вы тут, просьба написать "+" в чат!', id))
            wait(1200)
            sampSendChat(string.format('/pm %s В противном случае я буду вынужден Вас кикнуть!', id))
        end)
    end)
    sampRegisterChatCommand('nak2', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/pm %s Жалобу на администратора вы можете оставить на нашем форуме - forum.maze-rp.ru.', id))
        end)
    end)
    sampRegisterChatCommand('admm', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/pm %s Здравствуйте. На нашем проекте права администратора можно получить при:', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Вводе команды /adm в игровой чат. Быть "Пиарщиком", отстоять лидерку, сотрудничать с проектом.', id))
        end)
    end)
    sampRegisterChatCommand('nrp', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/pm %s Ув.Игрок, просьба сменить ваш NonRP nick на РП: Name_Surname! ', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Это позволит Вам полноценно играть на нашем проекте...', id))
            wait(1200)
            sampSendChat(string.format('/pm %s ...А также успешно трудоустроиться в любую фракцию!', id))
        end)
    end)
    sampRegisterChatCommand('lid', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/pm %s Ув.Игрок, чтобы получить лидерку, необходимо: ', id))
            wait(1200)
            sampSendChat(string.format('/pm %s Гетто: пройти обзвон. Мафия, Гос: оставить заявку на форуме, пройти обзвон!', id))
            wait(1200)
            sampSendChat(string.format('/pm %s ...А также успешно трудоустроиться в любую фракцию!', id))
        end)
    end)
    sampRegisterChatCommand('al', function(id)
        lua_thread.create(function()
            sampSendChat(string.format('/alogin', id))
            wait(10000)
            sampSendChat(string.format('/agm', id))
            wait(1200)
            sampSendChat(string.format('/lammo', id))
            wait(1200)
            sampSendChat(string.format('/btrack', id))
            wait(1200)
            sampSendChat(string.format('/showmc', id))
            wait(1200)
            sampSendChat(string.format('/showbc', id))
            wait(1000)
            sampSendChat(string.format('/a [ATools+] -Статус- [Свободен] могу принимать жалобы.', id))
            wait(1200)
        end)
    end)
    sampRegisterChatCommand('amg', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/mute %s 1 MG || ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('acheat', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/warn %s Cheats || ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('avcheat', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/ban %s 7 Vred. Cheats || ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('dma', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/prison %s 10 DeathMatch || ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('atk', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/prison %s 10 TeamKill || ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('ask', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/prison %s 10 SpawnKill || ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('amq', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/ban %s 7 Упом.Родни || ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('aeva', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/kban %s 5 /evad | /vadgo || ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('arelog', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/sban %s relog || ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('adb', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/prison %s 10 DriveBy || ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('nak', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/pm %s Вы были наказаны по просьбе администратора ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('acop', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/prison %s 5 Cop in Ghetto || ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('nak1', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/pm %s Если вы не согласны с наказанием, пишите жалобу на ADM ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('st1', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/a [Статус] Неактивен. Начинаю работать по жалобе игрока [ ID: %s] Nick: ' .. adminname, idnar))
    end)
    sampRegisterChatCommand('st2', function(ids)
        local idnar = string.sub(ids, 0, string.find(ids, "%s"))
                sampAddChatMessage(ids, -1)
        local idadm = string.sub(ids, string.find(ids, "%s") + 1, string.len(ids))
        local name = sampGetPlayerNickname(idadm) -- вот это строки не было
        local adminname = string.sub(name, 0, 1) .. '.' .. string.sub(name, string.find(name, '_') + 1, string.len(name))
        sampSendChat(string.format('/a [Статус] Активен. Закончил работать по жалобе игрока [ ID: %s] Nick: ' .. adminname, idnar))
    end)
    
function sampev.onSendPlayerSync(data)
    local speed = data.moveSpeed
    actualSpeed = math.sqrt( speed.x ^ 2 + speed.y ^ 2 + speed.z ^ 2 ) * 140
    if activation then
        data.moveSpeed.x = 10 / 140
        data.moveSpeed.y = 0
        data.moveSpeed.z = -1
        end
    end
end


    sampRegisterChatCommand("mzr", cmd_mzr)
    sampRegisterChatCommand("mzd", cmd_mzd)
    sampRegisterChatCommand("mzda", cmd_mzd)
    sampRegisterChatCommand("update", cmd_update)
    sampRegisterChatCommand("pozdr", cmd_pozdr)

    wait(1)
    sampAddChatMessage(tag .. "Скрипт успешно загружен.Автор {00fab3}Christopher_Kot", -1) -- сообщение в чат при заходе

    while true do
 

thebestsupreme

Участник
Автор темы
170
12
Lua:
function main()
    while not isSampAvailable() do wait(0) end
    _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    name = sampGetPlayerNickname(id)
    if name ~= "Christopher_Kot" then
        sampAddChatMessage("Ваш {C90303}[ATools+]{FFFFFF} не активирован : {5A90CE}vk.com/atoolsmaze", -1)
        thisScript():unload()
    end
    while true do
        wait(0)
    if activation then
    local camCoordX, camCoordY, camCoordZ = getActiveCameraCoordinates()
    local targetCamX, targetCamY, targetCamZ = getActiveCameraPointAt()
    local angle = getHeadingFromVector2d(targetCamX - camCoordX, targetCamY - camCoordY)
    local heading = getCharHeading(playerPed)
    setCharCoordinates(playerPed, airbreak_coords[1], airbreak_coords[2], airbreak_coords[3] - 1)
    if isKeyDown(VK_W) then
        airbreak_coords[1] = airbreak_coords[1] + speed * math.sin(-math.rad(angle))
        airbreak_coords[2] = airbreak_coords[2] + speed * math.cos(-math.rad(angle))
        setCharHeading(playerPed, angle)
    elseif isKeyDown(VK_S) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading))
    end

    if isKeyDown(VK_A) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading - 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading - 90))
    elseif isKeyDown(VK_D) then
        airbreak_coords[1] = airbreak_coords[1] - speed * math.sin(-math.rad(heading + 90))
        airbreak_coords[2] = airbreak_coords[2] - speed * math.cos(-math.rad(heading + 90))
    end

    if isKeyDown(VK_UP) then airbreak_coords[3] = airbreak_coords[3] + speed / 2.0 end
    if isKeyDown(VK_DOWN) and airbreak_coords[3] > -95.0 then airbreak_coords[3] = airbreak_coords[3] - speed / 2.0 end
    end

    if isKeyJustPressed(VK_RSHIFT) and isCharOnFoot(playerPed) then
        activation = not activation
        local posX, posY, posZ = getCharCoordinates(playerPed)
        airbreak_coords = {posX, posY, posZ, getCharHeading(playerPed)}
    end

    if isKeyJustPressed(0x6B) then
        speed = speed + 0.1
        printStringNow("speed~r~ "..speed, 1337)
    end

    if isKeyJustPressed(0x6D) then
        speed = speed - 0.1
        printStringNow("speed~r~ "..speed, 1337)
        end
    end
end
end
На будущее: если пишет "номер строчки": <eof> expected near end это значит что в этой строчке лишний энд, его нужно удалить
Убираю end как вы говорили все равно ошибка
 

k1zn

О КУ)))
Всефорумный модератор
2,404
2,052