Помирает скрипт

MoJlogou_XaKep

Участник
Автор темы
86
5
Версия MoonLoader
.026-beta
Вообщем сначала скрипт загружается и все ок. но потом ниже пишет вот это:
C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[ML] (error) Bot by Kalgan: Script died due to an error. (0649059C) - код ошибки. Сам скрипт ниже:

Код:
script_name("Bot by Kalgan")
script_authors("Kalgan_Haverts")
script_description("Шахта бот, использовать на свой риск")
script_version("0.1")
script_dependencies("CLEO")

---------------------------------------------------------------------------

require "lib.moonloader"

local sampev = require 'samp.events'
---------------------------------------------------------------------------

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    sampRegisterChatCommand("botstart", cmd_bot)

    local saveX = {}
    local saveY = {}
    local saveZ = {}
    while true do
        wait(0)
        if isPlayerPlaying(playerHandle) and enabled then
---------------------------------------------------------------------------
            local posX, posY, posZ = GetCoordinates()
            local mfind, mposX, mposY, mposZ = SearchMarker(posX, posY, posZ, 146.260864, false)
            if mfind then BeginToPoint(mposX, mposY, mposZ, 1.000000, -255, false) end
            wait(10000)
            BeginToPoint(-1901.540039, 1247.989990, 1216.239990, 1.000000, -255, false)
            wait(390)
            BeginToPoint(-1931.349976, 1249.260010, 1216.089966, 1.000000, -255, false)
            wait(390)
            BeginToPoint(-1975.000000, 1249.430054, 1216.619995, 1.000000, -255, false)
            wait(390)
            local posX, posY, posZ = GetCoordinates()
            local mfind, mposX, mposY, mposZ = SearchMarker(posX, posY, posZ, 146.260864, false)
            if mfind then BeginToPoint(mposX, mposY, mposZ, 1.000000, -255, false) end
            wait(4730)
            wait(450)
            BeginToPoint(-1973.560059, 1249.170044, 1216.369995, 1.000000, -255, false)
            BeginToPoint(-1973.560059, 1249.170044, 1216.369995, 1.000000, -255, false)
            wait(450)
            BeginToPoint(-1904.640015, 1249.530029, 1216.989990, 1.000000, -255, false)
            wait(450)
---------------------------------------------------------------------------
        end
    end
end



--------------------------- STANDART FUNCTIONS ---------------------------
function runToPoint(tox, toy, sprint)
local x, y, z = getCharCoordinates(PLAYER_PED)
local angle = getHeadingFromVector2d(tox - x, toy - y)
setCameraPositionUnfixed(0, math.rad(angle - 90))
stopRun = false
while getDistanceBetweenCoords2d(x, y, tox, toy) > 0.5 do
setGameKeyState(1, -255)
if sprint then
setGameKeyState(16, 255)
end
wait(0)
x, y, z = getCharCoordinates(PLAYER_PED)
angle = getHeadingFromVector2d(tox - x, toy - y)
setCameraPositionUnfixed(0, math.rad(angle - 90))
if stopRun then
break
end
end
end

function sampev.onServerMessage(color, text)
if text:find('У вас сломалась кирка! Для продолжени¤ работы необходимо купить новую!') then
 if isPlayerPlaying(playerHandle) and enabled then

runToPoint(-1913.109985, 1249.430054, 1216.719971, 1.000000, -255, false)
local posX, posY, posZ = GetCoordinates()
local mfind, mposX, mposY, mposZ = SearchMarker(posX, posY, posZ, 16.391304, false)
if mfind then runToPoint(mposX, mposY, mposZ, 1.000000, -255, false) end
enabled = false
             end
wait(100)
if MarkerPosX ~= 0.0 or MarkerPosY ~= 0.0 or MarkerPosZ ~= 0.0 then
            if getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ) < radius then
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
                radius = getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ)
                         end
                         end
wait(100)                
sampSendDialogResponse(9440, 1, 1, "Улица")
wait(1000)
if isPlayerPlaying(playerHandle) and enabled then
runToPoint(-1879.069946, -1642.060059, 21.770000, 1.000000, -255, false)
            enabled = false    
end            
wait(100)    
if MarkerPosX ~= 0.0 or MarkerPosY ~= 0.0 or MarkerPosZ ~= 0.0 then
            if getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ) < radius then
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
                radius = getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ)
                         end
                         end
wait(100)

sampSendDialogResponse(9441, 1, 2, "Кирка 2 уроверь")    
wait(100)
sampCloseCurrentDialogWithButton(1)    
end
if isPlayerPlaying(playerHandle) and enabled then
runToPoint(-1879.069946, -1642.060059, 21.770000, 1.000000, -255, false)
            enabled = false                    
        end        

if MarkerPosX ~= 0.0 or MarkerPosY ~= 0.0 or MarkerPosZ ~= 0.0 then
            if getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ) < radius then
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
                radius = getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ)
                         end
                         end
wait(100)
sampSendDialogResponse(9440, 1, 4, "3 этаж (Серебро)")    
    
    end        

function MovePlayer(move_code, isSprint)
    setGameKeyState(1, move_code)
    --[[255 - обычный бег назад
       -255 - обычный бег вперед
      65535 - идти шагом вперед
     -65535 - идти шагом назад]]
    if isSprint then setGameKeyState(16, 255) end
end

function SetAngle(x, y, z)
    local posX, posY, posZ = GetCoordinates()
    local pX = x - posX
    local pY = y - posY
    local zAngle = getHeadingFromVector2d(pX, pY)

    if isCharInAnyCar(playerPed) then
        local car = storeCarCharIsInNoSave(playerPed)
        setCarHeading(car, zAngle)
    else
        setCharHeading(playerPed, zAngle)
    end

    restoreCameraJumpcut()
end

function GetCoordinates()
    if isCharInAnyCar(playerPed) then
        local car = storeCarCharIsInNoSave(playerPed)
        return getCarCoordinates(car)
    else
        return getCharCoordinates(playerPed)
    end
end

function cmd_bot(param)
    enabled = not enabled
    if enabled then
        sampAddChatMessage(string.format("[%s]: Активирован", thisScript().name), 0x40FF40)
    else
        sampAddChatMessage(string.format("[%s]: Деактивирован", thisScript().name), 0xFF4040)
    end
end

-- Teleport from ClickWarp (by FYP)
function teleportPlayer(x, y, z)
    if isCharInAnyCar(playerPed) then
        setCharCoordinates(playerPed, x, y, z)
    end
    setCharCoordinatesDontResetAnim(playerPed, x, y, z)
end

function setCharCoordinatesDontResetAnim(char, x, y, z)
    if doesCharExist(char) then
        local ptr = getCharPointer(char)
        setEntityCoordinates(ptr, x, y, z)
    end
end

function setEntityCoordinates(entityPtr, x, y, z)
    if entityPtr ~= 0 then
        local matrixPtr = readMemory(entityPtr + 0x14, 4, false)
        if matrixPtr ~= 0 then
            local posPtr = matrixPtr + 0x30
            writeMemory(posPtr + 0, 4, representFloatAsInt(x), false) --X
            writeMemory(posPtr + 4, 4, representFloatAsInt(y), false) --Y
            writeMemory(posPtr + 8, 4, representFloatAsInt(z), false) --Z
        end
    end
end
-- End Teleport code

--------------------------- ADDITIONAL FUNCTIONS ---------------------------

function SearchMarker(posX, posY, posZ, radius, isRace)
    local ret_posX = 0.0
    local ret_posY = 0.0
    local ret_posZ = 0.0
    local isFind = false

    for id = 0, 31 do
        local MarkerStruct = 0
        if isRace then MarkerStruct = 0xC7F168 + id * 56
        else MarkerStruct = 0xC7DD88 + id * 160 end
        local MarkerPosX = representIntAsFloat(readMemory(MarkerStruct + 0, 4, false))
        local MarkerPosY = representIntAsFloat(readMemory(MarkerStruct + 4, 4, false))
        local MarkerPosZ = representIntAsFloat(readMemory(MarkerStruct + 8, 4, false))

        if MarkerPosX ~= 0.0 or MarkerPosY ~= 0.0 or MarkerPosZ ~= 0.0 then
            if getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ) < radius then
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
                radius = getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ)
            end
        end
    end

    return isFind, ret_posX, ret_posY, ret_posZ
end

Cупир пупир крутые скриптеры, прошу помогите
 

RedHolms

Известный
Проверенный
619
366
Говорю сам скрипт загружается!!!!. Но не работает вот из-за этой хуйни
Это конечно очень хорошо, что он загружается, но текст ошибки бьять можно?
Либо сразу лог мунлоадера
 

MoJlogou_XaKep

Участник
Автор темы
86
5
Скинь просто лог мунлоадера
Код:
[16:08:43.475114] (system)    Session started.
[16:08:43.475114] (debug)    Module handle: 6D200000

MoonLoader v.026.5-beta loaded.
Developers: FYP, hnnssy, EvgeN 1137

Copyright (c) 2016, BlastHack Team
https://www.blast.hk/moonloader/

[16:08:43.475114] (info)    Working directory: C:\GameCS\GTA LOW\moonloader
[16:08:43.475114] (debug)    FP Control: 0009001F
[16:08:43.475114] (debug)    Game: GTA SA 1.0.0.0 US
[16:08:43.475114] (system)    Installing pre-game hooks...
[16:08:43.475114] (system)    Hooks installed.
[16:08:46.262579] (debug)    Initializing opcode handler table
[16:08:46.262579] (debug)    package.path = C:\GameCS\GTA LOW\moonloader\lib\?.lua;C:\GameCS\GTA LOW\moonloader\lib\?\init.lua;C:\GameCS\GTA LOW\moonloader\?.lua;C:\GameCS\GTA LOW\moonloader\?\init.lua;.\?.lua;C:\GameCS\GTA LOW\moonloader\lib\?.luac;C:\GameCS\GTA LOW\moonloader\lib\?\init.luac;C:\GameCS\GTA LOW\moonloader\?.luac;C:\GameCS\GTA LOW\moonloader\?\init.luac;.\?.luac
[16:08:46.262579] (debug)    package.cpath = C:\GameCS\GTA LOW\moonloader\lib\?.dll;
[16:08:46.393586] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\aim.lua'...
[16:08:46.393586] (debug)    New script: 0649028C
[16:08:46.441589] (system)    aim.lua: Loaded successfully.
[16:08:46.441589] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\AutoPilot by Scar v5.2 [NEW].lua'...
[16:08:46.441589] (debug)    New script: 06490414
[16:08:46.450590] (error)    AutoPilot by Scar v5.2 [NEW].lua: ...meCS\GTA LOW\moonloader\AutoPilot by Scar v5.2 [NEW].lua:3: module 'mimgui' not found:
    no field package.preload['mimgui']
    no file 'C:\GameCS\GTA LOW\moonloader\lib\mimgui.lua'
    no file 'C:\GameCS\GTA LOW\moonloader\lib\mimgui\init.lua'
    no file 'C:\GameCS\GTA LOW\moonloader\mimgui.lua'
    no file 'C:\GameCS\GTA LOW\moonloader\mimgui\init.lua'
    no file '.\mimgui.lua'
    no file 'C:\GameCS\GTA LOW\moonloader\lib\mimgui.luac'
    no file 'C:\GameCS\GTA LOW\moonloader\lib\mimgui\init.luac'
    no file 'C:\GameCS\GTA LOW\moonloader\mimgui.luac'
    no file 'C:\GameCS\GTA LOW\moonloader\mimgui\init.luac'
    no file '.\mimgui.luac'
    no file 'C:\GameCS\GTA LOW\moonloader\lib\mimgui.dll'
stack traceback:
    [C]: in function 'require'
    ...meCS\GTA LOW\moonloader\AutoPilot by Scar v5.2 [NEW].lua:3: in main chunk
[16:08:46.450590] (error)    AutoPilot by Scar v5.2 [NEW].lua: Script died due to an error. (06490414)
[16:08:46.451590] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\AutoReboot.lua'...
[16:08:46.452590] (debug)    New script: 06490414
[16:08:46.455590] (system)    ML-AutoReboot: Loaded successfully.
[16:08:46.456590] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua'...
[16:08:46.456590] (debug)    New script: 0649059C
[16:08:46.565596] (system)    Bot by Kalgan: Loaded successfully.
[16:08:46.565596] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Bot dlya Vas.lua'...
[16:08:46.565596] (debug)    New script: 06490724
[16:08:46.576597] (system)    Bot dlya Vas: Loaded successfully.
[16:08:46.576597] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\BOT MAIN (1).luac'...
[16:08:46.576597] (debug)    New script: 064908AC
[16:08:46.605598] (system)    BOT MAIN BY BONDY: Loaded successfully.
[16:08:46.606598] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\BOT MAIN.luac'...
[16:08:46.606598] (debug)    New script: 06490A34
[16:08:46.639600] (system)    BOT MAIN BY BONDY: Loaded successfully.
[16:08:46.639600] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\camhack.lua'...
[16:08:46.639600] (debug)    New script: 06490BBC
[16:08:46.667602] (system)    CamHack: Loaded successfully.
[16:08:46.667602] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\check-moonloader-updates.lua'...
[16:08:46.667602] (debug)    New script: 06490D44
[16:08:46.678603] (system)    Check MoonLoader Updates: Loaded successfully.
[16:08:46.678603] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\CheckOnline.lua'...
[16:08:46.678603] (debug)    New script: 06490ECC
[16:08:46.684603] (system)    CheckOnline: Loaded successfully.
[16:08:46.685603] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\cwh.lua'...
[16:08:46.685603] (debug)    New script: 06491054
[16:08:46.734606] (system)    DRWH: Loaded successfully.
[16:08:46.735606] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\dialogs.lua'...
[16:08:46.735606] (debug)    New script: 064911DC
[16:08:46.739606] (system)    dialogs.lua: Loaded successfully.
[16:08:46.739606] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\new 1.lua'...
[16:08:46.739606] (debug)    New script: 06491364
[16:08:46.740606] (error)    new 1.lua: C:\GameCS\GTA LOW\moonloader\new 1.lua:14: 'end' expected (to close 'function' at line 7) near '<eof>'
[16:08:46.740606] (error)    new 1.lua: Script died due to an error. (06491364)
[16:08:46.740606] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\reload_all.lua'...
[16:08:46.740606] (debug)    New script: 06491364
[16:08:46.747607] (system)    ML-ReloadAll: Loaded successfully.
[16:08:46.747607] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\renderobjects.lua'...
[16:08:46.747607] (debug)    New script: 064914EC
[16:08:46.918616] (system)    renderobjects.lua: Loaded successfully.
[16:08:46.918616] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\routes_recorder.lua'...
[16:08:46.919616] (debug)    New script: 06491674
[16:08:46.952618] (system)    routes recorder: Loaded successfully.
[16:08:46.952618] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\SF Integration.lua'...
[16:08:46.952618] (debug)    New script: 064917FC
[16:08:46.963619] (system)    SF Integration: Loaded successfully.
[16:08:46.963619] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\SilentAim.luac'...
[16:08:46.963619] (debug)    New script: 06491984
[16:08:47.032623] (system)    SilentAim: Loaded successfully.
[16:08:47.032623] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\tpm.v3.lua'...
[16:08:47.033623] (debug)    New script: 06491B0C
[16:08:47.062625] (system)    CoordMaster.v2: Loaded successfully.
[16:08:47.062625] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Воспроизвести маршрут.lua'...
[16:08:47.063625] (debug)    New script: 06491C94
[16:08:47.072625] (system)    readcodinat: Loaded successfully.
[16:08:47.073625] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Для шахты.lua'...
[16:08:47.073625] (debug)    New script: 0A5D21B4
[16:08:47.083626] (system)    Для шахты: Loaded successfully.
[16:08:47.083626] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Для шахты2.lua'...
[16:08:47.083626] (debug)    New script: 0A5D233C
[16:08:47.093626] (system)    Для шахты2: Loaded successfully.
[16:08:47.093626] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Для шахты3.lua'...
[16:08:47.093626] (debug)    New script: 0A5D24C4
[16:08:47.103627] (system)    Для шахты3: Loaded successfully.
[16:08:47.103627] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\новый 1.lua'...
[16:08:47.103627] (debug)    New script: 0A5D264C
[16:08:47.141629] (error)    новый 1.lua: C:\GameCS\GTA LOW\moonloader\новый 1.lua:110: ')' expected near '2'
[16:08:47.141629] (error)    новый 1.lua: Script died due to an error. (0A5D264C)
[16:08:47.141629] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\новый 111111.lua'...
[16:08:47.142629] (debug)    New script: 0A5D264C
[16:08:47.175631] (error)    новый 111111.lua: C:\GameCS\GTA LOW\moonloader\новый 111111.lua:110: ')' expected near '2'
[16:08:47.175631] (error)    новый 111111.lua: Script died due to an error. (0A5D264C)
[16:08:47.175631] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Новый бот.lua'...
[16:08:47.175631] (debug)    New script: 0A5D264C
[16:08:47.185632] (system)    Новый бот: Loaded successfully.
[16:08:47.186632] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Новый текстовый документ.lua'...
[16:08:47.186632] (debug)    New script: 0A5D27D4
[16:08:47.209633] (system)    Новый текстовый документ.lua: Loaded successfully.
[16:08:47.212633] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Тестовые Скрипты.lua'...
[16:08:47.212633] (debug)    New script: 0A5D295C
[16:08:47.237635] (system)    Тестовые Скрипты.lua: Loaded successfully.
[16:08:47.237635] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Шахта Бот.lua'...
[16:08:47.238635] (debug)    New script: 0A5D2AE4
[16:08:47.248635] (error)    Шахта Бот.lua: C:\GameCS\GTA LOW\moonloader\Шахта Бот.lua:110: ')' expected near '2'
[16:08:47.249635] (error)    Шахта Бот.lua: Script died due to an error. (0A5D2AE4)
[16:08:47.249635] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Шахта Ботт.lua'...
[16:08:47.249635] (debug)    New script: 0A5D2AE4
[16:08:47.283637] (error)    Шахта Ботт.lua: C:\GameCS\GTA LOW\moonloader\Шахта Ботт.lua:110: ')' expected near '2'
[16:08:47.283637] (error)    Шахта Ботт.lua: Script died due to an error. (0A5D2AE4)
[16:08:47.284637] (system)    Loading script 'C:\GameCS\GTA LOW\moonloader\Шахта Боттт.lua'...
[16:08:47.284637] (debug)    New script: 0A5D2AE4
[16:08:47.294638] (error)    Шахта Боттт.lua: C:\GameCS\GTA LOW\moonloader\Шахта Боттт.lua:110: ')' expected near '2'
[16:08:47.294638] (error)    Шахта Боттт.lua: Script died due to an error. (0A5D2AE4)
[16:09:05.474678] (system)    Installing post-load hooks...
[16:09:05.475678] (system)    Hooks installed.
[16:09:38.172548] (error)    CheckOnline: C:\GameCS\GTA LOW\moonloader\CheckOnline.lua:108: Server not found.
stack traceback:
    [C]: in function 'assert'
    C:\GameCS\GTA LOW\moonloader\CheckOnline.lua:108: in function <C:\GameCS\GTA LOW\moonloader\CheckOnline.lua:104>
[16:09:38.172548] (error)    CheckOnline: Script died due to an error. (06490ECC)
[16:09:38.248552] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.250552] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.251552] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.252552] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.253553] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.257553] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.258553] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.259553] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.260553] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.262553] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.263553] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.267553] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.268553] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.269553] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.270554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.270554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.272554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.273554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.276554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.277554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.279554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.280554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.281554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.282554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.283554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.287554] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.288555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.289555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.290555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.291555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.291555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.293555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.296555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.298555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.299555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.300555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.300555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.301555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.302555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.303555] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.307556] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.308556] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.309556] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.310556] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.311556] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.312556] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.313556] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.317556] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.318556] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.319556] (error)    Bot by Kalgan: C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: attempt to compare number with nil
stack traceback:
    C:\GameCS\GTA LOW\moonloader\Bot by Kalgan.lua:123: in function 'callback'
    C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:79: in function <C:\GameCS\GTA LOW\moonloader\lib\samp\events\core.lua:53>
[16:09:38.402561] (error)    Bot by Kalgan: Script died due to an error. (0649059C)
[16:10:11.243439] (system)    Unloading...
[16:10:11.243439] (system)    aim.lua: Script terminated. (0649028C)
[16:10:11.245440] (system)    ML-AutoReboot: Script terminated. (06490414)
[16:10:11.249440] (system)    Bot dlya Vas: Script terminated. (06490724)
[16:10:11.251440] (system)    BOT MAIN BY BONDY: Script terminated. (064908AC)
[16:10:11.253440] (system)    BOT MAIN BY BONDY: Script terminated. (06490A34)
[16:10:11.254440] (system)    CamHack: Script terminated. (06490BBC)
[16:10:11.256440] (system)    Check MoonLoader Updates: Script terminated. (06490D44)
[16:10:11.260440] (system)    DRWH: Script terminated. (06491054)
[16:10:11.261440] (system)    dialogs.lua: Script terminated. (064911DC)
[16:10:11.262441] (system)    ML-ReloadAll: Script terminated. (06491364)
[16:10:11.263441] (system)    renderobjects.lua: Script terminated. (064914EC)
[16:10:11.266441] (system)    routes recorder: Script terminated. (06491674)
[16:10:11.271441] (system)    SF Integration: Script terminated. (064917FC)
[16:10:11.272441] (system)    SilentAim: Script terminated. (06491984)
[16:10:11.275441] (system)    CoordMaster.v2: Script terminated. (06491B0C)
[16:10:11.277441] (system)    readcodinat: Script terminated. (06491C94)
[16:10:11.281442] (system)    Для шахты: Script terminated. (0A5D21B4)
[16:10:11.282442] (system)    Для шахты2: Script terminated. (0A5D233C)
[16:10:11.283442] (system)    Для шахты3: Script terminated. (0A5D24C4)
[16:10:11.284442] (system)    Новый бот: Script terminated. (0A5D264C)
[16:10:11.285442] (system)    Новый текстовый документ.lua: Script terminated. (0A5D27D4)
[16:10:11.286442] (system)    Тестовые Скрипты.lua: Script terminated. (0A5D295C)
[16:10:11.335445] (system)    Session terminated.

Скинь просто лог мунлоадера
Кинул лог. И?
 
Последнее редактирование:

MoJlogou_XaKep

Участник
Автор темы
86
5
Код:
script_name("Bot by Kalgan")
script_authors("Kalgan_Haverts")
script_description("Шахта бот, использовать на свой риск")
script_version("0.1")
script_dependencies("CLEO")

---------------------------------------------------------------------------

require "lib.moonloader"

local sampev = require 'samp.events'
---------------------------------------------------------------------------

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    sampRegisterChatCommand("botstart", cmd_bot)

    local saveX = {}
    local saveY = {}
    local saveZ = {}
    while true do
        wait(0)
        if isPlayerPlaying(playerHandle) and enabled then
---------------------------------------------------------------------------
            local posX, posY, posZ = GetCoordinates()
            local mfind, mposX, mposY, mposZ = SearchMarker(posX, posY, posZ, 146.260864, false)
            if mfind then BeginToPoint(mposX, mposY, mposZ, 1.000000, -255, false) end
            wait(10000)
            BeginToPoint(-1901.540039, 1247.989990, 1216.239990, 1.000000, -255, false)
            wait(390)
            BeginToPoint(-1931.349976, 1249.260010, 1216.089966, 1.000000, -255, false)
            wait(390)
            BeginToPoint(-1975.000000, 1249.430054, 1216.619995, 1.000000, -255, false)
            wait(390)
            local posX, posY, posZ = GetCoordinates()
            local mfind, mposX, mposY, mposZ = SearchMarker(posX, posY, posZ, 146.260864, false)
            if mfind then BeginToPoint(mposX, mposY, mposZ, 1.000000, -255, false) end
            wait(4730)
            wait(450)
            BeginToPoint(-1973.560059, 1249.170044, 1216.369995, 1.000000, -255, false)
            BeginToPoint(-1973.560059, 1249.170044, 1216.369995, 1.000000, -255, false)
            wait(450)
            BeginToPoint(-1904.640015, 1249.530029, 1216.989990, 1.000000, -255, false)
            wait(450)
---------------------------------------------------------------------------
        end
    end
end



--------------------------- STANDART FUNCTIONS ---------------------------
function runToPoint(tox, toy, sprint)
local x, y, z = getCharCoordinates(PLAYER_PED)
local angle = getHeadingFromVector2d(tox - x, toy - y)
setCameraPositionUnfixed(0, math.rad(angle - 90))
stopRun = false
while getDistanceBetweenCoords2d(x, y, tox, toy) > 0.5 do
setGameKeyState(1, -255)
if sprint then
setGameKeyState(16, 255)
end
wait(0)
x, y, z = getCharCoordinates(PLAYER_PED)
angle = getHeadingFromVector2d(tox - x, toy - y)
setCameraPositionUnfixed(0, math.rad(angle - 90))
if stopRun then
break
end
end
end

function sampev.onServerMessage(color, text)
if text:find('У вас сломалась кирка! Для продолжени¤ работы необходимо купить новую!') then
 if isPlayerPlaying(playerHandle) and enabled then

runToPoint(-1913.109985, 1249.430054, 1216.719971, 1.000000, -255, false)
local posX, posY, posZ = GetCoordinates()
local mfind, mposX, mposY, mposZ = SearchMarker(posX, posY, posZ, 16.391304, false)
if mfind then runToPoint(mposX, mposY, mposZ, 1.000000, -255, false) end
enabled = false
             end
wait(100)
if MarkerPosX ~= 0.0 or MarkerPosY ~= 0.0 or MarkerPosZ ~= 0.0 then
            if getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ) < radius then
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
                radius = getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ)
                         end
                         end
wait(100)                
sampSendDialogResponse(9440, 1, 1, "Улица")
wait(1000)
if isPlayerPlaying(playerHandle) and enabled then
runToPoint(-1879.069946, -1642.060059, 21.770000, 1.000000, -255, false)
            enabled = false    
end            
wait(100)    
if MarkerPosX ~= 0.0 or MarkerPosY ~= 0.0 or MarkerPosZ ~= 0.0 then
            if getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ) < radius then
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ     
                isFind = true
                radius = getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ)
                         end
                         end
wait(100)

sampSendDialogResponse(9441, 1, 2, "Кирка 2 уроверь")    
wait(100)
sampCloseCurrentDialogWithButton(1)    
end
if isPlayerPlaying(playerHandle) and enabled then
runToPoint(-1879.069946, -1642.060059, 21.770000, 1.000000, -255, false)
            enabled = false                    
        end        

if MarkerPosX ~= 0.0 or MarkerPosY ~= 0.0 or MarkerPosZ ~= 0.0 then
            if getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ) < radius then
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
                radius = getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ)
                         end
                         end
wait(100)
sampSendDialogResponse(9440, 1, 4, "3 этаж (Серебро)")    
   
    end        

function MovePlayer(move_code, isSprint)
    setGameKeyState(1, move_code)
    --[[255 - обычный бег назад
       -255 - обычный бег вперед
      65535 - идти шагом вперед
     -65535 - идти шагом назад]]
    if isSprint then setGameKeyState(16, 255) end
end

function SetAngle(x, y, z)
    local posX, posY, posZ = GetCoordinates()
    local pX = x - posX
    local pY = y - posY
    local zAngle = getHeadingFromVector2d(pX, pY)

    if isCharInAnyCar(playerPed) then
        local car = storeCarCharIsInNoSave(playerPed)
        setCarHeading(car, zAngle)
    else
        setCharHeading(playerPed, zAngle)
    end

    restoreCameraJumpcut()
end

function GetCoordinates()
    if isCharInAnyCar(playerPed) then
        local car = storeCarCharIsInNoSave(playerPed)
        return getCarCoordinates(car)
    else
        return getCharCoordinates(playerPed)
    end
end

function cmd_bot(param)
    enabled = not enabled
    if enabled then
        sampAddChatMessage(string.format("[%s]: Активирован", thisScript().name), 0x40FF40)
    else
        sampAddChatMessage(string.format("[%s]: Деактивирован", thisScript().name), 0xFF4040)
    end
end

-- Teleport from ClickWarp (by FYP)
function teleportPlayer(x, y, z)
    if isCharInAnyCar(playerPed) then
        setCharCoordinates(playerPed, x, y, z)
    end
    setCharCoordinatesDontResetAnim(playerPed, x, y, z)
end

function setCharCoordinatesDontResetAnim(char, x, y, z)
    if doesCharExist(char) then
        local ptr = getCharPointer(char)
        setEntityCoordinates(ptr, x, y, z)
    end
end

function setEntityCoordinates(entityPtr, x, y, z)
    if entityPtr ~= 0 then
        local matrixPtr = readMemory(entityPtr + 0x14, 4, false)
        if matrixPtr ~= 0 then
            local posPtr = matrixPtr + 0x30
            writeMemory(posPtr + 0, 4, representFloatAsInt(x), false) --X
            writeMemory(posPtr + 4, 4, representFloatAsInt(y), false) --Y
            writeMemory(posPtr + 8, 4, representFloatAsInt(z), false) --Z
        end
    end
end
-- End Teleport code

--------------------------- ADDITIONAL FUNCTIONS ---------------------------

function SearchMarker(posX, posY, posZ, radius, isRace)
    local ret_posX = 0.0
    local ret_posY = 0.0
    local ret_posZ = 0.0
    local isFind = false

    for id = 0, 31 do
        local MarkerStruct = 0
        if isRace then MarkerStruct = 0xC7F168 + id * 56
        else MarkerStruct = 0xC7DD88 + id * 160 end
        local MarkerPosX = representIntAsFloat(readMemory(MarkerStruct + 0, 4, false))
        local MarkerPosY = representIntAsFloat(readMemory(MarkerStruct + 4, 4, false))
        local MarkerPosZ = representIntAsFloat(readMemory(MarkerStruct + 8, 4, false))

        if MarkerPosX ~= 0.0 or MarkerPosY ~= 0.0 or MarkerPosZ ~= 0.0 then
            if getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ) < radius then
                ret_posX = MarkerPosX
                ret_posY = MarkerPosY
                ret_posZ = MarkerPosZ
                isFind = true
                radius = getDistanceBetweenCoords3d(MarkerPosX, MarkerPosY, MarkerPosZ, posX, posY, posZ)
            end
        end
    end

    return isFind, ret_posX, ret_posY, ret_posZ
end