denny199 Posted July 9, 2012 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.
Jokeℝ1472771893 Posted July 9, 2012 Author Posted July 9, 2012 thnx thnx thnx you are the best and now how to attach speaker on tunk???
TAPL Posted July 9, 2012 Posted July 9, 2012 thnx thnx thnx you are the best and now how to attach speaker on tunk???
Jaysds1 Posted July 9, 2012 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 ^^^
denny199 Posted July 10, 2012 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
Tete omar Posted July 10, 2012 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
Jokeℝ1472771893 Posted July 10, 2012 Author Posted July 10, 2012 but speaker see only me and music too
denny199 Posted July 10, 2012 Posted July 10, 2012 ...This is only client, so, you are the only who is hearing it.
Jaysds1 Posted July 10, 2012 Posted July 10, 2012 You could create a colshape around it and who ever is in it could hear it.
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