Модуль:FooterSplashText: различия между версиями
Kraskaska (обсуждение | вклад) Нет описания правки |
Kraskaska (обсуждение | вклад) Нет описания правки |
||
| (не показана 1 промежуточная версия этого же участника) | |||
| Строка 1: | Строка 1: | ||
local p = {} | local p = {} | ||
math.randomseed( | math.randomseed( os.clock() ) | ||
-- массив со всеми сплешами. сплеш может быть строкой или функцией возращающую строку | -- массив со всеми сплешами. сплеш может быть строкой или функцией возращающую строку | ||
local splash_texts = { | local splash_texts = { | ||
"kraskaska was here", | --"kraskaska was here", | ||
"powered by mediawiki", | --"powered by mediawiki", | ||
"こんにちは", | --"こんにちは", | ||
function() | --function() | ||
-- return os.date("%Y").." is the year of Linux desktop!" | |||
end, | --end, | ||
"create your own european union" | "create your own european union" | ||
} | } | ||
Текущая версия от 12:36, 21 января 2025
{{#invoke:FooterSplashText|get_splash}} возвратит случайную строчку. Используется в футере Citizen.
Пример: create your own european union
сейчас не сильно работает
local p = {}
math.randomseed( os.clock() )
-- массив со всеми сплешами. сплеш может быть строкой или функцией возращающую строку
local splash_texts = {
--"kraskaska was here",
--"powered by mediawiki",
--"こんにちは",
--function()
-- return os.date("%Y").." is the year of Linux desktop!"
--end,
"create your own european union"
}
function p.get_splash()
local splash = splash_texts[math.random(1, #splash_texts)]
if type(splash) == "function" then
return splash()
else
return splash
end
end
return p