CLIENT
local sound = { }
addEvent( "onStartMusic", true )
addEventHandler( "onStartMusic", getRootElement(),
function (vehicle)
if vehicle then
local x,y,z = getElementPosition(vehicle)
local d = getElementDimension(vehicle)
local i = getElementInterior(vehicle)
local sound[vehicle] = playSound3D( "s.mp3", x, y, z, true)
attachElements(sound[vehicle],vehicle,0,0,0)
setSoundMaxDistance(sound[vehicle], 200)
setElementDimension(sound[vehicle], d)
setElementInterior(sound[vehicle], i)
end
end
)
SERVER
addEventHandler("onResourceStart", getRootElement(),
function ()
local mm55 = createVehicle(560, 1586.3, -1656.8, 28.6)
triggerClientEvent ( "onStartMusic", getRootElement(), mm55 )
end
)