Ищу скрипт вх на объекты

Решение
там модел, а не ид его
Lua:
local state = false
local font = renderCreateFont("Verdana", 6, 5)
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand("render", function()
        state = not state
        sampAddChatMessage(state and "on" or "off", -1)
    end)
    while true do wait(0)
        if state then
            for i, handle in pairs(getAllObjects()) do
                local res, ox, oy, oz = getObjectCoordinates(handle)
                local px, py, pz = getCharCoordinates(PLAYER_PED)
                if getDistanceBetweenCoords3d(px, py, pz, ox, oy, oz) <= 150 and isPointOnScreen(ox, oy, oz, 1.0)...

Kirkjubaijaarklaustur

Известный
384
126
 

Шалтай

Новичок
Автор темы
22
12
там модел, а не ид его

 

Вложения

  • 9999.JPG
    9999.JPG
    50.1 KB · Просмотры: 10

XRLM

Известный
2,584
899
там модел, а не ид его
Lua:
local state = false
local font = renderCreateFont("Verdana", 6, 5)
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand("render", function()
        state = not state
        sampAddChatMessage(state and "on" or "off", -1)
    end)
    while true do wait(0)
        if state then
            for i, handle in pairs(getAllObjects()) do
                local res, ox, oy, oz = getObjectCoordinates(handle)
                local px, py, pz = getCharCoordinates(PLAYER_PED)
                if getDistanceBetweenCoords3d(px, py, pz, ox, oy, oz) <= 150 and isPointOnScreen(ox, oy, oz, 1.0) then
                    local pos2d = Vector3D(convert3DCoordsToScreen(ox, oy, oz))
                    renderFontDrawText(font, 'Object: {00FFFF}'..sampGetObjectSampIdByHandle(handle)..' {E0FFFF}Model: {00FFFF}'..getObjectModel(handle), pos2d.x, pos2d.y, 0xE0FFFF00)
                end
            end
        end
    end
end
 

Шалтай

Новичок
Автор темы
22
12
Lua:
local state = false
local font = renderCreateFont("Verdana", 6, 5)
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand("render", function()
        state = not state
        sampAddChatMessage(state and "on" or "off", -1)
    end)
    while true do wait(0)
        if state then
            for i, handle in pairs(getAllObjects()) do
                local res, ox, oy, oz = getObjectCoordinates(handle)
                local px, py, pz = getCharCoordinates(PLAYER_PED)
                if getDistanceBetweenCoords3d(px, py, pz, ox, oy, oz) <= 150 and isPointOnScreen(ox, oy, oz, 1.0) then
                    local pos2d = Vector3D(convert3DCoordsToScreen(ox, oy, oz))
                    renderFontDrawText(font, 'Object: {00FFFF}'..sampGetObjectSampIdByHandle(handle)..' {E0FFFF}Model: {00FFFF}'..getObjectModel(handle), pos2d.x, pos2d.y, 0xE0FFFF00)
                end
            end
        end
    end
end
Скрипт загружен, но не показывает ничего
 

Шалтай

Новичок
Автор темы
22
12
нет, я же тупой пишу /vkluchisya psh
Я же написал скрипт подгружен, но не показывает ничего, явно что я его проверял и вводил команду

Lua:
local state = false
local font = renderCreateFont("Verdana", 6, 5)
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand("render", function()
        state = not state
        sampAddChatMessage(state and "on" or "off", -1)
    end)
    while true do wait(0)
        if state then
            for i, handle in pairs(getAllObjects()) do
                local res, ox, oy, oz = getObjectCoordinates(handle)
                local px, py, pz = getCharCoordinates(PLAYER_PED)
                if getDistanceBetweenCoords3d(px, py, pz, ox, oy, oz) <= 150 and isPointOnScreen(ox, oy, oz, 1.0) then
                    local pos2d = Vector3D(convert3DCoordsToScreen(ox, oy, oz))
                    renderFontDrawText(font, 'Object: {00FFFF}'..sampGetObjectSampIdByHandle(handle)..' {E0FFFF}Model: {00FFFF}'..getObjectModel(handle), pos2d.x, pos2d.y, 0xE0FFFF00)
                end
            end
        end
    end
end
После включения сразу же крашит скрипт

jbjects.lua:16: attempt to call global 'Vector3D' (a nil value)
 

Kirkjubaijaarklaustur

Известный
384
126
нет, я же тупой пишу /vkluchisya psh
Я же написал скрипт подгружен, но не показывает ничего, явно что я его проверял и вводил команду


После включения сразу же крашит скрипт

jbjects.lua:16: attempt to call global 'Vector3D' (a nil value)
Lua:
local state = false
local Vector3D = require "vector3d"
local font = renderCreateFont("Verdana", 6, 5)
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand("render", function()
        state = not state
        sampAddChatMessage(state and "on" or "off", -1)
    end)
    while true do wait(0)
        if state then
            for i, handle in pairs(getAllObjects()) do
                local res, ox, oy, oz = getObjectCoordinates(handle)
                local px, py, pz = getCharCoordinates(PLAYER_PED)
                if getDistanceBetweenCoords3d(px, py, pz, ox, oy, oz) <= 150 and isPointOnScreen(ox, oy, oz, 1.0) then
                    local pos2d = Vector3D(convert3DCoordsToScreen(ox, oy, oz))
                    renderFontDrawText(font, 'Object: {00FFFF}'..sampGetObjectSampIdByHandle(handle)..' {E0FFFF}Model: {00FFFF}'..getObjectModel(handle), pos2d.x, pos2d.y, 0xE0FFFF00)
                end
            end
        end
    end
end
 

Шалтай

Новичок
Автор темы
22
12
Lua:
local state = false
local Vector3D = require "vector3d"
local font = renderCreateFont("Verdana", 6, 5)
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampRegisterChatCommand("render", function()
        state = not state
        sampAddChatMessage(state and "on" or "off", -1)
    end)
    while true do wait(0)
        if state then
            for i, handle in pairs(getAllObjects()) do
                local res, ox, oy, oz = getObjectCoordinates(handle)
                local px, py, pz = getCharCoordinates(PLAYER_PED)
                if getDistanceBetweenCoords3d(px, py, pz, ox, oy, oz) <= 150 and isPointOnScreen(ox, oy, oz, 1.0) then
                    local pos2d = Vector3D(convert3DCoordsToScreen(ox, oy, oz))
                    renderFontDrawText(font, 'Object: {00FFFF}'..sampGetObjectSampIdByHandle(handle)..' {E0FFFF}Model: {00FFFF}'..getObjectModel(handle), pos2d.x, pos2d.y, 0xE0FFFF00)
                end
            end
        end
    end
end
Нет не так, я уже переделал, всё заработало
 

YarikVL

Известный
Проверенный
4,795
1,814

XRLM

Известный
2,584
899
нет, я же тупой пишу /vkluchisya psh
Я же написал скрипт подгружен, но не показывает ничего, явно что я его проверял и вводил команду


После включения сразу же крашит скрипт

jbjects.lua:16: attempt to call global 'Vector3D' (a nil value)
забыл про либу
 
  • Клоун
Реакции: Air_Official

YarikVL

Известный
Проверенный
4,795
1,814
Я скриншот приложил
Я скриншот тоже приложил
Мне нужно и ид модели и ид объекта, а это разные вещи
Нажимаешь на чекбокс «Писать id рядом с моделью» и у тебя кроме ид модели, будет ещё писаться ид объекта. Специально для тебя подчеркнул на картинке
Если ты думаешь что активация этого чекбокса включит id самой модели объекта - то это не так. Пример: https://www.blast.hk/threads/24320/post-551820
5AE969AB-71E1-44E9-AE4E-E78FBDE51570.jpeg
 
  • Нравится
Реакции: XRLM