Added /tp /bring and /goto and some comments

This commit is contained in:
Cooldude2606
2019-03-05 20:34:17 +00:00
parent 08038272b6
commit 402548dded
12 changed files with 73 additions and 11 deletions

View File

@@ -464,14 +464,14 @@ function Commands._prototype:register(callback)
end
self.description = description
-- registers the command under its own name
commands.add_command(self.name,description..' '..self.help,function(command_event)
commands.add_command(self.name,{'expcore-commands.command-help',description,self.help},function(command_event)
local success, err = pcall(Commands.run_command,command_event)
if not success then log('[ERROR] command/'..self.name..' :: '..err) end
end)
-- adds any aliases that it has
for _,alias in pairs(self.aliases) do
if not commands.commands[alias] and not commands.game_commands[alias] then
commands.add_command(alias,description..' '..self.help,function(command_event)
commands.add_command(alias,{'expcore-commands.command-help',description,self.help},function(command_event)
command_event.name = self.name
local success, err = pcall(Commands.run_command,command_event)
Commands.internal_error(success,self.name,err)

View File

@@ -114,7 +114,7 @@ end)
Commands.add_parse('player-alive',function(input,player,reject)
local input_player = Commands.parse('player-online',input,player,reject)
if not input_player then return end -- nil check
if not input_player.character or not input_player.character.health > 0 then
if not input_player.character or not input_player.character.health or input_player.character.health <= 0 then
return reject{'expcore-commands.reject-player-alive'}
else
return input_player

View File

@@ -11,6 +11,7 @@ reject-force=Invaild Force Name
reject-surface=Invaild surface Name
invalid-inputs=Invalid Input, /__1__ __2__
invalid-param=Invalid Param "__1__"; __2__
command-help=__1__ - __2__
command-ran=Command Complete
command-fail=Command failed to run: __1__
command-error-log-format=[ERROR] command/__1__ :: __2__