attempt to call field 'onDisplayGameText' (a nil value)

westbounds

Новичок
Автор темы
11
1
Версия MoonLoader
.026-beta
gtremover.lua:30: attempt to call field 'onDisplayGameText' (a nil value)
stack traceback:

я глупенький, объясните

Lua:
local sampev = require("samp.events");
local inicfg = require("inicfg");

--Config--
local inifilename = 'textstatus.ini';
local ini = inicfg.load({
    main = {
        enabled = true,
    }
}, inifilename);
inicfg.save(ini, inifilename);

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
        sampAddChatMessage(string.format("Game text remover loaded.", -1))
end

function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('tstatus', function()
        ini.main.enabled = not ini.main.enabled;
        inicfg.save(ini, inifilename);
        sampAddChatMessage('{89aa63}-> Status: ' .. (ini.main.enabled and 'OFF' or 'ON'), -1);
    end);
    while true do
        wait(0)
        if (ini.main.enabled) then
            sampev.onDisplayGameText()
            return false
        end
    end
end
 
  • Злость
Реакции: qdIbp