mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 04:51:40 +09:00
Added custom command check
This commit is contained in:
@@ -113,6 +113,7 @@ local function run_custom_command(command)
|
|||||||
end
|
end
|
||||||
|
|
||||||
commands._add_command = commands.add_command
|
commands._add_command = commands.add_command
|
||||||
|
commands._expgaming = true
|
||||||
--- Used to define commands
|
--- Used to define commands
|
||||||
-- @usage inputs = {'player','reason',true}
|
-- @usage inputs = {'player','reason',true}
|
||||||
-- commands.add_command('ban','bans a player',inputs,function() return end)
|
-- commands.add_command('ban','bans a player',inputs,function() return end)
|
||||||
|
|||||||
@@ -175,12 +175,14 @@ function Server.interface(callback,use_thread,...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
commands.add_command('server-interface', 'Runs the given input from the script', {'code',true}, function(event,args)
|
if commands._expgaming then
|
||||||
local callback = args.code
|
commands.add_command('server-interface', 'Runs the given input from the script', {'code',true}, function(event,args)
|
||||||
if not string.find(callback,'%s') and not string.find(callback,'return') then callback = 'return '..callback end
|
local callback = args.code
|
||||||
local success, err = Server.interface(callback)
|
if not string.find(callback,'%s') and not string.find(callback,'return') then callback = 'return '..callback end
|
||||||
player_return(err)
|
local success, err = Server.interface(callback)
|
||||||
end)
|
player_return(err)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
-- thread allows you to run fuinction async to the main game
|
-- thread allows you to run fuinction async to the main game
|
||||||
--- Returns a new thread object
|
--- Returns a new thread object
|
||||||
|
|||||||
Reference in New Issue
Block a user