mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-06-28 14:16:06 +02:00
Merge server with github repository
Pas mal de changement n’ont pas été pushé sur le github du serveur, voici l’occasion de faire une bonne synchronisation :)
This commit is contained in:
@ -21,19 +21,20 @@ local staminaHud = {}
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
playerName = player:get_player_name()
|
||||
players[playerName] = {
|
||||
state = 0,
|
||||
timeOut = 0,
|
||||
stamina = SPRINT_STAMINA,
|
||||
moving = false,
|
||||
hud= player:hud_add({
|
||||
hud_elem_type = "statbar",
|
||||
position = {x=0.5,y=1},
|
||||
size = {x=24, y=24},
|
||||
text = "stamina.png",
|
||||
number = 20,
|
||||
alignment = {x=0,y=1},
|
||||
offset = {x=-320, y=-186},
|
||||
}),
|
||||
state = 0,
|
||||
timeOut = 0,
|
||||
stamina = SPRINT_STAMINA,
|
||||
moving = false,
|
||||
hud = player:hud_add({
|
||||
hud_elem_type = "statbar",
|
||||
position = {x=0.5,y=1},
|
||||
size = {x=24, y=24},
|
||||
text = "stamina.png",
|
||||
number = 20,
|
||||
alignment = {x=0,y=1},
|
||||
offset = {x=-320, y=-186},
|
||||
}
|
||||
),
|
||||
}
|
||||
end)
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
@ -111,8 +112,8 @@ minetest.register_globalstep(function(dtime)
|
||||
end
|
||||
|
||||
--Update the players's hud sprint stamina bar
|
||||
player:hud_change(playerInfo["hud"], "number", playerInfo["stamina"])
|
||||
|
||||
local numBars = (playerInfo["stamina"]/SPRINT_STAMINA)*20
|
||||
player:hud_change(playerInfo["hud"], "number", numBars)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
Reference in New Issue
Block a user