Lua Автошот

Статус
В этой теме нельзя размещать новые ответы.

Rapt0r6113

Известный
Автор темы
103
11
Здаров, чёт захотел сделать авто шот на луа, как всегда где-то накосячил.

Код:
Lua:
script_name(autoshot)
script_author(Lagren)
script_dependencies(Cleo)
script_version("v1.0")

require "lib.moonloader"

function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end

  while not isSampAvailable()
    do
        wait(400)
    end
        while true do
     for id = 0, sampGetMaxPlayerId(true)
        do
            if sampIsPlayerConnected(id)
            then
          local exists, handle = sampGetCharHandleBySampPlayerId(id)
            if exists and doesCharExist(handle) then
         if isCharOnScreen(handle) then
                    if
                    isPlayerTargettingChar(handle, playerPed)
                    then
                        setPlayerFireButton(playerHandle, true)
                    end
                end
            end
        end
    end
end
end
 

4el0ve4ik

Известный
Всефорумный модератор
1,548
1,338
Здаров, чёт захотел сделать авто шот на луа, как всегда где-то накосячил.

Код:
Lua:
script_name(autoshot)
script_author(Lagren)
script_dependencies(Cleo)
script_version("v1.0")

require "lib.moonloader"

function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end

  while not isSampAvailable()
    do
        wait(400)
    end
        while true do
     for id = 0, sampGetMaxPlayerId(true)
        do
            if sampIsPlayerConnected(id)
            then
          local exists, handle = sampGetCharHandleBySampPlayerId(id)
            if exists and doesCharExist(handle) then
         if isCharOnScreen(handle) then
                    if
                    isPlayerTargettingChar(handle, playerPed)
                    then
                        setPlayerFireButton(playerHandle, true)
                    end
                end
            end
        end
    end
end
end
Lua:
script_name("autoshot")
script_author("Lagren")
script_version("v1.0")

require "lib.moonloader"

function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while true do
    wait(0)
    local result, handle = getCharPlayerIsTargeting(playerHandle)
    if result then
      if isCharOnScreen(handle) then
        setGameKeyState(17, 255)
      end
    end
  end
end
 
  • Нравится
Реакции: FYP и Rapt0r6113

Сэнд

Известный
Проверенный
436
212
Это
Lua:
script_name("autoshot")
script_author("Lagren")
script_version("v1.0")

require "lib.moonloader"

function main()
  if not isSampfuncsLoaded() or not isSampLoaded() then return end
  while true do
    wait(0)
    local result, handle = getCharPlayerIsTargeting(playerHandle)
    if result then
      if isCharOnScreen(handle) then
        setGameKeyState(17, 255)
      end
    end
  end
end
Работает?
 

Rapt0r6113

Известный
Автор темы
103
11
Последнее редактирование модератором:

Rapt0r6113

Известный
Автор темы
103
11
Последнее редактирование модератором:
Статус
В этой теме нельзя размещать новые ответы.