1
0
Fork 0
forked from Simnation/Main
Main/resources/[cfx-default]/[system]/runcode/runcode.js
2025-06-07 08:51:21 +02:00

11 lines
No EOL
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() ];
}
});