Jump to content

[Help]Attachments


rafull6

Recommended Posts

Hello, guys! I've played one server once. It's called [NR]Gaming server, and there was an awesome script. Using those script you can attach objects to your car using command /attach [x y z xy yz zx] - cordinates. Question: How to create such script, or, if it's allready exist, post it here, please :)

Link to comment

https://wiki.multitheftauto.com/wiki/AttachElements

With this function you can attach two elements. Don't except me to write the code for you.

Oh well, I wrote a bit.

function attachHand ( source, commandName,objID,x,y,z,rx,ry,rz )
car = getPedOccupiedVehicle(source)
if (car) then
object = createObject(tonumber(objID),0,0,0);
attachElements ( car, object, tonumber(x),  tonumber(y),  tonumber(z), tonumber(rx),  tonumber(ry),  tonumber(rz) );
else
outputChatBox("You must be in car!",source,255,0,0);
end
end
addCommandHandler ( "attach", attachHand )

This works like /attach OBJECTID,x,y,z,rx,ry,rz

I'm not sure what you wanted.

Edit: It's untested dunno if works.

Link to comment

Ok. But i need a script, that will attach an object when you'he used /attach command.

like: /attach 1225 0 10 0 10 15 10 - it's will attach a barrel to the car in front of it. /attach [id] [x y z rx ry rz]

EDITED: i need that using this command player can attach all kinds of objects.

Link to comment

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