Ricolin

Colorize

Sep 30th, 2020
557
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. AZUL = "#0000FF" AZUL_OSCURO = "#0000AA" AZUL_PASTEL = "#AEC6CF"
  2. VERDE = "#00FF00" VERDE_OSCURO = "#00AA00" VERDE_PASTEL = "#77DD77"
  3. AMARILLO = "#FFFF00" AMARILLO_OSCURO = "#AAAA00" AMARILLO_PASTEL = "#FDFD96"
  4. csa = core.chat_send_all
  5. csp = minetest.chat_send_player
  6. colorize = minetest.colorize
  7. core.register_chatcommand("me",{
  8. params = "<action>",
  9. description = "Display chat action (e.g., '/me orders a pizza' displays".." '<player name> orders a pizza')",
  10. privs = {shout=true},
  11. func = function(name, param)
  12. local player_privs = core.get_player_privs(name)
  13. if player_privs.teleport and player_privs.server then csa(colorize(AZUL_OSCURO,"### "..colorize(AZUL_PASTEL,name..colorize(AZUL_OSCURO," "..param)))) end
  14. if player_privs.teleport and not player_privs.server then csa(colorize(AMARILLO_OSCURO,"### "..colorize(AMARILLO_PASTEL,name..colorize(AMARILLO_OSCURO," "..param)))) end
  15. if not player_privs.teleport and not player_privs.server then csa(colorize(VERDE_OSCURO,"### "..colorize(VERDE_PASTEL,name..colorize(VERDE_OSCURO," "..param)))) end
  16. if player_privs.shout and not player_privs.interact then csa(colorize(ROJO_OSCURO,"### "..colorize(ROJO_PASTEL,name..colorize(ROJO_OSCURO," "..param)))) end
  17. end,
  18.  
  19. })
RAW Paste Data