mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-16 02:47:48 +02:00
mtn fortress - new command
added a command that allows for an admin to disable the wave_defense module
This commit is contained in:
parent
8062179602
commit
f6b94654c5
@ -2,6 +2,7 @@ local Color = require 'utils.color_presets'
|
||||
local Task = require 'utils.task'
|
||||
local Server = require 'utils.server'
|
||||
local WPT = require 'maps.mountain_fortress_v3.table'
|
||||
local WD = require 'modules.wave_defense.table'
|
||||
|
||||
local mapkeeper = '[color=blue]Mapkeeper:[/color]'
|
||||
|
||||
@ -121,6 +122,41 @@ commands.add_command(
|
||||
end
|
||||
)
|
||||
|
||||
commands.add_command(
|
||||
'disable_biters',
|
||||
'Usable only for admins - sets the queue speed of this map!',
|
||||
function(cmd)
|
||||
local player = game.player
|
||||
|
||||
if not player and player.valid then
|
||||
return
|
||||
end
|
||||
if not player.admin then
|
||||
player.print("[ERROR] You're not admin!", Color.fail)
|
||||
return
|
||||
end
|
||||
|
||||
local this = WPT.get()
|
||||
local tbl = WD.get()
|
||||
|
||||
if not this.disable_biters_are_you_sure then
|
||||
this.disable_biters_are_you_sure = true
|
||||
player.print('[WARNING] This command will disable the wave_defense in-game, run this command again if you really want to do this!', Color.warning)
|
||||
return
|
||||
end
|
||||
|
||||
if not tbl.game_lost then
|
||||
game.print(mapkeeper .. ' ' .. player.name .. ', has disabled the wave_defense module!', {r = 0.98, g = 0.66, b = 0.22})
|
||||
tbl.game_lost = true
|
||||
else
|
||||
game.print(mapkeeper .. ' ' .. player.name .. ', has enabled the wave_defense module!', {r = 0.98, g = 0.66, b = 0.22})
|
||||
tbl.game_lost = false
|
||||
end
|
||||
|
||||
this.disable_biters_are_you_sure = nil
|
||||
end
|
||||
)
|
||||
|
||||
commands.add_command(
|
||||
'get_queue_speed',
|
||||
'Usable only for admins - gets the queue speed of this map!',
|
||||
|
Loading…
Reference in New Issue
Block a user