This is what I've got now: I've added the 2 new parts.
I've heard a little sound and I think it will working, need to check the soundfile first.
function soundStart()
sound = playSound3D("music.mp3", 253.234375, -1784.283203125, 4.2362642288208, true)
if sound then
outputDebugString("3D Created successful", 3)
else
outputDebugString("Error creating 3D", 1)
end
end
addEventHandler("onClientResourceStart", resourceRoot, soundStart)
local sound = playSound3D("music.mp3", 253.234375, -1784.283203125, 4.2362642288208, true)
function distanceFunc(command, param)
setSoundMinDistance(sound, (10)(param))
end
addCommandHandler("setdistance", distanceFunc)
local sound = playSound3D("music.mp3", 253.234375, -1784.283203125, 4.2362642288208, true)
function maxdistanceFunc(command, param)
setSoundMaxDistance(sound, (50)(param))
end
addCommandHandler("setmaxdistance", maxdistanceFunc)
But my next question: Will this work in MTA 1.1? I couldn't start this 1 in the local server: It contain illegal charachters
function soundStart()
sound = playSound3D("myradio.listen2myradio.com", 253.234375, -1784.283203125, 4.2362642288208, true)
if sound then
outputDebugString("3D Created successful", 3)
else
outputDebugString("Error creating 3D", 1)
end
end
addEventHandler("onClientResourceStart", resourceRoot, soundStart)
local sound = playSound3D("myradio.listen2myradio.com", 253.234375, -1784.283203125, 4.2362642288208, true)
function distanceFunc(command, param)
setSoundMinDistance(sound, (10)(param))
end
addCommandHandler("setdistance", distanceFunc)
local sound = playSound3D("myradio.listen2myradio.com", 253.234375, -1784.283203125, 4.2362642288208, true)
function maxdistanceFunc(command, param)
setSoundMaxDistance(sound, (50)(param))
end
addCommandHandler("setmaxdistance", maxdistanceFunc)