tan.lua 433 B

1234567891011121314151617
  1. minetest.register_chatcommand("webmail_tan", {
  2. description = "generates a tan (temporary access number) for the webmail access",
  3. func = function(name)
  4. local tan = "" .. math.random(1000, 9999)
  5. mail.tan[name] = tan
  6. return true, "Your tan is " .. tan .. ", it will expire upon leaving the game"
  7. end
  8. })
  9. minetest.register_on_leaveplayer(function(player)
  10. local name = player:get_player_name()
  11. mail.tan[name] = nil
  12. end)