2kristof2 Posted August 17, 2015 Share Posted August 17, 2015 Hey, I have no idea how to attach a parachute to local player. I used simple attachElements but It looks horrible. Can somebody tell me how to get a better effect? (like in gta parachute). I couldn't find the solution in parachute resource. Video says all: https://www.youtube.com/watch?v=SLph2_Q ... e=youtu.be Link to comment
Wumbaloo Posted August 17, 2015 Share Posted August 17, 2015 U can't i think because the parachute is attached to an animation in MTA Version Link to comment
Moderators Citizen Posted August 17, 2015 Moderators Share Posted August 17, 2015 You can ! Wumbaloo you are kinda new to MTA, I don't want to be rude but if you are not sure, just don't say it. (It sounds rude I know, but i don't know how to better write it) You need to use matrix calculations. But it requires some advanced math calculations. I don't know the logics and calculations myself but I can tell you that you have to use that along with the bones positions of the player model: getPedBonePosition You can try to do it yourself (for the sake of learning) but @CrystalMV made a resource that provides you new functions that does the maths for you: Bone attachments: Website: http://crystalmv.net84.net/pages/script ... attach.php Documentation: http://crystalmv.net84.net/pages/script ... attach.php Video: MTA Community page: https://community.multitheftauto.com/index.php?p= ... ls&id=2540 You should be able to attach your parachute properly with that. Best regards, Citizen Link to comment
2kristof2 Posted August 17, 2015 Author Share Posted August 17, 2015 Thanks I tried to use getPedBonePosition yesterday but without any result. :c I also checked CrystalMV's script and it seems to be very interesting but also complicated for me. I copied functions from attach_func.lua and added few lines to my parachute script: local Me = getLocalPlayer() local x,y,z = getElementPosition( Me ) local rx,ry,rz = getElementRotation( Me ) parachute = createObject(371, x,y,z, rx, ry, rz) exports.bone_attach:attachElementToBone(parachute,Me, 3, 0, 0.25, 0.17,-90,2,0) It doesn't work for me but I'm going to try it once again. I would be so glad to see any advice what should I do or use Link to comment
Moderators Citizen Posted August 17, 2015 Moderators Share Posted August 17, 2015 It works just fine for me (just need some adjustments though): You need to: 1 - Download the bone_attach.zip and place it in your resources folder 2 - Start the bone_attach resource or you won't be able to use the exported functions. 3 - Use the code you just pasted in the previous post. You can add an tag in your meta to start the bone_attach resource automatically with your resource. Link to comment
2kristof2 Posted August 18, 2015 Author Share Posted August 18, 2015 The problem is I want to use this function only for 1 map which must be client sided. I tried to copy attach_func.lua, bone_attach.lua and bone_attach_c.lua to my map folder and added these lines to meta: Unfortunately it doesn't work properly. Link to comment
2kristof2 Posted August 18, 2015 Author Share Posted August 18, 2015 It worked when I changed bone id but only when I use bone_attach resource, how to make it only for 1 map client-sided? Edit: I think I solved the problem If I find new issues I'll bump this topic. Thanks Citizen PS if someone have an idea which bone would be the best to attach a parachute please write. 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