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(
|
||||
function(player)
|
||||
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)
|
||||
if faction then
|
||||
faction.last_logon = os.time()
|
||||
createHudFactionName(player,faction.name)
|
||||
createHudPower(player,faction)
|
||||
minetest.after(5,createHudFactionName,player,faction.name)
|
||||
minetest.after(5,createHudPower,player,faction)
|
||||
faction.offlineplayers[name] = nil
|
||||
faction.onlineplayers[name] = 1
|
||||
if faction.no_parcel ~= -1 then
|
||||
|
6
hud.lua
6
hud.lua
@ -1,6 +1,7 @@
|
||||
hud_ids = {}
|
||||
|
||||
function createHudfactionLand(player)
|
||||
if player then
|
||||
local name = player:get_player_name()
|
||||
local id_name = name .. "factionLand"
|
||||
if not hud_ids[id_name] then
|
||||
@ -14,9 +15,11 @@ function createHudfactionLand(player)
|
||||
alignment = {x=0, y=0},
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function createHudFactionName(player,factionname)
|
||||
if player and factionname then
|
||||
local name = player:get_player_name()
|
||||
local id_name = name .. "factionName"
|
||||
if not hud_ids[id_name] then
|
||||
@ -31,9 +34,11 @@ function createHudFactionName(player,factionname)
|
||||
offset = {x = -20, y = 20}
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function createHudPower(player,faction)
|
||||
if player and faction then
|
||||
local name = player:get_player_name()
|
||||
local id_name = name .. "powerWatch"
|
||||
if not hud_ids[id_name] then
|
||||
@ -48,6 +53,7 @@ function createHudPower(player,faction)
|
||||
offset = {x = 0, y = 0}
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function updateHudPower(player,faction)
|
||||
|
Loading…
Reference in New Issue
Block a user