Не сохраняется с нужной кодировкой

MoJlogou_XaKep

Участник
Автор темы
86
5
Версия MoonLoader
.026-beta
Помогите пока у меня еще не сильно говорит. Вообщем сделал скрипт, ставлю кодировку Macintosh(ее и надо). Сохраняю скрипт, перезахожу и стоит ANSI. В настройках отключил автоопределения кодировки. НЕ ПОМОГАЕТ. Что делать?
Если что делается в Нотепад++
 

RedHolms

Известный
Проверенный
617
360
Во первых, для сампа нужен cp1251(windows 1251), но тут хз, для сампа ли у тебя скрипт, поэтому проехали, просто лирическое отступление

Во вторых, значит кодировка Macintosh тут не имеет смысла, так как они полностью соответствует ANSI, именно в данном случае.
Тебе стоит забить, это никак ни на что не повлияет, просто Notepad++ указывает такую кодировку, которую ему удобно.
 

MoJlogou_XaKep

Участник
Автор темы
86
5
Во первых, для сампа нужен cp1251(windows 1251), но тут хз, для сампа ли у тебя скрипт, поэтому проехали, просто лирическое отступление

Во вторых, значит кодировка Macintosh тут не имеет смысла, так как они полностью соответствует ANSI, именно в данном случае.
Тебе стоит забить, это никак ни на что не повлияет, просто Notepad++ указывает такую кодировку, которую ему удобно.
Ну смотри это для сампа, Я записао все нужное передвижение в bot maker. Сам Нотепад определил это как Macintosh и с этой кодировкой скрипт не помирает в Сампе. Но как только я добавляю в скрипт функцию кодировка меняется и скрипт помирает
 

RedHolms

Известный
Проверенный
617
360
Ну смотри это для сампа, Я записао все нужное передвижение в bot maker. Сам Нотепад определил это как Macintosh и с этой кодировкой скрипт не помирает в Сампе. Но как только я добавляю в скрипт функцию кодировка меняется и скрипт помирает
попробуй юзать Atom
 

Shepard

Активный
459
88
Помогите пока у меня еще не сильно говорит. Вообщем сделал скрипт, ставлю кодировку Macintosh(ее и надо). Сохраняю скрипт, перезахожу и стоит ANSI. В настройках отключил автоопределения кодировки. НЕ ПОМОГАЕТ. Что делать?
Если что делается в Нотепад++
Зачем себя мучать, если есть сублайм текст 3?
Самый каефный редактор.
А если все равно, кидай скрипт
 

Shepard

Активный
459
88
Лол теперь другая проблема. Оказывается с Маситонишь скрипт помирает, но теперь не сохраняется с Виндоус 1251
Может, мы не будем тебе здесь угадывать в чем твоя проблема, а ты скинешь свой скрипт?
 

RedHolms

Известный
Проверенный
617
360

MoJlogou_XaKep

Участник
Автор темы
86
5
Теперь сохранилось, но скрипт помирает в сампе

Зачем себя мучать, если есть сублайм текст 3?
Самый каефный редактор.
А если все равно, кидай скрипт
Код:
script_name("Bot by Kalgan")
script_authors("Kalgan_Haverts")
script_description("Ўахта бот, использовать на свой риск")
script_version("0.1")
script_dependencies("CLEO")

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

require "lib.moonloader"

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

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        
    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, 4, 3 этаж (Серебро)}    
    
    end        
end
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
 

RedHolms

Известный
Проверенный
617
360
Теперь сохранилось, но скрипт помирает в сампе


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

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

require "lib.moonloader"

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

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       
    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, 4, 3 этаж (Серебро)}   
   
    end       
end
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
Текст ошибки хотя-бы можно?
 

MoJlogou_XaKep

Участник
Автор темы
86
5

RedHolms

Известный
Проверенный
617
360
Lua:
script_name("Bot by Kalgan")
script_authors("Kalgan_Haverts")
script_description("Ўахта бот, использовать на свой риск")
script_version("0.1")
script_dependencies("CLEO")

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

require "lib.moonloader"

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

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       
    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, 4, "3 этаж (Серебро)")   
    
    end       
end
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

И на будущее: Строки заключаются в кавычках