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)