1
0
mirror of https://github.com/citizenfx/cfx-server-data.git synced 2025-01-11 08:25:08 +08:00
cfx-server-data/resources/[system]/runcode/runcode.js
2019-12-10 09:54:29 +01:00

11 lines
298 B
JavaScript

exports('runJS', (snippet) => {
if (IsDuplicityVersion() && GetInvokingResource() !== GetCurrentResourceName()) {
return [ 'Invalid caller.', false ];
}
try {
return [ new Function(snippet)(), false ];
} catch (e) {
return [ false, e.toString() ];
}
});