RakSamp не долетает курдом

VoprosikNNN

Новичок
Автор темы
11
0
Версия MoonLoader
Другое
coordStart(-511.27499389648, -106.32901763916, 59.623123168945, timestep, step, true)
coordStart(-491.22528076172, -190.15161132813, 78.332656860352, timestep, step, true)

нужно чтобы он сначало долетал до 1 координаты а потом сразу до второй
 
Решение
Lua:
function getBotTeleport(x, y, z)
  coordStart(x, y, z, 21.5, 1, false)
  HEADWAY = {}
  table.insert(HEADWAY, {
    coordX = x,
    coordY = y,
    coordZ = z
  })
end

function onCoordStop()
  local BOT_POS = {getBotPosition()}
  if BOT_POS[1] == HEADWAY[1]['coordX'] and BOT_POS[2] == HEADWAY[1]['coordY'] and BOT_POS[3] == HEADWAY[1]['coordZ'] then
    print('Телепорт произошёл на точные координаты!')
  else
    print('Телепорт произошёл не на указанные координаты!')
    setBotPosition(HEADWAY[1]['coordX'], HEADWAY[1]['coordY'], HEADWAY[1]['coordZ'])
  end
end

-- USE: getBotTeleport(coord, coord, coord)

IlyaFontonov

Активный
213
57
Как-то так:
local task = nil

function onRunCommand(cmd)
    if cmd == '!tp' then
        task = 'teleport_1'
        coordStart(-511.27499389648, -106.32901763916, 59.623123168945, timestep, step, true)
    end
end

function onCoordStop()
    if task == 'teleport_1' then
        task = nil

        coordStart(-491.22528076172, -190.15161132813, 78.332656860352, timestep, step, true)
    end
end
 
  • Клоун
Реакции: Byte

Мишок

Участник
65
25
Lua:
function getBotTeleport(x, y, z)
  coordStart(x, y, z, 21.5, 1, false)
  HEADWAY = {}
  table.insert(HEADWAY, {
    coordX = x,
    coordY = y,
    coordZ = z
  })
end

function onCoordStop()
  local BOT_POS = {getBotPosition()}
  if BOT_POS[1] == HEADWAY[1]['coordX'] and BOT_POS[2] == HEADWAY[1]['coordY'] and BOT_POS[3] == HEADWAY[1]['coordZ'] then
    print('Телепорт произошёл на точные координаты!')
  else
    print('Телепорт произошёл не на указанные координаты!')
    setBotPosition(HEADWAY[1]['coordX'], HEADWAY[1]['coordY'], HEADWAY[1]['coordZ'])
  end
end

-- USE: getBotTeleport(coord, coord, coord)