--clientlocal sounds = {}function startSirene ( vehicle ) local x,y,z = getElementPosition( vehicle ) local sirene = playSound3D( \"files\\\\siren.mp3\", x, y, z, true)setSoundVolume(sirene, 0.9)setSoundMinDistance ( sirene, 90 )setSoundMaxDistance ( sirene, 150 ) attachElements ( sirene, vehicle) sounds [ vehicle ] = sireneendaddEvent( \"startSirene\", true )addEventHandler(\"startSirene\", getRootElement(), startSirene)function stopSirene( vehicle ) local sirene = sounds [ vehicle ] stopSound ( sirene )endaddEvent( \"stopSirene\", true )addEventHandler(\"stopSirene\", getRootElement(), stopSirene)
--serverfunction startSirene( player, cmd ) local commandant = getPedOccupiedVehicle(player) triggerClientEvent ( \"startSirene\", getRootElement(), commandant )endaddCommandHandler ( \"sirenon\", startSirene)function stopSirene( player, cmd ) local commandant = getPedOccupiedVehicle(player) triggerClientEvent ( \"stopSirene\", getRootElement(), commandant )endaddCommandHandler ( \"sirenoff\", stopSirene)
--clientlocal sounds = {}function startSirene ( vehicle ) local x,y,z = getElementPosition( vehicle ) local sirene = playSound3D( \"files\\\\siren.mp3\", x, y, z, true)setSoundVolume(sirene, 0.9)setSoundMinDistance ( sirene, 90 )setSoundMaxDistance ( sirene, 150 ) attachElements ( sirene, vehicle) sounds [ vehicle ] = sireneendaddEvent( \"startSirene\", true )addEventHandler(\"startSirene\", getRootElement(), startSirene)function stopSirene( vehicle ) local sirene = sounds [ vehicle ] stopSound ( sirene )endaddEvent( \"stopSirene\", true )addEventHandler(\"stopSirene\", getRootElement(), stopSirene)function bindTheKeys () bindKey ( \"x\", \"down\", startSirene ) bindKey ( \"x\", \"up\", stopSirene )end
--serverfunction startSirene( player, cmd ) local commandant = getPedOccupiedVehicle(player) triggerClientEvent ( \"startSirene\", getRootElement(), commandant )endaddCommandHandler ( \"sirenon\", startSirene)function stopSirene( player, cmd ) local commandant = getPedOccupiedVehicle(player) triggerClientEvent ( \"stopSirene\", getRootElement(), commandant )endaddCommandHandler ( \"sirenoff\", stopSirene) function bindTheKeys ( player, commandName ) bindKey ( player, \"x\", \"down\", startSirene ) bindKey ( player, \"x\", \"up\", stopSirene )end