forked from mtcontrib/factions
Delay for 5 seconds on all hud.
This commit is contained in:
parent
146df88de2
commit
615c9464cc
@ -978,12 +978,12 @@ end
|
|||||||
minetest.register_on_joinplayer(
|
minetest.register_on_joinplayer(
|
||||||
function(player)
|
function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
minetest.after(5,function(player)createHudfactionLand(player)end,player)
|
minetest.after(5,createHudfactionLand,player)
|
||||||
local faction = factions.get_player_faction(name)
|
local faction = factions.get_player_faction(name)
|
||||||
if faction then
|
if faction then
|
||||||
faction.last_logon = os.time()
|
faction.last_logon = os.time()
|
||||||
createHudFactionName(player,faction.name)
|
minetest.after(5,createHudFactionName,player,faction.name)
|
||||||
createHudPower(player,faction)
|
minetest.after(5,createHudPower,player,faction)
|
||||||
faction.offlineplayers[name] = nil
|
faction.offlineplayers[name] = nil
|
||||||
faction.onlineplayers[name] = 1
|
faction.onlineplayers[name] = 1
|
||||||
if faction.no_parcel ~= -1 then
|
if faction.no_parcel ~= -1 then
|
||||||
|
6
hud.lua
6
hud.lua
@ -1,6 +1,7 @@
|
|||||||
hud_ids = {}
|
hud_ids = {}
|
||||||
|
|
||||||
function createHudfactionLand(player)
|
function createHudfactionLand(player)
|
||||||
|
if player then
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local id_name = name .. "factionLand"
|
local id_name = name .. "factionLand"
|
||||||
if not hud_ids[id_name] then
|
if not hud_ids[id_name] then
|
||||||
@ -15,8 +16,10 @@ function createHudfactionLand(player)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function createHudFactionName(player,factionname)
|
function createHudFactionName(player,factionname)
|
||||||
|
if player and factionname then
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local id_name = name .. "factionName"
|
local id_name = name .. "factionName"
|
||||||
if not hud_ids[id_name] then
|
if not hud_ids[id_name] then
|
||||||
@ -32,8 +35,10 @@ function createHudFactionName(player,factionname)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function createHudPower(player,faction)
|
function createHudPower(player,faction)
|
||||||
|
if player and faction then
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local id_name = name .. "powerWatch"
|
local id_name = name .. "powerWatch"
|
||||||
if not hud_ids[id_name] then
|
if not hud_ids[id_name] then
|
||||||
@ -49,6 +54,7 @@ function createHudPower(player,faction)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function updateHudPower(player,faction)
|
function updateHudPower(player,faction)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
Loading…
Reference in New Issue
Block a user