kill :(

Xen8morph

Новичок
Автор темы
16
0
Версия MoonLoader
.026-beta
После ввода команды, тпает в первую точку координат, а дальше скрипт умирает.
Lua:
function main()
  if not isSampLoaded() or not isSampfuncsLoaded() then return end
  while not isSampAvailable() do wait(100) end
  sampRegisterChatCommand("gtp", cmd_gtp)
  wait(-1)
end

function cmd_gtp(arg)
  if #arg == 0 then
    sampAddChatMessage('Телепортирую!', 0xFFFFFF)

  setCharCoordinates(playerPed, -1015.901, -1230.261, 129.850)
  wait(1000)
  setCharCoordinates(playerPed, -994.763, -1232.510, 130.704)
  wait(1000)
setCharCoordinates(playerPed, -983.243, -1257.871, 133.616)
    else
        sampAddChatMessage('Что-то пошло не так!', 0xE26323)
    end
end
 
Решение
Lua:
function main()
  if not isSampLoaded() or not isSampfuncsLoaded() then return end
  while not isSampAvailable() do wait(100) end
  sampRegisterChatCommand("gtp", cmd_gtp)
  wait(-1)
end

function cmd_gtp(arg)
  if #arg == 0 then
   lua_thread.create(function()
    sampAddChatMessage('Телепортирую!', 0xFFFFFF)
    setCharCoordinates(playerPed, -1015.901, -1230.261, 129.850)
    wait(1000)
    setCharCoordinates(playerPed, -994.763, -1232.510, 130.704)
    wait(1000)
    setCharCoordinates(playerPed, -983.243, -1257.871, 133.616)
   end)
  else
   sampAddChatMessage('Что-то пошло не так!', 0xE26323)
  end
end

paulohardy

вы еще постите говно? тогда я иду к вам
Всефорумный модератор
1,891
1,254
Lua:
function main()
  if not isSampLoaded() or not isSampfuncsLoaded() then return end
  while not isSampAvailable() do wait(100) end
  sampRegisterChatCommand("gtp", cmd_gtp)
  wait(-1)
end

function cmd_gtp(arg)
  if #arg == 0 then
   lua_thread.create(function()
    sampAddChatMessage('Телепортирую!', 0xFFFFFF)
    setCharCoordinates(playerPed, -1015.901, -1230.261, 129.850)
    wait(1000)
    setCharCoordinates(playerPed, -994.763, -1232.510, 130.704)
    wait(1000)
    setCharCoordinates(playerPed, -983.243, -1257.871, 133.616)
   end)
  else
   sampAddChatMessage('Что-то пошло не так!', 0xE26323)
  end
end