Update tv.lua

This commit is contained in:
Michachatz
2025-11-02 00:32:54 +01:00
committed by GitHub
parent 0f082b4114
commit 969ce331e6

View File

@@ -1,4 +1,4 @@
TelevisionsLocal = {} local TelevisionsLocal = {}
function SetChannel(index) function SetChannel(index)
TriggerServerEvent("ptelevision:event", CURRENT_SCREEN, "ptv_status", { TriggerServerEvent("ptelevision:event", CURRENT_SCREEN, "ptv_status", {
@@ -20,8 +20,8 @@ function GetChannelList()
channel = status.channel channel = status.channel
end end
for index,value in pairs(Channels) do for index,value in pairs(Channels) do
table.insert(channel_list, {index = index, url = value.url}) channel_list[#channel_list+1] = {index = index, url = value.url}
table.insert(menu_list, "Channel #" .. index .. " (".. value.name ..")") menu_list[#menu_list+1] = "Channel #" .. index .. " (".. value.name ..")"
if channel ~= nil and channel == index then if channel ~= nil and channel == index then
current = #channel_list current = #channel_list
end end
@@ -95,10 +95,6 @@ function OpenTVMenu()
SetChannel(ChannelList.list[scrollIndex].index) SetChannel(ChannelList.list[scrollIndex].index)
end end
end, end,
onSelected = function(selected, scrollIndex, args)
end,
onClose = function(keyPressed)
end,
options = { options = {
{label = 'Videos', description = 'Play a video or stream on the screen.'}, {label = 'Videos', description = 'Play a video or stream on the screen.'},
{label = 'Web Browser', description = 'Access the web via your TV.'}, {label = 'Web Browser', description = 'Access the web via your TV.'},
@@ -219,8 +215,8 @@ end)
RegisterCommand('tv', function() RegisterCommand('tv', function()
OpenTVMenu() OpenTVMenu()
end) end, false)
RegisterCommand("broadcast", function(source, args, raw) RegisterCommand('broadcast', function()
BroadcastMenu() BroadcastMenu()
end) end, false)