This commit is contained in:
Lunovox 2024-02-29 21:37:55 -03:00
parent a32474939c
commit 5d4bcc8db3

37
api.lua
View file

@ -468,24 +468,29 @@ end)
--[[ ]] --[[ ]]
minetest.after(3.5, function() minetest.after(3.5, function()
local timecheck = 0
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
--local presname = modEUrn.handler.elected.president.name timecheck = timecheck + dtime
local presname = modEUrn.getPresidentName() if timecheck >= 60 then
if type(presname)=="string" and presname~="" then timecheck = 0
local mesAtual = os.date("%m", os.time()) --local presname = modEUrn.handler.elected.president.name
local mesChecked = os.date("%m", tonumber(modEUrn.handler.elected.president.when)) local presname = modEUrn.getPresidentName()
if mesChecked ~= mesAtual then if type(presname)=="string" and presname~="" then
local result, cause = modEUrn.doCheckPresident() local mesAtual = os.date("%m", os.time())
local titlecolor = "#FF0000" local mesChecked = os.date("%m", tonumber(modEUrn.handler.elected.president.when))
if result == true then if mesChecked ~= mesAtual then
titlecolor = "#00FF00" local result, cause = modEUrn.doCheckPresident()
modEUrn.doSave() local titlecolor = "#FF0000"
if result == true then
titlecolor = "#00FF00"
minetest.chat_send_all(
core.colorize(titlecolor, "[E-URN]").." "..cause
)
modEUrn.doSave()
end
end end
minetest.chat_send_all( end --Fim de if type(presname)=="string" and presname~="" then
core.colorize(titlecolor, "[E-URN]").." "..cause end --Fim de if timecheck >= 60 then
)
end
end
end) end)
end) end)
--]] --]]