commands.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ChatCmdBuilder.new("quikbild", function(cmd)
  2. -- create arena
  3. cmd:sub("create :arena", function(name, arena_name)
  4. arena_lib.create_arena(name, "quikbild", arena_name)
  5. end)
  6. cmd:sub("create :arena :minplayers:int :maxplayers:int", function(name, arena_name, min_players, max_players)
  7. arena_lib.create_arena(name, "quikbild", arena_name, min_players, max_players)
  8. end)
  9. -- remove arena
  10. cmd:sub("remove :arena", function(name, arena_name)
  11. arena_lib.remove_arena(name, "quikbild", arena_name)
  12. end)
  13. -- list of the arenas
  14. cmd:sub("list", function(name)
  15. arena_lib.print_arenas(name, "quikbild")
  16. end)
  17. -- enter editor mode
  18. cmd:sub("edit :arena", function(sender, arena)
  19. arena_lib.enter_editor(sender, "quikbild", arena)
  20. end)
  21. -- enable and disable arenas
  22. cmd:sub("enable :arena", function(name, arena)
  23. arena_lib.enable_arena(name, "quikbild", arena)
  24. end)
  25. cmd:sub("disable :arena", function(name, arena)
  26. arena_lib.disable_arena(name, "quikbild", arena)
  27. end)
  28. cmd:sub("version", function(name)
  29. minetest.chat_send_player(name,"The version of QuikBild is "..quikbild.version)
  30. end)
  31. end, {
  32. description = [[
  33. (/help quikbild)
  34. Use this to configure your arena:
  35. - create <arena name> [min players] [max players]
  36. - edit <arena name>
  37. - enable <arena name>
  38. Other commands:
  39. - remove <arena name>
  40. - disable <arena>
  41. ]],
  42. privs = { quikbild_admin = true }
  43. })