From 788cbfa2482eb71652e1df9e5a87540e0f8634b3 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 9 Dec 2017 16:22:20 +0000 Subject: [PATCH] Added custom command check --- locale/ExpCore/commands.lua | 1 + locale/ExpCore/server.lua | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/locale/ExpCore/commands.lua b/locale/ExpCore/commands.lua index c95b89ee..e4585a83 100644 --- a/locale/ExpCore/commands.lua +++ b/locale/ExpCore/commands.lua @@ -113,6 +113,7 @@ local function run_custom_command(command) end commands._add_command = commands.add_command +commands._expgaming = true --- Used to define commands -- @usage inputs = {'player','reason',true} -- commands.add_command('ban','bans a player',inputs,function() return end) diff --git a/locale/ExpCore/server.lua b/locale/ExpCore/server.lua index 9e4fc0d9..6dd650b2 100644 --- a/locale/ExpCore/server.lua +++ b/locale/ExpCore/server.lua @@ -175,12 +175,14 @@ function Server.interface(callback,use_thread,...) end end -commands.add_command('server-interface', 'Runs the given input from the script', {'code',true}, function(event,args) - local callback = args.code - if not string.find(callback,'%s') and not string.find(callback,'return') then callback = 'return '..callback end - local success, err = Server.interface(callback) - player_return(err) -end) +if commands._expgaming then + commands.add_command('server-interface', 'Runs the given input from the script', {'code',true}, function(event,args) + local callback = args.code + if not string.find(callback,'%s') and not string.find(callback,'return') then callback = 'return '..callback end + local success, err = Server.interface(callback) + player_return(err) + end) +end -- thread allows you to run fuinction async to the main game --- Returns a new thread object