denny199 Posted July 9, 2012 Share Posted July 9, 2012 ... This is only client, so, you are the only who is hearing it. function attach() pl = getLocalPlayer() -- get the local player if isPedInVehicle ( pl ) then -- if it's in a vehicle car = getPedOccupiedVehicle (pl) -- get the player's car sound = playSound3D ( "lol.mp3", 0, 0, 0 ) -- creating the sound speakerobject = createObject ( id , 0 ,0 ,0 ) -- You need to input the id on yourself, 0,0,0 = x,y,z attachElements ( speakerobject, car, xoffset, yoffset, zoffset ) -- attach the speaker on the car, the xyz offset is where the speaker will be attached, so change the xyz offset. attachElements ( sound, speakerobject ) -- attaching the sound to the object. end end addCommandHandler ( "attachmeup", attach ) Btw, I maded something like this too but then in a gui and while it's visible to evryone. Link to comment
Jokeℝ1472771893 Posted July 9, 2012 Author Share Posted July 9, 2012 thnx thnx thnx you are the best and now how to attach speaker on tunk??? Link to comment
TAPL Posted July 9, 2012 Share Posted July 9, 2012 thnx thnx thnx you are the best and now how to attach speaker on tunk??? Link to comment
Jaysds1 Posted July 9, 2012 Share Posted July 9, 2012 xDDDDDD Sorry Joker, but you have to test the script out for your self, Experiment more! or Read the Wiki and Learn, or your going to be getting more of those ^^^ Link to comment
denny199 Posted July 10, 2012 Share Posted July 10, 2012 attachElements ( speakerobject, car, xoffset, yoffset, zoffset ) -- the xyz offset is where the speaker will be attached, so change the xyz offset. So, 0 , 0, 0 = in the middle off the car and 0, 0, 6 = In the middle off the car but then the object is higher attached, and so one... just changes the xyz offset what I sayd before. btw, here's one that I maded in a GUI, I don't give it away I'm now busy with my next version to attach speakers, almost done. But that doesn't matter Link to comment
Tete omar Posted July 10, 2012 Share Posted July 10, 2012 attachElements ( speakerobject, car, xoffset, yoffset, zoffset ) -- the xyz offset is where the speaker will be attached, so change the xyz offset. So, 0 , 0, 0 = in the middle off the car and 0, 0, 6 = In the middle off the car but then the object is higher attached, and so one... just changes the xyz offset what I sayd before. btw, here's one that I maded in a GUI, I don't give it away I'm now busy with my next version to attach speakers, almost done. But that doesn't matter That's right .. well it's done i guess Link to comment
Jokeℝ1472771893 Posted July 10, 2012 Author Share Posted July 10, 2012 but speaker see only me and music too Link to comment
denny199 Posted July 10, 2012 Share Posted July 10, 2012 ...This is only client, so, you are the only who is hearing it. Link to comment
Jaysds1 Posted July 10, 2012 Share Posted July 10, 2012 You could create a colshape around it and who ever is in it could hear it. Link to comment
Jokeℝ1472771893 Posted July 10, 2012 Author Share Posted July 10, 2012 ok thnx you all 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