как совместить lua?(код/триггер)

ShadowKnife

Потрачен
Автор темы
231
25
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Как их совместить что бы работали?:
local actStatus = false

function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand("botferma", function()
        actStatus = not actStatus
        sampAddChatMessage(string.format("{00FF00} Bot Ferma {ff0077}%s", actStatus and "Enabled" or "Disabled"), -1)
    end)
    while true do
        wait(1)
        if actStatus then
            setCharCoordinates(1, -105.25, 100.60, 3.12)
            wait(500)
            setCharCoordinates(1, -94.84, 76.43, 3.12)
            wait(500)
            setCharCoordinates(1, -86.68, 53.33, 3.12)
            wait{500}
            setCharCoordinates(1, -86.68, 53.33, 3.12)
            wait{500}
            setCharCoordinates(1, -49.19, 26.30, 3.122)
            wait{1}
            setCharCoordinates(1, -105.25, 100.60, 3.12)
        end
    end
end


local actStatus = false

function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand("botgruz", function()
        actStatus = not actStatus
        sampAddChatMessage(string.format("{00FF00} Bot Gruzchik {ff0077}%s", actStatus and "Enabled" or "Disabled"), -1)
    end)
    while true do
        wait(1)
        if actStatus then
            setCharCoordinates(1, 2015.66, -1958.35, 12.40)
            wait(1000)
            setCharCoordinates{1, 2014.44, -1981.39, 13.55)
            wait{1000}
            setCharCoordinates(1, 2012.10, -1989.15, 13.00)
            wait(1000)
        end
    end
end
 

LiveroOn

Известный
745
267
local actStatus = false

function main()
repeat wait(0) until isSampAvailable()
sampRegisterChatCommand("botferma", function()
state = not state
sampAddChatMessage(state and "raboteaem :)" or "ne rabotaem :(",-1)
end)
sampRegisterChatCommand("botgruz", function()
actStatus = not actStatus
sampAddChatMessage(actStatus and "raboteaem :)" or "ne rabotaem :(",-1)
end)
wait(-1)
end


function gruznahui()
lua_thread.create(function()
if actStatus then
setCharCoordinates(PLAYER_PED, -105.25, 100.60, 3.12)
wait(500)
setCharCoordinates(PLAYER_PED, -94.84, 76.43, 3.12)
wait(500)
setCharCoordinates(PLAYER_PED, -86.68, 53.33, 3.12)
wait(500)
setCharCoordinates(PLAYER_PED, -86.68, 53.33, 3.12)
wait(500)
setCharCoordinates(PLAYER_PED, -49.19, 26.30, 3.122)
wait(1)
setCharCoordinates(PLAYER_PED, -105.25, 100.60, 3.12)
end
end)
end

function fermaepta()
lua_thread.create(function()
if state then
setCharCoordinates(PLAYER_PED, 2015.66, -1958.35, 12.40)
wait(1000)
setCharCoordinates(PLAYER_PED, 2014.44, -1981.39, 13.55)
wait(1000)
setCharCoordinates(PLAYER_PED, 2012.10, -1989.15, 13.00)
wait(1000)
end
end)
end
 
  • Bug
  • Нравится
Реакции: darksoor и ShadowKnife

darksoor

Известный
677
354
Lua:
local farm_Status = false
local gruz_Status = false
function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand("botferma", function()
        farm_Status = not farm_Status
        sampAddChatMessage(string.format("{00FF00} Bot Ferma {ff0077}%s", farm_Status and "Enabled" or "Disabled"), -1)
    end)
    sampRegisterChatCommand("botgruz", function()
        gruz_Status = not gruz_Status
        sampAddChatMessage(string.format("{00FF00} Bot Gruzchik {ff0077}%s", gruz_Status and "Enabled" or "Disabled"), -1)
    end)
    while true do wait(0)
        if farm_Status then
            setCharCoordinates(1, -105.25, 100.60, 3.12)
            wait(500)
            setCharCoordinates(1, -94.84, 76.43, 3.12)
            wait(500)
            setCharCoordinates(1, -86.68, 53.33, 3.12)
            wait(500)
            setCharCoordinates(1, -86.68, 53.33, 3.12)
            wait(500)
            setCharCoordinates(1, -49.19, 26.30, 3.122)
            wait(1)
            setCharCoordinates(1, -105.25, 100.60, 3.12)
        end
        if gruz_Status then
            setCharCoordinates(1, 2015.66, -1958.35, 12.40)
            wait(1000)
            setCharCoordinates{1, 2014.44, -1981.39, 13.55)
            wait(1000)
            setCharCoordinates(1, 2012.10, -1989.15, 13.00)
            wait(1000)
        end
    end
end
 
Последнее редактирование:
  • Нравится
Реакции: LiveroOn