SkatCh Posted September 5, 2014 Share Posted September 5, 2014 guys i need some help i create a table and i want just those players will hear the sound , server : for _, p in ipairs (CrTable) do textDisplayRemoveObserver(Display, p) triggerClientEvent("playMyMusic",p) end and iside the client file i add the PlaySound . the text is working fine and the triggerClientEvent i think that there is something wrong. i'm sorry about my english. Link to comment
Ab-47 Posted September 5, 2014 Share Posted September 5, 2014 Post your full code so we can understand your problem even better. Link to comment
SkatCh Posted September 5, 2014 Author Share Posted September 5, 2014 Post your full code so we can understand your problem even better. it's just a part from my code just i need to make the players inside the tabe can hear the sound that's all . i already change it to root but all players inside the server hear it. Link to comment
TAPL Posted September 5, 2014 Share Posted September 5, 2014 triggerClientEvent(p,"playMyMusic",p) Link to comment
SkatCh Posted September 5, 2014 Author Share Posted September 5, 2014 bro i already try it but did't work . Link to comment
TAPL Posted September 5, 2014 Share Posted September 5, 2014 Can you post the client side? Link to comment
SkatCh Posted September 5, 2014 Author Share Posted September 5, 2014 here u go addEvent("playMyMusic",true) addEventHandler("playMyMusic", getRootElement(), function() local sound = playSound("music.wav",false) setSoundVolume(sound, 1.0) end) Link to comment
TAPL Posted September 5, 2014 Share Posted September 5, 2014 addEvent("playMyMusic",true) addEventHandler("playMyMusic", getRootElement(), function() outputChatBox("Test") local sound = playSound("music.wav",false) setSoundVolume(sound, 1.0) end) see if it output 'Test' in the chat. Link to comment
SkatCh Posted September 5, 2014 Author Share Posted September 5, 2014 i tried it nothing i can't see Test in chatbox Link to comment
TAPL Posted September 5, 2014 Share Posted September 5, 2014 How about this? for _, p in ipairs (CrTable) do outputChatBox("Test - Server", p) textDisplayRemoveObserver(Display, p) triggerClientEvent(p,"playMyMusic",p) end Link to comment
SkatCh Posted September 5, 2014 Author Share Posted September 5, 2014 the same bro i can't see it . Link to comment
TAPL Posted September 5, 2014 Share Posted September 5, 2014 Then you aren't in the table CrTable. Link to comment
SkatCh Posted September 5, 2014 Author Share Posted September 5, 2014 bro what about this i have an other idea i will change playsound with playSound3D and i will change P with root , because i already test it with root and i can hear the sound. Link to comment
TAPL Posted September 5, 2014 Share Posted September 5, 2014 What kind of data you have in the table CrTable? Can you post the code where you insert data on the table? 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