+ Added fast enable cmd
parent
24c23ee0e9
commit
53f9176396
|
@ -147,6 +147,9 @@ end)
|
|||
|
||||
|
||||
arena_lib.on_enable("skywars", function(arena, pl_name)
|
||||
local fast_enable = pl_name:match("@")
|
||||
pl_name = pl_name:gsub("@", "")
|
||||
|
||||
if arena.treasures[1] == nil then
|
||||
skywars.print_error(pl_name, skywars.T("You didn't set the treasures!"))
|
||||
return false
|
||||
|
@ -158,7 +161,10 @@ arena_lib.on_enable("skywars", function(arena, pl_name)
|
|||
return false
|
||||
end
|
||||
|
||||
skywars.save_nodes_with_inventories(arena)
|
||||
if not fast_enable then
|
||||
skywars.print_msg(pl_name, skywars.T("The enabling process may take a few moments, please wait..."))
|
||||
skywars.save_nodes_with_inventories(arena)
|
||||
end
|
||||
|
||||
return true
|
||||
end)
|
||||
|
|
11
commands.lua
11
commands.lua
|
@ -90,6 +90,16 @@ ChatCmdBuilder.new("skywars", function(cmd)
|
|||
|
||||
|
||||
|
||||
cmd:sub("fast enable :arena", function(name, arena_name)
|
||||
local arena = get_valid_arena(arena_name, name)
|
||||
|
||||
if not arena then return end
|
||||
|
||||
arena_lib.enable_arena(name.."@", "skywars", arena.name)
|
||||
end)
|
||||
|
||||
|
||||
|
||||
cmd:sub("disable :arena", function(name, arena_name)
|
||||
local arena = get_valid_arena(arena_name, name)
|
||||
|
||||
|
@ -921,6 +931,7 @@ end, {
|
|||
- remove <arena name>
|
||||
- list
|
||||
- enable <arena name>
|
||||
- fast enable <arena name>
|
||||
- disable <arena name>
|
||||
|
||||
|
||||
|
|
|
@ -52,4 +52,5 @@ Kit not found!=Kit non trovato!
|
|||
x@1 @2 added to @3!=x@1 @2 aggiunto a @3!
|
||||
@1 reset!=@1 resettata!
|
||||
@1 kits have been copied to @2!=I kit di @1 sono stati copiati in @2!
|
||||
Nobody must be in the editor!=Nessuno deve essere nell'editor!
|
||||
Nobody must be in the editor!=Nessuno deve essere nell'editor!
|
||||
The enabling process may take a few moments, please wait...=Il processo di abilitazione potrebbe richiedere del tempo, attendere...
|
|
@ -52,4 +52,5 @@ Kit not found!=
|
|||
x@1 @2 added to @3!=
|
||||
@1 reset!=
|
||||
@1 kits have been copied to @2!=
|
||||
Nobody must be in the editor!=
|
||||
Nobody must be in the editor!=
|
||||
The enabling process may take a few moments, please wait...=
|
Loading…
Reference in New Issue