HoLsTeN Posted August 4, 2011 Share Posted August 4, 2011 we need to add this function attachElementToBone like in sa-mp this function will be helpful and easier to make many things by using it! we must add it for MTA 1.1 sorry for my bad english Link to comment
JR10 Posted August 4, 2011 Share Posted August 4, 2011 client side only: function attachElementToBone(element,ped,bone) local boneX,boneY,boneZ = getPedBonePosition(ped,bone) setElementPosition(element,boneX,boneY,boneZ) attachRotationAdjusted(element,ped) end function attachRotationAdjusted (from, to) local frPosX, frPosY, frPosZ = getElementPosition(from) local frRotX, frRotY, frRotZ = getElementRotation(from) local toPosX, toPosY, toPosZ = getElementPosition(to) local toRotX, toRotY, toRotZ = getElementRotation(to) local offsetPosX = frPosX - toPosX local offsetPosY = frPosY - toPosY local offsetPosZ = frPosZ - toPosZ local offsetRotX = frRotX - toRotX local offsetRotY = frRotY - toRotY local offsetRotZ = frRotZ - toRotZ offsetPosX, offsetPosY, offsetPosZ = applyInverseRotation (offsetPosX, offsetPosY, offsetPosZ, toRotX, toRotY, toRotZ) attachElements(from, to, offsetPosX, offsetPosY, offsetPosZ, offsetRotX, offsetRotY, offsetRotZ) end function applyInverseRotation (x,y,z, rx,ry,rz) local DEG2RAD = (math.pi * 2) / 360 rx = rx * DEG2RAD ry = ry * DEG2RAD rz = rz * DEG2RAD local tempY = y y = math.cos (rx) * tempY + math.sin (rx) * z z = -math.sin (rx) * tempY + math.cos (rx) * z local tempX = x x = math.cos (ry) * tempX - math.sin (ry) * z z = math.sin (ry) * tempX + math.cos (ry) * z tempX = x x = math.cos (rz) * tempX + math.sin (rz) * y y = -math.sin (rz) * tempX + math.cos (rz) * y return x, y, z end Not sure it will work though, just an idea i came up with. Link to comment
DiSaMe Posted August 4, 2011 Share Posted August 4, 2011 Why do people take SA-MP as an example? SA-MP sucks and has nothing impossible for MTA. Actually, with getPedBonePosition in MTA you can do much more than SetPlayerAttachedObject in SA-MP. If you don't want to script attachElementToBone yourself, use bone attachments resource. It has no limits for attaching objects, while in SA-MP there are only 5 object slots per player. Link to comment
diegofkda Posted August 4, 2011 Share Posted August 4, 2011 Also I don't see what is the point of comparing, MTA is a thing, and SA-MP is another thing, we all know MTA has more features. Link to comment
HoLsTeN Posted August 4, 2011 Author Share Posted August 4, 2011 i prefer MTA i sayed that because we want better then them i don't like samp Link to comment
DiSaMe Posted August 4, 2011 Share Posted August 4, 2011 We all want MTA to be better than SA-MP and that's exactly how it is. But I find a little problem in MTA community: everyone wants somebody to come out of nowhere and do the job for them. That was the situation with bone attachments: getPedBonePosition has existed for a long time, but there still were many people who wanted bone attachment functions to be implemented. That took such a long time that they could have scripted it themselves, but they didn't. So I decided to make the resource myself. I'm glad that people like it, but I also feel a bit disappointed in them. Link to comment
solidsnake Posted August 10, 2011 Share Posted August 10, 2011 We all want MTA to be better than SA-MP and that's exactly how it is. But I find a little problem in MTA community: everyone wants somebody to come out of nowhere and do the job for them. That was the situation with bone attachments: getPedBonePosition has existed for a long time, but there still were many people who wanted bone attachment functions to be implemented. That took such a long time that they could have scripted it themselves, but they didn't. So I decided to make the resource myself. I'm glad that people like it, but I also feel a bit disappointed in them. Its Suggestion ! He asked for new function like other do If you dont want it ... others will want it Its up to developers For me yes better than nothing Link to comment
DiSaMe Posted August 10, 2011 Share Posted August 10, 2011 We all want MTA to be better than SA-MP and that's exactly how it is. But I find a little problem in MTA community: everyone wants somebody to come out of nowhere and do the job for them. That was the situation with bone attachments: getPedBonePosition has existed for a long time, but there still were many people who wanted bone attachment functions to be implemented. That took such a long time that they could have scripted it themselves, but they didn't. So I decided to make the resource myself. I'm glad that people like it, but I also feel a bit disappointed in them. Its Suggestion ! He asked for new function like other do If you dont want it ... others will want it Its up to developers For me yes better than nothing If I didn't want the function, why would I make it? Writing the function in Lua isn't "nothing" and I haven't seen people who care if the function is added by the resource or implemented into MTA itself. Link to comment
solidsnake Posted August 21, 2011 Share Posted August 21, 2011 We all want MTA to be better than SA-MP and that's exactly how it is. But I find a little problem in MTA community: everyone wants somebody to come out of nowhere and do the job for them. That was the situation with bone attachments: getPedBonePosition has existed for a long time, but there still were many people who wanted bone attachment functions to be implemented. That took such a long time that they could have scripted it themselves, but they didn't. So I decided to make the resource myself. I'm glad that people like it, but I also feel a bit disappointed in them. Its Suggestion ! He asked for new function like other do If you dont want it ... others will want it Its up to developers For me yes better than nothing If I didn't want the function, why would I make it? Writing the function in Lua isn't "nothing" and I haven't seen people who care if the function is added by the resource or implemented into MTA itself. well I didnt ask you to create it MTA made by many people not by your side btw Holsten i saw a resource do that what u want search it in community & have fun Link to comment
DiSaMe Posted August 22, 2011 Share Posted August 22, 2011 At least do you know what's going on? First I make a resource, post the link in this topic and then you come, talking in the way as if I don't even want bone attachments, then how do you think that resource appeared in community? Link to comment
solidsnake Posted August 23, 2011 Share Posted August 23, 2011 At least do you know what's going on? First I make a resource, post the link in this topic and then you come, talking in the way as if I don't even want bone attachments, then how do you think that resource appeared in community? Maybe by magic Link to comment
Recommended Posts