Перечисление от 0 до бесконечности

Qlliman

Участник
Автор темы
38
1
Хочу написать скрипт который будет удалять вообще все серверные текстдравы для картинки как в фильме. Но вот как перечислить все текстдравы от 0 до бесконечности? Не в ручную же писать). Так же буду очень благодарен если подскажите как удалять все что над головой игрока (фама, ник, полоска хп и брони)
Lua:
script_name('Film Maker')
local sampev = require 'lib.samp.events'
local tds = {4, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2075, 2076, 2077, 2078, 2079, 2080, 2091, 2092, 2093, 2095, 2094, 2089, 2090, 2085, 2084, 2081, 2082, 2083, 2104, 2105, 2106, 2086, 2087, 2088}

act = false

function main()
    while not isSampAvailable() do wait(100) end
    wait(5000)
    sampAddChatMessage("[Looters Film Maker] {FFFFFF}Скрипт был успешно загружен. Автор: {FFD700}Carl Grasso", 0xFFD700)
    sampAddChatMessage("[Looters Film Maker] {FFFFFF}Активация скрипта - /act", 0xFFD700)
    sampRegisterChatCommand('act', function ()
        act = not act
        
        if act then
            sampSetChatDisplayMode(0)
            displayHud(false)
            for a = 0, 2304    do --cycle trough all textdeaw id
                if sampTextdrawIsExists(a) then
                    sampTextdrawDelete(a)
                end
            end
        else
            sampSetChatDisplayMode(2)
            displayHud(true)
        end

        sampAddChatMessage(act and '{FFD700}['..thisScript().name..']{FFFFFF} Интерфейс и ники отключены' or '{FFD700}['..thisScript().name..']{FFFFFF} Интерфейс и ники включены', -1)
    end)

    wait(-1)
end

function sampev.onShowTextDraw(id, data)
    table.insert(tds,id)
    if act then
        for i = 1, #tds do
            if id == tds[i] then
                table.remove(tds,id)
                return false
            end
        end
    end
end

local gangId  = {}

function sampev.onCreateGangZone(zoneId, squareStart, squareEnd, color)
    table.insert(gangId,zoneId)
    if act then
        for i = 1, #gangId do
            if zoneId == gangId[i] then
                table.remove(tds,id)
                return false
            end
        end
    end
end
 

Qlliman

Участник
Автор темы
38
1