mirror of
https://github.com/Michatec/ptelevision.git
synced 2026-03-31 23:46:30 +02:00
Update tv.lua
This commit is contained in:
@@ -59,11 +59,17 @@ end
|
|||||||
|
|
||||||
function VideoMenu()
|
function VideoMenu()
|
||||||
lib.hideMenu()
|
lib.hideMenu()
|
||||||
local input = lib.inputDialog('Video Player', {'URL:'})
|
local input = lib.inputDialog('Video Player', {
|
||||||
if input then
|
{ type = 'input', label = 'Video URL' },
|
||||||
|
{ type = 'checkbox', label = 'Loop Video' },
|
||||||
|
{ type = 'checkbox', label = 'Show Video Controls' }
|
||||||
|
})
|
||||||
|
if input then
|
||||||
TriggerServerEvent("ptelevision:event", CURRENT_SCREEN, "ptv_status", {
|
TriggerServerEvent("ptelevision:event", CURRENT_SCREEN, "ptv_status", {
|
||||||
type = "play",
|
type = "play",
|
||||||
url = input[1]
|
url = input[1],
|
||||||
|
loop = input[2],
|
||||||
|
showControls = input[3]
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
Citizen.Wait(300)
|
Citizen.Wait(300)
|
||||||
@@ -181,7 +187,7 @@ RegisterNetEvent("ptelevision:event", function(data, index, key, value)
|
|||||||
if (index) then
|
if (index) then
|
||||||
local event = value
|
local event = value
|
||||||
if (event.type == "play") then
|
if (event.type == "play") then
|
||||||
local data = { url = event.url }
|
local data = { url = event.url, loop = event.loop, showControls = event.showControls }
|
||||||
if (event.channel) then
|
if (event.channel) then
|
||||||
data = Channels[event.channel]
|
data = Channels[event.channel]
|
||||||
data.channel = event.channel
|
data.channel = event.channel
|
||||||
@@ -220,3 +226,4 @@ end, false)
|
|||||||
RegisterCommand('broadcast', function()
|
RegisterCommand('broadcast', function()
|
||||||
BroadcastMenu()
|
BroadcastMenu()
|
||||||
end, false)
|
end, false)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user