Не работает LUA скрипт. Ошибка

Статус
В этой теме нельзя размещать новые ответы.

WhiteWolf

Участник
Автор темы
141
6
Код:
[ML] (error) docgiverank.lua: ...PC\Desktop\Army\moonloader\lib\samp\events\core.lua:73: attempt to call field 'insert' (a nil value)
stack traceback:
    ...PC\Desktop\Army\moonloader\lib\samp\events\core.lua:73: in function 'process_event'
    ...PC\Desktop\Army\moonloader\lib\samp\events\core.lua:100: in function 'process_packet'
    ...PC\Desktop\Army\moonloader\lib\samp\events\core.lua:127: in function <...PC\Desktop\Army\moonloader\lib\samp\events\core.lua:126>
[ML] (error) docgiverank.lua: Script died due to error. (098F4E54)

Сам код:

Скрытое содержимое доступно для зарегистрированных пользователей!
 

Laine_prikol

ДИДЖЕЙ МАДЕСТ
Проверенный
260
216
Код:
[ML] (error) docgiverank.lua: ...PC\Desktop\Army\moonloader\lib\samp\events\core.lua:73: attempt to call field 'insert' (a nil value)
stack traceback:
    ...PC\Desktop\Army\moonloader\lib\samp\events\core.lua:73: in function 'process_event'
    ...PC\Desktop\Army\moonloader\lib\samp\events\core.lua:100: in function 'process_packet'
    ...PC\Desktop\Army\moonloader\lib\samp\events\core.lua:127: in function <...PC\Desktop\Army\moonloader\lib\samp\events\core.lua:126>
[ML] (error) docgiverank.lua: Script died due to error. (098F4E54)

Сам код:
Переопределена стандартная библиотека table. Посему функция table.insert больше не доступна.
 

Laine_prikol

ДИДЖЕЙ МАДЕСТ
Проверенный
260
216
А где скачать оригинальную бибу
У тебя переопределена библиотека table на этой строчке
Lua:
table = {}
Просто переименуй таблицу в название отличной от table. Просто если ты назовёшь таблицу table то у тебя луа будет думать что ты хочешь записать в элемент insert какое то значение вместо вызова фукции
 

WhiteWolf

Участник
Автор темы
141
6
Случайно хайд поставил простите, помогите почему он не работает.
У меня есть немного рублей могу дать тому кто поможет

Код:
require "lib.moonloader"
samp = require 'lib.samp.events'

function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('doc', function()
        local names = ''
        doc = true
        sampSendChat('/members')
        lua_thread.create(function(t)
            while not doc do wait(0) end
            for i, k in ipairs(t) do
                local result, handle = sampGetCharHandleBySampPlayerId(k)
                if result and doesCharExist(handle) then
                    names = names..sampGetPlayerNickname(k)..','
                end
            end
            if #names ~= 0 then
                sampSendChat('/r [PA]: Пост: C | Напарник: '..names..' | Состояние: Стабильное')
            end
            t = nil
        end, table)
    end)
    wait(-1)
end

function samp.onServerMessage(clr, msg)
    table = {}
    if doc then
        local id = msg:match('ID: (%d+) | .+')
        if id then table[#table+1] = id
        elseif msg:find('Всего: .+ человек') then doc = false end
    end
end
 
1,417
1,029
Случайно хайд поставил простите, помогите почему он не работает.
У меня есть немного рублей могу дать тому кто поможет

Код:
require "lib.moonloader"
samp = require 'lib.samp.events'

function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('doc', function()
        local names = ''
        doc = true
        sampSendChat('/members')
        lua_thread.create(function(t)
            while not doc do wait(0) end
            for i, k in ipairs(t) do
                local result, handle = sampGetCharHandleBySampPlayerId(k)
                if result and doesCharExist(handle) then
                    names = names..sampGetPlayerNickname(k)..','
                end
            end
            if #names ~= 0 then
                sampSendChat('/r [PA]: Пост: C | Напарник: '..names..' | Состояние: Стабильное')
            end
            t = nil
        end, table)
    end)
    wait(-1)
end

function samp.onServerMessage(clr, msg)
    table = {}
    if doc then
        local id = msg:match('ID: (%d+) | .+')
        if id then table[#table+1] = id
        elseif msg:find('Всего: .+ человек') then doc = false end
    end
end
Lua:
require "lib.moonloader"
samp = require 'lib.samp.events'

function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('doc', function()
        local names = ''
        doc = true
        sampSendChat('/members')
        lua_thread.create(function(t)
            while not doc do wait(0) end
            for i, k in ipairs(t) do
                local result, handle = sampGetCharHandleBySampPlayerId(k)
                if result and doesCharExist(handle) then
                    names = names..sampGetPlayerNickname(k)..','
                end
            end
            if #names ~= 0 then
                sampSendChat('/r [PA]: Пост: C | Напарник: '..names..' | Состояние: Стабильное')
            end
            t = nil
        end, Table)
    end)
    wait(-1)
end

function samp.onServerMessage(clr, msg)
    Table = {}
    if doc then
        local id = msg:match('ID: (%d+) | .+')
        if id then Table[#Table+1] = id
        elseif msg:find('Всего: .+ человек') then doc = false end
    end
end
 
  • Нравится
Реакции: WhiteWolf

WhiteWolf

Участник
Автор темы
141
6
Lua:
require "lib.moonloader"
samp = require 'lib.samp.events'

function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('doc', function()
        local names = ''
        doc = true
        sampSendChat('/members')
        lua_thread.create(function(t)
            while not doc do wait(0) end
            for i, k in ipairs(t) do
                local result, handle = sampGetCharHandleBySampPlayerId(k)
                if result and doesCharExist(handle) then
                    names = names..sampGetPlayerNickname(k)..','
                end
            end
            if #names ~= 0 then
                sampSendChat('/r [PA]: Пост: C | Напарник: '..names..' | Состояние: Стабильное')
            end
            t = nil
        end, Table)
    end)
    wait(-1)
end

function samp.onServerMessage(clr, msg)
    Table = {}
    if doc then
        local id = msg:match('ID: (%d+) | .+')
        if id then Table[#Table+1] = id
        elseif msg:find('Всего: .+ человек') then doc = false end
    end
end

Не работает(( на посту пишу /doc он только открывает /members а в чат доклад не делает
 
Статус
В этой теме нельзя размещать новые ответы.