mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2026-11-10 13:57:18 +01:00
* refactor: declare exports at runtime and drop the player-data provides alias Signed-off-by: Mathu-lmn <[email protected]> * refactor: pass handlers directly to RegisterNetEvent Signed-off-by: Mathu-lmn <[email protected]> * refactor: use CreateThread/Wait without the Citizen prefix Signed-off-by: Mathu-lmn <[email protected]> * chore: remove trailing whitespace, stray lines and unused locals Signed-off-by: Mathu-lmn <[email protected]> --------- Signed-off-by: Mathu-lmn <[email protected]>
13 lines
329 B
Lua
13 lines
329 B
Lua
RegisterNetEvent('runcode:gotSnippet', function(id, lang, code)
|
|
local res, err = RunCode(lang, code)
|
|
|
|
if not err then
|
|
if type(res) == 'vector3' then
|
|
res = json.encode({ table.unpack(res) })
|
|
elseif type(res) == 'table' then
|
|
res = json.encode(res)
|
|
end
|
|
end
|
|
|
|
TriggerServerEvent('runcode:gotResult', id, res, err)
|
|
end) |