mirror of
https://gitlab.com/lunovox/e-urn.git
synced 2025-03-15 07:21:22 +00:00
This commit is contained in:
parent
a32474939c
commit
5d4bcc8db3
1 changed files with 21 additions and 16 deletions
37
api.lua
37
api.lua
|
@ -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)
|
||||
--]]
|
||||
|
|
Loading…
Add table
Reference in a new issue