В чем рофлс?

Tectrex

Известный
Автор темы
138
164
Версия MoonLoader
.027.0-preview
1686059619784.png


Lua:
function main()
  while not isSampAvailable() do wait(100) end
  sampRegisterChatCommand('cmd', test)
  wait(-1)
end

function test()
  for id = 0, 2048 do
    local result = sampIs3dTextDefined(id)
    if result then
      local text, color, posX, posY, posZ, _, _, _, _ = sampGet3dTextInfoById(id)
      if text:find('Ромашка') then
        setCharCoordinates(PLAYER_PED, posX, posY, posZ)
        break
      end
    end
  end
end
пишу cmd, ничего не происходит, меня этот 3д текст уже зае...
 
Решение
Посмотреть вложение 203852

Lua:
function main()
  while not isSampAvailable() do wait(100) end
  sampRegisterChatCommand('cmd', test)
  wait(-1)
end

function test()
  for id = 0, 2048 do
    local result = sampIs3dTextDefined(id)
    if result then
      local text, color, posX, posY, posZ, _, _, _, _ = sampGet3dTextInfoById(id)
      if text:find('Ромашка') then
        setCharCoordinates(PLAYER_PED, posX, posY, posZ)
        break
      end
    end
  end
end
пишу cmd, ничего не происходит, меня этот 3д текст уже зае...
Скорее всего прикол кодировки, сохрани скрипт в кодировке CP1251 (Windows 1251)

chromiusj

fullstack eblan
Модератор
5,763
4,067
Посмотреть вложение 203852

Lua:
function main()
  while not isSampAvailable() do wait(100) end
  sampRegisterChatCommand('cmd', test)
  wait(-1)
end

function test()
  for id = 0, 2048 do
    local result = sampIs3dTextDefined(id)
    if result then
      local text, color, posX, posY, posZ, _, _, _, _ = sampGet3dTextInfoById(id)
      if text:find('Ромашка') then
        setCharCoordinates(PLAYER_PED, posX, posY, posZ)
        break
      end
    end
  end
end
пишу cmd, ничего не происходит, меня этот 3д текст уже зае...
а ты уверен что перед текстом ничего нет,цвета допустим
выведи в консоль себе все что видит в зоне стрима
 
  • Эм
Реакции: CaJlaT

CaJlaT

07.11.2024 14:55
Модератор
2,845
2,694
Посмотреть вложение 203852

Lua:
function main()
  while not isSampAvailable() do wait(100) end
  sampRegisterChatCommand('cmd', test)
  wait(-1)
end

function test()
  for id = 0, 2048 do
    local result = sampIs3dTextDefined(id)
    if result then
      local text, color, posX, posY, posZ, _, _, _, _ = sampGet3dTextInfoById(id)
      if text:find('Ромашка') then
        setCharCoordinates(PLAYER_PED, posX, posY, posZ)
        break
      end
    end
  end
end
пишу cmd, ничего не происходит, меня этот 3д текст уже зае...
Скорее всего прикол кодировки, сохрани скрипт в кодировке CP1251 (Windows 1251)
 
  • Нравится
Реакции: Tectrex