-- client
local locsfortown:~ = {
{-86.4970703125, 1120.2216796875, 0},
{-1475.625, 2629.337890625, 0},
{-2445.4267578125, 2388.9111328125, 0}
}
for i=1 ,#locsfortown:~ do
function onClientPlaySound()
xtown, ytown, ztown = locsfortown:~[i][1], locsfortown:~[i][2], locsfortown:~[i][3]
ambtown = playSound3D("ambtown.mp3", xtown, ytown, ztown, true)
setSoundMaxDistance(ambtown, 1000)
setSoundPanningEnabled (ambtown, false)
end
end
addEvent("onClientPlaySound", true)
addEventHandler("onClientPlaySound", resourceRoot, onClientPlaySound)
-- server
function timeFunction()
local realtime = getRealTime()
local hours = realtime.hour
local minutes = realtime.minute
if hours == 07 and minutes == 00 then
triggerClientEvent(getRootElement(), "onClientPlaySound", resourceRoot)
end
end
setTimer(timeFunction, 60000, 0)