Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'lib.moonloader'
- metr = 50
- function main()
- if not isSampLoaded() then return end
- while not isSampAvailable() do wait(100) end
- local font = renderCreateFont("Arial", 9, 4)
- sampRegisterChatCommand('ob', obmetr)
- while true do wait(0)
- if isKeyDown(96) and isKeyJustPressed(51) then
- act = not act
- end
- if act then
- for _, v in pairs(getAllObjects()) do
- local posX, posY, posZ = getCharCoordinates(PLAYER_PED)
- local result, object = findAllRandomObjectsInSphere(posX, posY, posZ, metr, true)
- if result then
- if isObjectOnScreen(object) then
- local _, x, y, z = getObjectCoordinates(object)
- local x1, y1 = convert3DCoordsToScreen(x,y,z)
- local model = getObjectModel(object)
- local x2, y2, z2 = getCharCoordinates(PLAYER_PED)
- local x10, y10 = convert3DCoordsToScreen(x2, y2, z2)
- 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)
- renderFontDrawText(font, 'Model ID:{DCDCDC} '..model..'', x1, y1, 0xFF808080)
- renderDrawLine(x10, y10, x1, y1, 1.0, 0xFF2ECC40)
- end
- end
- end
- end
- end
- end
- function obmetr(nn)
- local obm = tonumber(nn)
- if obm ~= nil then
- if 201 > obm and obm > 0 then
- metr = obm
- sampAddChatMessage(string.format('ObjCoord: {F73E3E}Стрим объектов выставлен на ' .. metr .. ' метров'), 0x808080)
- else
- sampAddChatMessage(string.format("Ошибка: {F73E3E}Значение должно быть от 1 до 200"), 0x808080)
- end
- else
- sampAddChatMessage(string.format("Ошибка: {F73E3E}Введите значение от 1 до 200"), 0x808080)
- end
- end
Add Comment
Please, Sign In to add comment