benwilkins Posted September 4, 2011 Share Posted September 4, 2011 OK i have set up a client script where a command will play the sound to the local client. Ive never worked with playSound3D. How can I make it so that if someone types /alarm, then the whole server will hear it not just the local player who typed it?.. Code: function bankalarm () Alarm = playSound3D("alarm.wav", -2649.9130859375, 376.15625, 6.15625, true) setSoundVolume(Alarm, 3) setSoundMaxDistance(Alarm, 100) Alarm2 = playSound3D("alarm.wav", 2328.638671875, 2367.5283203125, 2022.92578125, true) setSoundVolume(Alarm2, 3) setSoundMaxDistance(Alarm2, 100) setElementInterior ( Alarm2, 0 ) setElementDimension ( Alarm2, 5 ) outputChatBox("Playing", getRootElement(), 255, 255, 0) end addCommandHandler("alarm", bankalarm) function stopAlarm () stopSound( Alarm ) stopSound( Alarm2 ) outputChatBox("Stopped", getRootElement(), 255, 255, 0) end addCommandHandler("stopalarm", stopAlarm) Link to comment
SpUnKyMe Posted September 4, 2011 Share Posted September 4, 2011 client function bankalarm () Alarm = playSound3D("alarm.wav", -2649.9130859375, 376.15625, 6.15625, true) setSoundVolume(Alarm, 3) setSoundMaxDistance(Alarm, 100) Alarm2 = playSound3D("alarm.wav", 2328.638671875, 2367.5283203125, 2022.92578125, true) setSoundVolume(Alarm2, 3) setSoundMaxDistance(Alarm2, 100) setElementInterior ( Alarm2, 0 ) setElementDimension ( Alarm2, 5 ) outputChatBox("Playing", getRootElement(), 255, 255, 0) end addEvent( "playAlarm", true ) addEventHandler( "playAlarm", getRootElement(), bankalarm ) server function playAlarm ( ) triggerClientEvent ( "playAlarm", getRootElement() ) end addCommandHandler ( "alarm", playAlarm ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now