thund3rbird23 Posted September 5, 2019 Share Posted September 5, 2019 I attached a crate to the player's hand, is there any way to determine if the crate is attached or not? crate = createObject(2912,0,0,0) exports.bone_attach:attachElementToBone(crate,localPlayer,12,0,0,0.70,0,165,0) Link to comment
Ceeser Posted September 5, 2019 Share Posted September 5, 2019 i guess you are using this resource: https://wiki.multitheftauto.com/wiki/Resource:Bone_attach If so, this resource also brings an build in function for that: bool isElementAttachedToBone (element theElement) Link to comment
thund3rbird23 Posted September 5, 2019 Author Share Posted September 5, 2019 I'm using this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=2540 Link to comment
Moderators IIYAMA Posted September 6, 2019 Moderators Share Posted September 6, 2019 14 hours ago, thund3rbird23 said: I'm using this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=2540 That is the same resource. Link to comment
thund3rbird23 Posted September 6, 2019 Author Share Posted September 6, 2019 25 minutes ago, IIYAMA said: That is the same resource. Yes, I realized after posted. Link to comment
thund3rbird23 Posted September 6, 2019 Author Share Posted September 6, 2019 I'm trying to figure out how to use this function, but doesn't works. Attached "doboz" to the player's hand: doboz[thePlayer] = createObject(2912,0,0,0) exports.bone_attach:attachElementToBone(doboz[thePlayer], thePlayer, 12,0,0,0.70,0,165,0) And after that I wants to get if the "doboz" attached to the bone or no: function xy(thePlayer) if (exports.bone_attach:isElementAttachedToBone(doboz[thePlayer]))then outputChatBox("Yes!") else outputChatBox("No!") end addCommandHandler("xy", xy) Link to comment
PaiN^ Posted September 9, 2019 Share Posted September 9, 2019 Is it not working at all or is it saying No in the chat box? if it's the later, make sure that the player who's calling the command "xy" has an element attached and stored in the table doboz. if it's not working at all check the debug. Link to comment
thund3rbird23 Posted September 9, 2019 Author Share Posted September 9, 2019 1 hour ago, PaiN^ said: Is it not working at all or is it saying No in the chat box? if it's the later, make sure that the player who's calling the command "xy" has an element attached and stored in the table doboz. if it's not working at all check the debug. Uff, I just forgot to close the function with 'end'. It's works now. 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