Поломался скрипт, помогите кривым рукам)

Qlliman

Участник
Автор темы
38
1
Версия SA-MP
  1. Любая
И так, есть у меня скрипт который удаляет все текстдравы, и по идее должен их вернуть. На одном сервере все работает. То есть текстдравы по активации скрываются и появляются, а на другом нет. Помогите(
Lua:
script_name('Looters Film Maker')
local sampev = require 'lib.samp.events'
local tds = {}


act = false

function main()
    while not isSampAvailable() do wait(100) end
    wait(5000)
    sampAddChatMessage("[Looters Film Maker] {FFFFFF}Скрипт был успешно загружен. Автор: {FFD700}The Qlliman", 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

на сервере samp.looters.su:7777 все работает как надо (не реклама, не играйте там), а вот на самп рп не работает

проверил на других серверах, та же история

И так, есть у меня скрипт который удаляет все текстдравы, и по идее должен их вернуть. На одном сервере все работает. То есть текстдравы по активации скрываются и появляются, а на другом нет. Помогите(
Lua:
script_name('Looters Film Maker')
local sampev = require 'lib.samp.events'
local tds = {}


act = false

function main()
    while not isSampAvailable() do wait(100) end
    wait(5000)
    sampAddChatMessage("[Looters Film Maker] {FFFFFF}Скрипт был успешно загружен. Автор: {FFD700}The Qlliman", 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

на сервере samp.looters.su:7777 все работает как надо (не реклама, не играйте там), а вот на самп рп не работает

проверил на других серверах, та же история
20 - 21 строка, скрипт удаляет текстдравы но не возвращает их. подскажите как исправить

Более менее нашел в чем проблема. на 20-21 строке удаление текстдравов, на 27 должен быть ключ на возвращение текстдравов, но вот какой ключ я хз
Lua:
script_name('Film Maker')
local sampev = require 'lib.samp.events'
local tds = {}


act = false

function main()
    while not isSampAvailable() do wait(100) end
    wait(5000)
    sampAddChatMessage("[Film Maker] {FFFFFF}Скрипт был успешно загружен. Автор: {FFA500}The Qlliman", 0xFFA500)
    sampAddChatMessage("[Film Maker] {FFFFFF}Активация скрипта - /act", 0xFFA500)
    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)
            тут должен быть ключ типа sampTextdrawIsExists но я хз какой
        end

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

    wait(-1)
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
 
Последнее редактирование: