mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-12-12 06:14:09 +01:00
initial
This commit is contained in:
40
resources/[gameplay]/channelfeed/client/channelfeed.lua
Normal file
40
resources/[gameplay]/channelfeed/client/channelfeed.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
local eventBuffer = {}
|
||||
|
||||
AddUIHandler('getNew', function(data, cb)
|
||||
local localBuf = eventBuffer
|
||||
eventBuffer = {}
|
||||
|
||||
cb(localBuf)
|
||||
end)
|
||||
|
||||
function printTo(channel, data)
|
||||
table.insert(eventBuffer, {
|
||||
meta = 'print',
|
||||
channel = channel,
|
||||
data = data
|
||||
})
|
||||
|
||||
PollUI()
|
||||
end
|
||||
|
||||
function addChannel(id, options)
|
||||
if not options.template then
|
||||
return
|
||||
end
|
||||
|
||||
options.id = id
|
||||
|
||||
table.insert(eventBuffer, {
|
||||
meta = 'addChannel',
|
||||
data = options
|
||||
})
|
||||
|
||||
PollUI()
|
||||
end
|
||||
|
||||
function removeChannel(id)
|
||||
table.insert(eventBuffer, {
|
||||
meta = 'removeChannel',
|
||||
data = id
|
||||
})
|
||||
end
|
||||
Reference in New Issue
Block a user