mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-12-12 06:14:09 +01:00
reorganize resource directories
This commit is contained in:
11
resources/[system]/runcode/runcode.js
Normal file
11
resources/[system]/runcode/runcode.js
Normal file
@@ -0,0 +1,11 @@
|
||||
exports('runJS', (snippet) => {
|
||||
if (IsDuplicityVersion() && GetInvokingResource() !== GetCurrentResourceName()) {
|
||||
return [ 'Invalid caller.', false ];
|
||||
}
|
||||
|
||||
try {
|
||||
return [ new Function(snippet)(), false ];
|
||||
} catch (e) {
|
||||
return [ false, e.toString() ];
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user