This commit is contained in:
Cooldude2606
2017-11-16 17:00:52 +00:00
parent 91c9392e86
commit cafb4ee86b
3 changed files with 9 additions and 6 deletions

View File

@@ -36,4 +36,6 @@ end)
ranking,ExpGui,server = unpack(require("locale/ExpGaming-Core/file-header"))
--loads all the other scripts
require("locale/Stand-Alone/file-header")
require("locale/ExpGaming-Addons/file-header")
require("locale/ExpGaming-Addons/file-header")
--call from command maker
load_commands()

View File

@@ -56,7 +56,7 @@ local function load_command(command_data)
debug_write({'COMMAND','LOAD'},command_data)
commands.add_command(command_data.name,{'commands.help-format',command_inputs_to_string(command_data),command_data.help},function(event)
--gets the command data
local command = get_commands()[event.name]
local command = Exp_commands[event.name]
debug_write({'COMMAND','RUN','START'},command.name)
debug_write({'COMMAND','RUN','PLAYER-INDEX'},event.player_index)
if event.player_index then
@@ -100,11 +100,12 @@ end
function get_commands(rank)
local rank = rank or 'Owner'
local to_return = {}
if not rank then return Exp_commands end
for command_name,command in pairs(Exp_commands) do
if ranking.rank_allowed(ranking.string_to_rank(rank),command_name) then table.insert(to_return,command) end
end
return to_return
end
-- loads all the commands
for command_name,command in pairs(Exp_commands) do load_command(command) end
-- loads all the commands, call once all script have been loaded
function load_commands()
for command_name,command in pairs(Exp_commands) do load_command(command) end
end

View File

@@ -98,7 +98,7 @@ function json_log(lua_table,no_log)
end
-- allows a simple way to debug code; idenitys = {'string1','string2'}; string will be writen to file; no_trigger dissables the trigger useful for on_tick events
function debug_write(idenitys,string,no_trigger)
if global.exp_core.debug.state then
if global.exp_core and global.exp_core.debug.state then
if type(string) == 'table' then string = table.tostring(string)
elseif type(string) ~= 'string' then string = tostring(string) end
if not no_trigger or global.exp_core.debug.triggered then game.write_file('debug.log', '\n['..table.concat(idenitys, " " )..'] '..string, true, 0) end