Jump to content

[Help]Attach Music


Recommended Posts

Posted

...

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.

Posted

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 ^^^

Posted
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 xD

Posted
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 xD

That's right .. well it's done i guess

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...