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