adextrometh

Untitled

Mar 20th, 2021
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.74 KB | None | 0 0
  1. require 'lib.moonloader'
  2.  
  3. metr = 50
  4.  
  5. function main()
  6.     if not isSampLoaded() then return end
  7.     while not isSampAvailable() do wait(100) end
  8.     local font = renderCreateFont("Arial", 9, 4)
  9.     sampRegisterChatCommand('ob', obmetr)
  10.     while true do wait(0)
  11.         if isKeyDown(96) and isKeyJustPressed(51) then
  12.           act = not act
  13.         end
  14.         if act then
  15.             for _, v in pairs(getAllObjects()) do
  16.                 local posX, posY, posZ = getCharCoordinates(PLAYER_PED)
  17.                 local result, object = findAllRandomObjectsInSphere(posX, posY, posZ, metr, true)
  18.                 if result then
  19.                     if isObjectOnScreen(object) then
  20.                         local _, x, y, z = getObjectCoordinates(object)
  21.                         local x1, y1 = convert3DCoordsToScreen(x,y,z)
  22.                         local model = getObjectModel(object)
  23.                         local x2, y2, z2 = getCharCoordinates(PLAYER_PED)
  24.                         local x10, y10 = convert3DCoordsToScreen(x2, y2, z2)
  25.                         renderFontDrawText(font, string.format('Model ID:{DCDCDC} '..model..'\n{808080}X:{DCDCDC} %.4f {808080}Y:{DCDCDC} %.4f {808080}Z: {DCDCDC}%.4f', x, y, z), x1, y1, 0xFF808080)
  26.                         renderFontDrawText(font, 'Model ID:{DCDCDC} '..model..'', x1, y1, 0xFF808080)
  27.                         renderDrawLine(x10, y10, x1, y1, 1.0, 0xFF2ECC40)
  28.                     end
  29.                 end
  30.             end
  31.         end
  32.     end
  33. end
  34.  
  35. function obmetr(nn)
  36.     local obm = tonumber(nn)
  37.     if obm ~= nil then
  38.         if 201 > obm and obm > 0 then
  39.             metr = obm
  40.             sampAddChatMessage(string.format('ObjCoord: {F73E3E}Стрим объектов выставлен на ' .. metr .. ' метров'), 0x808080)
  41.         else
  42.             sampAddChatMessage(string.format("Ошибка: {F73E3E}Значение должно быть от 1 до 200"), 0x808080)
  43.         end
  44.     else
  45.         sampAddChatMessage(string.format("Ошибка: {F73E3E}Введите значение от 1 до 200"), 0x808080)
  46.     end
  47. end
  48.  
Add Comment
Please, Sign In to add comment