addEvent("startSound", true)
addEventHandler("startSound", root,
function(url)
destroyElement(sound)
local x, y, z = getElementPosition(source)
sound = playSound(tostring(url), x, y, z)
end
)
addEventHandler("onClientGUIClick", root,
function()
if (source == playButton) then
if (not guiGetText(linkEdit) == "") then
triggerServerEvent("setCustomStream", root, guiGetText(linkEdit))
else
local radioUrl = guiGridListGetItemText(radioGrid, guiGridListGetSelectedItem(radioGrid), 2)
triggerServerEvent("setCustomStream", root, radioUrl)
end
end
end
)
addEvent("setCustomStream", true)
addEventHandler("setCustomStream", root,
function(radio, p)
if (p == source) then
local x, y, z = getElementPosition(p)
destroyElement(speaker)
speaker = createObject(2229, x, y, z)
triggerClientEvent(root, "startSound", root, radio)
local vehicle = getPedOccupiedVehicle(p)
attachElements(speaker, vehicle)
end
end
)
Not working, nothing happens, no errors on debug.