счетчик 3dText

Я кавказец

Известный
Автор темы
440
107
Версия MoonLoader
.026-beta
Хочу чтобы скрипт считал кол-во 3dText'ов, но сколько бы не пытался - не выходит
Помогите кто может
 

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,776
11,229
Lua:
local font = renderCreateFont('Arial', 13, 5)

function main()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
        renderFontDrawText(font, '3d text count:'..get3dTextCount(), 100, 100, 0xFFFFFFFF, 0x90000000)
    end
end

function get3dTextCount()
    local count = 0
    for i = 0, 4096 do
        if sampIs3dTextDefined(i) then
            count = count + 1
        end
    end
    return count
end
 
  • Нравится
Реакции: Я кавказец

Я кавказец

Известный
Автор темы
440
107
Lua:
local font = renderCreateFont('Arial', 13, 5)

function main()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
        renderFontDrawText(font, '3d text count:'..get3dTextCount(), 100, 100, 0xFFFFFFFF, 0x90000000)
    end
end

function get3dTextCount()
    local count = 0
    for i = 0, 4096 do
        if sampIs3dTextDefined(i) then
            count = count + 1
        end
    end
    return count
end
Мне нужен чтобы он считал с определённым текстом
 

SomaGnoma

Известный
442
152
Мне нужен чтобы он считал с определённым текстом
Lua:
function get3dTextCount()
    local count = 0
    for i = 0, 4096 do
    local text = sampGet3dTextInfoById(i)
        if sampIs3dTextDefined(i) and text == "Пупка" then -- если есть 3д текст с пупкой то крч
            count = count + 1
        end
    end
    return count
end
Вот так или нет?