mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2026-05-14 09:25:33 +08:00
add runcode resource
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
function RunCode(code)
|
||||
local code, err = load(code, '@runcode')
|
||||
|
||||
if err then
|
||||
print(err)
|
||||
return nil, err
|
||||
end
|
||||
|
||||
local status, result = pcall(code)
|
||||
print(result)
|
||||
|
||||
if status then
|
||||
return result
|
||||
else
|
||||
return nil, result
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user