Код JFM запись маршрута

xoez

Известный
Автор темы
4
2
Версия MoonLoader
Другое
Всем привет, есть вопрос.
Есть старенький скрипт от JustFedot - spawning tools
Там имеется запись маршрута, всё работает чётенько на аризоне, но проблема в том что он после спавна как угарелый бежит, а мне нужно добавить задержку, может кто подсказать в каком направлении двигаться?
 

Вложения

  • [JF] SpawningTools.lua
    69.2 KB · Просмотры: 4
  • Нравится
Реакции: Sworikk
Решение
Lua:
local autoOutfit_thread = lua_thread.create_suspended(function()



    local exeption = function(reason)

        local gamestate = sampGetGamestate() == 3



        if not state.autoOutfit.active or

           not gamestate or

           isCharInAnyCar(1)

        then

            autoOutfitToggle(not gamestate and "Соединение с сервером разорвано!" or reason or nil)

            return true

        else

            return false

        end

    end



    local routeIndex = 1

    local errorCount = 0



    while state.autoOutfit.active do wait(0)



        if sampIsLocalPlayerSpawned() and doesCharExist(1) then

            wait(10000) -- Задержка в 10 сек



            exeption()



            if...

sosulka

Участник
9
1
Lua:
local autoOutfit_thread = lua_thread.create_suspended(function()



    local exeption = function(reason)

        local gamestate = sampGetGamestate() == 3



        if not state.autoOutfit.active or

           not gamestate or

           isCharInAnyCar(1)

        then

            autoOutfitToggle(not gamestate and "Соединение с сервером разорвано!" or reason or nil)

            return true

        else

            return false

        end

    end



    local routeIndex = 1

    local errorCount = 0



    while state.autoOutfit.active do wait(0)



        if sampIsLocalPlayerSpawned() and doesCharExist(1) then

            wait(10000) -- Задержка в 10 сек



            exeption()



            if state.autoOutfit.state == 1 then

                local isFactionSkin = getCharModel(1) == cfg.autoOutfit.factionSkinId

                local rtime = math.random(5000, 15000)



                if isFactionSkin then

                    wait(rtime)

                    state.autoOutfit.state = 3

                    sampProcessChatInput("/rec")

                    break

                end



                local x, y, z = getCharCoordinates(1)

                local routeCoords = cfg.autoOutfit.route[routeIndex]



                if routeCoords then

                    if routeCoords.type == 1 then

                        if walkTo(routeCoords.x, routeCoords.y, routeCoords.z, routeCoords.run, routeCoords.jump) then

                            routeIndex = routeIndex + 1

                        end

                    elseif routeCoords.type == 2 then

                        if not isFactionSkin then

                            if walkTo(routeCoords.x, routeCoords.y, routeCoords.z, routeCoords.run) then

                                local id = getPickupId(routeCoords.x, routeCoords.y, routeCoords.z)

                                if id then

                                    sampSendPickedUpPickup(id)

                                    wait(300)

                                end

                            end

                        end

                    end

                else

                    autoOutfitToggle()

                end

            end

        end

    end

end)