mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 19:01:27 +00:00
15 lines
343 B
Lua
15 lines
343 B
Lua
local Chunks = {}
|
|
|
|
RegisterNUICallback('__chunk', function(data, cb)
|
|
Chunks[data.id] = Chunks[data.id] or ''
|
|
Chunks[data.id] = Chunks[data.id] .. data.chunk
|
|
|
|
if data['end'] then
|
|
local msg = json.decode(Chunks[data.id])
|
|
TriggerEvent(GetCurrentResourceName() .. ':message:' .. data.__type, msg)
|
|
Chunks[data.id] = nil
|
|
end
|
|
|
|
cb('')
|
|
end)
|