diff --git a/playtime/init.lua b/playtime/init.lua index 2f5b575..06a573a 100644 --- a/playtime/init.lua +++ b/playtime/init.lua @@ -53,15 +53,19 @@ local function format_duration(seconds) end minetest.register_chatcommand("playtime", { - params = "", + params = "[playername]", description = S("See your total playtime on this server"), - func = function(name) - if minetest.get_player_by_name(name) then + func = function(name, player_name) + if player_name == "" then + player_name = name + end + + if minetest.get_player_by_name(player_name) then return true, - C("#63d437", "Total: ")..C("#ffea00", format_duration(playtime.get_total_playtime(name))).."\n".. - C("#63d437", "Current: ")..C("#ffea00", format_duration(playtime.get_session_playtime(name))) + C("#63d437", "Total: ")..C("#ffea00", format_duration(playtime.get_total_playtime(player_name))).."\n".. + C("#63d437", "Current: ")..C("#ffea00", format_duration(playtime.get_session_playtime(player_name))) else - return false, S("You must be connected to run this command!") + return false, S("Player must be online to run this command!") end end, }) diff --git a/playtime/locale/playtime.fr.tr b/playtime/locale/playtime.fr.tr index 2e9c637..d6beada 100644 --- a/playtime/locale/playtime.fr.tr +++ b/playtime/locale/playtime.fr.tr @@ -1,4 +1,5 @@ # textdomain: playtime - +You must enter a existing player name!=Vous devez entrer un nom de joueur existant ! You must be connected to run this command!=Vous devez être connecté pour utiliser cette commande ! -See your total playtime on this server=Voir votre temps de jeu total sur ce serveur \ No newline at end of file +See your total playtime on this server=Voir votre temps de jeu total sur ce serveur +Player must be online to run this command!=Le joueur doit être en ligne pour exécuter cette commande ! \ No newline at end of file