ask player to turn achievements on instead of just doing it

This commit is contained in:
chmodsayshello 2022-05-02 17:41:20 +00:00
parent ced89ff957
commit b7f6e16f55
1 changed files with 13 additions and 8 deletions

View File

@ -21,10 +21,13 @@ minetest.register_chatcommand("awards", {
description = S("Show, clear, disable or enable your achievements"),
func = function(name, param)
if param == "clear" then
awards.enable(name)
awards.clear_player(name)
minetest.chat_send_player(name,
S("All your awards and statistics have been cleared. You can now start again."))
if awards.player(name).disabled ~= nil then
minetest.chat_send_player(name, "Sorry, but you have to enable achievements do do that!")
else
awards.clear_player(name)
minetest.chat_send_player(name,
S("All your awards and statistics have been cleared. You can now start again."))
end
elseif param == "disable" then
awards.disable(name)
minetest.chat_send_player(name, S("You have disabled your achievements."))
@ -32,8 +35,11 @@ minetest.register_chatcommand("awards", {
awards.enable(name)
minetest.chat_send_player(name, S("You have enabled your achievements."))
elseif param == "c" then
awards.enable(name)
awards.show_to(name, name, nil, true)
if awards.player(name).disabled ~= nil then
minetest.chat_send_player(name, "Sorry, but you have to enable achievements do do that!")
else
awards.show_to(name, name, nil, true)
end
else
awards.show_to(name, name, nil, false)
end
@ -85,5 +91,4 @@ minetest.register_chatcommand("achievement", {
return false, S("Achievement “@1” does not exist.", achievement)
end
end
})
})