News = {
title = "news",
text = "1.1.2016: ch1\n2.2.2016: ch2"
}
function News:printNews()
outputChatBox(self.title)
outputChatBox(self.text)
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
function()
News:printNews() --1
--addCommandHandler("news", News:printNews) --2
end
)
--1: выводит всё верно
--2: ошибка: Loading script failed: test\text.lua:13: function arguments expected near ')'
Функцию вне таблицы не могу объявлять, ибо требуется self внутри функции.