added mod:dofile()
This commit is contained in:
parent
4cc3a49153
commit
c574b03bdd
1 changed files with 12 additions and 0 deletions
|
@ -62,6 +62,18 @@ VMFMod.pcall = function (self, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
VMFMod.dofile = function (self, script_path)
|
||||||
|
|
||||||
|
local status, value = pcall(dofile, script_path)
|
||||||
|
|
||||||
|
if not status then
|
||||||
|
self:echo("ERROR(loadfile): " .. value.error, true)
|
||||||
|
|
||||||
|
print("\nTRACEBACK:\n\n" .. value.traceback .. "\nLOCALS:\n\n" .. value.locals)
|
||||||
|
end
|
||||||
|
|
||||||
|
return value
|
||||||
|
end
|
||||||
-- ####################################################################################################################
|
-- ####################################################################################################################
|
||||||
-- ##### Event functions ##############################################################################################
|
-- ##### Event functions ##############################################################################################
|
||||||
-- ####################################################################################################################
|
-- ####################################################################################################################
|
||||||
|
|
Loading…
Add table
Reference in a new issue